Formattazione stile codice
This commit is contained in:
parent
9e63a1bc90
commit
6f3140bba5
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->files()
|
||||
->exclude('.couscous')
|
||||
->exclude('node_modules')
|
||||
->exclude('vendor')
|
||||
->exclude('tests')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true)
|
||||
->in(__DIR__);
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
$config->setRules([
|
||||
'@Symfony' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'yoda_style' => false,
|
||||
'echo_tag_syntax' => ['format' => 'long'],
|
||||
'ordered_imports' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'ordered_class_elements' => true,
|
||||
'phpdoc_order' => true,
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
||||
return $config;
|
33
.php_cs
33
.php_cs
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->files()
|
||||
->exclude('.couscous')
|
||||
->exclude('node_modules')
|
||||
->exclude('vendor')
|
||||
->exclude('tests')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true)
|
||||
->in(__DIR__);
|
||||
|
||||
$config = PhpCsFixer\Config::create()
|
||||
->setRules([
|
||||
'@Symfony' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'yoda_style' => false,
|
||||
'no_short_echo_tag' => true,
|
||||
'ordered_imports' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'ordered_class_elements' => true,
|
||||
'phpdoc_order' => true,
|
||||
//'no_superfluous_phpdoc_tags' => [
|
||||
// 'allow_mixed' => true,
|
||||
// 'allow_unused_params' => true,
|
||||
//],
|
||||
//'phpdoc_add_missing_param_annotation' => [
|
||||
// 'only_untyped' => false,
|
||||
//],
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
||||
return $config;
|
22
actions.php
22
actions.php
|
@ -54,26 +54,22 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
|
||||
// Gestione delle operazioni
|
||||
else {
|
||||
|
||||
//UPLOAD PER CKEDITOR
|
||||
if (filter('op') == 'aggiungi-allegato' && !empty($_FILES) && !empty($_FILES['upload']['name'])) {
|
||||
|
||||
$CKEditor = get('CKEditor');
|
||||
$funcNum = get('CKEditorFuncNum');
|
||||
|
||||
|
||||
$allowed_extension = array(
|
||||
"png","jpg","jpeg"
|
||||
);
|
||||
$allowed_extension = [
|
||||
'png', 'jpg', 'jpeg',
|
||||
];
|
||||
|
||||
//Maximum file limit (unit: byte)
|
||||
$max_size = '2097152'; //2MB
|
||||
|
||||
// Get image file extension
|
||||
$file_extension = pathinfo($_FILES["upload"]["name"], PATHINFO_EXTENSION);
|
||||
|
||||
if(in_array(strtolower($file_extension),$allowed_extension) && $_FILES["upload"]['size']<$max_size){
|
||||
$file_extension = pathinfo($_FILES['upload']['name'], PATHINFO_EXTENSION);
|
||||
|
||||
if (in_array(strtolower($file_extension), $allowed_extension) && $_FILES['upload']['size'] < $max_size) {
|
||||
$upload = Uploads::upload($_FILES['upload'], [
|
||||
'name' => filter('nome_allegato'),
|
||||
'category' => filter('categoria'),
|
||||
|
@ -98,7 +94,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
$response = [
|
||||
'fileName' => basename($upload->filepath),
|
||||
'uploaded' => 1,
|
||||
'url' => $upload->filepath
|
||||
'url' => $upload->filepath,
|
||||
];
|
||||
|
||||
// Upload da form
|
||||
|
@ -116,19 +112,13 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
else {
|
||||
echo json_encode($response);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
//flash()->error(tr('Errore durante il caricamento del file!'));
|
||||
echo '<script type="text/javascript"> window.parent.toastr.error("'.tr('Errore durante il caricamento del file!').'"); </script>';
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
//flash()->error(tr('Estensione non permessa!'));
|
||||
echo '<script type="text/javascript"> window.parent.toastr.error("'.tr('Estensione non permessa').'"); </script>';
|
||||
|
||||
}
|
||||
|
||||
exit();
|
||||
|
|
|
@ -27,7 +27,6 @@ $db_options = [
|
|||
//'sort_buffer_size' => '2M',
|
||||
];
|
||||
|
||||
|
||||
// Percorso della cartella di backup
|
||||
$backup_dir = __DIR__.'/backup/';
|
||||
|
||||
|
|
|
@ -352,7 +352,6 @@ foreach ($righe as $i => $riga) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
</td>';
|
||||
|
||||
|
|
|
@ -179,19 +179,14 @@ if (post('db_host') !== null) {
|
|||
}
|
||||
// Continua con l'esecuzione delle operazioni previste
|
||||
else {
|
||||
|
||||
// Creazione manifest.json
|
||||
include_once App::filepath('include/init', 'manifest.php');
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Controlla che i parametri di configurazione permettano l'accesso al database
|
||||
if ((file_exists('config.inc.php') || $valid_config) && !$dbo->isConnected()) {
|
||||
echo '
|
||||
|
@ -200,7 +195,7 @@ if ((file_exists('config.inc.php') || $valid_config) && !$dbo->isConnected()) {
|
|||
<h3 class="box-title">'.tr('Impossibile connettersi al database').'</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>'.tr("Si è verificato un errore durante la connessione al database").'.</p>
|
||||
<p>'.tr('Si è verificato un errore durante la connessione al database').'.</p>
|
||||
<p>'.tr('Controllare di aver inserito correttamente i dati di accesso, e che il database atto ad ospitare i dati del gestionale sia esistente').'.</p>
|
||||
<a class="btn btn-info" href="'.base_path().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
</div>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
$creation = file_put_contents('manifest.json', '');
|
||||
|
||||
if (!$creation) {
|
||||
|
||||
$manifest = '{
|
||||
|
||||
"dir" : "ltr",
|
||||
|
@ -44,11 +43,8 @@ if (!$creation) {
|
|||
]
|
||||
}';
|
||||
|
||||
|
||||
file_put_contents('manifest.json', $manifest);
|
||||
|
||||
} else {
|
||||
|
||||
echo '
|
||||
<div class="box box-center box-danger box-solid text-center">
|
||||
<div class="box-header with-border">
|
||||
|
@ -61,5 +57,3 @@ if (!$creation) {
|
|||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ foreach ($modules as $name => $values) {
|
|||
|
||||
//PHP
|
||||
$settings = [
|
||||
|
||||
'php_version' => [
|
||||
'type' => 'version',
|
||||
'description' => '7.3.x - 8.0.x, consigliato almeno 7.4.x',
|
||||
|
@ -122,7 +121,6 @@ $settings = [
|
|||
'type' => 'value',
|
||||
'description' => '>5000',
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
$php = [];
|
||||
|
@ -130,14 +128,12 @@ foreach ($settings as $name => $values) {
|
|||
$description = $values['description'];
|
||||
|
||||
if ($values['type'] == 'version') {
|
||||
|
||||
$description = tr('Valore consigliato: _VALUE_ (Valore attuale: _PHP_VERSION_)', [
|
||||
'_VALUE_' => $description,
|
||||
'_PHP_VERSION_' => phpversion(),
|
||||
]);
|
||||
|
||||
$status = ((version_compare(phpversion(), $values['minimum'], ">=") && version_compare(phpversion(), $values['maximum'], "<=")) ? 1 : 0);
|
||||
|
||||
$status = ((version_compare(phpversion(), $values['minimum'], '>=') && version_compare(phpversion(), $values['maximum'], '<=')) ? 1 : 0);
|
||||
} elseif ($values['type'] == 'ext') {
|
||||
$status = extension_loaded($name);
|
||||
} else {
|
||||
|
@ -185,7 +181,6 @@ foreach ($settings as $name => $values) {
|
|||
// MySQL
|
||||
if ($database->isInstalled()) {
|
||||
$db = [
|
||||
|
||||
'mysql_version' => [
|
||||
'type' => 'version',
|
||||
'description' => '5.7.x - 8.0.x',
|
||||
|
@ -197,8 +192,6 @@ if ($database->isInstalled()){
|
|||
'type' => 'value',
|
||||
'description' => '>2M',
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
|
||||
/*foreach (App::getConfig()['db_options'] as $n => $v){
|
||||
|
@ -213,23 +206,19 @@ if ($database->isInstalled()){
|
|||
}
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
foreach ($db as $name => $values) {
|
||||
|
||||
$description = $values['description'];
|
||||
|
||||
if ($values['type'] == 'version') {
|
||||
|
||||
$type = tr('Versione');
|
||||
$description = tr('Valore consigliato: _VALUE_ (Valore attuale: _MYSQL_VERSION_)', [
|
||||
'_VALUE_' => $description,
|
||||
'_MYSQL_VERSION_' => $database->getMySQLVersion(),
|
||||
]);
|
||||
|
||||
$status = ((version_compare($database->getMySQLVersion(), $values['minimum'], ">=") && version_compare($database->getMySQLVersion(), $values['maximum'], "<=")) ? 1 : 0);
|
||||
|
||||
$status = ((version_compare($database->getMySQLVersion(), $values['minimum'], '>=') && version_compare($database->getMySQLVersion(), $values['maximum'], '<=')) ? 1 : 0);
|
||||
} else {
|
||||
$type = tr('Impostazione');
|
||||
|
||||
|
@ -237,13 +226,13 @@ foreach ($db as $name => $values) {
|
|||
$rs_session_variabile = $dbo->fetchArray('SHOW SESSION VARIABLES LIKE '.prepare($name));
|
||||
$rs_global_variabile = $dbo->fetchArray('SHOW GLOBAL VARIABLES LIKE '.prepare($name));
|
||||
|
||||
if (!empty($rs_session_variabile[0]['Value']))
|
||||
if (!empty($rs_session_variabile[0]['Value'])) {
|
||||
$inc = $rs_session_variabile[0]['Value'];
|
||||
else if (!empty($rs_global_variabile[0]['Value']))
|
||||
} elseif (!empty($rs_global_variabile[0]['Value'])) {
|
||||
$inc = $rs_global_variabile[0]['Value'];
|
||||
else
|
||||
} else {
|
||||
$inc = str_replace(['k', 'M'], ['000', '000000'], App::getConfig()['db_options'][$name]);
|
||||
|
||||
}
|
||||
|
||||
$real = str_replace(['k', 'M'], ['000', '000000'], $description);
|
||||
|
||||
|
@ -261,12 +250,10 @@ foreach ($db as $name => $values) {
|
|||
$description = str_replace(['>', '<'], '', $description);
|
||||
}
|
||||
|
||||
|
||||
$description = tr('Valore consigliato: _VALUE_ (Valore attuale: _INC_)', [
|
||||
'_VALUE_' => $description,
|
||||
'_INC_' => \Util\FileSystem::formatBytes($inc),
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
$mysql[] = [
|
||||
|
@ -277,7 +264,6 @@ foreach ($db as $name => $values) {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
// Percorsi di servizio
|
||||
$dirs_to_check = [
|
||||
'backup' => tr('Necessario per il salvataggio dei backup'),
|
||||
|
@ -298,7 +284,6 @@ foreach ($dirs_to_check as $name => $description) {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
// File di servizio
|
||||
$files_to_check = [
|
||||
'manifest.json' => tr('Necessario per l\'aggiunta a schermata home da terminale (creato al termine della configurazione)'),
|
||||
|
@ -319,7 +304,6 @@ foreach ($files_to_check as $name => $description) {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
// Configurazioni OSM
|
||||
$config_to_check = [
|
||||
'lang' => [
|
||||
|
@ -349,17 +333,14 @@ $config_to_check = [
|
|||
'value_to_check' => '|time|',
|
||||
'suggested_value' => 'H:i',
|
||||
'section' => 'formatter',
|
||||
]
|
||||
|
||||
],
|
||||
];
|
||||
|
||||
$config = [];
|
||||
|
||||
foreach ($config_to_check as $name => $values) {
|
||||
|
||||
$type = $values['type'];
|
||||
|
||||
|
||||
if ($type == 'value') {
|
||||
$description = tr('Valore consigliato: _SUGGESTED_ (Valore attuale: _ACTUAL_)', [
|
||||
'_SUGGESTED_' => $values['suggested_value'],
|
||||
|
@ -375,16 +356,13 @@ foreach ($config_to_check as $name => $values) {
|
|||
'status' => $status,
|
||||
'type' => tr('Configurazione'),
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$requirements = [
|
||||
tr('Apache') => $apache,
|
||||
tr('PHP (_VERSION_ _SUPPORTED_)', [
|
||||
'_VERSION_' => phpversion(),
|
||||
'_SUPPORTED_' => ( ( version_compare(phpversion(), $settings['php_version']['minimum'], ">=") && version_compare(phpversion(), $settings['php_version']['maximum'], "<=") ) ? '' : '<small><small class="label label-danger" ><i class="fa fa-warning"></i> '.tr('versioni supportate:').' '.$settings['php_version']['description'].'</small></small>')
|
||||
'_SUPPORTED_' => ((version_compare(phpversion(), $settings['php_version']['minimum'], '>=') && version_compare(phpversion(), $settings['php_version']['maximum'], '<=')) ? '' : '<small><small class="label label-danger" ><i class="fa fa-warning"></i> '.tr('versioni supportate:').' '.$settings['php_version']['description'].'</small></small>'),
|
||||
]) => $php,
|
||||
tr('MySQL') => $mysql,
|
||||
tr('Percorsi di servizio') => $directories,
|
||||
|
@ -396,7 +374,6 @@ if (!$database->isInstalled() || empty($mysql)){
|
|||
unset($requirements['MySQL']);
|
||||
}
|
||||
|
||||
|
||||
// Tabelle di riepilogo
|
||||
foreach ($requirements as $key => $values) {
|
||||
$statuses = array_column($values, 'status');
|
||||
|
|
|
@ -123,7 +123,7 @@ if (filter('action') == 'do_update') {
|
|||
<h3 class="box-title">'.tr('Aggiornamento in corso!').'</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>'.tr("Il software si trova attualmente nella fase di aggiornamento, potrebbero volerci fino a 10 minuti, siete pregati di attendere sino alla sua conclusione").'.</p>
|
||||
<p>'.tr('Il software si trova attualmente nella fase di aggiornamento, potrebbero volerci fino a 10 minuti, siete pregati di attendere sino alla sua conclusione').'.</p>
|
||||
<p>'.tr("In caso di problemi rivolgersi all'amministratore di sistema o all'assistenza del gestionale").'.</p>
|
||||
<a class="btn btn-info" href="'.base_path().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
</div>
|
||||
|
|
|
@ -518,8 +518,6 @@ if (Auth::check()) {
|
|||
if (!empty($id_record)) {
|
||||
$plugins = $dbo->fetchArray('SELECT id, title, options, options2 FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1 ORDER BY zz_plugins.order DESC");
|
||||
foreach ($plugins as $plugin) {
|
||||
|
||||
|
||||
//Badge count per record plugin
|
||||
$count = 0;
|
||||
$opt = '';
|
||||
|
@ -557,7 +555,6 @@ if (Auth::check()) {
|
|||
</li>';
|
||||
}
|
||||
|
||||
|
||||
// Tab per le checklist
|
||||
if ($structure->permission != '-' && $structure->use_checklists) {
|
||||
$checklists_unchecked = $structure->recordChecks($id_record)->where('checked_at', null);
|
||||
|
@ -680,6 +677,6 @@ if ($free_space < ($space_limit * (1024 ** 3))) {
|
|||
'_TOT_' => FileSystem::formatBytes($free_space),
|
||||
]).'.</p>
|
||||
<p>'.tr('Questo può risultare un serio problema per la continuità di funzionamento del software, poiché le operazioni più espansive che richiedono spazio di archiviazione possono causare malfunzionamenti imprevisti').'. '.tr('Ad esempio, le attività di backup, caricamento di allegati o anche l\'utilizzo normale del gestionale potrebbero rendere i dati inaffidabili, provocando pertanto una perdita delle informazioni salvate').'.</p>
|
||||
<p>'.tr("Contatta gli amministratori di sistema per risolvere al più presto il problema").'.</p>
|
||||
<p>'.tr('Contatta gli amministratori di sistema per risolvere al più presto il problema').'.</p>
|
||||
</div>';
|
||||
}
|
||||
|
|
|
@ -245,4 +245,3 @@ function getSegmentPredefined($id_module)
|
|||
|
||||
return $id_segment;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,8 @@ function copyr($source, $destination, $ignores = [])
|
|||
|
||||
try {
|
||||
$fs->chmod($destination, 0777, 0000, true);
|
||||
} catch (IOException $e) {}
|
||||
} catch (IOException $e) {
|
||||
}
|
||||
|
||||
foreach ($files as $file) {
|
||||
$filename = rtrim($destination, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$file->getRelativePathname();
|
||||
|
|
1
mail.php
1
mail.php
|
@ -50,7 +50,6 @@ foreach ($mansioni as $mansione) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Aggiungo email tecnici assegnati quando sono sul template Notifica intervento
|
||||
if ($template->name == 'Notifica intervento') {
|
||||
$tecnici = $dbo->select('in_interventi_tecnici_assegnati', 'id_tecnico', ['id_intervento' => $id_record]);
|
||||
|
|
|
@ -21,11 +21,11 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
use Models\Cache;
|
||||
use Modules\Aggiornamenti\Controlli\ColonneDuplicateViste;
|
||||
use Modules\Aggiornamenti\Controlli\ReaValidi;
|
||||
use Modules\Aggiornamenti\Controlli\PluginDuplicati;
|
||||
use Modules\Aggiornamenti\Controlli\Controllo;
|
||||
use Modules\Aggiornamenti\Controlli\DatiFattureElettroniche;
|
||||
use Modules\Aggiornamenti\Controlli\PianoConti;
|
||||
use Modules\Aggiornamenti\Controlli\PluginDuplicati;
|
||||
use Modules\Aggiornamenti\Controlli\ReaValidi;
|
||||
use Modules\Aggiornamenti\UpdateHook;
|
||||
|
||||
$id = post('id');
|
||||
|
|
|
@ -75,7 +75,7 @@ $(document).ready(function () {
|
|||
$mysql_min_version = '5.7.0';
|
||||
$mysql_max_version = '5.7.99';
|
||||
|
||||
$contents = ((version_compare($database->getMySQLVersion(), $mysql_min_version, ">=") && version_compare($database->getMySQLVersion(), $mysql_max_version, "<=")) ? $file_to_check_database = 'database_5_7.json' : $file_to_check_database = 'database.json' );
|
||||
$contents = ((version_compare($database->getMySQLVersion(), $mysql_min_version, '>=') && version_compare($database->getMySQLVersion(), $mysql_max_version, '<=')) ? $file_to_check_database = 'database_5_7.json' : $file_to_check_database = 'database.json');
|
||||
$contents = file_get_contents(base_dir().'/'.$file_to_check_database);
|
||||
$data = json_decode($contents, true);
|
||||
|
||||
|
|
|
@ -185,7 +185,6 @@ function search(button) {
|
|||
|
||||
<div class="row">';
|
||||
|
||||
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
|
@ -228,7 +227,6 @@ echo '
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
<div class="box box-warning">
|
||||
|
|
|
@ -67,7 +67,6 @@ class ReaValidi extends Controllo
|
|||
GROUP BY an_anagrafiche.idanagrafica');
|
||||
|
||||
foreach ($anagrafiche_interessate as $anagrafica) {
|
||||
|
||||
/*$tipi = explode(',', $anagrafica['tipi_anagrafica']);
|
||||
$cliente = in_array('Cliente', $tipi) && empty($anagrafica['idconto_cliente']);
|
||||
$fornitore = in_array('Fornitore', $tipi) && empty($anagrafica['idconto_fornitore']);*/
|
||||
|
@ -79,7 +78,6 @@ class ReaValidi extends Controllo
|
|||
'_REA_' => $anagrafica['codicerea'],
|
||||
]),
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ switch ($resource) {
|
|||
}
|
||||
|
||||
// Tutti gli agenti del cliente
|
||||
$q = "SELECT DISTINCT(email), ragione_sociale, idanagrafica FROM an_anagrafiche WHERE email != '' AND (idanagrafica=(SELECT idagente FROM an_anagrafiche AS agenti WHERE 1=1 ".$where.") OR idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE 1=1 ".$where."))";
|
||||
$q = "SELECT DISTINCT(email), ragione_sociale, idanagrafica FROM an_anagrafiche WHERE email != '' AND (idanagrafica=(SELECT idagente FROM an_anagrafiche AS agenti WHERE 1=1 ".$where.') OR idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE 1=1 '.$where.'))';
|
||||
|
||||
$rs = $dbo->fetchArray($q);
|
||||
foreach ($rs as $r) {
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$filter_agente = Auth::user()['gruppo'] == 'Agenti';
|
||||
|
@ -59,10 +57,10 @@ switch ($resource) {
|
|||
ON an_anagrafiche.idpagamento_vendite=co_pagamenti.id
|
||||
LEFT JOIN
|
||||
co_banche banca_vendite
|
||||
ON co_pagamenti.idconto_vendite = banca_vendite.id_pianodeiconti3 AND banca_vendite.id_anagrafica = ".prepare($id_azienda)." AND banca_vendite.deleted_at IS NULL AND banca_vendite.predefined = 1
|
||||
ON co_pagamenti.idconto_vendite = banca_vendite.id_pianodeiconti3 AND banca_vendite.id_anagrafica = ".prepare($id_azienda).' AND banca_vendite.deleted_at IS NULL AND banca_vendite.predefined = 1
|
||||
|where|
|
||||
ORDER BY
|
||||
ragione_sociale";
|
||||
ragione_sociale';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'an_anagrafiche.idanagrafica='.prepare($element);
|
||||
|
@ -77,8 +75,6 @@ switch ($resource) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!empty($search)) {
|
||||
$search_fields[] = 'ragione_sociale LIKE '.prepare('%'.$search.'%');
|
||||
$search_fields[] = 'citta LIKE '.prepare('%'.$search.'%');
|
||||
|
@ -92,12 +88,10 @@ switch ($resource) {
|
|||
$rs = $data['results'];
|
||||
|
||||
foreach ($rs as $k => $r) {
|
||||
|
||||
$rs[$k] = array_merge($r, [
|
||||
'text' => $r['descrizione'],
|
||||
'disabled' => $r['is_bloccata'],
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
$results = [
|
||||
|
@ -110,7 +104,7 @@ switch ($resource) {
|
|||
case 'fornitori':
|
||||
$id_azienda = setting('Azienda predefinita');
|
||||
|
||||
$query = "SELECT an_anagrafiche.idanagrafica AS id, CONCAT(ragione_sociale, IF(citta IS NULL OR citta = '', '', CONCAT(' (', citta, ')')), IF(an_anagrafiche.deleted_at IS NULL, '', ' (".tr('eliminata').")'),' - ', an_anagrafiche.codice) AS descrizione, idtipointervento_default AS idtipointervento, co_pagamenti.id AS id_pagamento, co_pagamenti.descrizione AS desc_pagamento, banca_acquisti.id AS id_banca_acquisti, CONCAT(banca_acquisti.nome, ' - ', banca_acquisti.iban) AS descrizione_banca_acquisti FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica LEFT JOIN co_pagamenti ON an_anagrafiche.idpagamento_acquisti=co_pagamenti.id LEFT JOIN co_banche banca_acquisti ON co_pagamenti.idconto_acquisti = banca_acquisti.id_pianodeiconti3 AND banca_acquisti.id_anagrafica = ".prepare($id_azienda)." AND banca_acquisti.deleted_at IS NULL AND banca_acquisti.predefined = 1 |where| ORDER BY ragione_sociale";
|
||||
$query = "SELECT an_anagrafiche.idanagrafica AS id, CONCAT(ragione_sociale, IF(citta IS NULL OR citta = '', '', CONCAT(' (', citta, ')')), IF(an_anagrafiche.deleted_at IS NULL, '', ' (".tr('eliminata').")'),' - ', an_anagrafiche.codice) AS descrizione, idtipointervento_default AS idtipointervento, co_pagamenti.id AS id_pagamento, co_pagamenti.descrizione AS desc_pagamento, banca_acquisti.id AS id_banca_acquisti, CONCAT(banca_acquisti.nome, ' - ', banca_acquisti.iban) AS descrizione_banca_acquisti FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica LEFT JOIN co_pagamenti ON an_anagrafiche.idpagamento_acquisti=co_pagamenti.id LEFT JOIN co_banche banca_acquisti ON co_pagamenti.idconto_acquisti = banca_acquisti.id_pianodeiconti3 AND banca_acquisti.id_anagrafica = ".prepare($id_azienda).' AND banca_acquisti.deleted_at IS NULL AND banca_acquisti.predefined = 1 |where| ORDER BY ragione_sociale';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'an_anagrafiche.idanagrafica='.prepare($element);
|
||||
|
@ -448,7 +442,6 @@ switch ($resource) {
|
|||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'relazioni':
|
||||
$query = "SELECT id, CONCAT(descrizione, IF(an_relazioni.deleted_at IS NULL, '', ' (".tr('eliminata').")')) AS descrizione, colore AS _bgcolor_ FROM an_relazioni |where| ORDER BY descrizione";
|
||||
|
||||
|
@ -479,7 +472,6 @@ switch ($resource) {
|
|||
|
||||
break;
|
||||
|
||||
|
||||
case 'settori':
|
||||
$query = 'SELECT id, descrizione FROM an_settori |where| ORDER BY descrizione';
|
||||
|
||||
|
@ -499,19 +491,15 @@ switch ($resource) {
|
|||
*/
|
||||
|
||||
case 'dichiarazioni_intento':
|
||||
|
||||
if (isset($superselect['idanagrafica']) && isset($superselect['data'])) {
|
||||
//$query = "SELECT id, CONCAT('N. prot. ', numero_protocollo, ' (periodo dal ', DATE_FORMAT(data_inizio, '%d/%m/%Y'), ' al ' ,DATE_FORMAT(data_fine, '%d/%m/%Y'),') (utilizzati ',REPLACE(REPLACE(REPLACE(FORMAT(SUM(totale),2), ',', '#'), '.', ','), '#', '.'), ' su ' , REPLACE(REPLACE(REPLACE(FORMAT(SUM(massimale),2), ',', '#'), '.', ','), '#', '.'), ' €)' ) AS descrizione, data_inizio, data_fine FROM co_dichiarazioni_intento |where| ORDER BY `data`, `id`";
|
||||
|
||||
$query = "SELECT id, numero_protocollo, data_inizio, data_fine, massimale, totale FROM co_dichiarazioni_intento |where| ORDER BY data";
|
||||
|
||||
|
||||
$query = 'SELECT id, numero_protocollo, data_inizio, data_fine, massimale, totale FROM co_dichiarazioni_intento |where| ORDER BY data';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'id='.prepare($element);
|
||||
}
|
||||
|
||||
|
||||
//$where[] = '( '.prepare($superselect['data']).' BETWEEN data_inizio AND data_fine)';
|
||||
|
||||
//$where[] = 'data_inizio < NOW()';
|
||||
|
@ -532,7 +520,6 @@ switch ($resource) {
|
|||
$rs = $data['results'];
|
||||
|
||||
foreach ($rs as $k => $r) {
|
||||
|
||||
$currentDate = date('Y-m-d', strtotime($superselect['data']));
|
||||
$startDate = date('Y-m-d', strtotime($r['data_inizio']));
|
||||
$endDate = date('Y-m-d', strtotime($r['data_fine']));
|
||||
|
|
|
@ -87,7 +87,6 @@ switch (post('op')) {
|
|||
$anagrafica->idrelazione = $idrelazione;
|
||||
|
||||
$anagrafica->save();
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -261,14 +261,12 @@ echo '
|
|||
<br>';
|
||||
|
||||
if (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($sede_cliente->lng))) {
|
||||
|
||||
// Modifica manuale delle informazioni
|
||||
echo '
|
||||
<a class="btn btn-info btn-block" onclick="modificaPosizione()">
|
||||
<i class="fa fa-map"></i> '.tr('Aggiorna posizione').'
|
||||
</a>';
|
||||
} else {
|
||||
|
||||
// Definizione manuale delle informazioni
|
||||
echo '
|
||||
<a class="btn btn-primary btn-block" onclick="modificaPosizione()">
|
||||
|
@ -278,16 +276,13 @@ if (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($se
|
|||
|
||||
// Navigazione diretta verso l'indirizzo
|
||||
echo '
|
||||
<a class="btn btn-info btn-block '.((empty($sede_cliente->lat) && empty($sede_cliente->lng))? "disabled" : "").'" onclick="$(\'#map-edit\').height(235); caricaMappa(); $(this).hide();">
|
||||
<a class="btn btn-info btn-block '.((empty($sede_cliente->lat) && empty($sede_cliente->lng)) ? 'disabled' : '').'" onclick="$(\'#map-edit\').height(235); caricaMappa(); $(this).hide();">
|
||||
<i class="fa fa-compass"></i> '.tr('Carica mappa').'
|
||||
</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
// Navigazione diretta verso l'indirizzo
|
||||
echo '
|
||||
<a class="btn btn-info btn-block '.(($anagrafica->isAzienda() || (empty($sede_cliente->lat) || empty($sede_cliente->lng))|| (empty($sede_azienda->lat) || empty($sede_azienda->lng)) ) ? "disabled": "").'" onclick="calcolaPercorso()">
|
||||
<a class="btn btn-info btn-block '.(($anagrafica->isAzienda() || (empty($sede_cliente->lat) || empty($sede_cliente->lng)) || (empty($sede_azienda->lat) || empty($sede_azienda->lng))) ? 'disabled' : '').'" onclick="calcolaPercorso()">
|
||||
<i class="fa fa-map-signs"></i> '.tr('Calcola percorso').'
|
||||
'.((!empty($sede_cliente->lat) && !empty($sede_azienda->lat)) ? tr('(GPS)') : '').'
|
||||
</a>';
|
||||
|
@ -353,7 +348,7 @@ echo '
|
|||
const lng = parseFloat("'.$sede_cliente->lng.'");
|
||||
|
||||
if (typeof lat === "undefined" || typeof lng === "undefined"){
|
||||
swal("' . tr('Errore') . '", "' . tr("La posizione non è stata definita. Impossibile caricare la mappa.") . '", "error");
|
||||
swal("'.tr('Errore').'", "'.tr('La posizione non è stata definita. Impossibile caricare la mappa.').'", "error");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -369,7 +364,7 @@ echo '
|
|||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("'.setting("Tile server OpenStreetMap").'", {
|
||||
L.tileLayer("'.setting('Tile server OpenStreetMap').'", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Models\Module;
|
||||
use Carbon\Carbon;
|
||||
use Models\Module;
|
||||
|
||||
$id_record = filter('id_record');
|
||||
$dir = filter('dir');
|
||||
|
|
|
@ -102,7 +102,7 @@ function caricaMappa() {
|
|||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("'.setting("Tile server OpenStreetMap").'", {
|
||||
L.tileLayer("'.setting('Tile server OpenStreetMap').'", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
|
|
|
@ -41,7 +41,6 @@ if (empty($_GET['visualizza_allegati'])) {
|
|||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
|
||||
//Controllo i permessi dei modulo per la visualizzazione degli allegati
|
||||
$rs = $dbo->table('zz_permissions')->where('idgruppo', $user->idgruppo)->get();
|
||||
$permessi = [];
|
||||
|
|
|
@ -415,6 +415,7 @@ class Anagrafica extends Model
|
|||
$database->update('co_pianodeiconti3', ['descrizione' => $this->ragione_sociale], ['id' => $this->idconto_fornitore]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function fixRagioneSociale()
|
||||
{
|
||||
if (!empty($this->cognome) || !empty($this->nome)) {
|
||||
|
|
|
@ -28,6 +28,13 @@ class Referente extends Model
|
|||
|
||||
protected $table = 'an_referenti';
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Crea un nuovo referente.
|
||||
*
|
||||
|
@ -39,7 +46,6 @@ class Referente extends Model
|
|||
{
|
||||
$model = new static();
|
||||
|
||||
|
||||
$model->idanagrafica = $idanagrafica;
|
||||
|
||||
$model->nome = $nome;
|
||||
|
@ -52,14 +58,6 @@ class Referente extends Model
|
|||
return $model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
public function anagrafica()
|
||||
{
|
||||
return $this->belongsTo(Anagrafica::class, 'idanagrafica');
|
||||
|
|
|
@ -374,7 +374,6 @@ switch (post('op')) {
|
|||
break;
|
||||
|
||||
case 'add-movimento':
|
||||
|
||||
$articolo = Articolo::find(post('idarticolo'));
|
||||
$tipo_movimento = post('tipo_movimento');
|
||||
$descrizione = post('movimento');
|
||||
|
@ -399,7 +398,6 @@ switch (post('op')) {
|
|||
$articolo->movimenta($qta, $descrizione, $data, 1, [
|
||||
'idsede' => $id_sede_azienda,
|
||||
]);
|
||||
|
||||
} elseif ($tipo_movimento == 'spostamento') {
|
||||
// Registrazione del movimento verso la sede di destinazione
|
||||
$articolo->registra($qta, $descrizione, $data, 1, [
|
||||
|
|
|
@ -126,7 +126,7 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Abilita serial number'); ?>", "name": "abilita_serial", "help": "<?php echo tr('Abilita serial number in fase di aggiunta articolo in fattura o ddt'); ?>", "value": "<?php echo setting('Serial number abilitato di default') ?>","placeholder": "<?php echo tr('Serial number'); ?>" ]}
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Abilita serial number'); ?>", "name": "abilita_serial", "help": "<?php echo tr('Abilita serial number in fase di aggiunta articolo in fattura o ddt'); ?>", "value": "<?php echo setting('Serial number abilitato di default'); ?>","placeholder": "<?php echo tr('Serial number'); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -42,9 +42,9 @@ switch ($resource) {
|
|||
IF(`categoria`.`nome` IS NOT NULL, CONCAT(`categoria`.`nome`, IF(`sottocategoria`.`nome` IS NOT NULL, CONCAT(' (', `sottocategoria`.`nome`, ')'), '-')), '<i>".tr('Nessuna categoria')."</i>') AS optgroup,
|
||||
`mg_articoli`.`barcode`,
|
||||
|
||||
`mg_articoli`.".($prezzi_ivati ? '`prezzo_vendita_ivato`' : '`prezzo_vendita`')." AS prezzo_vendita,
|
||||
`mg_articoli`.".($prezzi_ivati ? '`prezzo_vendita_ivato`' : '`prezzo_vendita`').' AS prezzo_vendita,
|
||||
`mg_articoli`.`prezzo_vendita_ivato` AS prezzo_vendita_ivato,
|
||||
`mg_articoli`.".($prezzi_ivati ? '`minimo_vendita_ivato`' : '`minimo_vendita`')." AS minimo_vendita,";
|
||||
`mg_articoli`.'.($prezzi_ivati ? '`minimo_vendita_ivato`' : '`minimo_vendita`').' AS minimo_vendita,';
|
||||
|
||||
// Informazioni relative al fornitore specificato dal documenti di acquisto
|
||||
if ($usare_dettaglio_fornitore) {
|
||||
|
|
|
@ -92,7 +92,7 @@ switch (post('op')) {
|
|||
$articolo->setPrezzoVendita($new_prezzo_vendita, $articolo->idiva_vendita);
|
||||
$articolo->save();
|
||||
} else {
|
||||
$articoli_coeff++;
|
||||
++$articoli_coeff;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,6 @@ switch (post('op')) {
|
|||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('codice', '!=', '')->first()->id);
|
||||
exit();
|
||||
|
||||
|
||||
case 'change-qta':
|
||||
$descrizione = post('descrizione');
|
||||
$data = post('data');
|
||||
|
@ -221,7 +220,6 @@ switch (post('op')) {
|
|||
redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
exit();
|
||||
|
||||
|
||||
case 'export-csv':
|
||||
$file = temp_file();
|
||||
$exporter = new CSV($file);
|
||||
|
@ -293,7 +291,7 @@ switch (post('op')) {
|
|||
$articolo->save();
|
||||
|
||||
if ($new_prezzo_acquisto != 0) {
|
||||
$n_art++;
|
||||
++$n_art;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +387,7 @@ switch (post('op')) {
|
|||
'tipo_provvigione' => post('tipo_provvigione'),
|
||||
]);
|
||||
}
|
||||
$n_art++;
|
||||
++$n_art;
|
||||
}
|
||||
|
||||
flash()->info(tr('Provvigioni inserite correttamente!', [
|
||||
|
@ -489,7 +487,7 @@ $operations['crea-preventivo'] = [
|
|||
'msg' => tr('Ogni articolo selezionato, verrà aggiunto al preventivo').'
|
||||
<br><br>{[ "type": "text", "label": "'.tr('Nome preventivo').'", "name": "nome", "required": 1 ]}
|
||||
{[ "type": "select", "label": "'.tr('Cliente').'", "name": "id_cliente", "ajax-source": "clienti", "required": 1 ]}
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_preventivi, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_preventivi, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}
|
||||
{[ "type": "select", "label": "'.tr('Tipo di attività').'", "name": "id_tipo", "ajax-source": "tipiintervento", "required": 1 ]}
|
||||
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
|
|
|
@ -50,8 +50,8 @@ use Modules\Iva\Aliquota;
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?php echo ((!empty($record['id_categoria'])) ?
|
||||
Modules::link('Categorie articoli', $record['id_categoria'], null, null, 'class="pull-right"') : '') ?>
|
||||
<?php echo (!empty($record['id_categoria'])) ?
|
||||
Modules::link('Categorie articoli', $record['id_categoria'], null, null, 'class="pull-right"') : ''; ?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>" ]}
|
||||
</div>
|
||||
|
||||
|
@ -107,7 +107,7 @@ use Modules\Iva\Aliquota;
|
|||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "number", "label": "<?php echo tr('Quantità'); ?>", "name": "qta", "required": 1, "value": "$qta$", "readonly": 1, "decimals": "qta", "min-value": "undefined", "icon-after": "<?php echo (!empty($record['um']) ? $record['um']: ''); ?>" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Quantità'); ?>", "name": "qta", "required": 1, "value": "$qta$", "readonly": 1, "decimals": "qta", "min-value": "undefined", "icon-after": "<?php echo !empty($record['um']) ? $record['um'] : ''; ?>" ]}
|
||||
<input type="hidden" id="old_qta" value="<?php echo $record['qta']; ?>">
|
||||
</div>
|
||||
|
||||
|
@ -127,7 +127,7 @@ use Modules\Iva\Aliquota;
|
|||
|
||||
<div class="alert alert-info">
|
||||
<p><?php echo tr('Le modifiche alle quantità in questa schermata prevedono la generazione di un movimento relativo alla sede legale'); ?>. <?php echo tr('Se si desidera effettuare movimenti per altre sedi, utilizzare il modulo _MODULO_ ', [
|
||||
'_MODULO_' => Modules::link('Movimenti', null, tr('Movimenti'))
|
||||
'_MODULO_' => Modules::link('Movimenti', null, tr('Movimenti')),
|
||||
]); ?>.</p>
|
||||
</div>
|
||||
|
||||
|
@ -182,8 +182,8 @@ use Modules\Iva\Aliquota;
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php echo ((!empty($record['id_fornitore'])) ?
|
||||
Plugins::link('Listino Fornitori', $id_record, null, null, 'class="pull-right" onclick="modificaFornitore('.$id_record.','.$record['id_fornitore'].')"', null): ''); ?>
|
||||
<?php echo (!empty($record['id_fornitore'])) ?
|
||||
Plugins::link('Listino Fornitori', $id_record, null, null, 'class="pull-right" onclick="modificaFornitore('.$id_record.','.$record['id_fornitore'].')"', null) : ''; ?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Fornitore predefinito'); ?>", "name": "id_fornitore", "ajax-source": "fornitori-articolo", "select-options": <?php echo json_encode(['id_articolo' => $id_record]); ?>, "value":"$id_fornitore$", "help": "<?php echo tr('Fornitore predefinito selezionabile tra i fornitori presenti nel plugin \"Listino fornitori\"'); ?>." ]}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -274,7 +274,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "number", "label": "<?php echo tr('Minimo di vendita'); ?>", "name": "minimo_vendita", "value": "<?php echo ($prezzi_ivati ? $articolo->minimo_vendita_ivato : $articolo->minimo_vendita); ?>", "icon-after": "<?php echo currency(); ?>", "help": "<?php echo ($prezzi_ivati ? tr('Importo IVA inclusa') : ''); ?>" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Minimo di vendita'); ?>", "name": "minimo_vendita", "value": "<?php echo $prezzi_ivati ? $articolo->minimo_vendita_ivato : $articolo->minimo_vendita; ?>", "icon-after": "<?php echo currency(); ?>", "help": "<?php echo $prezzi_ivati ? tr('Importo IVA inclusa') : ''; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -50,11 +50,11 @@ echo '
|
|||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<span><b>'.tr("Codice: ").'</b>'.$articolo->codice.'</span>
|
||||
<span><b>'.tr('Codice: ').'</b>'.$articolo->codice.'</span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<span><b>'.tr("Descrizione: ").'</b>'.$articolo->descrizione.'</span>
|
||||
<span><b>'.tr('Descrizione: ').'</b>'.$articolo->descrizione.'</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -191,8 +191,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
]).(!empty($extra) ? ' '.$extra : '');
|
||||
|
||||
echo
|
||||
Modules::link($module_id, $id, $text).'<br>';
|
||||
echo Modules::link($module_id, $id, $text).'<br>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -293,8 +292,7 @@ for ($i = 0; $i < count($rs2); ++$i) {
|
|||
'_DATE_' => Translator::dateToLocale($data[0]['data']),
|
||||
]).(!empty($extra) ? ' '.$extra : '');
|
||||
|
||||
echo
|
||||
Modules::link($module_id, $id, $text).'<br>';
|
||||
echo Modules::link($module_id, $id, $text).'<br>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
|
|
@ -28,11 +28,11 @@ echo '
|
|||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<span><b>'.tr("Codice: ").'</b>'.$articolo->codice.'</span>
|
||||
<span><b>'.tr('Codice: ').'</b>'.$articolo->codice.'</span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<span><b>'.tr("Descrizione: ").'</b>'.$articolo->descrizione.'</span>
|
||||
<span><b>'.tr('Descrizione: ').'</b>'.$articolo->descrizione.'</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -215,7 +215,7 @@ class CSV extends CSVImporter
|
|||
// Count the numbers of rows in a CSV
|
||||
$number = 0;
|
||||
foreach ($this->csv as $row) {
|
||||
$number++;
|
||||
++$number;
|
||||
}
|
||||
|
||||
// Lettura primo record: se non c'è la pulizia listini da fare, esco, altrimenti
|
||||
|
|
|
@ -102,5 +102,4 @@ if (filter('op') == 'restore') {
|
|||
|
||||
Backup::restore($path, is_file($path));
|
||||
$database->beginTransaction();
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ switch (filter('op')) {
|
|||
|
||||
break;
|
||||
|
||||
|
||||
case 'add':
|
||||
$nome = filter('nome');
|
||||
$nota = filter('nota');
|
||||
|
|
|
@ -23,8 +23,7 @@ use Modules\Checklists\Check;
|
|||
use Modules\Checklists\ChecklistItem;
|
||||
|
||||
switch (post('op')) {
|
||||
|
||||
case "delete_check":
|
||||
case 'delete_check':
|
||||
$id = post('id');
|
||||
$main_check = post('main_check');
|
||||
|
||||
|
@ -38,25 +37,23 @@ switch(post('op')){
|
|||
|
||||
break;
|
||||
|
||||
case "update_position":
|
||||
|
||||
case 'update_position':
|
||||
$main_check = post('main_check');
|
||||
$order = explode(',', post('order', true));
|
||||
|
||||
if ($main_check) {
|
||||
foreach ($order as $i => $id) {
|
||||
$dbo->query("UPDATE zz_checklist_items SET `order`=".prepare($i)." WHERE id=".prepare($id));
|
||||
$dbo->query('UPDATE zz_checklist_items SET `order`='.prepare($i).' WHERE id='.prepare($id));
|
||||
}
|
||||
} else {
|
||||
foreach ($order as $i => $id) {
|
||||
$dbo->query("UPDATE zz_checks SET `order`=".prepare($i)." WHERE id=".prepare($id));
|
||||
$dbo->query('UPDATE zz_checks SET `order`='.prepare($i).' WHERE id='.prepare($id));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "save_checkbox":
|
||||
|
||||
case 'save_checkbox':
|
||||
$id = post('id');
|
||||
|
||||
$record = Check::find($id);
|
||||
|
@ -66,7 +63,7 @@ switch(post('op')){
|
|||
|
||||
break;
|
||||
|
||||
case "save_note":
|
||||
case 'save_note':
|
||||
$note = post('note');
|
||||
$id = post('id');
|
||||
|
||||
|
@ -78,18 +75,17 @@ switch(post('op')){
|
|||
|
||||
break;
|
||||
|
||||
case "remove_checkbox":
|
||||
|
||||
case 'remove_checkbox':
|
||||
$id = post('id');
|
||||
|
||||
$record = Check::find($id);
|
||||
$record->checked_by = NULL;
|
||||
$record->checked_at = NULL;
|
||||
$record->checked_by = null;
|
||||
$record->checked_at = null;
|
||||
$record->save();
|
||||
|
||||
break;
|
||||
|
||||
case "edit_check":
|
||||
case 'edit_check':
|
||||
$id_record = post('id_record');
|
||||
$main_check = post('main_check');
|
||||
|
||||
|
@ -107,5 +103,3 @@ switch(post('op')){
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
|
@ -39,7 +39,7 @@ echo '
|
|||
'label' => tr('Contenuto'),
|
||||
'name' => 'content',
|
||||
'required' => 1,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
]).'
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Modules\Checklists\ChecklistItem;
|
||||
use Modules\Checklists\Check;
|
||||
use Modules\Checklists\ChecklistItem;
|
||||
|
||||
$id_record = get("id_record");
|
||||
$main_check = get("main_check");
|
||||
$id_record = get('id_record');
|
||||
$main_check = get('main_check');
|
||||
|
||||
if ($main_check) {
|
||||
$record = ChecklistItem::find($id_record);
|
||||
|
@ -40,7 +40,7 @@ if($main_check){
|
|||
'label' => tr('Descrizione'),
|
||||
'name' => 'content_edit',
|
||||
'required' => 1,
|
||||
'value' => htmlentities($record->content)
|
||||
'value' => htmlentities($record->content),
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
|
@ -48,7 +48,7 @@ if($main_check){
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Utilizza come titolo'); ?>", "name": "is_titolo", "value": "<?php echo $record->is_titolo ?>" ]}
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Utilizza come titolo'); ?>", "name": "is_titolo", "value": "<?php echo $record->is_titolo; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 text-right">
|
||||
|
@ -64,10 +64,10 @@ if($main_check){
|
|||
|
||||
$.post('<?php echo $rootdir; ?>/modules/checklists/ajax.php', {
|
||||
op: "edit_check",
|
||||
id_record: "<?=$id_record?>",
|
||||
id_record: "<?php echo $id_record; ?>",
|
||||
content: input('content_edit').get(),
|
||||
is_titolo: input('is_titolo').get(),
|
||||
main_check: "<?=$main_check?>",
|
||||
main_check: "<?php echo $main_check; ?>",
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
|
|
|
@ -96,7 +96,7 @@ echo '
|
|||
'label' => tr('Contenuto'),
|
||||
'name' => 'content',
|
||||
'required' => 1,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
]).'
|
||||
</div>
|
||||
|
||||
|
@ -119,8 +119,8 @@ echo " <table class='table'>
|
|||
foreach ($checks as $check) {
|
||||
echo renderChecklistInserimento($check);
|
||||
}
|
||||
echo " </tbody>
|
||||
</table>";
|
||||
echo ' </tbody>
|
||||
</table>';
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
function renderChecklist($check, $level = 1, $parent = 0) {
|
||||
|
||||
function renderChecklist($check, $level = 1, $parent = 0)
|
||||
{
|
||||
global $structure;
|
||||
|
||||
$user = auth()->getUser();
|
||||
|
@ -113,7 +113,6 @@ function renderChecklist($check, $level = 1, $parent = 0) {
|
|||
|
||||
function renderChecklistInserimento($check, $level = 1, $parent = 0)
|
||||
{
|
||||
|
||||
global $record;
|
||||
|
||||
$margin = ($level * 20);
|
||||
|
@ -139,8 +138,6 @@ function renderChecklistInserimento($check, $level = 1, $parent = 0)
|
|||
</div>
|
||||
</td>';
|
||||
|
||||
|
||||
|
||||
$result .= '
|
||||
</tr>';
|
||||
|
||||
|
|
|
@ -617,7 +617,6 @@ switch (post('op')) {
|
|||
$articolo->setProvvigione($provvigione ?: 0, 'PRC');
|
||||
$articolo->save();
|
||||
|
||||
|
||||
flash()->info(tr('Nuovo articolo aggiunto!'));
|
||||
} else {
|
||||
$response['error'] = tr('Nessun articolo corrispondente a magazzino');
|
||||
|
|
|
@ -130,7 +130,6 @@ switch (post('op')) {
|
|||
case 'renew_contratto':
|
||||
$numero_totale = 0;
|
||||
|
||||
|
||||
// Lettura righe selezionate
|
||||
foreach ($id_records as $id) {
|
||||
$contratto = Contratto::find($id);
|
||||
|
@ -208,7 +207,7 @@ switch (post('op')) {
|
|||
// Cambio stato precedente contratto in concluso (non più pianificabile)
|
||||
$dbo->query('UPDATE `co_contratti` SET `rinnovabile`= 0, `idstato`= (SELECT id FROM co_staticontratti WHERE descrizione = \'Concluso\') WHERE `id` = '.prepare($contratto->id));
|
||||
|
||||
$numero_totale++;
|
||||
++$numero_totale;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,7 +252,7 @@ $operations['crea_fattura'] = [
|
|||
'data' => [
|
||||
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
|
||||
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture esistenti non ancora emesse?').'", "name": "accodare" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT id, CONCAT(codice_tipo_documento_fe, \' - \', descrizione) AS descrizione FROM co_tipidocumento WHERE enabled = 1 AND dir =\'entrata\' ORDER BY codice_tipo_documento_fe", "value": "'.$idtipodocumento.'" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
|
|
|
@ -135,8 +135,7 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
echo input([
|
||||
<?php echo input([
|
||||
'type' => 'ckeditor',
|
||||
'use_full_ckeditor' => 0,
|
||||
'label' => tr('Condizioni generali di fornitura'),
|
||||
|
|
|
@ -88,8 +88,8 @@ $righe = $dbo->fetchArray(
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $riga['codice'] ?></td>
|
||||
<td><?= $riga['descrizione'] ?></td>
|
||||
<td><?php echo $riga['codice']; ?></td>
|
||||
<td><?php echo $riga['descrizione']; ?></td>
|
||||
<td>
|
||||
<div>
|
||||
{[ "type": "number", "label": "", "data-id":"<?php echo $riga['id']; ?>","name": "nuovo_prezzo_unitario[]", "value": "<?php echo numberFormat($riga['prezzo_unitario'], 2); ?>"]}
|
||||
|
|
|
@ -23,9 +23,8 @@ use Modules\Contratti\Contratto;
|
|||
use Modules\Interventi\Intervento;
|
||||
|
||||
/**
|
||||
* Calcolo imponibile contratto (totale_righe - sconto)
|
||||
* Calcolo imponibile contratto (totale_righe - sconto).
|
||||
*/
|
||||
|
||||
function get_imponibile_contratto($idcontratto)
|
||||
{
|
||||
$contratto = Contratto::find($idcontratto);
|
||||
|
@ -33,10 +32,8 @@ function get_imponibile_contratto($idcontratto)
|
|||
return $contratto->totale_imponibile;
|
||||
}
|
||||
|
||||
|
||||
function get_totale_interventi_contratto($idcontratto)
|
||||
{
|
||||
|
||||
$interventi = Intervento::where('id_contratto', $idcontratto)->get();
|
||||
$array_interventi = $interventi->toArray();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ if (!empty($interventi)) {
|
|||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($intervento->ore_totali<=0 ? '<i class="fa fa-warning tip" style="position:relative;margin-left:-16px;" title="'.tr("Questa sessione è vuota").'" ></i> ': '' ).numberFormat($intervento->ore_totali).'
|
||||
'.($intervento->ore_totali <= 0 ? '<i class="fa fa-warning tip" style="position:relative;margin-left:-16px;" title="'.tr('Questa sessione è vuota').'" ></i> ' : '').numberFormat($intervento->ore_totali).'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
|
|
|
@ -350,7 +350,6 @@ switch (filter('op')) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$tooltip .= '
|
||||
<script type="text/javascript">
|
||||
$(".shorten").shorten({
|
||||
|
@ -360,9 +359,7 @@ switch (filter('op')) {
|
|||
});
|
||||
</script>';
|
||||
|
||||
|
||||
echo $tooltip;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -479,7 +476,6 @@ switch (filter('op')) {
|
|||
break;
|
||||
|
||||
case 'calendario_eventi':
|
||||
|
||||
$start = filter('start');
|
||||
$end = filter('end');
|
||||
|
||||
|
@ -501,7 +497,7 @@ switch (filter('op')) {
|
|||
'title' => $evento['nome'],
|
||||
'start' => ($evento['is_recurring'] ? date('Y-', strtotime($start)).date('m-d', strtotime($evento['data'])) : $evento['data']),
|
||||
//'end' => date('Y-m-d', strtotime($evento['data']. '+1 day')),
|
||||
'display' => "background",
|
||||
'display' => 'background',
|
||||
'allDay' => true,
|
||||
'overlap' => true,
|
||||
];
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Individuazione dati selezionabili
|
||||
|
@ -315,7 +316,6 @@ WHERE (SELECT COUNT(*) FROM in_interventi_tecnici WHERE in_interventi_tecnici.id
|
|||
$chiave = $data->format('mY');
|
||||
$testo = $data->formatLocalized('%B %Y');
|
||||
|
||||
|
||||
if (checkdate($data->format('m'), $data->format('d'), $data->format('Y'))) {
|
||||
echo '
|
||||
<option value="'.$chiave.'">'.ucfirst($testo).'</option>';
|
||||
|
@ -347,9 +347,9 @@ $days = [
|
|||
4 => 'Giovedì',
|
||||
5 => 'Venerdì',
|
||||
6 => 'Sabato',
|
||||
0 => 'Domenica'
|
||||
0 => 'Domenica',
|
||||
];
|
||||
$working_days = explode(",",setting('Giorni lavorativi'));
|
||||
$working_days = explode(',', setting('Giorni lavorativi'));
|
||||
$non_working_days = [];
|
||||
|
||||
foreach ($days as $key => $day) {
|
||||
|
|
|
@ -92,7 +92,7 @@ foreach ($moduli as $module_id => $note) {
|
|||
$documento = $dbo->fetchOne("SELECT matricola AS numero, ragione_sociale FROM zz_notes INNER JOIN my_impianti ON (my_impianti.id = zz_notes.id_record AND zz_notes.id_module=(SELECT id FROM zz_modules WHERE title = 'Impianti')) INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = my_impianti.idanagrafica");
|
||||
} else {
|
||||
$documento['numero'] = ' ';
|
||||
};
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr class="'.$class.'">
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
// Trovo id_print della stampa
|
||||
$id_print = Prints::getPrints()['Stampa calendario settimanale'];
|
||||
|
||||
|
|
|
@ -636,7 +636,6 @@ switch (filter('op')) {
|
|||
$articolo->setSconto($sconto, 'PRC');
|
||||
$articolo->save();
|
||||
|
||||
|
||||
flash()->info(tr('Nuovo articolo aggiunto!'));
|
||||
}
|
||||
} else {
|
||||
|
@ -696,7 +695,6 @@ switch (filter('op')) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
// Aggiornamento stato degli ordini presenti in questa fattura in base alle quantità totali evase
|
||||
if (!empty($id_record) && setting('Cambia automaticamente stato ordini fatturati')) {
|
||||
$rs = $dbo->fetchArray('SELECT idordine FROM dt_righe_ddt WHERE idddt='.prepare($id_record).' AND idordine!=0');
|
||||
|
|
|
@ -182,7 +182,7 @@ $operations['crea_fattura'] = [
|
|||
'data' => [
|
||||
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
|
||||
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle _TYPE_ non ancora emesse?', ['_TYPE_' => strtolower($module_fatture)]).'", "placeholder": "'.tr('Aggiungere alle _TYPE_ nello stato bozza?', ['_TYPE_' => strtolower($module_fatture)]).'</small>", "name": "accodare" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT id, CONCAT(codice_tipo_documento_fe, \' - \', descrizione) AS descrizione FROM co_tipidocumento WHERE enabled = 1 AND dir ='.prepare($dir).' ORDER BY codice_tipo_documento_fe", "value": "'.$idtipodocumento.'" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
|
|
|
@ -43,7 +43,7 @@ if (!empty($ddt->id_ddt_trasporto_interno)) {
|
|||
function completaTrasporto() {
|
||||
swal({
|
||||
title: "'.tr('Completare il trasporto?').'",
|
||||
html: "'.tr('Sei sicuro di voler completare il trasporto interno tramite un DDT in direzione opposta?').'" + `<br><br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_module_collegamento, 'is_sezionale' => 1]).', "value": "'.$_SESSION['module_'.$id_module_collegamento]['id_segment'].'" ]}`,
|
||||
html: "'.tr('Sei sicuro di voler completare il trasporto interno tramite un DDT in direzione opposta?').'" + `<br><br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module_collegamento, 'is_sezionale' => 1]).', "value": "'.$_SESSION['module_'.$id_module_collegamento]['id_segment'].'" ]}`,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonClass: "btn btn-lg btn-success",
|
||||
|
@ -88,4 +88,3 @@ echo '
|
|||
<button type="button" class="btn btn-primary ask" data-title="'.tr('Duplicare questo Ddt?').'" data-msg="'.tr('Clicca su tasto duplica per procedere.').'" data-op="copy" data-button="'.tr('Duplica').'" data-class="btn btn-lg btn-primary" data-backto="record-edit">
|
||||
<i class="fa fa-copy"></i> '.tr('Duplica ddt').'
|
||||
</button>';
|
||||
|
||||
|
|
|
@ -89,8 +89,8 @@ $righe = $dbo->fetchArray(
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $riga['codice'] ?></td>
|
||||
<td><?= $riga['descrizione'] ?></td>
|
||||
<td><?php echo $riga['codice']; ?></td>
|
||||
<td><?php echo $riga['descrizione']; ?></td>
|
||||
<td>
|
||||
<div>
|
||||
{[ "type": "number", "label": "", "data-id":"<?php echo $riga['id']; ?>","name": "nuovo_prezzo_unitario[]", "value": "<?php echo numberFormat($riga['prezzo_unitario'], 2); ?>"]}
|
||||
|
|
|
@ -129,7 +129,6 @@ foreach ($righe as $riga) {
|
|||
<br><small><i class="fa fa-barcode"></i> '.$riga->articolo->barcode.'</small>';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($riga->note)) {
|
||||
echo '
|
||||
<br><small class="label label-default">'.nl2br($riga->note).'</small>';
|
||||
|
@ -392,7 +391,8 @@ if (!$block_edit && sizeof($righe) > 0) {
|
|||
<button type="button" class="btn btn-xs btn-default disabled" id="confronta_righe" onclick="confrontaRighe(getSelectData());">
|
||||
Confronta prezzi
|
||||
</button>';
|
||||
} echo'
|
||||
}
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -116,8 +116,7 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
echo input([
|
||||
<?php echo input([
|
||||
'type' => 'ckeditor',
|
||||
'use_full_ckeditor' => 1,
|
||||
'label' => tr('Contenuto'),
|
||||
|
|
|
@ -19,17 +19,15 @@
|
|||
|
||||
namespace Modules\Emails;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Notifications\EmailNotification;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
use Tasks\Manager;
|
||||
|
||||
class EmailTask extends Manager
|
||||
{
|
||||
|
||||
public function needsExecution()
|
||||
{
|
||||
$lista = database()->fetchArray("SELECT * FROM em_emails WHERE (sent_at IS NULL OR failed_at IS NOT NULL) AND attempt<".prepare(setting('Numero massimo di tentativi'))." ORDER BY created_at");
|
||||
$lista = database()->fetchArray('SELECT * FROM em_emails WHERE (sent_at IS NULL OR failed_at IS NOT NULL) AND attempt<'.prepare(setting('Numero massimo di tentativi')).' ORDER BY created_at');
|
||||
$remaining = sizeof($lista);
|
||||
|
||||
return !empty($remaining);
|
||||
|
@ -37,10 +35,9 @@ class EmailTask extends Manager
|
|||
|
||||
public function execute()
|
||||
{
|
||||
$lista = database()->fetchArray("SELECT * FROM em_emails WHERE (sent_at IS NULL OR failed_at IS NOT NULL) AND attempt<".prepare(setting('Numero massimo di tentativi'))." ORDER BY created_at LIMIT 0,".setting('Numero email da inviare in contemporanea per account'));
|
||||
$lista = database()->fetchArray('SELECT * FROM em_emails WHERE (sent_at IS NULL OR failed_at IS NOT NULL) AND attempt<'.prepare(setting('Numero massimo di tentativi')).' ORDER BY created_at LIMIT 0,'.setting('Numero email da inviare in contemporanea per account'));
|
||||
|
||||
foreach ($lista as $mail) {
|
||||
|
||||
$mail = Mail::find($mail['id']);
|
||||
|
||||
try {
|
||||
|
|
|
@ -29,7 +29,6 @@ switch (post('op')) {
|
|||
$is_bank_holiday = post('is_bank_holiday');
|
||||
|
||||
if ($dbo->fetchNum('SELECT * FROM `zz_events` WHERE `nome`='.prepare($nome).' AND `id`!='.prepare($id_record)) == 0) {
|
||||
|
||||
$dbo->update('zz_events', [
|
||||
'nome' => $nome,
|
||||
'data' => $data,
|
||||
|
@ -41,7 +40,6 @@ switch (post('op')) {
|
|||
'id' => $id_record,
|
||||
]);
|
||||
|
||||
|
||||
flash()->info(tr('Salvataggio completato.'));
|
||||
} else {
|
||||
flash()->error(tr("E' già presente un _TYPE_ con lo stesso nome", [
|
||||
|
@ -56,7 +54,6 @@ switch (post('op')) {
|
|||
$data = post('data');
|
||||
$id_nazione = post('id_nazione');
|
||||
if ($dbo->fetchNum('SELECT * FROM `zz_events` WHERE `id_nazione` = '.prepare($id_nazione).' AND `nome`='.prepare($nome).' AND `data`='.prepare($data)) == 0) {
|
||||
|
||||
$dbo->insert('zz_events', [
|
||||
'nome' => $nome,
|
||||
'data' => $data,
|
||||
|
@ -81,7 +78,6 @@ switch (post('op')) {
|
|||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$dbo->delete('zz_events', [
|
||||
'id' => $id_record,
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
//$block_edit = $record['is_predefined'];
|
||||
|
|
|
@ -29,7 +29,6 @@ switch (post('op')) {
|
|||
$is_predefined = post('is_predefined');
|
||||
|
||||
if ($dbo->fetchNum('SELECT * FROM `in_fasceorarie` WHERE `nome`='.prepare($nome).' AND `id`!='.prepare($id_record)) == 0) {
|
||||
|
||||
if (!empty($is_predefined)) {
|
||||
$dbo->query('UPDATE in_fasceorarie SET is_predefined = 0');
|
||||
}
|
||||
|
@ -60,7 +59,6 @@ switch (post('op')) {
|
|||
$ora_fine = post('ora_fine');
|
||||
|
||||
if ($dbo->fetchNum('SELECT * FROM `in_fasceorarie` WHERE `nome`='.prepare($nome)) == 0) {
|
||||
|
||||
$dbo->insert('in_fasceorarie', [
|
||||
'nome' => $nome,
|
||||
'ora_inizio' => $ora_inizio,
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
//$block_edit = $record['is_predefined'];
|
||||
|
@ -79,7 +78,6 @@ include_once __DIR__.'/../../core.php';
|
|||
$results = $dbo->fetchArray('SELECT * FROM `co_pagamenti` WHERE descrizione='.prepare($record['descrizione']).' ORDER BY `num_giorni` ASC');
|
||||
$numero_data = 1;
|
||||
foreach ($results as $result) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -167,7 +165,6 @@ if (!empty($elementi)) {
|
|||
|
||||
echo '
|
||||
<li>'.Modules::link($modulo, $id, $descrizione).'</li>';
|
||||
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -178,6 +175,6 @@ if (!empty($elementi)) {
|
|||
|
||||
?>
|
||||
|
||||
<a class="btn btn-danger ask <?php echo (intval($record['can_delete'])==0 ? 'disabled' : ''); ?>" data-backto="record-list">
|
||||
<a class="btn btn-danger ask <?php echo intval($record['can_delete']) == 0 ? 'disabled' : ''; ?>" data-backto="record-list">
|
||||
<i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?>
|
||||
</a>
|
||||
|
|
|
@ -173,7 +173,7 @@ switch ($op) {
|
|||
$fattura->setScontoFinale(post('sconto_finale'), post('tipo_sconto_finale'));
|
||||
|
||||
$anagrafica = Anagrafica::find($fattura->idanagrafica);
|
||||
if ($anagrafica->tipo === "Privato" && $fattura->is_fattura_conto_terzi) {
|
||||
if ($anagrafica->tipo === 'Privato' && $fattura->is_fattura_conto_terzi) {
|
||||
flash()->warning(tr('L\'anagrafica selezionata è del tipo "Privato", correggere la tipologia dalla scheda anagrafica!'));
|
||||
} else {
|
||||
$results = $fattura->save();
|
||||
|
@ -181,7 +181,6 @@ switch ($op) {
|
|||
flash()->info(tr('Fattura modificata correttamente!'));
|
||||
}
|
||||
|
||||
|
||||
foreach ($results as $numero => $result) {
|
||||
foreach ($result as $title => $links) {
|
||||
foreach ($links as $link => $errors) {
|
||||
|
@ -243,7 +242,7 @@ switch ($op) {
|
|||
->where('id', '!=', $id_record)
|
||||
->where('data', '>=', $_SESSION['period_start'])
|
||||
->where('data', '<=', $_SESSION['period_end'])
|
||||
->where('numero_esterno', '!=', NULL)
|
||||
->where('numero_esterno', '!=', null)
|
||||
->whereHas('tipo', function ($query) use ($direzione) {
|
||||
$query->where('dir', '=', $direzione);
|
||||
})->count();
|
||||
|
@ -281,7 +280,6 @@ switch ($op) {
|
|||
}
|
||||
|
||||
$totale_documento = abs($totale_documento);
|
||||
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
|
@ -558,7 +556,6 @@ switch ($op) {
|
|||
// Ricalcolo inps, ritenuta e bollo
|
||||
ricalcola_costiagg_fattura($id_record);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'manage_riga':
|
||||
|
@ -568,7 +565,6 @@ switch ($op) {
|
|||
$riga = Riga::build($fattura);
|
||||
}
|
||||
|
||||
|
||||
$qta = post('qta');
|
||||
|
||||
$riga->descrizione = post('descrizione');
|
||||
|
@ -614,7 +610,6 @@ switch ($op) {
|
|||
$riga->descrizione = post('descrizione');
|
||||
$riga->note = post('note');
|
||||
|
||||
|
||||
$riga->save();
|
||||
|
||||
if (post('idriga') != null) {
|
||||
|
@ -741,7 +736,6 @@ switch ($op) {
|
|||
$fattura->idpagamento = setting('Tipo di pagamento predefinito');
|
||||
}
|
||||
|
||||
|
||||
$idsede = ($documento->idsede_destinazione ? $documento->idsede_destinazione : $documento->idsede);
|
||||
|
||||
$fattura->idsede_destinazione = $idsede;
|
||||
|
@ -856,7 +850,6 @@ switch ($op) {
|
|||
$id_record = $nota->id;
|
||||
aggiorna_sedi_movimenti('documenti', $id_record);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
// Autofattura
|
||||
|
@ -1020,7 +1013,6 @@ switch ($op) {
|
|||
$articolo->setProvvigione($provvigione ?: 0, 'PRC');
|
||||
$articolo->save();
|
||||
|
||||
|
||||
flash()->info(tr('Nuovo articolo aggiunto!'));
|
||||
}
|
||||
} else {
|
||||
|
@ -1048,7 +1040,7 @@ switch ($op) {
|
|||
}
|
||||
$result = [
|
||||
'id' => $azienda->id,
|
||||
'ragione_sociale' => $azienda->ragione_sociale
|
||||
'ragione_sociale' => $azienda->ragione_sociale,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1080,6 @@ switch ($op) {
|
|||
flash()->warning(tr('Nessun prezzo modificato!'));
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
<div id="info-title-bozza" class="box">
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'.tr("Fatture in stato Bozza del cliente").'</h3>
|
||||
<h3 class="box-title">'.tr('Fatture in stato Bozza del cliente').'</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fa fa-minus"></i>
|
||||
|
@ -100,7 +100,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
<div class="col-md-6">
|
||||
<div id="info-title-scadute" class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'.tr("Fatture con termini di pagamento trascorsi").'</h3>
|
||||
<h3 class="box-title">'.tr('Fatture con termini di pagamento trascorsi').'</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fa fa-minus"></i>
|
||||
|
@ -116,7 +116,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
<!-- DETTAGLI CLIENTE -->
|
||||
<div class="box box-info collapsable collapsed-box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'.tr("Dettagli cliente").'</h3>
|
||||
<h3 class="box-title">'.tr('Dettagli cliente').'</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fa fa-plus"></i>
|
||||
|
@ -125,7 +125,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
</div>
|
||||
|
||||
<div class="box-body" id="dettagli_cliente">
|
||||
'.tr("Seleziona prima un cliente").'...
|
||||
'.tr('Seleziona prima un cliente').'...
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
|
|
@ -82,8 +82,8 @@ foreach ($rs as $key => $value) {
|
|||
$prezzo = $intervento->totale;
|
||||
|
||||
$rs[$key]['prezzo'] = Translator::numberToLocale($prezzo);
|
||||
$rs[$key]['descrizione_intervento'] = str_replace("'", " ", strip_tags($rs[$key]['descrizione_intervento']));
|
||||
$rs[$key]['info'] = str_replace("'", " ", strip_tags($module_interventi->replacePlaceholders($value['id'], setting('Descrizione personalizzata in fatturazione')))) ?: $rs[$key]['info'];
|
||||
$rs[$key]['descrizione_intervento'] = str_replace("'", ' ', strip_tags($rs[$key]['descrizione_intervento']));
|
||||
$rs[$key]['info'] = str_replace("'", ' ', strip_tags($module_interventi->replacePlaceholders($value['id'], setting('Descrizione personalizzata in fatturazione')))) ?: $rs[$key]['info'];
|
||||
}
|
||||
|
||||
// Intervento
|
||||
|
|
|
@ -19,17 +19,17 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Modules\Aggiornamenti\Controlli\DatiFattureElettroniche;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Fatture\Export\CSV;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Stato;
|
||||
use Plugins\ExportFE\FatturaElettronica;
|
||||
use Plugins\ExportFE\Interaction;
|
||||
use Plugins\ReceiptFE\Ricevuta;
|
||||
use Util\XML;
|
||||
use Util\Zip;
|
||||
use Modules\Fatture\Stato;
|
||||
use Plugins\ReceiptFE\Ricevuta;
|
||||
use Carbon\Carbon;
|
||||
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$stato_emessa = $dbo->selectOne('co_statidocumento', 'id', ['descrizione' => 'Emessa'])['id'];
|
||||
|
@ -334,7 +334,6 @@ switch (post('op')) {
|
|||
$data = date('Y-m-d', strtotime('+1 year', strtotime($fattura->data)));
|
||||
}
|
||||
|
||||
|
||||
$new = $fattura->replicate();
|
||||
|
||||
$new->data = $data;
|
||||
|
@ -556,11 +555,9 @@ switch (post('op')) {
|
|||
|
||||
case 'verify-notifiche':
|
||||
foreach ($id_records as $id) {
|
||||
|
||||
$documento = Fattura::find($id);
|
||||
|
||||
if ($documento->codice_stato_fe == 'GEN' || $documento->codice_stato_fe == 'WAIT') {
|
||||
|
||||
$result = Interaction::getInvoiceRecepits($id);
|
||||
$last_recepit = $result['results'][0];
|
||||
if (!empty($last_recepit)) {
|
||||
|
@ -620,7 +617,7 @@ $operations['export-csv'] = [
|
|||
$operations['copy-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-copy"></i> '.tr('Duplica selezionati').'</span>',
|
||||
'data' => [
|
||||
'msg' => tr('Vuoi davvero duplicare le righe selezionate?').'<br><br>{[ "type": "select", "label": "'.tr('Fattura in avanti di').'", "name": "skip_time", "required": 1, "values": "list=\"Giorno\":\"'.tr('Un giorno').'\", \"Settimana\":\"'.tr('Una settimana').'\", \"Mese\":\"'.tr('Un mese').'\", \"Anno\":\"'.tr('Un anno').'\" ", "value": "Giorno" ]}<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_module, 'is_sezionale' => 1]).', "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'", "select-options-escape": true ]}<br>{[ "type": "checkbox", "label": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "placeholder": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "name": "riferimenti" ]}',
|
||||
'msg' => tr('Vuoi davvero duplicare le righe selezionate?').'<br><br>{[ "type": "select", "label": "'.tr('Fattura in avanti di').'", "name": "skip_time", "required": 1, "values": "list=\"Giorno\":\"'.tr('Un giorno').'\", \"Settimana\":\"'.tr('Una settimana').'\", \"Mese\":\"'.tr('Un mese').'\", \"Anno\":\"'.tr('Un anno').'\" ", "value": "Giorno" ]}<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module, 'is_sezionale' => 1]).', "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'", "select-options-escape": true ]}<br>{[ "type": "checkbox", "label": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "placeholder": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "name": "riferimenti" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
],
|
||||
|
@ -733,7 +730,7 @@ $operations['cambia-sezionale'] = [
|
|||
'title' => tr('Cambia sezionale'),
|
||||
'msg' => tr('Scegli il sezionale _TIPOLOGIA_ in cui spostare le fatture in stato "Bozza" selezionate', [
|
||||
'_TIPOLOGIA_' => $is_fiscale ? tr('fiscale') : tr('non fiscale'),
|
||||
]).':<br><br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_module, 'is_sezionale' => 1, 'is_fiscale' => $is_fiscale, 'escludi_id' => $_SESSION['module_'.$id_module]['id_segment']]).', "select-options-escape": true ]}',
|
||||
]).':<br><br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module, 'is_sezionale' => 1, 'is_fiscale' => $is_fiscale, 'escludi_id' => $_SESSION['module_'.$id_module]['id_segment']]).', "select-options-escape": true ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
|
|
|
@ -59,7 +59,7 @@ echo '
|
|||
}
|
||||
|
||||
if (empty($record['is_fiscale'])) {
|
||||
$msg = '<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_module, 'is_sezionale' => 1, 'is_fiscale' => 1]).', "select-options-escape": true ]}
|
||||
$msg = '<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_module, 'is_sezionale' => 1, 'is_fiscale' => 1]).', "select-options-escape": true ]}
|
||||
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-" ]}';
|
||||
|
||||
echo '
|
||||
|
@ -93,7 +93,6 @@ if (!empty($record['is_fiscale'])) {
|
|||
// Aggiunta prima nota solo se non c'è già, se non si è in bozza o se il pagamento non è completo
|
||||
$prima_nota_presente = $dbo->fetchNum('SELECT id FROM co_movimenti WHERE iddocumento = '.prepare($id_record).' AND primanota = 1');
|
||||
|
||||
|
||||
$registrazione_contabile = 0;
|
||||
if ($differenza != 0 || (!$prima_nota_presente && $record['stato'] == 'Emessa')) {
|
||||
$registrazione_contabile = 1;
|
||||
|
|
|
@ -35,18 +35,14 @@ if ($module->name == 'Fatture di vendita' && $services_enable) {
|
|||
$data_limite_invio = (new Carbon())->subDays(10);
|
||||
$data_setting = Carbon::createFromFormat('d/m/Y', setting('Data inizio controlli su stati FE'))->format('Y-m-d');
|
||||
|
||||
|
||||
$documenti = Fattura::where('data', '>', $data_limite)->where('data', '>', $data_setting)->whereIn('codice_stato_fe', ['EC02', 'ERR', 'ERVAL', 'NS', 'GEN', 'QUEUE'])->get();
|
||||
|
||||
foreach ($documenti as $documento) {
|
||||
|
||||
$stato_fe = $database->fetchOne('SELECT descrizione, icon FROM fe_stati_documento WHERE codice = '.prepare($documento->codice_stato_fe));
|
||||
|
||||
if (in_array($documento->codice_stato_fe, $codici_scarto)) {
|
||||
|
||||
// In caso di NS verifico che non sia semplicemente un codice 00404 (Fattura duplicata)
|
||||
if ($documento->codice_stato_fe == 'NS') {
|
||||
|
||||
$ricevuta_principale = $documento->getRicevutaPrincipale();
|
||||
|
||||
if (!empty($ricevuta_principale)) {
|
||||
|
@ -69,8 +65,6 @@ if ($module->name == 'Fatture di vendita' && $services_enable) {
|
|||
]));
|
||||
|
||||
$show_avviso = $show_avviso ?: ($documento->data_stato_fe < (new Carbon())->subDays(4) ? 1 : 0);
|
||||
|
||||
|
||||
} elseif (in_array($documento->codice_stato_fe, $codici_invio)) {
|
||||
$is_estera = false;
|
||||
|
||||
|
@ -92,7 +86,7 @@ if ($module->name == 'Fatture di vendita' && $services_enable) {
|
|||
if (sizeof($documenti_scarto) > 0) {
|
||||
echo '
|
||||
<div class="alert alert-danger">
|
||||
<i class="fa fa-warning"></i> '.tr("<b>ATTENZIONE:</b> le seguenti fatture riscontrano problemi").':<ul>';
|
||||
<i class="fa fa-warning"></i> '.tr('<b>ATTENZIONE:</b> le seguenti fatture riscontrano problemi').':<ul>';
|
||||
foreach ($documenti_scarto as $documento) {
|
||||
echo '
|
||||
<li><b>'.$documento.'</b></li>';
|
||||
|
@ -109,7 +103,7 @@ if ($module->name == 'Fatture di vendita' && $services_enable) {
|
|||
if (sizeof($documenti_invio) > 0) {
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-clock-o"></i> '.tr("Le seguenti fatture sono in attesa di essere inviate").':<ul>';
|
||||
<i class="fa fa-clock-o"></i> '.tr('Le seguenti fatture sono in attesa di essere inviate').':<ul>';
|
||||
foreach ($documenti_invio as $documento) {
|
||||
echo '
|
||||
<li><b>'.$documento.'</b></li>';
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Anagrafiche\Nazione;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Gestori\Bollo;
|
||||
use Modules\Interventi\Intervento;
|
||||
|
@ -47,7 +46,6 @@ if ($dir == 'entrata' && !empty($fattura->dichiarazione) ) {
|
|||
$iva = Aliquota::find($id_iva);
|
||||
|
||||
if (!empty($iva)) {
|
||||
|
||||
if ($diff == 0) {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
|
@ -64,8 +62,7 @@ if ($dir == 'entrata' && !empty($fattura->dichiarazione) ) {
|
|||
'_PROTOCOLLO_' => $fattura->dichiarazione->numero_protocollo,
|
||||
]).'.</b>
|
||||
</div>';
|
||||
}
|
||||
elseif ($diff_in_days < 0) {
|
||||
} elseif ($diff_in_days < 0) {
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i> '.tr("La dichiarazione d'intento _PROTOCOLLO_ ha come data fine validità _SCADENZA_ mentre la fattura ha data _DATA_", [
|
||||
|
@ -75,7 +72,6 @@ if ($dir == 'entrata' && !empty($fattura->dichiarazione) ) {
|
|||
]).'.</b>
|
||||
</div>';
|
||||
}
|
||||
|
||||
} else {
|
||||
//TODO link ad impostazioni con nuova ricerca rapida
|
||||
echo '
|
||||
|
@ -116,7 +112,7 @@ if ($abilita_autofattura) {
|
|||
} elseif ($autofattura_collegata != null) {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info"></i> '.tr("Questa autofattura è già stata importata come fattura di acquisto").':
|
||||
<i class="fa fa-info"></i> '.tr('Questa autofattura è già stata importata come fattura di acquisto').':
|
||||
<b>'.Modules::link('Fatture di acquisto', $autofattura_collegata->id, tr('Fattura num. _NUM_ del _DATE_', [
|
||||
'_NUM_' => $autofattura_collegata->numero_esterno,
|
||||
'_DATE_' => dateFormat($autofattura_collegata->data),
|
||||
|
@ -146,7 +142,7 @@ if (!empty($fattura->ref_documento) && $fattura->isNota()) {
|
|||
$nota = Fattura::find($fattura->ref_documento);
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info"></i> '.tr("Questa è una _TIPO_ generata dalla seguente fattura", [
|
||||
<i class="fa fa-info"></i> '.tr('Questa è una _TIPO_ generata dalla seguente fattura', [
|
||||
'_TIPO_' => $fattura->tipo->descrizione,
|
||||
]).':
|
||||
<b>'.Modules::link($module->name, $fattura->ref_documento, tr('Fattura num. _NUM_ del _DATE_', [
|
||||
|
@ -159,12 +155,10 @@ if (!empty($fattura->ref_documento) && $fattura->isNota()) {
|
|||
// Ricordo che si sta emettendo una fattura conto terzi
|
||||
if ($dir == 'entrata' && $fattura->stato->descrizione == 'Bozza') {
|
||||
if ($fattura->is_fattura_conto_terzi) {
|
||||
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info"></i> '.tr("Questa è una fattura per conto di terzi. Nell'XML della Fattura Elettronica sarà indicato il fornitore _FORNITORE_ come cessionario e il cliente come cedente/prestatore", ['_FORNITORE_' => '"<b>'.stripslashes($database->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')))['ragione_sociale']).'</b>"',]).'.</b>
|
||||
<i class="fa fa-info"></i> '.tr("Questa è una fattura per conto di terzi. Nell'XML della Fattura Elettronica sarà indicato il fornitore _FORNITORE_ come cessionario e il cliente come cedente/prestatore", ['_FORNITORE_' => '"<b>'.stripslashes($database->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')))['ragione_sociale']).'</b>"']).'.</b>
|
||||
</div>';
|
||||
|
||||
}
|
||||
}
|
||||
// Verifica aggiuntive sulla sequenzialità dei numeri
|
||||
|
@ -371,8 +365,7 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php
|
||||
if ($record['id_banca_azienda'] != 0) {
|
||||
<?php if ($record['id_banca_azienda'] != 0) {
|
||||
echo Modules::link('Banche', $record['id_banca_azienda'], null, null, 'class="pull-right"');
|
||||
}
|
||||
?>
|
||||
|
@ -457,7 +450,6 @@ echo '
|
|||
echo '<div class="col-md-3">
|
||||
{[ "type": "number", "label": "'.tr('Sconto in fattura').'", "name": "sconto_finale", "value": "'.($fattura->sconto_finale_percentuale ?: $fattura->sconto_finale).'", "icon-after": "choice|untprc|'.(empty($fattura->sconto_finale) ? 'PRC' : 'UNT').'", "help": "'.tr('Sconto in fattura, utilizzabile per applicare sconti sul Netto a pagare del documento e le relative scadenze').'. '.tr('Per utilizzarlo in relazione a una riga della Fattura Elettronica, inserire il tipo di dato in \'\'Attributi avanzati\'\' -> \'\'Altri Dati Gestionali\'\' -> \'\'TipoDato\'\' e il testo di descrizione in \'\'Attributi avanzati\'\' -> \'\'Altri Dati Gestionali\'\' -> \'\'RiferimentoTesto\'\' della specifica riga').'. '.tr('Nota: lo sconto in fattura non influenza i movimenti contabili').'." ]}
|
||||
</div>';
|
||||
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
@ -560,8 +552,7 @@ if ($record['descrizione_tipo'] == 'Fattura accompagnatoria di vendita') {
|
|||
}
|
||||
$esterno = $dbo->selectOne('dt_spedizione', 'esterno', [
|
||||
'id' => $record['idspedizione'],
|
||||
])['esterno'];
|
||||
?>
|
||||
])['esterno']; ?>
|
||||
|
||||
{[ "type": "select", "label": "<?php echo tr('Vettore'); ?>", "name": "idvettore", "ajax-source": "vettori", "value": "$idvettore$", "disabled": <?php echo empty($esterno) || (!empty($esterno) && !empty($record['idvettore'])) ? 1 : 0; ?>, "required": <?php echo !empty($esterno) ?: 0; ?>, "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=Vettore&readonly_tipo=1|btn_idvettore|<?php echo ($esterno and (intval(!$record['flag_completato']) || empty($record['idvettore']))) ? '' : 'disabled'; ?>", "class": "<?php echo empty($record['idvettore']) ? 'unblockable' : ''; ?>" ]}
|
||||
</div>
|
||||
|
@ -694,21 +685,17 @@ echo '
|
|||
|
||||
//Dich. intento collegata
|
||||
if ($dir == 'entrata' && !empty($fattura->dichiarazione)) {
|
||||
|
||||
$ive_accettate = $dbo->table('co_iva')->where('codice_natura_fe', 'N3.5')->get();
|
||||
foreach ($ive_accettate as $iva_accettata) {
|
||||
$descrizione_iva_accettata .= '<li>'.$iva_accettata->descrizione.'</li>';
|
||||
}
|
||||
|
||||
if ($fattura->stato->descrizione == 'Bozza') {
|
||||
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info"></i> '.tr("La fattura è collegata ad una dichiarazione d'intento con diponibilità residura pari a _MONEY_.", [ '_MONEY_' => moneyFormat($diff),]).'<br>'.tr("Per collegare una riga alla dichiarazione è sufficiente specificare come IVA <ul>_IVA_</ul>", ['_IVA_' => $descrizione_iva_accettata]).'</b>
|
||||
<i class="fa fa-info"></i> '.tr("La fattura è collegata ad una dichiarazione d'intento con diponibilità residura pari a _MONEY_.", ['_MONEY_' => moneyFormat($diff)]).'<br>'.tr('Per collegare una riga alla dichiarazione è sufficiente specificare come IVA <ul>_IVA_</ul>', ['_IVA_' => $descrizione_iva_accettata]).'</b>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -947,8 +934,6 @@ echo '
|
|||
}
|
||||
}';
|
||||
|
||||
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
echo '$("#idsede_destinazione").selectReset();';
|
||||
} else {
|
||||
|
|
|
@ -88,8 +88,8 @@ $righe = $dbo->fetchArray(
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $riga['codice'] ?></td>
|
||||
<td><?= $riga['descrizione'] ?></td>
|
||||
<td><?php echo $riga['codice']; ?></td>
|
||||
<td><?php echo $riga['descrizione']; ?></td>
|
||||
<td>
|
||||
<div>
|
||||
{[ "type": "number", "label": "", "data-id":"<?php echo $riga['id']; ?>","name": "nuovo_prezzo_unitario[]", "value": "<?php echo numberFormat($riga['prezzo_unitario'], 2); ?>"]}
|
||||
|
|
|
@ -255,7 +255,6 @@ foreach ($righe as $riga) {
|
|||
</a>';
|
||||
}
|
||||
} elseif ($record['stato'] != 'Pagato' && $record['stato'] != 'Emessa') {
|
||||
|
||||
echo '
|
||||
<div class="input-group-btn">';
|
||||
|
||||
|
@ -268,7 +267,6 @@ foreach ($righe as $riga) {
|
|||
}
|
||||
|
||||
if ($record['stato'] != 'Pagato' && $record['stato'] != 'Emessa') {
|
||||
|
||||
if ($riga->id != $fattura->rigaBollo->id) {
|
||||
echo '
|
||||
<a class="btn btn-xs btn-info" title="'.tr('Aggiungi informazioni FE per questa riga').'" onclick="apriInformazioniFE(this)">
|
||||
|
@ -483,7 +481,6 @@ if(!empty($fattura->provvigione)) {
|
|||
<td></td>
|
||||
</tr>';
|
||||
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="6" class="text-right">
|
||||
|
@ -513,7 +510,8 @@ if (!$block_edit && sizeof($righe) > 0) {
|
|||
<button type="button" class="btn btn-xs btn-default disabled" id="confronta_righe" onclick="confrontaRighe(getSelectData());">
|
||||
Confronta prezzi
|
||||
</button>';
|
||||
} echo'
|
||||
}
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -760,7 +760,7 @@ class Fattura extends Document
|
|||
public function isAutofattura()
|
||||
{
|
||||
return in_array($this->tipo->codice_tipo_documento_fe, ['TD16', 'TD17', 'TD18', 'TD19',
|
||||
'TD20', 'TD21', 'TD28']);
|
||||
'TD20', 'TD21', 'TD28', ]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,8 +50,7 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
echo input([
|
||||
<?php echo input([
|
||||
'type' => 'ckeditor',
|
||||
'use_full_ckeditor' => 1,
|
||||
'label' => tr('Descrizione'),
|
||||
|
|
|
@ -48,7 +48,7 @@ switch (post('op')) {
|
|||
|
||||
if (empty($elementi)) {
|
||||
$dbo->query('DELETE FROM my_impianti WHERE id='.prepare($id));
|
||||
$n_impianti++;
|
||||
++$n_impianti;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ if (!empty($elementi)) {
|
|||
echo '
|
||||
<li>'.Modules::link($modulo, $id, $descrizione).'</li>';
|
||||
}
|
||||
$class = "disabled";
|
||||
$class = 'disabled';
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
|
|
|
@ -76,7 +76,7 @@ if ($is_completato) {
|
|||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'.tr("Impianti soggetti ad intervento").'</h3>
|
||||
<h3 class="box-title">'.tr('Impianti soggetti ad intervento').'</h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ echo '
|
|||
'.input([
|
||||
'type' => 'text',
|
||||
'name' => 'ricerca_impostazioni',
|
||||
'value' => $ricerca
|
||||
'value' => $ricerca,
|
||||
]).'
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button">
|
||||
|
|
|
@ -75,7 +75,6 @@ switch (post('op')) {
|
|||
|
||||
$tecnici_assegnati = (array) post('tecnici_assegnati');
|
||||
|
||||
|
||||
$tecnici_presenti_array = $dbo->select('in_interventi_tecnici_assegnati', 'id_tecnico', ['id_intervento' => $intervento->id]);
|
||||
|
||||
foreach ($tecnici_presenti_array as $tecnico_presente) {
|
||||
|
@ -99,7 +98,6 @@ switch (post('op')) {
|
|||
}
|
||||
|
||||
foreach ($tecnici_assegnati as $tecnico_assegnato) {
|
||||
|
||||
// Notifica aggiunta tecnico assegnato
|
||||
if (setting('Notifica al tecnico l\'assegnazione all\'attività')) {
|
||||
if (!in_array($tecnico_assegnato, $tecnici_presenti)) {
|
||||
|
@ -116,7 +114,6 @@ switch (post('op')) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Assegnazione dei tecnici all'intervento
|
||||
|
@ -1007,7 +1004,7 @@ switch (post('op')) {
|
|||
foreach ($impianti as $impianto) {
|
||||
$dbo->insert('my_impianti_interventi', [
|
||||
'idintervento' => $id_record,
|
||||
'idimpianto' => $impianto['idimpianto']
|
||||
'idimpianto' => $impianto['idimpianto'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1015,7 +1012,7 @@ switch (post('op')) {
|
|||
foreach ($componenti as $componente) {
|
||||
$dbo->insert('my_componenti_interventi', [
|
||||
'id_intervento' => $id_record,
|
||||
'id_componente' => $componente['id_componente']
|
||||
'id_componente' => $componente['id_componente'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -1128,7 +1125,6 @@ switch (post('op')) {
|
|||
$articolo->idsede_partenza = $intervento->idsede_partenza;
|
||||
$articolo->save();
|
||||
|
||||
|
||||
flash()->info(tr('Nuovo articolo aggiunto!'));
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -48,8 +48,6 @@ if ($user['gruppo'] == 'Tecnici' && !empty($user['idanagrafica'])) {
|
|||
$id_cliente = $user['idanagrafica'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Se è indicata un'anagrafica relativa, si carica il tipo di intervento di default impostato
|
||||
if (!empty($id_anagrafica)) {
|
||||
$anagrafica = $dbo->fetchOne('SELECT idtipointervento_default, idzona FROM an_anagrafiche WHERE idanagrafica='.prepare($id_anagrafica));
|
||||
|
@ -261,7 +259,6 @@ echo '
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
$espandi_dettagli = setting('Espandi automaticamente la sezione "Dettagli aggiuntivi"');
|
||||
echo '
|
||||
<!-- DATI AGGIUNTIVI -->
|
||||
|
@ -798,7 +795,7 @@ echo '
|
|||
|
||||
//console.log(lat, lng);
|
||||
if (typeof lat === "undefined" || typeof lng === "undefined"){
|
||||
swal("' . tr('Errore') . '", "' . tr("La posizione non è stata definita. Impossibile caricare la mappa.") . '", "error");
|
||||
swal("'.tr('Errore').'", "'.tr('La posizione non è stata definita. Impossibile caricare la mappa.').'", "error");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -815,7 +812,7 @@ echo '
|
|||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("'.setting("Tile server OpenStreetMap").'", {
|
||||
L.tileLayer("'.setting('Tile server OpenStreetMap').'", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
|
|
|
@ -21,7 +21,7 @@ include_once __DIR__.'/../../../core.php';
|
|||
|
||||
switch ($resource) {
|
||||
case 'tipiintervento':
|
||||
$query = 'SELECT idtipointervento AS id, CASE WHEN ISNULL(tempo_standard) OR tempo_standard <= 0 THEN CONCAT(descrizione, IF(in_tipiintervento.deleted_at IS NULL, "", " ('.tr("eliminato").')")) WHEN tempo_standard > 0 THEN CONCAT(descrizione, \' (\', REPLACE(FORMAT(tempo_standard, 2), \'.\', \',\'), \' ore)\', IF(in_tipiintervento.deleted_at IS NULL, "", " ('.tr("eliminato").')")) END AS descrizione, tempo_standard FROM in_tipiintervento |where| ORDER BY descrizione';
|
||||
$query = 'SELECT idtipointervento AS id, CASE WHEN ISNULL(tempo_standard) OR tempo_standard <= 0 THEN CONCAT(descrizione, IF(in_tipiintervento.deleted_at IS NULL, "", " ('.tr('eliminato').')")) WHEN tempo_standard > 0 THEN CONCAT(descrizione, \' (\', REPLACE(FORMAT(tempo_standard, 2), \'.\', \',\'), \' ore)\', IF(in_tipiintervento.deleted_at IS NULL, "", " ('.tr('eliminato').')")) END AS descrizione, tempo_standard FROM in_tipiintervento |where| ORDER BY descrizione';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'idtipointervento='.prepare($element);
|
||||
|
|
|
@ -30,7 +30,6 @@ if ($user['gruppo'] == 'Tecnici') {
|
|||
$rss = $dbo->fetchArray('SELECT is_completato AS flag_completato FROM in_statiintervento WHERE idstatointervento = (SELECT idstatointervento FROM in_interventi WHERE id='.prepare($id_record).')');
|
||||
$is_completato = $rss[0]['flag_completato'];
|
||||
|
||||
|
||||
// Sessioni dell'intervento
|
||||
$query = 'SELECT
|
||||
in_interventi_tecnici.*,
|
||||
|
@ -71,9 +70,8 @@ if (!empty($sessioni)) {
|
|||
<table class="table table-striped table-hover table-condensed">
|
||||
<tr><th>';
|
||||
|
||||
|
||||
if ($sessione['id_user']) {
|
||||
$user = User::where('idanagrafica', $sessione['idtecnico'])->orderByRaw("CASE WHEN idgruppo = 2 THEN -1 ELSE idgruppo END")->first();
|
||||
$user = User::where('idanagrafica', $sessione['idtecnico'])->orderByRaw('CASE WHEN idgruppo = 2 THEN -1 ELSE idgruppo END')->first();
|
||||
echo '
|
||||
<img class="attachment-img tip" src="'.$user->photo.'" title="'.$user->nome_completo.'">';
|
||||
} else {
|
||||
|
@ -81,7 +79,6 @@ if (!empty($sessioni)) {
|
|||
<i class="fa fa-user-circle-o attachment-img tip" title="'.$sessione['ragione_sociale'].'"></i>';
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
'.$sessione['ragione_sociale'].' '.(($sessione['anagrafica_deleted_at']) ? '<small class="text-danger"><em>('.tr('Eliminato').')</em></small>' : '').'</th>
|
||||
<th width="15%">'.tr('Orario inizio').'</th>
|
||||
|
@ -145,7 +142,7 @@ if (!empty($sessioni)) {
|
|||
|
||||
// ORE
|
||||
echo '
|
||||
<td style="border-right:1px solid #aaa;">'.($ore<=0 ? '<i class="fa fa-warning tip" style="position:relative;margin-left:-16px;" title="'.tr("Questa sessione è vuota").'" ></i>': '' ).' '.numberFormat($ore,'qta').'
|
||||
<td style="border-right:1px solid #aaa;">'.($ore <= 0 ? '<i class="fa fa-warning tip" style="position:relative;margin-left:-16px;" title="'.tr('Questa sessione è vuota').'" ></i>' : '').' '.numberFormat($ore, 'qta').'
|
||||
|
||||
<div class="extra hide">
|
||||
<table class="table table-condensed table-bordered">
|
||||
|
|
|
@ -21,12 +21,12 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
use Models\OperationLog;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Emails\Mail;
|
||||
use Modules\Emails\Template;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Tipo;
|
||||
use Modules\Interventi\Intervento;
|
||||
use Modules\Interventi\Stato;
|
||||
use Modules\Emails\Mail;
|
||||
use Modules\Emails\Template;
|
||||
use Util\Zip;
|
||||
|
||||
// Segmenti
|
||||
|
@ -109,11 +109,9 @@ switch (post('op')) {
|
|||
|
||||
// Lettura righe selezionate
|
||||
foreach ($interventi as $intervento) {
|
||||
|
||||
if (!empty($intervento['idclientefinale'])) {
|
||||
$id_anagrafica = $intervento['idclientefinale'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$id_anagrafica = $intervento['idanagrafica'];
|
||||
}
|
||||
|
||||
|
@ -139,7 +137,7 @@ switch (post('op')) {
|
|||
}
|
||||
}
|
||||
|
||||
$descrizione = str_replace("'", " ", strip_tags($module->replacePlaceholders($intervento['id'], setting('Descrizione personalizzata in fatturazione')))) ?: tr('Attività numero _NUM_ del _DATE_', [
|
||||
$descrizione = str_replace("'", ' ', strip_tags($module->replacePlaceholders($intervento['id'], setting('Descrizione personalizzata in fatturazione')))) ?: tr('Attività numero _NUM_ del _DATE_', [
|
||||
'_NUM_' => $intervento['codice_intervento'],
|
||||
'_DATE_' => Translator::dateToLocale($intervento['data']),
|
||||
]);
|
||||
|
@ -256,7 +254,7 @@ switch (post('op')) {
|
|||
foreach ($impianti as $impianto) {
|
||||
$dbo->insert('my_impianti_interventi', [
|
||||
'idintervento' => $id_record,
|
||||
'idimpianto' => $impianto['idimpianto']
|
||||
'idimpianto' => $impianto['idimpianto'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -264,7 +262,7 @@ switch (post('op')) {
|
|||
foreach ($componenti as $componente) {
|
||||
$dbo->insert('my_componenti_interventi', [
|
||||
'id_intervento' => $id_record,
|
||||
'id_componente' => $componente['id_componente']
|
||||
'id_componente' => $componente['id_componente'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -296,7 +294,6 @@ switch (post('op')) {
|
|||
'id_module' => $id_module,
|
||||
'id_record' => $id_record,
|
||||
]);
|
||||
|
||||
} catch (InvalidArgumentException $e) {
|
||||
}
|
||||
}
|
||||
|
@ -305,7 +302,6 @@ switch (post('op')) {
|
|||
|
||||
break;
|
||||
|
||||
|
||||
case 'stampa-riepilogo':
|
||||
$_SESSION['superselect']['interventi'] = $id_records;
|
||||
$id_print = Prints::getPrints()['Riepilogo interventi'];
|
||||
|
@ -313,7 +309,6 @@ switch (post('op')) {
|
|||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&tipo='.post('tipo'));
|
||||
exit();
|
||||
|
||||
|
||||
case 'send-mail':
|
||||
$template = Template::find(post('id_template'));
|
||||
|
||||
|
@ -394,7 +389,7 @@ if (App::debug()) {
|
|||
'data' => [
|
||||
'title' => tr('Fatturare gli _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]).' <small><i class="fa fa-question-circle-o tip" title="'.tr('Verranno fatturati solo gli interventi completati non collegati a contratti o preventivi').'."></i></small>',
|
||||
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture di vendita nello stato bozza?').'", "name": "accodare" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(["id_module" => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT id, CONCAT(codice_tipo_documento_fe, \' - \', descrizione) AS descrizione FROM co_tipidocumento WHERE enabled = 1 AND dir =\'entrata\' ORDER BY codice_tipo_documento_fe", "value": "'.$idtipodocumento.'" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
|
|
|
@ -249,7 +249,7 @@ echo '
|
|||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("'.setting("Tile server OpenStreetMap").'", {
|
||||
L.tileLayer("'.setting('Tile server OpenStreetMap').'", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
|
|
|
@ -147,7 +147,7 @@ if(setting('Sistema di firma')=='Base'){
|
|||
caricaTavoletta()
|
||||
} else {
|
||||
// Handle the case when navigator.hid is undefined
|
||||
swal("' . tr('Errore') . '", "' . tr("navigator.hid non è supportato da questo browser!") . '", "error");
|
||||
swal("'.tr('Errore').'", "'.tr('navigator.hid non è supportato da questo browser!').'", "error");
|
||||
$("#modals > div").modal("hide");
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
@ -89,8 +89,8 @@ $righe = $dbo->fetchArray(
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $riga['codice'] ?></td>
|
||||
<td><?= $riga['descrizione'] ?></td>
|
||||
<td><?php echo $riga['codice']; ?></td>
|
||||
<td><?php echo $riga['descrizione']; ?></td>
|
||||
<td>
|
||||
<div>
|
||||
{[ "type": "number", "label": "", "data-id":"<?php echo $riga['id']; ?>","name": "nuovo_prezzo_unitario[]", "value": "<?php echo numberFormat($riga['prezzo_unitario'], 2); ?>"]}
|
||||
|
|
|
@ -165,7 +165,7 @@ echo '
|
|||
</table>
|
||||
<br>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i> '.tr("Questi interventi non verranno firmati").'
|
||||
<i class="fa fa-warning"></i> '.tr('Questi interventi non verranno firmati').'
|
||||
</div>';
|
||||
} else {
|
||||
echo 'Nessun Intervento..';
|
||||
|
|
|
@ -26,9 +26,9 @@ use Modules\Emails\Template;
|
|||
use Modules\Fatture\Components\Descrizione;
|
||||
use Modules\Fatture\Components\Riga;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Interventi\Components\Riga as RigaIntervento;
|
||||
use Modules\Interventi\Components\Sessione;
|
||||
use Modules\Interventi\Intervento;
|
||||
use Modules\Interventi\Components\Riga as RigaIntervento;
|
||||
use Util\Generator;
|
||||
use Util\Ini;
|
||||
|
||||
|
@ -111,7 +111,7 @@ function add_tecnico($id_intervento, $idtecnico, $inizio, $fine, $idcontratto =
|
|||
}
|
||||
|
||||
//Inserisco le righe aggiuntive previste dal tipo di intervento
|
||||
$righe_aggiuntive = database()->fetchArray("SELECT * FROM in_righe_tipiinterventi WHERE id_tipointervento=".prepare($sessione->idtipointervento));
|
||||
$righe_aggiuntive = database()->fetchArray('SELECT * FROM in_righe_tipiinterventi WHERE id_tipointervento='.prepare($sessione->idtipointervento));
|
||||
|
||||
foreach ($righe_aggiuntive as $riga_aggiuntiva) {
|
||||
$riga = RigaIntervento::build($intervento);
|
||||
|
|
|
@ -215,7 +215,6 @@ echo '
|
|||
</tbody>';
|
||||
|
||||
if ($show_prezzi) {
|
||||
|
||||
// IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
|
@ -267,7 +266,6 @@ echo '
|
|||
<td></td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -287,7 +285,8 @@ if (!$block_edit && sizeof($righe) > 0) {
|
|||
<button type="button" class="btn btn-xs btn-default disabled" id="confronta_righe" onclick="confrontaRighe(getSelectData());">
|
||||
Confronta prezzi
|
||||
</button>';
|
||||
} echo'
|
||||
}
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
|
|
|
@ -23,9 +23,7 @@ use Modules\ListeNewsletter\Lista;
|
|||
|
||||
switch (post('op')) {
|
||||
case 'aggiorna-liste':
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
|
||||
$lista = Lista::find($id);
|
||||
|
||||
$query = $lista->query;
|
||||
|
@ -41,7 +39,6 @@ switch (post('op')) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
$operations['aggiorna-liste'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Aggiorna liste').'</span>',
|
||||
'data' => [
|
||||
|
@ -51,5 +48,4 @@ $operations['aggiorna-liste'] = [
|
|||
],
|
||||
];
|
||||
|
||||
|
||||
return $operations;
|
|
@ -20,8 +20,6 @@
|
|||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
use API\Services;
|
||||
use Carbon\Carbon;
|
||||
use Models\Module;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Anagrafiche\Referente;
|
||||
use Modules\Anagrafiche\Sede;
|
||||
|
|
|
@ -25,7 +25,7 @@ use Plugins\ListinoClienti\DettaglioPrezzo;
|
|||
|
||||
switch (post('op')) {
|
||||
case 'copy_listino':
|
||||
$id_anagrafiche = explode(",",post('idanagrafica', true)[0]);
|
||||
$id_anagrafiche = explode(',', post('idanagrafica', true)[0]);
|
||||
|
||||
// Lettura righe selezionate
|
||||
foreach ($id_records as $id) {
|
||||
|
@ -64,7 +64,7 @@ switch (post('op')) {
|
|||
$articolo->save();
|
||||
}
|
||||
|
||||
$numero_totale++;
|
||||
++$numero_totale;
|
||||
}
|
||||
} else {
|
||||
$dettaglio = DettaglioPrezzo::build($articolo, $anagrafica, $direzione);
|
||||
|
@ -75,7 +75,7 @@ switch (post('op')) {
|
|||
$dettaglio->setPrezzoUnitario($prezzo_unitario);
|
||||
$dettaglio->save();
|
||||
|
||||
$numero_totale++;
|
||||
++$numero_totale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,6 @@ switch (post('op')) {
|
|||
break;
|
||||
|
||||
case 'change_prezzo':
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
$listino = DettaglioPrezzo::find($id);
|
||||
|
||||
|
@ -142,7 +141,4 @@ $operations['change_prezzo'] = [
|
|||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
return $operations;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\Articoli\Articolo AS ArticoloOriginale;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\ListiniCliente\Articolo;
|
||||
use Modules\ListiniCliente\Listino;
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ switch ($resource) {
|
|||
$search_fields[] = '|table_articoli|.codice LIKE '.prepare('%'.$search.'%');
|
||||
$search_fields[] = '|table_articoli|.descrizione LIKE '.prepare('%'.$search.'%');
|
||||
$search_fields[] = ($prezzi_ivati ? '|table_articoli|.minimo_vendita_ivato' : '|table_articoli|.minimo_vendita').' LIKE '.prepare('%'.$search.'%');
|
||||
|
||||
}
|
||||
|
||||
// Aggiunta filtri di ricerca
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Modules\ListiniCliente;
|
|||
|
||||
use Common\SimpleModelTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Articoli\Articolo AS ArticoloOriginale;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Iva\Aliquota;
|
||||
|
||||
/*
|
||||
|
|
|
@ -38,7 +38,6 @@ switch (post('op')) {
|
|||
$nome = post('nome');
|
||||
|
||||
if ($dbo->fetchNum('SELECT * FROM `an_mansioni` WHERE `nome`='.prepare($nome)) == 0) {
|
||||
|
||||
$dbo->insert('an_mansioni', [
|
||||
'nome' => $nome,
|
||||
]);
|
||||
|
|
|
@ -65,7 +65,6 @@ if (!empty($elementi)) {
|
|||
'_ANAGRAFICA_' => $elemento['ragione_sociale'],
|
||||
]);
|
||||
|
||||
|
||||
$plugin = 'Referenti';
|
||||
$id = $elemento['idanagrafica'];
|
||||
|
||||
|
|
|
@ -22,28 +22,26 @@ include_once __DIR__.'/../../core.php';
|
|||
use Util\Query;
|
||||
|
||||
switch (get('op')) {
|
||||
|
||||
case "get_markers":
|
||||
|
||||
case 'get_markers':
|
||||
$idanagrafica = get('idanagrafica');
|
||||
$checks = get('check');
|
||||
|
||||
$where = [];
|
||||
//Filtro per anagrafica
|
||||
if (!empty($idanagrafica) && $idanagrafica != 'null') {
|
||||
$where[] = "in_interventi.idanagrafica=".prepare($idanagrafica);
|
||||
$where[] = 'in_interventi.idanagrafica='.prepare($idanagrafica);
|
||||
}
|
||||
|
||||
//Filtri per stato
|
||||
$checks = explode(',', $checks);
|
||||
$where[] = "in_statiintervento.descrizione IN ('".implode("','", $checks)."')";
|
||||
|
||||
$add_query = "WHERE 1=1 AND ".implode(' AND ', $where);
|
||||
$add_query = 'WHERE 1=1 AND '.implode(' AND ', $where);
|
||||
|
||||
//Filtri per data
|
||||
$add_query .= " |date_period(`orario_inizio`,`data_richiesta`)|";
|
||||
$add_query .= ' |date_period(`orario_inizio`,`data_richiesta`)|';
|
||||
|
||||
$query = "SELECT *, in_interventi.id AS idintervento, an_anagrafiche.lat AS lat_anagrafica, an_anagrafiche.lng AS lng_anagrafica, an_anagrafiche.indirizzo AS indirizzo_anagrafica, an_anagrafiche.cap AS cap_anagrafica, an_anagrafiche.citta AS citta_anagrafica, an_anagrafiche.provincia AS provincia_anagrafica, an_sedi.lat AS lat_sede, an_sedi.lng AS lng_sede, an_sedi.indirizzo AS indirizzo_sede, an_sedi.cap AS cap_sede, an_sedi.citta AS citta_sede, an_sedi.provincia AS provincia_sede, in_statiintervento.descrizione AS stato FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica LEFT JOIN an_sedi ON in_interventi.idsede_destinazione=an_sedi.id INNER JOIN in_statiintervento ON in_interventi.idstatointervento=in_statiintervento.idstatointervento LEFT JOIN in_interventi_tecnici ON in_interventi_tecnici.idintervento = in_interventi.id ".$add_query;
|
||||
$query = 'SELECT *, in_interventi.id AS idintervento, an_anagrafiche.lat AS lat_anagrafica, an_anagrafiche.lng AS lng_anagrafica, an_anagrafiche.indirizzo AS indirizzo_anagrafica, an_anagrafiche.cap AS cap_anagrafica, an_anagrafiche.citta AS citta_anagrafica, an_anagrafiche.provincia AS provincia_anagrafica, an_sedi.lat AS lat_sede, an_sedi.lng AS lng_sede, an_sedi.indirizzo AS indirizzo_sede, an_sedi.cap AS cap_sede, an_sedi.citta AS citta_sede, an_sedi.provincia AS provincia_sede, in_statiintervento.descrizione AS stato FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica LEFT JOIN an_sedi ON in_interventi.idsede_destinazione=an_sedi.id INNER JOIN in_statiintervento ON in_interventi.idstatointervento=in_statiintervento.idstatointervento LEFT JOIN in_interventi_tecnici ON in_interventi_tecnici.idintervento = in_interventi.id '.$add_query;
|
||||
|
||||
$query = Query::replacePlaceholder($query);
|
||||
$query = Modules::replaceAdditionals(Modules::get('Interventi')['id'], $query);
|
||||
|
@ -53,8 +51,7 @@ use Util\Query;
|
|||
$rs = [];
|
||||
|
||||
if (sizeof($records) > 0) {
|
||||
|
||||
for( $i=0; $i<sizeof($records); $i++ ){
|
||||
for ($i = 0; $i < sizeof($records); ++$i) {
|
||||
if (!empty($records[$i]['idsede_destinazione'])) {
|
||||
$lat = $records[$i]['lat_sede'];
|
||||
$lng = $records[$i]['lng_sede'];
|
||||
|
@ -98,12 +95,12 @@ use Util\Query;
|
|||
</a>';
|
||||
|
||||
//dettagli intervento
|
||||
$rs_sessioni = $dbo->fetchOne("SELECT MIN(orario_inizio) AS data, GROUP_CONCAT(DISTINCT ragione_sociale SEPARATOR ', ') AS tecnici FROM in_interventi_tecnici INNER JOIN an_anagrafiche ON in_interventi_tecnici.idtecnico=an_anagrafiche.idanagrafica WHERE idintervento=".prepare($records[$i]['idintervento'])." GROUP BY idintervento");
|
||||
$rs_sessioni = $dbo->fetchOne("SELECT MIN(orario_inizio) AS data, GROUP_CONCAT(DISTINCT ragione_sociale SEPARATOR ', ') AS tecnici FROM in_interventi_tecnici INNER JOIN an_anagrafiche ON in_interventi_tecnici.idtecnico=an_anagrafiche.idanagrafica WHERE idintervento=".prepare($records[$i]['idintervento']).' GROUP BY idintervento');
|
||||
|
||||
$descrizione .= '<hr>';
|
||||
$descrizione .= '<b>Data</b>: '.(!empty($rs_sessioni['data']) ? Translator::dateToLocale($rs_sessioni['data']) : Translator::dateToLocale($records[$i]['data_richiesta'])).'<br>';
|
||||
$descrizione .= '<b>Stato</b>: '.$records[$i]['stato']."<br>";
|
||||
$descrizione .= '<b>Richiesta</b>: '.substr(strip_tags($records[$i]['richiesta']), 0, 200)."<br>";
|
||||
$descrizione .= '<b>Stato</b>: '.$records[$i]['stato'].'<br>';
|
||||
$descrizione .= '<b>Richiesta</b>: '.substr(strip_tags($records[$i]['richiesta']), 0, 200).'<br>';
|
||||
if (!empty($rs_sessioni['tecnici'])) {
|
||||
$descrizione .= '<b>Tecnici</b>: '.$rs_sessioni['tecnici'];
|
||||
}
|
||||
|
@ -125,4 +122,3 @@ use Util\Query;
|
|||
|
||||
break;
|
||||
}
|
||||
?>
|
|
@ -21,7 +21,7 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?=$rootdir?>/modules/mappa/css/app.css">
|
||||
<link rel="stylesheet" href="<?php echo $rootdir; ?>/modules/mappa/css/app.css">
|
||||
|
||||
<!-- Mappa -->
|
||||
<div id="mappa"></div>
|
||||
|
@ -57,15 +57,15 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
<div class="row">
|
||||
<?php
|
||||
$rs_stati = $dbo->fetchArray("SELECT * FROM in_statiintervento");
|
||||
$rs_stati = $dbo->fetchArray('SELECT * FROM in_statiintervento');
|
||||
|
||||
foreach($rs_stati AS $stato){
|
||||
foreach ($rs_stati as $stato) {
|
||||
?>
|
||||
<div class="col-md-4">
|
||||
<label><?=$stato['descrizione']?></label>
|
||||
<label><?php echo $stato['descrizione']; ?></label>
|
||||
<div class="material-switch">
|
||||
<input id="<?=$stato['descrizione']?>" name="<?=$stato['descrizione']?>" type="checkbox" checked/>
|
||||
<label for="<?=$stato['descrizione']?>" class="label-success"></label>
|
||||
<input id="<?php echo $stato['descrizione']; ?>" name="<?php echo $stato['descrizione']; ?>" type="checkbox" checked/>
|
||||
<label for="<?php echo $stato['descrizione']; ?>" class="label-success"></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -76,7 +76,7 @@ include_once __DIR__.'/../../core.php';
|
|||
</div>
|
||||
|
||||
<script>
|
||||
var ROOTDIR = '<?=$rootdir?>';
|
||||
var ROOTDIR = '<?php echo $rootdir; ?>';
|
||||
|
||||
function caricaMappa() {
|
||||
const lat = "41.706";
|
||||
|
@ -88,11 +88,11 @@ include_once __DIR__.'/../../core.php';
|
|||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("<?php echo setting("Tile server OpenStreetMap"); ?>", {
|
||||
L.tileLayer("<?php echo setting('Tile server OpenStreetMap'); ?>", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="<?=$rootdir?>/modules/mappa/js/app.js"></script>
|
||||
<script type="text/javascript" src="<?php echo $rootdir; ?>/modules/mappa/js/app.js"></script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue