Formattazione codice
This commit is contained in:
parent
453b3603cc
commit
b3c6cb7110
16
actions.php
16
actions.php
|
@ -54,7 +54,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
|
||||
// Gestione delle operazioni
|
||||
else {
|
||||
//UPLOAD PER CKEDITOR
|
||||
// UPLOAD PER CKEDITOR
|
||||
if (filter('op') == 'aggiungi-allegato' && !empty($_FILES) && !empty($_FILES['upload']['name'])) {
|
||||
$CKEditor = get('CKEditor');
|
||||
$funcNum = get('CKEditorFuncNum');
|
||||
|
@ -63,8 +63,8 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
'png', 'jpg', 'jpeg',
|
||||
];
|
||||
|
||||
//Maximum file limit (unit: byte)
|
||||
$max_size = '2097152'; //2MB
|
||||
// Maximum file limit (unit: byte)
|
||||
$max_size = '2097152'; // 2MB
|
||||
|
||||
// Get image file extension
|
||||
$file_extension = pathinfo($_FILES['upload']['name'], PATHINFO_EXTENSION);
|
||||
|
@ -86,7 +86,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
|
||||
// Creazione file fisico
|
||||
if (!empty($upload)) {
|
||||
//flash()->info(tr('File caricato correttamente!'));
|
||||
// flash()->info(tr('File caricato correttamente!'));
|
||||
|
||||
$id_allegato = $dbo->lastInsertedID();
|
||||
$upload = Upload::find($id_allegato);
|
||||
|
@ -113,15 +113,15 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
echo json_encode($response);
|
||||
}
|
||||
} else {
|
||||
//flash()->error(tr('Errore durante il caricamento del file!'));
|
||||
// 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!'));
|
||||
// flash()->error(tr('Estensione non permessa!'));
|
||||
echo '<script type="text/javascript"> window.parent.toastr.error("'.tr('Estensione non permessa').'"); </script>';
|
||||
}
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// UPLOAD
|
||||
|
@ -359,7 +359,7 @@ elseif (filter('op') == 'ordina-checks') {
|
|||
elseif (post('op') == 'send-email') {
|
||||
$template = Template::find(post('template'));
|
||||
|
||||
$mail = \Modules\Emails\Mail::build($user, $template, $id_record);
|
||||
$mail = Modules\Emails\Mail::build($user, $template, $id_record);
|
||||
|
||||
// Rimozione allegati predefiniti
|
||||
$mail->resetPrints();
|
||||
|
|
|
@ -31,7 +31,7 @@ if (!empty(filter('order'))) {
|
|||
}
|
||||
array_shift($columns);
|
||||
|
||||
$total = Util\Query::readQuery($structure);
|
||||
$total = Query::readQuery($structure);
|
||||
|
||||
// Ricerca
|
||||
$search = [];
|
||||
|
@ -74,7 +74,7 @@ if (!empty($query)) {
|
|||
$results['recordsFiltered'] = $data['count'];
|
||||
|
||||
// SOMME
|
||||
$results['summable'] = Util\Query::getSums($structure, $search);
|
||||
$results['summable'] = Query::getSums($structure, $search);
|
||||
|
||||
// Allineamento delle righe
|
||||
$align = [];
|
||||
|
|
|
@ -43,7 +43,7 @@ try {
|
|||
} catch (Exception $e) {
|
||||
// Log dell'errore
|
||||
$logger = logger();
|
||||
$logger->addRecord(\Monolog\Logger::ERROR, $e);
|
||||
$logger->addRecord(Monolog\Logger::ERROR, $e);
|
||||
|
||||
$response = Response::error('serverError');
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ $db_host = '|host|';
|
|||
$db_username = '|username|';
|
||||
$db_password = '|password|';
|
||||
$db_name = '|database|';
|
||||
//$port = '|port|';
|
||||
// $port = '|port|';
|
||||
$db_options = [
|
||||
//'sort_buffer_size' => '2M',
|
||||
// 'sort_buffer_size' => '2M',
|
||||
];
|
||||
|
||||
// Percorso della cartella di backup
|
||||
|
|
6
core.php
6
core.php
|
@ -30,7 +30,7 @@ if (version_compare(phpversion(), $minimum) < 0) {
|
|||
<p>Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.</p>
|
||||
|
||||
<p>Aggiorna PHP alla versione >= '.$minimum.'.</p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Caricamento delle impostazioni personalizzabili
|
||||
|
@ -69,7 +69,7 @@ $config = App::getConfig();
|
|||
if (!empty($config['redirectHTTPS']) && !isHTTPS(true)) {
|
||||
header('HTTP/1.1 301 Moved Permanently');
|
||||
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
/* GESTIONE DEGLI ERRORI */
|
||||
|
@ -181,7 +181,7 @@ if (!$continue && getURLPath() != slashes(base_path().'/index.php') && !Permissi
|
|||
}
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
/* INIZIALIZZAZIONE GENERALE */
|
||||
|
|
|
@ -34,7 +34,7 @@ WHERE mg_articoli.id = '.prepare($result['idarticolo']));
|
|||
|
||||
$qta_minima = $articolo['qta_minima'];
|
||||
|
||||
echo '
|
||||
echo '
|
||||
{[ "type": "select", "disabled":"1", "label": "'.tr('Articolo').'", "name": "idarticolo", "value": "'.$result['idarticolo'].'", "ajax-source": "articoli", "select-options": '.json_encode($options['select-options']['articoli']).' ]}
|
||||
|
||||
<script>
|
||||
|
@ -382,7 +382,7 @@ function verificaPrezzoArticolo() {
|
|||
let table = $(".table-prezzi");
|
||||
|
||||
if (prezzo_anagrafica) {
|
||||
table.append(`<tr><td class="pr_anagrafica"><small>'.($options['dir'] == 'uscita' ? tr('Prezzo listino') : tr('Netto cliente')).': '.Plugins::link(($options['dir'] == 'uscita' ? 'Listino Fornitori' : 'Netto Clienti'), $result['idarticolo'], tr('Visualizza'), null, '').'</small></td><td align="right" class="pr_anagrafica"><small>` + prezzo_anagrafica.toLocale() + ` ` + globals.currency + `</small></td>`);
|
||||
table.append(`<tr><td class="pr_anagrafica"><small>'.($options['dir'] == 'uscita' ? tr('Prezzo listino') : tr('Netto cliente')).': '.Plugins::link($options['dir'] == 'uscita' ? 'Listino Fornitori' : 'Netto Clienti', $result['idarticolo'], tr('Visualizza'), null, '').'</small></td><td align="right" class="pr_anagrafica"><small>` + prezzo_anagrafica.toLocale() + ` ` + globals.currency + `</small></td>`);
|
||||
|
||||
let tr = $(".pr_anagrafica").parent();
|
||||
if (prezzo_unitario == prezzo_anagrafica.toFixed(2)) {
|
||||
|
|
|
@ -48,25 +48,25 @@ $calcolo_ritenuta_acconto = $calcolo_ritenuta_acconto ?: setting("Metodologia ca
|
|||
echo '
|
||||
<div class="row">';
|
||||
|
||||
// Cassa previdenziale
|
||||
echo '
|
||||
// Cassa previdenziale
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Cassa previdenziale').'", "name": "id_rivalsa_inps", "value": "'.$id_rivalsa_inps.'", "values": "query=SELECT * FROM co_rivalse", "help": "'.(($options['dir'] == 'entrata') ? setting('Tipo Cassa Previdenziale') : null).'" ]}
|
||||
</div>';
|
||||
|
||||
// Ritenuta d'acconto
|
||||
echo '
|
||||
// Ritenuta d'acconto
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr("Ritenuta d'acconto").'", "name": "id_ritenuta_acconto", "value": "'.$id_ritenuta_acconto.'", "values": "query=SELECT * FROM co_ritenutaacconto" ]}
|
||||
</div>';
|
||||
|
||||
// Calcola ritenuta d'acconto su
|
||||
echo '
|
||||
// Calcola ritenuta d'acconto su
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr("Calcola ritenuta d'acconto su").'", "name": "calcolo_ritenuta_acconto", "value": "'.$calcolo_ritenuta_acconto.'", "values": "list=\"IMP\":\"Imponibile\", \"IMP+RIV\":\"Imponibile + rivalsa\""]}
|
||||
</div>';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>';
|
||||
|
||||
if (!empty($options['show-ritenuta-contributi']) || empty($options['hide_conto'])) {
|
||||
|
|
|
@ -73,8 +73,8 @@ if (post('db_host') !== null) {
|
|||
$privileges = current($result);
|
||||
|
||||
if (
|
||||
string_contains($privileges, ' ON `'.$db_name.'`.*') ||
|
||||
string_contains($privileges, ' ON *.*')
|
||||
string_contains($privileges, ' ON `'.$db_name.'`.*')
|
||||
|| string_contains($privileges, ' ON *.*')
|
||||
) {
|
||||
$pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]);
|
||||
|
||||
|
@ -110,7 +110,7 @@ if (post('db_host') !== null) {
|
|||
}
|
||||
|
||||
echo $state;
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Creazione della configurazione
|
||||
|
@ -182,7 +182,7 @@ if (post('db_host') !== null) {
|
|||
// Creazione manifest.json
|
||||
include_once App::filepath('include/init', 'manifest.php');
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -587,4 +587,4 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
exit();
|
||||
exit;
|
||||
|
|
|
@ -116,7 +116,7 @@ if (post('action') == 'init') {
|
|||
}
|
||||
|
||||
redirect(base_path(), 'js');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
$img = App::getPaths()['img'];
|
||||
|
@ -263,4 +263,4 @@ echo '
|
|||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
exit();
|
||||
exit;
|
||||
|
|
|
@ -43,5 +43,5 @@ if ($config['maintenance_ip'] != $_SERVER['REMOTE_ADDR']) {
|
|||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ foreach ($modules as $name => $values) {
|
|||
];
|
||||
}
|
||||
|
||||
//PHP
|
||||
// PHP
|
||||
$settings = [
|
||||
'php_version' => [
|
||||
'type' => 'version',
|
||||
|
@ -101,10 +101,10 @@ $settings = [
|
|||
'description' => tr('Permette la creazione dell\'immagine della firma per il rapportino d\'intervento (facoltativo)'),
|
||||
],
|
||||
|
||||
//'display_errors' => [
|
||||
// 'display_errors' => [
|
||||
// 'type' => 'value',
|
||||
// 'description' => true,
|
||||
//],
|
||||
// ],
|
||||
|
||||
'allow_url_fopen' => [
|
||||
'type' => 'value',
|
||||
|
@ -233,7 +233,7 @@ foreach ($db as $name => $values) {
|
|||
} else {
|
||||
$type = tr('Impostazione');
|
||||
|
||||
//Vedo se riesco a recuperare l'impostazione dalle variabili di sessione o globali di mysql
|
||||
// Vedo se riesco a recuperare l'impostazione dalle variabili di sessione o globali di mysql
|
||||
$rs_session_variabile = $dbo->fetchArray('SHOW SESSION VARIABLES LIKE '.prepare($name));
|
||||
$rs_global_variabile = $dbo->fetchArray('SHOW GLOBAL VARIABLES LIKE '.prepare($name));
|
||||
|
||||
|
@ -263,7 +263,7 @@ foreach ($db as $name => $values) {
|
|||
|
||||
$description = tr('Valore consigliato: _VALUE_ (Valore attuale: _INC_)', [
|
||||
'_VALUE_' => $description,
|
||||
'_INC_' => \Util\FileSystem::formatBytes($inc),
|
||||
'_INC_' => Util\FileSystem::formatBytes($inc),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ foreach ($config_to_check as $name => $values) {
|
|||
]);
|
||||
}
|
||||
|
||||
$status = ($values['operator']((!empty($values['section']) ? ${$values['section']}[$name] : $$name), $values['value_to_check']) ? 1 : 0);
|
||||
$status = ($values['operator'](!empty($values['section']) ? ${$values['section']}[$name] : $$name, $values['value_to_check']) ? 1 : 0);
|
||||
|
||||
$config[] = [
|
||||
'name' => $name,
|
||||
|
|
|
@ -109,7 +109,7 @@ if (filter('action') == 'do_update') {
|
|||
</a>';
|
||||
}
|
||||
|
||||
exit();
|
||||
exit;
|
||||
} elseif (Update::isUpdateAvailable()) {
|
||||
// Controllo se l'aggiornamento è in esecuzione
|
||||
if (Update::isUpdateLocked() && filter('force') === null) {
|
||||
|
@ -131,7 +131,7 @@ if (filter('action') == 'do_update') {
|
|||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
$firstuse = !$dbo->isInstalled() ? 'true' : 'false';
|
||||
|
|
|
@ -29,7 +29,7 @@ echo '
|
|||
<input type="hidden" name="op" value="modifica-allegato">
|
||||
|
||||
<div class="row">';
|
||||
if (sizeof($id_allegati) == 1) {
|
||||
if (sizeof($id_allegati) == 1) {
|
||||
$allegato = Upload::find($id_allegati[0]);
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
|
@ -38,14 +38,14 @@ echo '
|
|||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Categoria').'", "name": "categoria_allegato", "value": "'.$allegato->category.'", "disabled": "'.intval(in_array($allegato->category, ['Fattura Elettronica'])).'" ]}
|
||||
</div>';
|
||||
} else {
|
||||
} else {
|
||||
$allegato = Upload::find($id_allegati[0]);
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Categoria').'", "name": "categoria_allegato", "value": "" ]}
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
|
|
|
@ -42,8 +42,8 @@ echo '
|
|||
|
||||
<tbody>';
|
||||
|
||||
$righe = $documento->getRighe();
|
||||
foreach ($righe as $riga) {
|
||||
$righe = $documento->getRighe();
|
||||
foreach ($righe as $riga) {
|
||||
$riga_class = get_class($riga);
|
||||
|
||||
$riferimento_locale = $riga_class.'|'.$riga->id;
|
||||
|
@ -59,8 +59,8 @@ echo '
|
|||
</button>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
|
|
|
@ -204,7 +204,7 @@ if (Auth::check()) {
|
|||
|
||||
search: search,
|
||||
translations: translations,
|
||||
locale: "'.(explode('_', $lang)[0]).'",
|
||||
locale: "'.explode('_', $lang)[0].'",
|
||||
full_locale: "'.$lang.'",
|
||||
|
||||
start_date: "'.$_SESSION['period_start'].'",
|
||||
|
@ -274,7 +274,7 @@ if (Auth::check()) {
|
|||
date_format: "'.formatter()->getDatePattern().'",
|
||||
time_format: "'.formatter()->getTimePattern().'",
|
||||
|
||||
locale: "'.(explode('_', $lang)[0]).'",
|
||||
locale: "'.explode('_', $lang)[0].'",
|
||||
full_locale: "'.$lang.'",
|
||||
};
|
||||
</script>';
|
||||
|
@ -518,7 +518,7 @@ 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
|
||||
// Badge count per record plugin
|
||||
$count = 0;
|
||||
$opt = '';
|
||||
if (!empty($plugin['options2'])) {
|
||||
|
@ -565,7 +565,7 @@ if (Auth::check()) {
|
|||
<a class="bg-info" data-toggle="tab" href="#tab_checks" id="link-tab_checks">
|
||||
'.tr('Checklist').'
|
||||
'.(($checklists_total->count() > 0) ?
|
||||
'<span class="badge pull-right">'.$checklists_unchecked->count().tr(' / ').($checklists_total->count()).'</span>' : '').'
|
||||
'<span class="badge pull-right">'.$checklists_unchecked->count().tr(' / ').$checklists_total->count().'</span>' : '').'
|
||||
</a>
|
||||
</li>';
|
||||
}
|
||||
|
|
|
@ -46,14 +46,14 @@ switch ($op) {
|
|||
}
|
||||
|
||||
// Rimozione log vecchi
|
||||
//$dbo->query('DELETE FROM `zz_operations` WHERE DATE_ADD(`created_at`, INTERVAL 30*24*60*60 SECOND) <= NOW()');
|
||||
// $dbo->query('DELETE FROM `zz_operations` WHERE DATE_ADD(`created_at`, INTERVAL 30*24*60*60 SECOND) <= NOW()');
|
||||
} else {
|
||||
$status = auth()->getCurrentStatus();
|
||||
|
||||
flash()->error(Auth::getStatus()[$status]['message']);
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -62,7 +62,7 @@ switch ($op) {
|
|||
Auth::logout();
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) {
|
||||
|
@ -73,7 +73,7 @@ if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled())
|
|||
} else {
|
||||
redirect(base_path().'/index.php?op=logout');
|
||||
}
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Modalità manutenzione
|
||||
|
|
|
@ -95,12 +95,6 @@ function calcola_sconto($data)
|
|||
|
||||
/**
|
||||
* Individua il valore della colonna order per i nuovi elementi di una tabella.
|
||||
*
|
||||
* @param $table
|
||||
* @param $field
|
||||
* @param $id
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function orderValue($table, $field, $id)
|
||||
{
|
||||
|
@ -109,10 +103,6 @@ function orderValue($table, $field, $id)
|
|||
|
||||
/**
|
||||
* Ricalcola il riordinamento righe di una tabella.
|
||||
*
|
||||
* @param $table
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function reorderRows($table, $field, $id)
|
||||
{
|
||||
|
@ -172,14 +162,13 @@ function provvigioneInfo(Accounting $riga, $mostra_provigione = true)
|
|||
/**
|
||||
* Genera i riferimenti ai documenti del gestionale, attraverso l'interfaccia Common\ReferenceInterface.
|
||||
*
|
||||
* @param $document
|
||||
* @param string $text Formato "Contenuto descrittivo _DOCUMENT_"
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function reference($document, $text = null)
|
||||
{
|
||||
if (!empty($document) && !($document instanceof \Common\ReferenceInterface)) {
|
||||
if (!empty($document) && !($document instanceof Common\ReferenceInterface)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -208,8 +197,6 @@ function reference($document, $text = null)
|
|||
* Funzione che gestisce il parsing di uno sconto combinato e la relativa trasformazione in sconto fisso.
|
||||
* Esempio: (40 + 10) % = 44 %.
|
||||
*
|
||||
* @param $combinato
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
function parseScontoCombinato($combinato)
|
||||
|
@ -234,8 +221,6 @@ function parseScontoCombinato($combinato)
|
|||
/**
|
||||
* Visualizza le informazioni del segmento.
|
||||
*
|
||||
* @param $id_module
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
function getSegmentPredefined($id_module)
|
||||
|
@ -248,11 +233,6 @@ function getSegmentPredefined($id_module)
|
|||
/**
|
||||
* Funzione che visualizza i prezzi degli articoli nei listini.
|
||||
*
|
||||
* @param $id_anagrafica
|
||||
* @param $direzione
|
||||
* @param $id_articolo
|
||||
* @param $riga
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPrezzoConsigliato($id_anagrafica, $direzione, $id_articolo, $riga = null)
|
||||
|
|
|
@ -40,13 +40,9 @@ function get_next_code($str, $qty = 1, $mask = '')
|
|||
* Se descrizione = 1 e il tipo è 'query=' mi restituisce il valore del campo descrizione della query.
|
||||
*
|
||||
* @deprecated 2.4.2
|
||||
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $sezione
|
||||
* @param string $descrizione
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get_var($nome, $sezione = null, $descrizione = false, $again = false)
|
||||
{
|
||||
|
@ -163,7 +159,7 @@ function datediff($interval, $datefrom, $dateto, $using_timestamps = false)
|
|||
break;
|
||||
case 'm': // Number of full months
|
||||
$months_difference = floor($difference / 2678400);
|
||||
while (mktime(date('H', $datefrom), date('i', $datefrom), date('s', $datefrom), date('n', $datefrom) + ($months_difference), date('j', $dateto), date('Y', $datefrom)) < $dateto) {
|
||||
while (mktime(date('H', $datefrom), date('i', $datefrom), date('s', $datefrom), date('n', $datefrom) + $months_difference, date('j', $dateto), date('Y', $datefrom)) < $dateto) {
|
||||
++$months_difference;
|
||||
}
|
||||
--$months_difference;
|
||||
|
@ -207,12 +203,6 @@ function datediff($interval, $datefrom, $dateto, $using_timestamps = false)
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $field
|
||||
* @param $id_riga
|
||||
* @param $old_qta
|
||||
* @param $new_qta
|
||||
* @param $dir
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return bool
|
||||
|
@ -274,8 +264,6 @@ function seriali_non_rimuovibili($field, $id_riga, $dir)
|
|||
/**
|
||||
* Restistuisce le informazioni sull'eventuale riferimento ai documenti.
|
||||
*
|
||||
* @param $info
|
||||
* @param $dir
|
||||
* @param array $ignore
|
||||
*
|
||||
* @deprecated
|
||||
|
|
|
@ -54,8 +54,6 @@ function redirect($url, $type = 'php')
|
|||
* Verifica e corregge il nome di un file.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function sanitizeFilename($filename)
|
||||
{
|
||||
|
@ -96,14 +94,13 @@ function delete($files)
|
|||
*/
|
||||
function directory($path)
|
||||
{
|
||||
return Util\FileSystem::directory($path);
|
||||
return FileSystem::directory($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file, or recursively copy a folder and its contents.
|
||||
*
|
||||
* @param array|string $source Source path
|
||||
* @param string $dest Destination path
|
||||
* @param array|string $ignores Paths to ingore
|
||||
*
|
||||
* @return bool Returns TRUE on success, FALSE on failure
|
||||
|
@ -271,7 +268,7 @@ function translateTemplate()
|
|||
|
||||
// Annullo le notifiche (AJAX)
|
||||
if (isAjaxRequest()) {
|
||||
//flash()->clearMessage('info');
|
||||
// flash()->clearMessage('info');
|
||||
}
|
||||
|
||||
echo $template;
|
||||
|
@ -300,7 +297,7 @@ function slashes($string)
|
|||
*/
|
||||
function isAjaxRequest()
|
||||
{
|
||||
return \Whoops\Util\Misc::isAjaxRequest() && filter('ajax') !== null;
|
||||
return Whoops\Util\Misc::isAjaxRequest() && filter('ajax') !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -327,7 +324,7 @@ function redirectOperation($id_module, $id_record)
|
|||
redirect(base_path().'/controller.php?id_module='.$id_module.$hash);
|
||||
}
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@ use HTMLBuilder\HTMLBuilder;
|
|||
/**
|
||||
* Restituisce l'oggetto dedicato alla gestione della connessione con il database.
|
||||
*
|
||||
* @return \Database
|
||||
* @return Database
|
||||
*/
|
||||
function database()
|
||||
{
|
||||
return \Database::getConnection();
|
||||
return Database::getConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,6 @@ function database()
|
|||
* @param string $parameter
|
||||
*
|
||||
* @since 2.3
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function prepare($parameter)
|
||||
{
|
||||
|
@ -62,7 +60,7 @@ function prepare($parameter)
|
|||
*/
|
||||
function filter($param, $method = null, $raw = false)
|
||||
{
|
||||
return \Filter::getValue($param, $method, $raw);
|
||||
return Filter::getValue($param, $method, $raw);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,7 +75,7 @@ function filter($param, $method = null, $raw = false)
|
|||
*/
|
||||
function post($param, $raw = false)
|
||||
{
|
||||
return \Filter::getValue($param, 'post', $raw);
|
||||
return Filter::getValue($param, 'post', $raw);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +90,7 @@ function post($param, $raw = false)
|
|||
*/
|
||||
function get($param, $raw = false)
|
||||
{
|
||||
return \Filter::getValue($param, 'get', $raw);
|
||||
return Filter::getValue($param, 'get', $raw);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,7 +105,7 @@ function get($param, $raw = false)
|
|||
*/
|
||||
function setting($name, $again = false)
|
||||
{
|
||||
return \Settings::getValue($name);
|
||||
return Settings::getValue($name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,7 +113,7 @@ function setting($name, $again = false)
|
|||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Util\Messages
|
||||
* @return Util\Messages
|
||||
*/
|
||||
function flash()
|
||||
{
|
||||
|
@ -127,11 +125,11 @@ function flash()
|
|||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Auth
|
||||
* @return Auth
|
||||
*/
|
||||
function auth()
|
||||
{
|
||||
return \Auth::getInstance();
|
||||
return Auth::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,11 +137,11 @@ function auth()
|
|||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Translator
|
||||
* @return Translator
|
||||
*/
|
||||
function trans()
|
||||
{
|
||||
return \Translator::getInstance();
|
||||
return Translator::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,11 +149,11 @@ function trans()
|
|||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Intl\Formatter
|
||||
* @return Intl\Formatter
|
||||
*/
|
||||
function formatter()
|
||||
{
|
||||
return \Translator::getFormatter();
|
||||
return Translator::getFormatter();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,7 +169,7 @@ function formatter()
|
|||
*/
|
||||
function tr($string, $parameters = [], $operations = [])
|
||||
{
|
||||
return \Translator::translate($string, $parameters, $operations);
|
||||
return Translator::translate($string, $parameters, $operations);
|
||||
}
|
||||
|
||||
// Retrocompatibilità (con la funzione gettext)
|
||||
|
@ -187,7 +185,7 @@ if (!function_exists('_')) {
|
|||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Monolog\Logger
|
||||
* @return Monolog\Logger
|
||||
*/
|
||||
function logger()
|
||||
{
|
||||
|
@ -213,7 +211,8 @@ function numberFormat($number, $decimals = null)
|
|||
* Restituisce il timestamp indicato formattato secondo la configurazione del sistema.
|
||||
*
|
||||
* @param string $timestamp
|
||||
+ *
|
||||
* + *
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 2.4.8
|
||||
|
@ -260,14 +259,12 @@ function timeFormat($time)
|
|||
*/
|
||||
function currency()
|
||||
{
|
||||
return \Translator::getCurrency();
|
||||
return Translator::getCurrency();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il numero indicato formattato come una valuta secondo la configurazione del sistema.
|
||||
*
|
||||
* @param string $time
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 2.4.9
|
||||
|
|
24
lib/util.php
24
lib/util.php
|
@ -48,8 +48,6 @@ if (!function_exists('array_clean')) {
|
|||
/**
|
||||
* Pulisce i contenuti vuoti di un array.
|
||||
*
|
||||
* @param $array
|
||||
*
|
||||
* @since 2.3.2
|
||||
*
|
||||
* @return array
|
||||
|
@ -68,8 +66,6 @@ if (!function_exists('array_deep_clean')) {
|
|||
/**
|
||||
* Pulisce i contenuti vuoti di un array.
|
||||
*
|
||||
* @param $array
|
||||
*
|
||||
* @since 2.4.11
|
||||
*
|
||||
* @return array
|
||||
|
@ -111,7 +107,7 @@ if (!function_exists('string_starts_with')) {
|
|||
*/
|
||||
function string_starts_with($string, $starts_with)
|
||||
{
|
||||
//return strpos($string, $string_starts_with) === 0;
|
||||
// return strpos($string, $string_starts_with) === 0;
|
||||
return S::create($string)->startsWith($starts_with);
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +123,7 @@ if (!function_exists('string_ends_with')) {
|
|||
*/
|
||||
function string_ends_with($string, $ends_with)
|
||||
{
|
||||
//return substr($string, -strlen($string_ends_with)) === $string_ends_with;
|
||||
// return substr($string, -strlen($string_ends_with)) === $string_ends_with;
|
||||
return S::create($string)->endsWith($ends_with);
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +139,7 @@ if (!function_exists('string_contains')) {
|
|||
*/
|
||||
function string_contains($string, $contains)
|
||||
{
|
||||
//return strpos($string, $contains) !== false;
|
||||
// return strpos($string, $contains) !== false;
|
||||
return S::create($string)->contains($contains);
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +236,7 @@ if (!function_exists('random_string')) {
|
|||
// Don't allow duplicate letters to be disabled if the length is
|
||||
// longer than the available characters
|
||||
if ($no_duplicate_chars && strlen($pool) < $length) {
|
||||
throw new \LengthException('$length exceeds the size of the pool and $no_duplicate_chars is enabled');
|
||||
throw new LengthException('$length exceeds the size of the pool and $no_duplicate_chars is enabled');
|
||||
}
|
||||
|
||||
// Convert the pool of characters into an array of characters and
|
||||
|
@ -286,7 +282,7 @@ if (!function_exists('secure_random_string')) {
|
|||
$bytes = openssl_random_pseudo_bytes($length * 2);
|
||||
|
||||
if ($bytes === false) {
|
||||
throw new \LengthException('$length is not accurate, unable to generate random string');
|
||||
throw new LengthException('$length is not accurate, unable to generate random string');
|
||||
}
|
||||
|
||||
return substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $length);
|
||||
|
@ -304,9 +300,6 @@ if (!function_exists('download')) {
|
|||
*
|
||||
* @param string $filename The name of the filename to display to
|
||||
* browsers
|
||||
* @param string $content The content to output for the download.
|
||||
* If you don't specify this, just the
|
||||
* headers will be sent
|
||||
*
|
||||
* @since 2.3
|
||||
*
|
||||
|
@ -427,7 +420,7 @@ if (!function_exists('color_darken')) {
|
|||
}
|
||||
$rgb = '';
|
||||
for ($x = 0; $x < 3; ++$x) {
|
||||
$c = hexdec(substr($color, (2 * $x), 2)) - $dif;
|
||||
$c = hexdec(substr($color, 2 * $x, 2)) - $dif;
|
||||
$c = ($c < 0) ? 0 : dechex($c);
|
||||
$rgb .= (strlen($c) < 2) ? '0'.$c : $c;
|
||||
}
|
||||
|
@ -448,7 +441,7 @@ if (!function_exists('color_inverse')) {
|
|||
*/
|
||||
function color_inverse($start_colour)
|
||||
{
|
||||
if (preg_match('/^#[a-f0-9]{6}$/i', $start_colour)) { //hex color is valid
|
||||
if (preg_match('/^#[a-f0-9]{6}$/i', $start_colour)) { // hex color is valid
|
||||
$R1 = hexdec(substr($start_colour, 1, 2));
|
||||
$G1 = hexdec(substr($start_colour, 3, 2));
|
||||
$B1 = hexdec(substr($start_colour, 5, 2));
|
||||
|
@ -543,9 +536,6 @@ if (!function_exists('temp_file')) {
|
|||
/**
|
||||
* Crea un file temporaneo e lo imposta per la rimozione alla fine dell'esecuzione.
|
||||
*
|
||||
* @param $name
|
||||
* @param $content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function temp_file($name = null, $content = null)
|
||||
|
|
16
mail.php
16
mail.php
|
@ -112,21 +112,21 @@ echo '
|
|||
<b>'.tr('Destinatari').' <span class="tip" title="'.tr('Email delle sedi, dei referenti o agente collegato all\'anagrafica.').'"><i class="fa fa-question-circle-o"></i></span></b>
|
||||
<div class="row" id="lista-destinatari">';
|
||||
|
||||
$idx = 0;
|
||||
$idx = 0;
|
||||
|
||||
foreach ($emails as $email) {
|
||||
foreach ($emails as $email) {
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
{[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 0 ]}
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($emails)) {
|
||||
if (empty($emails)) {
|
||||
echo '
|
||||
<div class="col-md-12">
|
||||
{[ "type": "email", "name": "destinatari['.$idx++.']", "value": "", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 0 ]}
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
|
||||
|
@ -171,16 +171,16 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12">';
|
||||
echo input([
|
||||
echo input([
|
||||
'type' => 'ckeditor',
|
||||
'use_full_ckeditor' => 1,
|
||||
'label' => tr('Contenuto'),
|
||||
'name' => 'body',
|
||||
'id' => 'body_'.rand(0, 999),
|
||||
'value' => $body,
|
||||
]);
|
||||
]);
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ if (!empty($results) || !empty($results_settings)) {
|
|||
}
|
||||
}
|
||||
if (!empty($results_settings)) {
|
||||
echo'
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<h3>Impostazioni mancanti</h3>
|
||||
|
@ -205,7 +205,7 @@ if (!empty($results) || !empty($results_settings)) {
|
|||
</thead>
|
||||
<tbody>';
|
||||
foreach ($results_settings as $key => $setting) {
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
'.$key.'
|
||||
|
@ -219,8 +219,8 @@ if (!empty($results) || !empty($results_settings)) {
|
|||
</tbody>
|
||||
</table>';
|
||||
}
|
||||
} else{
|
||||
echo '
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Il database non presenta problemi di integrità').'.
|
||||
</div>';
|
||||
|
|
|
@ -76,7 +76,7 @@ if (function_exists('customComponents')) {
|
|||
}
|
||||
}
|
||||
|
||||
//Fix per funzione base_path non trovata in fase di aggiornamento da versione < 2.4.19
|
||||
// Fix per funzione base_path non trovata in fase di aggiornamento da versione < 2.4.19
|
||||
if (!function_exists('base_path')) {
|
||||
function base_path()
|
||||
{
|
||||
|
@ -92,27 +92,27 @@ if (!function_exists('base_dir')) {
|
|||
}
|
||||
|
||||
// Aggiornamenti
|
||||
$alerts = [];
|
||||
$alerts = [];
|
||||
|
||||
if (!extension_loaded('zip')) {
|
||||
if (!extension_loaded('zip')) {
|
||||
$alerts[tr('Estensione ZIP')] = tr('da abilitare');
|
||||
}
|
||||
}
|
||||
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
$upload_max_filesize = str_replace(['k', 'M'], ['000', '000000'], $upload_max_filesize);
|
||||
// Dimensione minima: 32MB
|
||||
if ($upload_max_filesize < 32000000) {
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
$upload_max_filesize = str_replace(['k', 'M'], ['000', '000000'], $upload_max_filesize);
|
||||
// Dimensione minima: 32MB
|
||||
if ($upload_max_filesize < 32000000) {
|
||||
$alerts['upload_max_filesize'] = '32MB';
|
||||
}
|
||||
}
|
||||
|
||||
$post_max_size = ini_get('post_max_size');
|
||||
$post_max_size = str_replace(['k', 'M'], ['000', '000000'], $post_max_size);
|
||||
// Dimensione minima: 32MB
|
||||
if ($post_max_size < 32000000) {
|
||||
$post_max_size = ini_get('post_max_size');
|
||||
$post_max_size = str_replace(['k', 'M'], ['000', '000000'], $post_max_size);
|
||||
// Dimensione minima: 32MB
|
||||
if ($post_max_size < 32000000) {
|
||||
$alerts['post_max_size'] = '32MB';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($alerts)) {
|
||||
if (!empty($alerts)) {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<p>'.tr('Devi modificare il seguenti parametri del file di configurazione PHP (_FILE_) per poter caricare gli aggiornamenti', [
|
||||
|
@ -125,9 +125,9 @@ if (!function_exists('base_dir')) {
|
|||
echo '
|
||||
</ul></p>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<script>
|
||||
function update() {
|
||||
if ($("#blob").val()) {
|
||||
|
@ -201,7 +201,7 @@ echo '
|
|||
|
||||
';
|
||||
|
||||
if (!empty($custom) || !empty($tables)) {
|
||||
if (!empty($custom) || !empty($tables)) {
|
||||
$disabled = 'disabled';
|
||||
echo ' <input type="checkbox" id="aggiorna_custom" class="pull-left" style="margin-top:10px;" value="1" >
|
||||
<label for="aggiorna_custom" style="margin-top:7px;" >'.tr("Desidero comunque procedere all'aggiornamento").'.</label>
|
||||
|
@ -214,7 +214,7 @@ echo '
|
|||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
echo '
|
||||
|
||||
<button type="button" class="btn btn-primary pull-right '.$disabled.'" id="aggiorna" onclick="update()">
|
||||
|
@ -261,15 +261,15 @@ echo '
|
|||
</h3>
|
||||
</div>
|
||||
<div class="box-body" id="update-search">';
|
||||
if (extension_loaded('curl')) {
|
||||
if (extension_loaded('curl')) {
|
||||
echo ' <button type="button" class="btn btn-info btn-block" onclick="search(this)">
|
||||
<i class="fa fa-search"></i> '.tr('Ricerca').'
|
||||
</button>';
|
||||
} else {
|
||||
} else {
|
||||
echo ' <button type="button" class="btn btn-warning btn-block disabled" >
|
||||
<i class="fa fa-warning"></i> '.tr('Estensione curl non supportata').'.
|
||||
</button>';
|
||||
}
|
||||
}
|
||||
|
||||
echo ' </div>
|
||||
</div>
|
||||
|
|
|
@ -21,15 +21,13 @@ namespace Modules\Aggiornamenti;
|
|||
|
||||
use GuzzleHttp\Client;
|
||||
use Hooks\CachedManager;
|
||||
use Modules;
|
||||
use Update;
|
||||
|
||||
/**
|
||||
* Hook dedicato all'individuazione di nuove versioni del gestionale, pubblicate sulla repository ufficiale di GitHub.
|
||||
*/
|
||||
class UpdateHook extends CachedManager
|
||||
{
|
||||
protected static $client = null;
|
||||
protected static $client;
|
||||
|
||||
public function getCacheName()
|
||||
{
|
||||
|
@ -44,11 +42,11 @@ class UpdateHook extends CachedManager
|
|||
public function response()
|
||||
{
|
||||
$update = $this->getCache()->content[0];
|
||||
if ($update == Update::getVersion() || empty(setting('Attiva aggiornamenti'))) {
|
||||
if ($update == \Update::getVersion() || empty(setting('Attiva aggiornamenti'))) {
|
||||
$update = null;
|
||||
}
|
||||
|
||||
$module = Modules::get('Aggiornamenti');
|
||||
$module = \Modules::get('Aggiornamenti');
|
||||
$link = base_path().'/controller.php?id_module='.$module->id;
|
||||
|
||||
$message = tr("E' disponibile la versione _VERSION_ del gestionale", [
|
||||
|
@ -75,7 +73,7 @@ class UpdateHook extends CachedManager
|
|||
if (!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')) {
|
||||
$version[0] = ltrim($api['tag_name'], 'v');
|
||||
$version[1] = !empty($api['prerelease']) ? 'beta' : 'stabile';
|
||||
$current = Update::getVersion();
|
||||
$current = \Update::getVersion();
|
||||
|
||||
if (version_compare($current, $version[0]) < 0) {
|
||||
return $version;
|
||||
|
|
|
@ -315,7 +315,7 @@ switch (post('op')) {
|
|||
case 'delete':
|
||||
// Se l'anagrafica non è l'azienda principale, la disattivo
|
||||
if (!$anagrafica->isAzienda()) {
|
||||
//$anagrafica->delete();
|
||||
// $anagrafica->delete();
|
||||
$dbo->query('UPDATE an_anagrafiche SET deleted_at = NOW() WHERE idanagrafica = '.prepare($id_record));
|
||||
|
||||
// Se l'anagrafica è collegata ad un utente lo disabilito
|
||||
|
|
|
@ -121,7 +121,7 @@ echo '
|
|||
{[ "type": "text", "label": "'.tr('PEC').'", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "icon-before": "<i class=\'fa fa-envelope-o\'></i>" ]}
|
||||
</div>';
|
||||
|
||||
$help_codice_destinatario = tr("Per impostare il codice specificare prima '<b>Tipologia</b>' e '<b>Nazione</b>' dell'anagrafica").':<br><br><ul><li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li><li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li><li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li>'.'</ul>Se non si conosce il codice destinatario lasciare vuoto il campo. Verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').';
|
||||
$help_codice_destinatario = tr("Per impostare il codice specificare prima '<b>Tipologia</b>' e '<b>Nazione</b>' dell'anagrafica").':<br><br><ul><li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li><li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li><li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li></ul>Se non si conosce il codice destinatario lasciare vuoto il campo. Verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').';
|
||||
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
|
|
|
@ -103,7 +103,7 @@ foreach ($fields as $name => $value) {
|
|||
$query .= ' OR '.$value.' LIKE "%'.$term.'%"';
|
||||
}
|
||||
|
||||
//$query .= Modules::getAdditionalsQuery('Anagrafiche');
|
||||
// $query .= Modules::getAdditionalsQuery('Anagrafiche');
|
||||
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ switch ($resource) {
|
|||
|
||||
if (setting('Permetti inserimento sessioni degli altri tecnici')) {
|
||||
} else {
|
||||
//come tecnico posso aprire attività solo a mio nome
|
||||
// come tecnico posso aprire attività solo a mio nome
|
||||
$user = Auth::user();
|
||||
if ($user['gruppo'] == 'Tecnici' && !empty($user['idanagrafica'])) {
|
||||
$where[] = 'an_anagrafiche.idanagrafica='.$user['idanagrafica'];
|
||||
|
@ -369,7 +369,7 @@ switch ($resource) {
|
|||
}
|
||||
|
||||
$where[] = 'idanagrafica='.prepare($id_azienda);
|
||||
//admin o utente senza una sede prefissata, avrà accesso a tutte le sedi
|
||||
// admin o utente senza una sede prefissata, avrà accesso a tutte le sedi
|
||||
if (!empty($user->sedi) and !$user->is_admin) {
|
||||
$where[] = 'id IN('.implode(',', $user->sedi).')';
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ 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, 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';
|
||||
|
||||
|
@ -500,10 +500,10 @@ switch ($resource) {
|
|||
$filter[] = 'id='.prepare($element);
|
||||
}
|
||||
|
||||
//$where[] = '( '.prepare($superselect['data']).' BETWEEN data_inizio AND data_fine)';
|
||||
// $where[] = '( '.prepare($superselect['data']).' BETWEEN data_inizio AND data_fine)';
|
||||
|
||||
//$where[] = 'data_inizio < NOW()';
|
||||
//$where[] = 'data_fine > NOW()';
|
||||
// $where[] = 'data_inizio < NOW()';
|
||||
// $where[] = 'data_fine > NOW()';
|
||||
|
||||
if (empty($filter)) {
|
||||
$where[] = 'co_dichiarazioni_intento.deleted_at IS NULL';
|
||||
|
|
|
@ -26,7 +26,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">';
|
||||
|
||||
//Aggiunta utente per i tecnici
|
||||
// Aggiunta utente per i tecnici
|
||||
if (in_array($id_tecnico, $tipi_anagrafica)) {
|
||||
echo '
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi utente').'" data-href="modules/utenti/user.php?id_module='.Modules::get('Utenti e permessi')['id'].'&id_record='.$dbo->fetchOne('SELECT id FROM zz_groups WHERE nome=\'Tecnici\'')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-user"></i>'.tr('Nuovo utente').'
|
||||
|
@ -77,7 +77,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
}
|
||||
|
||||
if (in_array($id_agente, $tipi_anagrafica)) {
|
||||
//Aggiunta liquidazione provvigioni per agente
|
||||
// Aggiunta liquidazione provvigioni per agente
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary" data-title="'.tr('Liquida Provvigioni').'" data-href="'.base_path().'/modules/anagrafiche/liquida_provvigioni.php?nome_stampa=Provvigioni&id_record='.$id_record.'" ><i class="fa fa-print"></i>'.tr(' Liquida Provvigioni').'</button>';
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
} ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
@ -147,10 +147,10 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
<li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li></ul>
|
||||
'.tr('Se non si conosce il codice destinatario lasciare vuoto il campo, e verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\')').'.';
|
||||
|
||||
if (in_array($id_azienda, $tipi_anagrafica)) {
|
||||
if (in_array($id_azienda, $tipi_anagrafica)) {
|
||||
$help_codice_destinatario .= ' <b>'.tr("Non è necessario comunicare il proprio codice destinatario ai fornitori in quanto è sufficiente che questo sia registrato nel portale del Sistema Di Interscambio dell'Agenzia Entrate (SDI)").'.</b>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
{[ "type": "text", "label": "<?php echo ($record['tipo'] == 'Ente pubblico') ? tr('Codice unico ufficio') : tr('Codice destinatario'); ?>", "name": "codice_destinatario", "required": 0, "class": "text-center text-uppercase alphanumeric-mask", "value": "$codice_destinatario$", "maxlength": <?php echo ($record['tipo'] == 'Ente pubblico') ? '6' : '7'; ?>, "help": "<?php echo tr($help_codice_destinatario); ?>", "readonly": "<?php echo intval($nazione_anagrafica ? !(($nazione_anagrafica->iso2 === 'IT') || ($nazione_anagrafica->iso2 === 'SM')) : 0); ?>" ]}
|
||||
</div>
|
||||
|
||||
|
@ -243,10 +243,10 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
<?php
|
||||
$sede_cliente = $anagrafica->sedeLegale;
|
||||
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$sede_azienda = $anagrafica_azienda->sedeLegale;
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$sede_azienda = $anagrafica_azienda->sedeLegale;
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
|
@ -254,48 +254,48 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
</div>
|
||||
<div class="panel-body">';
|
||||
|
||||
// Area caricamento mappa
|
||||
echo '
|
||||
// Area caricamento mappa
|
||||
echo '
|
||||
<div id="map-edit" style="width: 100%;"></div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br>';
|
||||
|
||||
if (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($sede_cliente->lng))) {
|
||||
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 {
|
||||
} else {
|
||||
// Definizione manuale delle informazioni
|
||||
echo '
|
||||
<a class="btn btn-primary btn-block" onclick="modificaPosizione()">
|
||||
<i class="fa fa-map"></i> '.tr('Definisci posizione').'
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Navigazione diretta verso l'indirizzo
|
||||
echo '
|
||||
// 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();">
|
||||
<i class="fa fa-compass"></i> '.tr('Carica mappa').'
|
||||
</a>';
|
||||
|
||||
// Navigazione diretta verso l'indirizzo
|
||||
echo '
|
||||
// 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()">
|
||||
<i class="fa fa-map-signs"></i> '.tr('Calcola percorso').'
|
||||
'.((!empty($sede_cliente->lat) && !empty($sede_azienda->lat)) ? tr('(GPS)') : '').'
|
||||
</a>';
|
||||
|
||||
// Ricerca diretta su Mappa
|
||||
echo '
|
||||
// Ricerca diretta su Mappa
|
||||
echo '
|
||||
<a class="btn btn-info btn-block" onclick="cercaOpenStreetMap()">
|
||||
<i class="fa fa-map-marker"></i> '.tr('Cerca su Mappa').'
|
||||
'.((!empty($sede_cliente->lat)) ? tr(' (GPS)') : '').'
|
||||
</a>';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -423,7 +423,7 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
|
||||
</script>';
|
||||
|
||||
if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
echo '
|
||||
|
||||
<div class="panel panel-primary">
|
||||
|
@ -632,8 +632,8 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
|
@ -663,7 +663,7 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
@ -710,7 +710,7 @@ if (sizeof($problemi_anagrafica) > 0) {
|
|||
echo '
|
||||
<p class="badge badge-info">'.tr('Questa anagrafica è di tipo "Azienda"').'.</p>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -779,8 +779,8 @@ if (!empty($elementi)) {
|
|||
'_DELETED_AT_' => (!empty($elemento['deleted_at']) ? tr('Eliminato il:').' '.Translator::dateToLocale($elemento['deleted_at']) : ''),
|
||||
]);
|
||||
|
||||
//se non è un preventivo è un ddt o una fattura
|
||||
//se non è un ddt è una fattura.
|
||||
// se non è un preventivo è un ddt o una fattura
|
||||
// se non è un ddt è una fattura.
|
||||
if (in_array($elemento['tipo_documento'], ['Utente'])) {
|
||||
$modulo = 'Utenti e permessi';
|
||||
} elseif (in_array($elemento['tipo_documento'], ['Intervento'])) {
|
||||
|
|
|
@ -40,7 +40,7 @@ echo '
|
|||
|
||||
<form action="" method="post" id="form" >
|
||||
<div class="row">';
|
||||
echo '
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "date", "label": "'.tr('Data inizio').'", "required": "1", "name": "date_start", "value": "'.$_SESSION['period_start'].'" ]}
|
||||
</div>
|
||||
|
@ -67,7 +67,7 @@ echo '
|
|||
</div>
|
||||
';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="col-md-4 pull-right">
|
||||
<p style="line-height:14px;"> </p>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="if($(\'#form\').parsley().validate()) { return avvia_stampa(); }">
|
||||
|
@ -108,9 +108,9 @@ echo '
|
|||
input("date_start").disable();
|
||||
input("date_end").disable();
|
||||
}';
|
||||
if ($nome_stampa != 'Liquidazione IVA') {
|
||||
if ($nome_stampa != 'Liquidazione IVA') {
|
||||
echo 'eseguiControlli();';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
});
|
||||
</script>';
|
||||
|
|
|
@ -22,7 +22,7 @@ use Modules\Anagrafiche\Anagrafica;
|
|||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
//Allegati dell'anagrafica
|
||||
// Allegati dell'anagrafica
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
|
@ -41,7 +41,7 @@ if (empty($_GET['visualizza_allegati'])) {
|
|||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
//Controllo i permessi dei modulo per la visualizzazione degli allegati
|
||||
// Controllo i permessi dei modulo per la visualizzazione degli allegati
|
||||
$rs = $dbo->table('zz_permissions')->where('idgruppo', $user->idgruppo)->get();
|
||||
$permessi = [];
|
||||
$documenti[] = 0;
|
||||
|
@ -58,25 +58,25 @@ if (empty($_GET['visualizza_allegati'])) {
|
|||
];
|
||||
}
|
||||
|
||||
//Interventi dell'anagrafica
|
||||
// Interventi dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Interventi')['id'], $permessi)) {
|
||||
$interventi = $dbo->fetcharray('SELECT '.prepare(Modules::get('Interventi')['id'])." AS id_module, id AS id_record, CONCAT('Intervento num. ',codice,' del ',DATE_FORMAT(data_richiesta,'%d/%m/%Y')) AS descrizione FROM in_interventi WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $interventi);
|
||||
}
|
||||
|
||||
//Preventivi dell'anagrafica
|
||||
// Preventivi dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Preventivi')['id'], $permessi)) {
|
||||
$preventivi = $dbo->fetcharray('SELECT '.prepare(Modules::get('Preventivi')['id'])." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_preventivi WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $preventivi);
|
||||
}
|
||||
|
||||
//Contratti dell'anagrafica
|
||||
// Contratti dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Contratti')['id'], $permessi)) {
|
||||
$contratti = $dbo->fetcharray('SELECT '.prepare(Modules::get('Contratti')['id'])." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_contratti WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $contratti);
|
||||
}
|
||||
|
||||
//DDT dell'anagrafica
|
||||
// DDT dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Ddt di vendita')['id'], $permessi)) {
|
||||
$ddt_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ddt di vendita')['id'])." AS id_module, id AS id_record, CONCAT('Ddt di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ddt_vendita);
|
||||
|
@ -87,7 +87,7 @@ if (empty($_GET['visualizza_allegati'])) {
|
|||
$documenti = array_merge($documenti, $ddt_acquisto);
|
||||
}
|
||||
|
||||
//Fatture dell'anagrafica
|
||||
// Fatture dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Fatture di vendita')['id'], $permessi)) {
|
||||
$fatture_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Fatture di vendita')['id'])." AS id_module, id AS id_record, CONCAT('Fattura di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $fatture_vendita);
|
||||
|
@ -98,7 +98,7 @@ if (empty($_GET['visualizza_allegati'])) {
|
|||
$documenti = array_merge($documenti, $fatture_acquisto);
|
||||
}
|
||||
|
||||
//Ordini dell'anagrafica
|
||||
// Ordini dell'anagrafica
|
||||
if ($user->is_admin || in_array(Modules::get('Ordini cliente')['id'], $permessi)) {
|
||||
$ordini_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ordini cliente')['id'])." AS id_module, id AS id_record, CONCAT('Ordine cliente num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ordini_vendita);
|
||||
|
|
|
@ -30,7 +30,6 @@ use Modules\Ordini\Ordine;
|
|||
use Modules\Preventivi\Preventivo;
|
||||
use Modules\TipiIntervento\Tipo as TipoSessione;
|
||||
use Plugins\DichiarazioniIntento\Dichiarazione;
|
||||
use Settings;
|
||||
use Traits\RecordTrait;
|
||||
use Util\Generator;
|
||||
|
||||
|
@ -100,7 +99,7 @@ class Anagrafica extends Model
|
|||
|
||||
public static function fixAzienda(Anagrafica $anagrafica)
|
||||
{
|
||||
Settings::setValue('Azienda predefinita', $anagrafica->id);
|
||||
\Settings::setValue('Azienda predefinita', $anagrafica->id);
|
||||
}
|
||||
|
||||
public static function fixCliente(Anagrafica $anagrafica)
|
||||
|
|
|
@ -21,12 +21,12 @@ use Modules\Anagrafiche\Anagrafica;
|
|||
|
||||
$anagrafica = Anagrafica::find($id_record);
|
||||
|
||||
//cliente
|
||||
// cliente
|
||||
if ($anagrafica->idconto_cliente != '') {
|
||||
$conto = $anagrafica->idconto_cliente;
|
||||
$conto_descrizione = $dbo->fetchOne('SELECT CONCAT ((SELECT numero FROM co_pianodeiconti2 WHERE id=co_pianodeiconti3.idpianodeiconti2), ".", numero, " ", descrizione) AS descrizione FROM co_pianodeiconti3 WHERE id='.prepare($conto))['descrizione'];
|
||||
}
|
||||
//Fornitore
|
||||
// Fornitore
|
||||
elseif ($anagrafica->idconto_fornitore != '') {
|
||||
$conto = $anagrafica->idconto_fornitore;
|
||||
$conto_descrizione = $dbo->fetchOne('SELECT CONCAT ((SELECT numero FROM co_pianodeiconti2 WHERE id=co_pianodeiconti3.idpianodeiconti2), ".", numero, " ", descrizione) AS descrizione FROM co_pianodeiconti3 WHERE id='.prepare($conto))['descrizione'];
|
||||
|
|
|
@ -34,7 +34,7 @@ switch (post('op')) {
|
|||
// Aggiunta articolo
|
||||
// no break
|
||||
case 'add':
|
||||
//Se non specifico il codice articolo lo imposto uguale all'id della riga
|
||||
// Se non specifico il codice articolo lo imposto uguale all'id della riga
|
||||
if (empty(post('codice'))) {
|
||||
$codice = $dbo->fetchOne('SELECT MAX(id) as codice FROM mg_articoli')['codice'] + 1;
|
||||
} else {
|
||||
|
@ -185,7 +185,7 @@ switch (post('op')) {
|
|||
// Se non è presente un componente, copia i valori dal file di origine
|
||||
$campi_componente = [];
|
||||
foreach ($contenuto_componente as $key => $value) {
|
||||
//Fix per nomi con spazi che vengono tradotti con "_" (es. Data_di_installazione)
|
||||
// Fix per nomi con spazi che vengono tradotti con "_" (es. Data_di_installazione)
|
||||
$key = preg_replace('/\s+/', '_', $key);
|
||||
|
||||
$valore = $contenuto_precedente_esistente ? filter($key) : $value['valore'];
|
||||
|
@ -245,7 +245,7 @@ switch (post('op')) {
|
|||
case 'copy':
|
||||
$new = $articolo->replicate();
|
||||
|
||||
//Se non specifico il codice articolo lo imposto uguale all'id della riga
|
||||
// Se non specifico il codice articolo lo imposto uguale all'id della riga
|
||||
if (empty(post('codice'))) {
|
||||
$codice = $dbo->fetchOne('SELECT MAX(id) as codice FROM mg_articoli')['codice'] + 1;
|
||||
} else {
|
||||
|
@ -297,7 +297,7 @@ switch (post('op')) {
|
|||
// Combinazione di seriali
|
||||
$serials = [];
|
||||
for ($s = 0; $s < $totale; ++$s) {
|
||||
$serial = $prefix.(str_pad($numero_start + $s, $pad_length, '0', STR_PAD_LEFT));
|
||||
$serial = $prefix.str_pad($numero_start + $s, $pad_length, '0', STR_PAD_LEFT);
|
||||
|
||||
$serials[] = $serial;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
|
|||
echo '
|
||||
<button type="button" class="btn btn-info btn-xs pull-right tip pull-right" title="'.tr('Scorpora l\'IVA dal prezzo di vendita.').'" id="scorpora_iva_add"><i class="fa fa-calculator" aria-hidden="true"></i></button>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
{[ "type": "number", "label": "<?php echo tr('Prezzo di vendita'); ?>", "name": "prezzo_vendita", "icon-after": "<?php echo currency(); ?>", "help": "<?php echo setting('Utilizza prezzi di vendita comprensivi di IVA') ? tr('Importo IVA inclusa') : ''; ?>" ]}
|
||||
</div>
|
||||
|
|
|
@ -155,7 +155,7 @@ switch (post('op')) {
|
|||
}
|
||||
|
||||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('codice', '!=', '')->first()->id);
|
||||
exit();
|
||||
exit;
|
||||
|
||||
case 'change-qta':
|
||||
$descrizione = post('descrizione');
|
||||
|
@ -219,7 +219,7 @@ switch (post('op')) {
|
|||
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
exit();
|
||||
exit;
|
||||
|
||||
case 'export-csv':
|
||||
$file = temp_file();
|
||||
|
|
|
@ -425,8 +425,8 @@ if (!empty($elementi)) {
|
|||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
]);
|
||||
|
||||
//se non è un preventivo è un ddt o una fattura
|
||||
//se non è un ddt è una fattura.
|
||||
// se non è un preventivo è un ddt o una fattura
|
||||
// se non è un ddt è una fattura.
|
||||
if (in_array($elemento['tipo_documento'], ['Preventivo'])) {
|
||||
$modulo = 'Preventivi';
|
||||
} elseif (!in_array($elemento['tipo_documento'], ['Ddt di vendita', 'Ddt di acquisto', 'Ddt in entrata', 'Ddt in uscita'])) {
|
||||
|
|
|
@ -280,7 +280,7 @@ foreach ($sedi as $sede) {
|
|||
</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -181,7 +181,7 @@ if (empty(get('modal'))) {
|
|||
$id = $data[0]['idordine'];
|
||||
}
|
||||
|
||||
$totali[] = [($data[0]['prezzo_unitario'] - $data[0]['sconto_unitario']), $data[0]['iva_unitaria']];
|
||||
$totali[] = [$data[0]['prezzo_unitario'] - $data[0]['sconto_unitario'], $data[0]['iva_unitaria']];
|
||||
|
||||
$numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero'];
|
||||
|
||||
|
@ -300,7 +300,7 @@ if (empty(get('modal'))) {
|
|||
$id = $data[0]['idvendita'];
|
||||
}
|
||||
|
||||
$totali[] = [($data[0]['prezzo_unitario'] - $data[0]['sconto_unitario']), $data[0]['iva_unitaria']];
|
||||
$totali[] = [$data[0]['prezzo_unitario'] - $data[0]['sconto_unitario'], $data[0]['iva_unitaria']];
|
||||
|
||||
$numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero'];
|
||||
|
||||
|
|
|
@ -22,14 +22,12 @@ namespace Modules\Articoli;
|
|||
use Common\SimpleModelTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules;
|
||||
use Modules\AttributiCombinazioni\ValoreAttributo;
|
||||
use Modules\CombinazioniArticoli\Combinazione;
|
||||
use Modules\Interventi\Components\Articolo as ArticoloIntervento;
|
||||
use Modules\Iva\Aliquota;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
use Traits\RecordTrait;
|
||||
use Uploads;
|
||||
|
||||
class Articolo extends Model
|
||||
{
|
||||
|
@ -64,7 +62,6 @@ class Articolo extends Model
|
|||
/**
|
||||
* Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, modificando di conseguenza la quantità dell'articolo stesso.
|
||||
*
|
||||
* @param $qta
|
||||
* @param string $descrizone
|
||||
* @param string $data
|
||||
* @param bool $manuale
|
||||
|
@ -89,7 +86,6 @@ class Articolo extends Model
|
|||
/**
|
||||
* Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, senza movimentare la quantità dell'articolo stesso.
|
||||
*
|
||||
* @param $qta
|
||||
* @param string $descrizone
|
||||
* @param string $data
|
||||
* @param bool $manuale
|
||||
|
@ -124,9 +120,6 @@ class Articolo extends Model
|
|||
|
||||
/**
|
||||
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
|
||||
*
|
||||
* @param $prezzo_vendita
|
||||
* @param $id_iva
|
||||
*/
|
||||
public function setPrezzoVendita($prezzo_vendita, $id_iva)
|
||||
{
|
||||
|
@ -147,9 +140,6 @@ class Articolo extends Model
|
|||
|
||||
/**
|
||||
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
|
||||
*
|
||||
* @param $prezzo_vendita
|
||||
* @param $id_iva
|
||||
*/
|
||||
public function setMinimoVendita($prezzo_minimo, $id_iva)
|
||||
{
|
||||
|
@ -168,8 +158,6 @@ class Articolo extends Model
|
|||
|
||||
/**
|
||||
* Imposta il prezzo di acquisto e aggiorna il prezzo di vendita in base al coefficiente.
|
||||
*
|
||||
* @param $value
|
||||
*/
|
||||
public function setPrezzoAcquistoAttribute($value)
|
||||
{
|
||||
|
@ -217,8 +205,8 @@ class Articolo extends Model
|
|||
return null;
|
||||
}
|
||||
|
||||
$module = Modules::get($this->module);
|
||||
$fileinfo = Uploads::fileInfo($this->immagine);
|
||||
$module = \Modules::get($this->module);
|
||||
$fileinfo = \Uploads::fileInfo($this->immagine);
|
||||
|
||||
$directory = '/'.$module->upload_directory.'/';
|
||||
$image = $directory.$this->immagine;
|
||||
|
|
|
@ -22,7 +22,6 @@ namespace Modules\Articoli\Import;
|
|||
use Carbon\Carbon;
|
||||
use Importer\CSVImporter;
|
||||
use Models\Upload;
|
||||
use Modules;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Anagrafiche\Sede;
|
||||
use Modules\Anagrafiche\Tipo;
|
||||
|
@ -31,7 +30,6 @@ use Modules\Articoli\Categoria;
|
|||
use Modules\Iva\Aliquota;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
use Uploads;
|
||||
|
||||
/**
|
||||
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Articoli.
|
||||
|
@ -331,7 +329,7 @@ class CSV extends CSVImporter
|
|||
$articolo->attivo = 1;
|
||||
|
||||
// Esportazione della quantità indicata
|
||||
$nuova_qta = (float) ($record['qta']);
|
||||
$nuova_qta = (float) $record['qta'];
|
||||
$nome_sede = $record['nome_sede'];
|
||||
|
||||
if (!empty($dettagli['id_fornitore']) || !empty($dettagli['anagrafica_listino'] || !empty($dettagli['partita_iva']))) {
|
||||
|
@ -361,14 +359,14 @@ class CSV extends CSVImporter
|
|||
unset($record['descrizione_fornitore']);
|
||||
unset($record['id_fornitore']);
|
||||
|
||||
//Gestione immagine
|
||||
// Gestione immagine
|
||||
if (!empty($url) && !empty($record['import_immagine'])) {
|
||||
$file_content = file_get_contents($url);
|
||||
|
||||
if (!empty($file_content)) {
|
||||
if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) {
|
||||
Uploads::deleteLinked([
|
||||
'id_module' => Modules::get('Articoli')['id'],
|
||||
\Uploads::deleteLinked([
|
||||
'id_module' => \Modules::get('Articoli')['id'],
|
||||
'id_record' => $articolo->id,
|
||||
]);
|
||||
|
||||
|
@ -381,11 +379,11 @@ class CSV extends CSVImporter
|
|||
|
||||
$name = 'immagine_'.$articolo->id.'.'.Upload::getExtensionFromMimeType($file_content);
|
||||
|
||||
$upload = Uploads::upload($file_content, [
|
||||
$upload = \Uploads::upload($file_content, [
|
||||
'name' => 'Immagine',
|
||||
'category' => 'Immagini',
|
||||
'original_name' => $name,
|
||||
'id_module' => Modules::get('Articoli')['id'],
|
||||
'id_module' => \Modules::get('Articoli')['id'],
|
||||
'id_record' => $articolo->id,
|
||||
], [
|
||||
'thumbnails' => true,
|
||||
|
|
|
@ -149,7 +149,6 @@ class Movimento extends Model
|
|||
/**
|
||||
* Restituisce una descrizione standard applicabile a un movimento sulla base della relativa quantità e alla direzione.
|
||||
*
|
||||
* @param $qta
|
||||
* @param string $direzione
|
||||
*
|
||||
* @return string
|
||||
|
|
|
@ -57,7 +57,7 @@ unset($_SESSION['superselect']['idautomezzo']);
|
|||
|
||||
<?php
|
||||
include $docroot.'/modules/automezzi/row-list-tecnici.php';
|
||||
?>
|
||||
?>
|
||||
</form>
|
||||
|
||||
<a href="javascript:;" class="btn btn-sm btn-success pull-right" title="Aggiorna date" onclick="$('#updatetech-form input[name=op]').val('savetech'); $('#updatetech-form').submit();"><i class="fa fa-edit"></i> <?php echo tr('Salva date'); ?></a>
|
||||
|
@ -89,7 +89,7 @@ unset($_SESSION['superselect']['idautomezzo']);
|
|||
<div class="col-md-12">
|
||||
<?php
|
||||
include $docroot.'/modules/automezzi/row-list-articoli.php';
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="pull-left">
|
||||
<a class="btn btn-sm btn-primary" data-href="<?php echo $rootdir; ?>/modules/automezzi/add_articolo.php?idautomezzo=<?php echo $id_record; ?>" data-toggle="modal" data-title="Aggiungi articoli"><i class="fa fa-plus"></i> <?php echo tr('Articolo magazzino'); ?></a><br>
|
||||
|
|
|
@ -63,7 +63,7 @@ switch (filter('op')) {
|
|||
} else {
|
||||
flash()->error(tr('Errore durante la creazione del backup!').' '.str_replace('_DIR_', '"'.$backup_dir.'"', tr('Verifica che la cartella _DIR_ abbia i permessi di scrittura!')));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
flash()->error(tr('Errore durante la creazione del backup!').' '.$e->getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ class BackupTask extends Manager
|
|||
{
|
||||
public function needsExecution()
|
||||
{
|
||||
return setting('Backup automatico') && !Backup::isDailyComplete();
|
||||
return setting('Backup automatico') && !\Backup::isDailyComplete();
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
if (setting('Backup automatico') && !Backup::isDailyComplete()) {
|
||||
Backup::daily();
|
||||
if (setting('Backup automatico') && !\Backup::isDailyComplete()) {
|
||||
\Backup::daily();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Modules\Banche;
|
||||
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Format:
|
||||
* b = National bank code (Codice ABI)
|
||||
|
@ -418,7 +416,7 @@ class IBAN
|
|||
$matches = array_filter($matches, 'is_string', ARRAY_FILTER_USE_KEY);
|
||||
foreach ($matches as $key => $value) {
|
||||
if (!isset($value[0])) {
|
||||
throw new UnexpectedValueException('Invalid '.$key.' for format '.$regex);
|
||||
throw new \UnexpectedValueException('Invalid '.$key.' for format '.$regex);
|
||||
}
|
||||
|
||||
$this->{$key} = $value[0];
|
||||
|
|
|
@ -44,7 +44,7 @@ switch (filter('op')) {
|
|||
if ($id_original != null) {
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -90,7 +90,7 @@ switch (filter('op')) {
|
|||
// Redirect alla categoria se si sta aggiungendo una sottocategoria
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -66,7 +66,7 @@ if (isset($id_record)) {
|
|||
?>
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> <?php echo tr('Aggiungi'); ?></button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -48,7 +48,7 @@ switch (filter('op')) {
|
|||
if ($id_original != null) {
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -94,7 +94,7 @@ switch (filter('op')) {
|
|||
// Redirect alla categoria se si sta aggiungendo una sottocategoria
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -66,7 +66,7 @@ if (isset($id_record)) {
|
|||
?>
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> <?php echo tr('Aggiungi'); ?></button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -42,7 +42,7 @@ if ($main_check) {
|
|||
'required' => 1,
|
||||
'value' => htmlentities($record->content),
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ if (!function_exists('renderChecklist')) {
|
|||
global $structure;
|
||||
|
||||
$user = auth()->getUser();
|
||||
$enabled = $check->assignedUsers ? ($check->assignedUsers->pluck('id')->search($user->id) !== false || ($user->idgruppo) == 1) : true;
|
||||
$enabled = $check->assignedUsers ? ($check->assignedUsers->pluck('id')->search($user->id) !== false || $user->idgruppo == 1) : true;
|
||||
|
||||
$margin = ($level * 20);
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-6">';
|
||||
if (!empty($record['id_categoria'])) {
|
||||
if (!empty($record['id_categoria'])) {
|
||||
echo '
|
||||
'.Modules::link('Categorie articoli', $record['id_categoria'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Categoria').'", "name": "id_categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|'.Modules::get('Categorie articoli')['id'].'" ]}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Combinazione extends Model
|
|||
protected static $campi_varianti = [
|
||||
'id_categoria',
|
||||
'id_sottocategoria',
|
||||
//'descrizione',
|
||||
// 'descrizione',
|
||||
'um',
|
||||
'gg_garanzia',
|
||||
'servizio',
|
||||
|
@ -76,8 +76,6 @@ class Combinazione extends Model
|
|||
|
||||
/**
|
||||
* Metodo per generare dinamicamente una variante dell'articolo per la combinazione corrente.
|
||||
*
|
||||
* @param $valori_attributi
|
||||
*/
|
||||
public function generaVariante($valori_attributi, $id_articolo = null)
|
||||
{
|
||||
|
@ -190,8 +188,6 @@ class Combinazione extends Model
|
|||
|
||||
/**
|
||||
* Funzione per sincronizzare i campi condivisi dagli Articoli di tipo Variante.
|
||||
*
|
||||
* @param $values
|
||||
*/
|
||||
protected function sincronizzaCampi($values)
|
||||
{
|
||||
|
|
|
@ -478,7 +478,7 @@ switch (post('op')) {
|
|||
$id_documento = post('id_documento');
|
||||
|
||||
// Individuazione del documento originale
|
||||
if (!is_subclass_of($class, \Common\Document::class)) {
|
||||
if (!is_subclass_of($class, Common\Document::class)) {
|
||||
return;
|
||||
}
|
||||
$documento = $class::find($id_documento);
|
||||
|
@ -637,7 +637,7 @@ switch (post('op')) {
|
|||
$numero_totale = 0;
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
if (($riga['id']) != null) {
|
||||
if ($riga['id'] != null) {
|
||||
$articolo = Articolo::find($riga['id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ switch (post('op')) {
|
|||
if ($qta > 0) {
|
||||
$copia = $riga->copiaIn($fattura, $qta);
|
||||
|
||||
//Fix per idconto righe fattura
|
||||
// Fix per idconto righe fattura
|
||||
$articolo = ArticoloOriginale::find($copia->idarticolo);
|
||||
$copia->id_conto = ($articolo->idconto_vendita ? $articolo->idconto_vendita : $idconto);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ if (strtotime($record['data_conclusione']) < strtotime($record['data_accettazion
|
|||
<div class="col-md-3">
|
||||
<?php
|
||||
echo Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
?>
|
||||
?>
|
||||
|
||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "id": "idanagrafica_c", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti" ]}
|
||||
</div>
|
||||
|
@ -83,9 +83,9 @@ if (strtotime($record['data_conclusione']) < strtotime($record['data_accettazion
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">';
|
||||
if ($record['idagente'] != 0) {
|
||||
if ($record['idagente'] != 0) {
|
||||
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
|
||||
}
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
|
||||
</div>
|
||||
|
@ -142,7 +142,7 @@ echo '
|
|||
'name' => 'condizioni_fornitura',
|
||||
'value' => $record['condizioni_fornitura'],
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -167,7 +167,7 @@ echo '
|
|||
} else {
|
||||
$collapsed = ' collapsed-box';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<!-- Fatturazione Elettronica PA-->
|
||||
|
||||
|
@ -271,7 +271,7 @@ echo '
|
|||
<button type="button" onclick="$(this).next().toggleClass(\'hide\');" class="btn btn-info btn-sm"><i class="fa fa-th-list"></i> '.tr('Mostra tipi di attività non modificati').'</button>
|
||||
<div class="hide">';
|
||||
|
||||
//Loop fra i tipi di attività e i relativi costi del tipo intervento (quelli a 0)
|
||||
// Loop fra i tipi di attività e i relativi costi del tipo intervento (quelli a 0)
|
||||
$rs = $dbo->fetchArray('SELECT * FROM co_contratti_tipiintervento INNER JOIN in_tipiintervento ON in_tipiintervento.idtipointervento = co_contratti_tipiintervento.idtipointervento WHERE co_contratti_tipiintervento.idtipointervento NOT IN('.implode(',', $idtipiintervento).') AND idcontratto='.prepare($id_record).' ORDER BY descrizione');
|
||||
|
||||
if (!empty($rs)) {
|
||||
|
@ -316,7 +316,7 @@ if (!empty($rs)) {
|
|||
echo '
|
||||
</table>';
|
||||
}
|
||||
echo '
|
||||
echo '
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -281,42 +281,42 @@ echo '
|
|||
</big>
|
||||
<br><br>';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="row">
|
||||
<big class="col-md-4 col-md-offset-4 text-center">
|
||||
<table class="table text-left table-striped table-bordered">';
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore a contratto').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore_contratto).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore erogate totali').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore).'</td>
|
||||
</tr>';
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore residue totali').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore)).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore erogate concluse').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale($totale_ore_completate).'</td>
|
||||
</tr>';
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
if (!empty($totale_ore_contratto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Ore residue concluse').':</td>
|
||||
<td class="text-right">'.Translator::numberToLocale(floatval($totale_ore_contratto) - floatval($totale_ore_completate)).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</big>
|
||||
</div>';
|
||||
|
@ -327,7 +327,7 @@ if (empty($totale_ore_contratto)) {
|
|||
<p>'.tr('Per monitorare il consumo ore, inserisci almeno una riga con unità di misura "ore"').'.</p>
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<table class="table text-left table-striped table-bordered">
|
||||
|
@ -339,8 +339,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<th width="10%">'.tr('Margine').'</th>
|
||||
<th width="10%">'.tr('Ricarico').'</th>
|
||||
</tr>';
|
||||
ksort($tipologie);
|
||||
foreach ($tipologie as $key => $tipologia) {
|
||||
ksort($tipologie);
|
||||
foreach ($tipologie as $key => $tipologia) {
|
||||
$margine = $tipologia['ricavo'] - $tipologia['costo'];
|
||||
if ($tipologia['ricavo']) {
|
||||
$margine_prc = (int) (1 - ($tipologia['costo'] / $tipologia['ricavo'])) * 100;
|
||||
|
@ -356,8 +356,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$ricarico_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -372,8 +372,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<th width="10%">'.tr('Margine').'</th>
|
||||
<th width="10%">'.tr('Ricarico').'</th>
|
||||
</tr>';
|
||||
ksort($tecnici);
|
||||
foreach ($tecnici as $key => $tecnico) {
|
||||
ksort($tecnici);
|
||||
foreach ($tecnici as $key => $tecnico) {
|
||||
$margine = $tecnico['ricavo'] - $tecnico['costo'];
|
||||
if ($tecnico['ricavo']) {
|
||||
$margine_prc = (int) (1 - ($tecnico['costo'] / $tecnico['ricavo'])) * 100;
|
||||
|
@ -389,8 +389,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$ricarico_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -406,8 +406,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<th width="10%">'.tr('Margine').'</th>
|
||||
<th width="10%">'.tr('Ricarico').'</th>
|
||||
</tr>';
|
||||
ksort($stati_intervento);
|
||||
foreach ($stati_intervento as $key => $stato) {
|
||||
ksort($stati_intervento);
|
||||
foreach ($stati_intervento as $key => $stato) {
|
||||
$margine = $stato['ricavo'] - $stato['costo'];
|
||||
if ($stato['ricavo']) {
|
||||
$margine_prc = (int) (1 - ($stato['costo'] / $stato['ricavo'])) * 100;
|
||||
|
@ -422,8 +422,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$ricarico_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -437,8 +437,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<th width="10%">'.tr('Margine').'</th>
|
||||
<th width="10%">'.tr('Ricarico').'</th>
|
||||
</tr>';
|
||||
ksort($materiali_art);
|
||||
foreach ($materiali_art as $key => $materiali_array1) {
|
||||
ksort($materiali_art);
|
||||
foreach ($materiali_art as $key => $materiali_array1) {
|
||||
foreach ($materiali_array1 as $materiali_array2) {
|
||||
foreach ($materiali_array2 as $materiale) {
|
||||
$margine = $materiale['ricavo'] - $materiale['costo'];
|
||||
|
@ -455,10 +455,10 @@ if (empty($totale_ore_contratto)) {
|
|||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($materiali_righe);
|
||||
foreach ($materiali_righe as $key => $materiale) {
|
||||
ksort($materiali_righe);
|
||||
foreach ($materiali_righe as $key => $materiale) {
|
||||
$margine = $materiale['ricavo'] - $materiale['costo'];
|
||||
$margine_prc = (int) (1 - ($materiale['costo'] / $materiale['ricavo'])) * 100;
|
||||
$ricarico_prc = ($materiale['ricavo'] && $materiale['costo']) ? (int) ((($materiale['ricavo'] / $materiale['costo']) - 1) * 100) : 100;
|
||||
|
@ -471,8 +471,8 @@ if (empty($totale_ore_contratto)) {
|
|||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$margine_prc.'%)</td>
|
||||
<td class="text-right '.($margine > 0 ? 'bg-success' : 'bg-danger').'">'.Translator::numberToLocale($margine).' € ('.$ricarico_prc.'%)</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -30,11 +30,11 @@ echo '
|
|||
<thead>
|
||||
<tr>
|
||||
<th width="5" class="text-center">';
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
echo '
|
||||
<input id="check_all" type="checkbox"/>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</th>
|
||||
<th width="35" class="text-center">'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
|
|
|
@ -49,7 +49,7 @@ include_once __DIR__.'/../../core.php';
|
|||
'required' => 1,
|
||||
'value' => '{[ "type": "text", "label": "|label|", "name": "|name|", "value": "|value|" ]}',
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ include_once __DIR__.'/../../core.php';
|
|||
'name' => 'content',
|
||||
'value' => $record['content'],
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -121,7 +121,7 @@ switch (filter('op')) {
|
|||
}
|
||||
|
||||
if (setting('Visualizza informazioni aggiuntive sul calendario')) {
|
||||
//# Box allDay preventivi
|
||||
// # Box allDay preventivi
|
||||
$query = 'SELECT
|
||||
co_preventivi.id,
|
||||
co_preventivi.nome,
|
||||
|
@ -151,9 +151,9 @@ switch (filter('op')) {
|
|||
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||
'idintervento' => $preventivo['id'],
|
||||
'idtecnico' => '',
|
||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Accettazione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div><b>'.tr('Accettazione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'start' => $preventivo['data_accettazione'],
|
||||
//'end' => $preventivo['data_accettazione'],
|
||||
// 'end' => $preventivo['data_accettazione'],
|
||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'backgroundColor' => '#ff7f50',
|
||||
'textColor' => color_inverse('#ff7f50'),
|
||||
|
@ -169,9 +169,9 @@ switch (filter('op')) {
|
|||
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||
'idintervento' => $preventivo['id'],
|
||||
'idtecnico' => '',
|
||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Conclusione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div><b>'.tr('Conclusione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'start' => $preventivo['data_conclusione'],
|
||||
//'end' => $preventivo['data_conclusione'],
|
||||
// 'end' => $preventivo['data_conclusione'],
|
||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'backgroundColor' => '#ff7f50',
|
||||
'textColor' => color_inverse('#ff7f50'),
|
||||
|
@ -184,7 +184,7 @@ switch (filter('op')) {
|
|||
}
|
||||
}
|
||||
|
||||
//# Box allDay eventi (escluse festività)
|
||||
// # Box allDay eventi (escluse festività)
|
||||
$query = 'SELECT
|
||||
*
|
||||
FROM
|
||||
|
@ -197,7 +197,7 @@ switch (filter('op')) {
|
|||
OR
|
||||
(`zz_events`.`is_recurring` = 0 AND `zz_events`.`data` >= '.prepare($start).' AND `zz_events`.`data` <= '.prepare($end).')';
|
||||
|
||||
//echo $query;
|
||||
// echo $query;
|
||||
|
||||
$eventi = $dbo->fetchArray($query);
|
||||
|
||||
|
@ -206,7 +206,7 @@ switch (filter('op')) {
|
|||
'id' => $modulo_eventi->id.'_'.$evento['id'],
|
||||
'title' => '<b>'.tr('Evento').':</b> '.$evento['nome'].'</b>',
|
||||
'start' => ($evento['is_recurring'] ? date('Y-', strtotime($start)).date('m-d', strtotime($evento['data'])) : $evento['data']),
|
||||
//'end' => $evento['data'],
|
||||
// 'end' => $evento['data'],
|
||||
'extendedProps' => [
|
||||
'link' => base_path().'/editor.php?id_module='.$modulo_eventi->id.'&id_record='.$evento['id'],
|
||||
'idintervento' => $evento['id'],
|
||||
|
@ -276,7 +276,7 @@ switch (filter('op')) {
|
|||
$query = 'SELECT *, in_interventi.codice, an_anagrafiche.note AS note_anagrafica, idstatointervento AS parent_idstato, in_interventi.idtipointervento AS parent_idtipo, (SELECT GROUP_CONCAT(CONCAT(matricola, " - ", nome) SEPARATOR ", ") FROM my_impianti INNER JOIN my_impianti_interventi ON my_impianti.id=my_impianti_interventi.idimpianto WHERE my_impianti_interventi.idintervento='.prepare($id).' GROUP BY my_impianti_interventi.idintervento) AS impianti, (SELECT descrizione FROM in_statiintervento WHERE idstatointervento=parent_idstato) AS stato, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=parent_idtipo) AS tipo, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica=in_interventi.idanagrafica) AS idzona FROM in_interventi LEFT JOIN in_interventi_tecnici ON in_interventi.id =in_interventi_tecnici.idintervento LEFT JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.id='.prepare($id).' '.Modules::getAdditionalsQuery('Interventi', null, false);
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
//correggo info indirizzo citta cap provincia con quelle della sede di destinazione
|
||||
// correggo info indirizzo citta cap provincia con quelle della sede di destinazione
|
||||
if (!empty($rs[0]['idsede_destinazione'])) {
|
||||
$sede = $database->fetchOne('SELECT * FROM an_sedi WHERE id = '.prepare($rs[0]['idsede_destinazione']));
|
||||
$rs[0]['indirizzo'] = $sede['nomesede'].'<br>'.$sede['indirizzo'];
|
||||
|
@ -483,7 +483,7 @@ switch (filter('op')) {
|
|||
$start = filter('start');
|
||||
$end = filter('end');
|
||||
|
||||
//TODO: Problema con anni bisestili Es. 2024-02-29 e 2023-03-01 sono entrambi il 60 esimo giorno dell'anno.
|
||||
// TODO: Problema con anni bisestili Es. 2024-02-29 e 2023-03-01 sono entrambi il 60 esimo giorno dell'anno.
|
||||
$query = 'SELECT *, DAYOFYEAR(`zz_events`.`data`) AS d, DAYOFYEAR('.prepare($start).') AS st, DAYOFYEAR('.prepare($end).') AS fi FROM `zz_events`
|
||||
WHERE `zz_events`.`is_bank_holiday` = 1
|
||||
AND
|
||||
|
@ -500,7 +500,7 @@ switch (filter('op')) {
|
|||
'id' => $evento['id'],
|
||||
'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')),
|
||||
// 'end' => date('Y-m-d', strtotime($evento['data']. '+1 day')),
|
||||
'display' => 'background',
|
||||
'allDay' => true,
|
||||
'overlap' => true,
|
||||
|
|
|
@ -282,7 +282,7 @@ switch (filter('op')) {
|
|||
$id_documento = post('id_documento');
|
||||
|
||||
// Individuazione del documento originale
|
||||
if (!is_subclass_of($class, \Common\Document::class)) {
|
||||
if (!is_subclass_of($class, Common\Document::class)) {
|
||||
return;
|
||||
}
|
||||
$documento = $class::find($id_documento);
|
||||
|
@ -653,7 +653,7 @@ switch (filter('op')) {
|
|||
$numero_totale = 0;
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
if (($riga['id']) != null) {
|
||||
if ($riga['id'] != null) {
|
||||
$articolo = Articolo::find($riga['id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ foreach ($fields as $name => $value) {
|
|||
$query .= ' OR '.$value.' LIKE "%'.$term.'%"';
|
||||
}
|
||||
|
||||
//$query .= Modules::getAdditionalsQuery('Interventi');
|
||||
// $query .= Modules::getAdditionalsQuery('Interventi');
|
||||
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ switch (post('op')) {
|
|||
if ($qta > 0) {
|
||||
$copia = $riga->copiaIn($fattura, $qta);
|
||||
|
||||
//Fix per idconto righe fattura
|
||||
// Fix per idconto righe fattura
|
||||
$articolo = ArticoloOriginale::find($copia->idarticolo);
|
||||
$copia->id_conto = ($articolo->idconto_vendita ? $articolo->idconto_vendita : $idconto);
|
||||
|
||||
|
@ -190,7 +190,7 @@ $operations['crea_fattura'] = [
|
|||
],
|
||||
];
|
||||
|
||||
$operations['cambia_stato'] = [
|
||||
$operations['cambia_stato'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Cambia stato'),
|
||||
'data' => [
|
||||
'title' => tr('Vuoi davvero cambiare lo stato per questi DDT?'),
|
||||
|
@ -200,6 +200,6 @@ $operations['crea_fattura'] = [
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
return $operations;
|
||||
|
|
|
@ -91,7 +91,7 @@ if ($dir == 'entrata') {
|
|||
{[ "type": "span", "label": "'.tr('Numero ddt').'", "class": "text-center", "value": "$numero$" ]}
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Numero secondario'); ?>", "name": "numero_esterno", "class": "text-center", "value": "$numero_esterno$" ]}
|
||||
|
@ -118,7 +118,7 @@ if ($dir == 'entrata') {
|
|||
{[ "type": "select", "label": "<?php echo tr('Stato'); ?>", "name": "idstatoddt", "required": 1, "values": "query=SELECT *, colore AS _bgcolor_ FROM dt_statiddt ORDER BY descrizione", "value": "$idstatoddt$", "class": "unblockable" ]}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ($dir == 'entrata') {
|
||||
|
@ -131,7 +131,7 @@ if ($dir == 'entrata') {
|
|||
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
@ -142,18 +142,18 @@ if ($dir == 'entrata') {
|
|||
<?php
|
||||
echo '
|
||||
<div class="col-md-6">';
|
||||
if (!empty($record['idreferente'])) {
|
||||
if (!empty($record['idreferente'])) {
|
||||
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'} ]}
|
||||
</div>';
|
||||
|
||||
// Conteggio numero articoli ddt in uscita
|
||||
$articolo = $dbo->fetchArray('SELECT mg_articoli.id FROM ((mg_articoli INNER JOIN dt_righe_ddt ON mg_articoli.id=dt_righe_ddt.idarticolo) INNER JOIN dt_ddt ON dt_ddt.id=dt_righe_ddt.idddt) WHERE dt_ddt.id='.prepare($id_record));
|
||||
$id_modulo_anagrafiche = Modules::get('Anagrafiche')['id'];
|
||||
$id_plugin_sedi = Plugins::get('Sedi')['id'];
|
||||
if ($dir == 'entrata') {
|
||||
// Conteggio numero articoli ddt in uscita
|
||||
$articolo = $dbo->fetchArray('SELECT mg_articoli.id FROM ((mg_articoli INNER JOIN dt_righe_ddt ON mg_articoli.id=dt_righe_ddt.idarticolo) INNER JOIN dt_ddt ON dt_ddt.id=dt_righe_ddt.idddt) WHERE dt_ddt.id='.prepare($id_record));
|
||||
$id_modulo_anagrafiche = Modules::get('Anagrafiche')['id'];
|
||||
$id_plugin_sedi = Plugins::get('Sedi')['id'];
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "help": "'.tr("Sedi di partenza dell'azienda").'" ]}
|
||||
|
@ -162,7 +162,7 @@ if ($dir == 'entrata') {
|
|||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Destinazione merce').'", "name": "idsede_destinazione", "ajax-source": "sedi", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idsede_destinazione$", "help": "'.tr('Sedi del destinatario').'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.$id_plugin_sedi.'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
} else {
|
||||
} else {
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idsede_partenza$", "help": "'.tr('Sedi del mittente').'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.$id_plugin_sedi.'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
|
@ -171,8 +171,8 @@ if ($dir == 'entrata') {
|
|||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Destinazione merce').'", "name": "idsede_destinazione", "ajax-source": "sedi_azienda", "value": "$idsede_destinazione$", "help": "'.tr("Sedi di arrivo dell'azienda").'" ]}
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -181,18 +181,18 @@ if ($dir == 'entrata') {
|
|||
<div class="col-md-4">
|
||||
<?php
|
||||
$sede_anagrafica = $ddt->anagrafica->sedeLegale;
|
||||
$id_sede_anagrafica = $dir == 'entrata' ? $ddt->idsede_destinazione : $ddt->idsede_partenza;
|
||||
if (!empty($id_sede_anagrafica)) {
|
||||
$id_sede_anagrafica = $dir == 'entrata' ? $ddt->idsede_destinazione : $ddt->idsede_partenza;
|
||||
if (!empty($id_sede_anagrafica)) {
|
||||
$sede_anagrafica = Sede::find($id_sede_anagrafica);
|
||||
}
|
||||
}
|
||||
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$sede_azienda = $anagrafica_azienda->sedeLegale;
|
||||
$id_sede_azienda = $dir == 'entrata' ? $ddt->idsede_partenza : $ddt->idsede_destinazione;
|
||||
if (!empty($id_sede_azienda)) {
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$sede_azienda = $anagrafica_azienda->sedeLegale;
|
||||
$id_sede_azienda = $dir == 'entrata' ? $ddt->idsede_partenza : $ddt->idsede_destinazione;
|
||||
if (!empty($id_sede_azienda)) {
|
||||
$sede_azienda = Sede::find($id_sede_azienda);
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- GEOLOCALIZZAZIONE -->
|
||||
<div class="panel panel-primary">
|
||||
|
@ -319,7 +319,7 @@ if ($dir == 'entrata') {
|
|||
map.setView([lat, lng], 10);
|
||||
}
|
||||
</script>';
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -340,7 +340,7 @@ if ($dir == 'entrata') {
|
|||
if (!empty($record['idcausalet'])) {
|
||||
echo Modules::link('Causali', $record['idcausalet'], null, null, 'class="pull-right"');
|
||||
}
|
||||
?>
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Causale trasporto'); ?>", "name": "idcausalet", "required": 1, "value": "$idcausalet$", "ajax-source": "causali", "icon-after": "add|<?php echo Modules::get('Causali')['id']; ?>|||<?php echo $block_edit ? 'disabled' : ''; ?>", "help": "<?php echo tr('Definisce la causale del trasporto'); ?>" ]}
|
||||
</div>
|
||||
|
||||
|
@ -370,7 +370,7 @@ if ($dir == 'entrata') {
|
|||
$esterno = $dbo->selectOne('dt_spedizione', 'esterno', [
|
||||
'id' => $record['idspedizione'],
|
||||
])['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>
|
||||
|
||||
|
@ -441,7 +441,7 @@ if ($dir == 'entrata') {
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "number", "label": "'.('Sconto in fattura').'", "name": "sconto_finale", "value": "'.($ddt->sconto_finale_percentuale ?: $ddt->sconto_finale).'", "icon-after": "choice|untprc|'.(empty($ddt->sconto_finale) ? 'PRC' : 'UNT').'", "help": "'.tr('Sconto in fattura, utilizzabile per applicare sconti sul netto a pagare del documento').'." ]}
|
||||
{[ "type": "number", "label": "Sconto in fattura", "name": "sconto_finale", "value": "'.($ddt->sconto_finale_percentuale ?: $ddt->sconto_finale).'", "icon-after": "choice|untprc|'.(empty($ddt->sconto_finale) ? 'PRC' : 'UNT').'", "help": "'.tr('Sconto in fattura, utilizzabile per applicare sconti sul netto a pagare del documento').'." ]}
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ if ($dir == 'entrata') {
|
|||
} else {
|
||||
$collapsed = ' collapsed-box';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<!-- Fatturazione Elettronica PA-->
|
||||
|
||||
|
|
|
@ -30,19 +30,19 @@ echo '
|
|||
<thead>
|
||||
<tr>
|
||||
<th width="5" class="text-center">';
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
echo '
|
||||
<input id="check_all" type="checkbox"/>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</th>
|
||||
<th width="35" class="text-center">'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center tip" width="150">'.tr('Q.tà').'</th>';
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '<th class="text-center" width="150">'.tr('Costo unitario').'</th>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
<th class="text-center" width="180">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center" width="140">'.tr('Sconto unitario').'</th>
|
||||
<th class="text-center" width="130">'.tr('Importo').'</th>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
namespace Modules\DDT;
|
||||
|
||||
use Auth;
|
||||
use Common\Components\Component;
|
||||
use Common\Document;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
|
@ -59,7 +58,7 @@ class DDT extends Document
|
|||
{
|
||||
$model = new static();
|
||||
|
||||
$user = Auth::user();
|
||||
$user = \Auth::user();
|
||||
|
||||
$stato_documento = Stato::where('descrizione', 'Bozza')->first();
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ echo '
|
|||
'name' => 'body',
|
||||
'value' => $record['body'],
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,6 +24,6 @@ include_once __DIR__.'/../../core.php';
|
|||
if (isset($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT * FROM em_templates WHERE id='.prepare($id_record).' AND deleted_at IS NULL');
|
||||
|
||||
//Controllo se ci sono newletter collegate a questo template
|
||||
// Controllo se ci sono newletter collegate a questo template
|
||||
$newsletters = Newsletter::where('id_template', $id_record)->get();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class Mail extends Model
|
|||
|
||||
protected $table = 'em_emails';
|
||||
|
||||
protected $options = null;
|
||||
protected $options;
|
||||
|
||||
public static function build(User $user, $template = null, $id_record = null, $account = null)
|
||||
{
|
||||
|
@ -75,7 +75,6 @@ class Mail extends Model
|
|||
/**
|
||||
* Aggiunge una stampa alla notifica.
|
||||
*
|
||||
* @param string|int $print
|
||||
* @param string $name
|
||||
*/
|
||||
public function addPrint($print_id, $name = null)
|
||||
|
|
|
@ -19,7 +19,7 @@ class Microsoft extends Azure implements ProviderInterface
|
|||
'scope' => [
|
||||
'offline_access',
|
||||
'https://outlook.office.com/SMTP.Send',
|
||||
//'https://outlook.office.com/IMAP.AccessAsUser.All'
|
||||
// 'https://outlook.office.com/IMAP.AccessAsUser.All'
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
//$block_edit = $record['is_predefined'];
|
||||
// $block_edit = $record['is_predefined'];
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
//$block_edit = $record['is_predefined'];
|
||||
// $block_edit = $record['is_predefined'];
|
||||
|
||||
?>
|
||||
|
||||
|
@ -76,11 +76,11 @@ include_once __DIR__.'/../../core.php';
|
|||
<?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) {
|
||||
}
|
||||
$numero_data = 1;
|
||||
foreach ($results as $result) {
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
|
|
|
@ -48,7 +48,7 @@ $stato_fe = $dbo->fetchOne('SELECT codice_stato_fe FROM co_documenti WHERE id =
|
|||
$ops = ['update', 'add_intervento', 'manage_documento_fe', 'manage_riga_fe', 'manage_articolo', 'manage_sconto', 'manage_riga', 'manage_descrizione', 'unlink_intervento', 'delete_riga', 'copy_riga', 'add_serial', 'add_articolo', 'edit-price'];
|
||||
|
||||
if ($dir === 'entrata' && in_array($stato_fe['codice_stato_fe'], ['WAIT', 'RC', 'MC', 'QUEUE', 'DT', 'EC01', 'NE']) && Interaction::isEnabled() && in_array($op, $ops)) {
|
||||
//Permetto sempre la modifica delle note aggiuntive e/o della data di competenza della fattura di vendita
|
||||
// Permetto sempre la modifica delle note aggiuntive e/o della data di competenza della fattura di vendita
|
||||
if ($op == 'update' && ($fattura->note_aggiuntive != post('note_aggiuntive') || $fattura->data_competenza != post('data_competenza'))) {
|
||||
if ($fattura->note_aggiuntive != post('note_aggiuntive')) {
|
||||
$fattura->note_aggiuntive = post('note_aggiuntive');
|
||||
|
@ -111,7 +111,7 @@ switch ($op) {
|
|||
WHERE
|
||||
co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment);
|
||||
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->descrizione == 'Emessa') && (Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax']))) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->descrizione == 'Emessa') && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
$fattura->data = $data_fattura_precedente['datamax'];
|
||||
$fattura->data_competenza = $data_fattura_precedente['datamax'];
|
||||
flash()->info(tr('Data di emissione aggiornata, come da impostazione!'));
|
||||
|
@ -733,7 +733,7 @@ switch ($op) {
|
|||
$id_documento = post('id_documento');
|
||||
|
||||
// Individuazione del documento originale
|
||||
if (!is_subclass_of($class, \Common\Document::class)) {
|
||||
if (!is_subclass_of($class, Common\Document::class)) {
|
||||
return;
|
||||
}
|
||||
$documento = $class::find($id_documento);
|
||||
|
@ -1066,7 +1066,7 @@ switch ($op) {
|
|||
$numero_totale = 0;
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
if (($riga['id']) != null) {
|
||||
if ($riga['id'] != null) {
|
||||
$articolo = Articolo::find($riga['id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
} else {
|
||||
$size = 6;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="col-md-<?php echo $size; ?>">
|
||||
{[ "type": "date", "label": "<?php echo tr('Data'); ?>", "name": "data", "required": 1, "value": "-now-" ]}
|
||||
|
@ -79,7 +79,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
</div>
|
||||
|
||||
<?php
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div id="info" class="hidden">
|
||||
<div class="row">
|
||||
|
@ -128,8 +128,8 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
|||
'.tr('Seleziona prima un cliente').'...
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
|
|
|
@ -78,7 +78,7 @@ $rs = $dbo->fetchArray('SELECT
|
|||
AND in_interventi.id NOT IN (SELECT idintervento FROM co_righe_documenti WHERE idintervento IS NOT NULL)
|
||||
AND NOT in_interventi.id IN (SELECT idintervento FROM co_promemoria WHERE idintervento IS NOT NULL) '.$where);
|
||||
foreach ($rs as $key => $value) {
|
||||
$intervento = \Modules\Interventi\Intervento::find($value['id']);
|
||||
$intervento = Modules\Interventi\Intervento::find($value['id']);
|
||||
$prezzo = $intervento->totale;
|
||||
|
||||
$rs[$key]['prezzo'] = Translator::numberToLocale($prezzo);
|
||||
|
|
|
@ -41,7 +41,7 @@ foreach ($fields as $name => $value) {
|
|||
$query .= ' OR '.$value.' LIKE "%'.$term.'%"';
|
||||
}
|
||||
|
||||
//$query .= Modules::getAdditionalsQuery('Interventi');
|
||||
// $query .= Modules::getAdditionalsQuery('Interventi');
|
||||
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ switch (post('op')) {
|
|||
|
||||
if ($result) {
|
||||
++$added;
|
||||
//operationLog('export-xml-bulk', ['id_record' => $r['id']]);
|
||||
// operationLog('export-xml-bulk', ['id_record' => $r['id']]);
|
||||
} else {
|
||||
$failed[] = $fattura->numero_esterno;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ switch (post('op')) {
|
|||
|
||||
if ($result) {
|
||||
++$added;
|
||||
//operationLog('export-xml-bulk', ['id_record' => $r['id']]);
|
||||
// operationLog('export-xml-bulk', ['id_record' => $r['id']]);
|
||||
} else {
|
||||
$failed[] = $fattura->numero_esterno;
|
||||
}
|
||||
|
@ -314,22 +314,22 @@ switch (post('op')) {
|
|||
$id_segment = (post('id_segment') ? post('id_segment') : $fattura->id_segment);
|
||||
$dir = $dbo->fetchOne('SELECT dir FROM co_tipidocumento WHERE id='.prepare($fattura->idtipodocumento))['dir'];
|
||||
|
||||
//+ 1 giorno
|
||||
// + 1 giorno
|
||||
if (post('skip_time') == 'Giorno') {
|
||||
$data = date('Y-m-d', strtotime('+1 day', strtotime($fattura->data)));
|
||||
}
|
||||
|
||||
//+ 1 settimana
|
||||
// + 1 settimana
|
||||
if (post('skip_time') == 'Settimana') {
|
||||
$data = date('Y-m-d', strtotime('+1 week', strtotime($fattura->data)));
|
||||
}
|
||||
|
||||
//+ 1 mese
|
||||
// + 1 mese
|
||||
if (post('skip_time') == 'Mese') {
|
||||
$data = date('Y-m-d', strtotime('+1 month', strtotime($fattura->data)));
|
||||
}
|
||||
|
||||
//+ 1 anno
|
||||
// + 1 anno
|
||||
if (post('skip_time') == 'Anno') {
|
||||
$data = date('Y-m-d', strtotime('+1 year', strtotime($fattura->data)));
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ switch (post('op')) {
|
|||
WHERE
|
||||
co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment);
|
||||
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && (Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax']))) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
$fattura->data = $data_fattura_precedente['datamax'];
|
||||
$fattura->data_competenza = $data_fattura_precedente['datamax'];
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ if (empty($record['is_fiscale'])) {
|
|||
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-" ]}';
|
||||
|
||||
echo '
|
||||
<button type="button" class="btn btn-warning ask" data-msg="'.tr('Vuoi trasformare questa fattura pro-forma in una di tipo fiscale?').'<br>'.prepareToField(\HTMLBuilder\HTMLBuilder::replace($msg)).'" data-op="transform" data-button="'.tr('Trasforma').'" data-class="btn btn-lg btn-warning" data-backto="record-edit">
|
||||
<button type="button" class="btn btn-warning ask" data-msg="'.tr('Vuoi trasformare questa fattura pro-forma in una di tipo fiscale?').'<br>'.prepareToField(HTMLBuilder\HTMLBuilder::replace($msg)).'" data-op="transform" data-button="'.tr('Trasforma').'" data-class="btn btn-lg btn-warning" data-backto="record-edit">
|
||||
<i class="fa fa-upload"></i> '.tr('Trasforma in fattura fiscale').'
|
||||
</button>';
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ if ($module->name == 'Fatture di vendita' && $services_enable) {
|
|||
}
|
||||
}
|
||||
}
|
||||
//Controllo già presente sul plugin Ricevute FE
|
||||
// Controllo già presente sul plugin Ricevute FE
|
||||
if (sizeof($documenti_scarto) > 0) {
|
||||
echo '
|
||||
<div class="alert alert-danger">
|
||||
|
|
|
@ -73,7 +73,7 @@ if ($dir == 'entrata' && !empty($fattura->dichiarazione)) {
|
|||
</div>';
|
||||
}
|
||||
} else {
|
||||
//TODO link ad impostazioni con nuova ricerca rapida
|
||||
// TODO link ad impostazioni con nuova ricerca rapida
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i> '.tr("Attenzione nessuna aliq. IVA definita per la dichiarazione d'intento. _SETTING_", [
|
||||
|
@ -131,7 +131,7 @@ if (!empty($note_accredito)) {
|
|||
]);
|
||||
|
||||
echo '
|
||||
<br>'.Modules::link(($dir == 'entrata' ? 'Fatture di vendita' : 'Fatture di acquisto'), $nota['id'], $text, $text);
|
||||
<br>'.Modules::link($dir == 'entrata' ? 'Fatture di vendita' : 'Fatture di acquisto', $nota['id'], $text, $text);
|
||||
}
|
||||
echo '
|
||||
</div>';
|
||||
|
@ -227,7 +227,7 @@ if ($dir == 'entrata') {
|
|||
$label = tr('Numero fattura');
|
||||
$size = 4;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="col-md-<?php echo $size; ?>">
|
||||
{[ "type": "text", "label": "<?php echo $label; ?>", "required": "<?php echo ($dir == 'uscita') ? 1 : 0; ?>", "name": "numero_esterno", "class": "text-center", "value": "$numero_esterno$", "help": "<?php echo (empty($record['numero_esterno']) and $dir == 'entrata') ? tr('Il numero della fattura sarà generato automaticamente in fase di emissione.') : ''; ?>" ]}
|
||||
|
@ -256,8 +256,8 @@ $query .= ' ORDER BY descrizione';
|
|||
?>
|
||||
<?php if ($dir == 'entrata') {
|
||||
$readonly = '"readonly":1,';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="col-md-2" <?php echo ($dir == 'entrata') ? 'hidden' : ''; ?>>
|
||||
{[ "type": "date", "label": "<?php echo tr('Data registrazione'); ?>", <?php echo $readonly; ?> "name": "data_registrazione", "value": "$data_registrazione$", "help": "<?php echo tr('Data in cui si è effettuata la registrazione della fattura in contabilità'); ?>" ]}
|
||||
|
@ -289,20 +289,20 @@ $query .= ' ORDER BY descrizione';
|
|||
<div class="col-md-4">
|
||||
'.Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "ajax-source": "clienti", "help": "<?php echo tr("In caso di autofattura indicare l'azienda: ").stripslashes($database->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')))['ragione_sociale']); ?>", "value": "$idanagrafica$" ]}
|
||||
<?php
|
||||
} else {
|
||||
} else {
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Fornitore'); ?>", "name": "idanagrafica", "required": 1, "ajax-source": "fornitori", "value": "$idanagrafica$" ]}
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>';
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-4">';
|
||||
if ($record['idagente'] != 0) {
|
||||
|
@ -311,25 +311,25 @@ $query .= ' ORDER BY descrizione';
|
|||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Agente di riferimento').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente_fattura$" ]}
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="col-md-4">';
|
||||
if (!empty($record['idreferente'])) {
|
||||
if (!empty($record['idreferente'])) {
|
||||
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'}, "icon-after": "add|'.Modules::get('Anagrafiche')['id'].'|id_plugin='.Plugins::get('Referenti')['id'].'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>
|
||||
<div class="row">';
|
||||
// Conteggio numero articoli fatture
|
||||
$articolo = $dbo->fetchArray('SELECT mg_articoli.id FROM ((mg_articoli INNER JOIN co_righe_documenti ON mg_articoli.id=co_righe_documenti.idarticolo) INNER JOIN co_documenti ON co_documenti.id=co_righe_documenti.iddocumento) WHERE co_documenti.id='.prepare($id_record));
|
||||
$id_modulo_anagrafiche = Modules::get('Anagrafiche')['id'];
|
||||
$id_plugin_sedi = Plugins::get('Sedi')['id'];
|
||||
if ($dir == 'entrata') {
|
||||
// Conteggio numero articoli fatture
|
||||
$articolo = $dbo->fetchArray('SELECT mg_articoli.id FROM ((mg_articoli INNER JOIN co_righe_documenti ON mg_articoli.id=co_righe_documenti.idarticolo) INNER JOIN co_documenti ON co_documenti.id=co_righe_documenti.iddocumento) WHERE co_documenti.id='.prepare($id_record));
|
||||
$id_modulo_anagrafiche = Modules::get('Anagrafiche')['id'];
|
||||
$id_plugin_sedi = Plugins::get('Sedi')['id'];
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "help": "'.tr("Sedi di partenza dell'azienda").'" ]}
|
||||
|
@ -338,7 +338,7 @@ $query .= ' ORDER BY descrizione';
|
|||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Destinazione merce').'", "name": "idsede_destinazione", "ajax-source": "sedi", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idsede_destinazione$", "help": "'.tr('Sedi del destinatario').'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.$id_plugin_sedi.'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
} else {
|
||||
} else {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idsede_partenza$", "help": "'.tr('Sedi del mittente').'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.$id_plugin_sedi.'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
|
@ -347,8 +347,8 @@ $query .= ' ORDER BY descrizione';
|
|||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Destinazione merce').'", "name": "idsede_destinazione", "ajax-source": "sedi_azienda", "value": "$idsede_destinazione$", "help": "'.tr("Sedi di arrivo dell'azienda").'" ]}
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
|
@ -371,20 +371,20 @@ $query .= ' ORDER BY descrizione';
|
|||
echo Modules::link('Banche', $record['id_banca_azienda'], null, null, 'class="pull-right"');
|
||||
}
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Banca accredito').'", "name": "id_banca_azienda", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "$id_banca_azienda$", "icon-after": "add|'.Modules::get('Banche')['id'].'|id_anagrafica='.$anagrafica_azienda->id.'", "extra": "'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Banca addebito').'", "name": "id_banca_controparte", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $record['idanagrafica']]).', "value": "$id_banca_controparte$", "icon-after": "add|'.Modules::get('Banche')['id'].'|idanagrafica='.$record['idanagrafica'].'", "extra": "'.(intval($block_edit) ? 'disabled' : '').'" ]}';
|
||||
} else {
|
||||
} else {
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Banca accredito').'", "name": "id_banca_controparte", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $record['idanagrafica']]).', "value": "$id_banca_controparte$", "icon-after": "add|'.Modules::get('Banche')['id'].'|idanagrafica='.$record['idanagrafica'].'", "extra": "'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Banca addebito').'", "name": "id_banca_azienda", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "$id_banca_azienda$", "icon-after": "add|'.Modules::get('Banche')['id'].'|id_anagrafica='.$anagrafica_azienda->id.'", "extra": "'.(intval($block_edit) ? 'disabled' : '').'" ]}';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -415,7 +415,7 @@ $query .= ' ORDER BY descrizione';
|
|||
</div>';
|
||||
}
|
||||
|
||||
if ($record['stato'] != 'Bozza' && $record['stato'] != 'Annullata') {
|
||||
if ($record['stato'] != 'Bozza' && $record['stato'] != 'Annullata') {
|
||||
$scadenze = $fattura->scadenze;
|
||||
|
||||
$ricalcola = true;
|
||||
|
@ -452,7 +452,7 @@ $query .= ' ORDER BY descrizione';
|
|||
<strike>';
|
||||
}
|
||||
|
||||
echo(empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
echo (empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
|
||||
if ($pagamento_iniziato) {
|
||||
echo '
|
||||
|
@ -469,8 +469,8 @@ $query .= ' ORDER BY descrizione';
|
|||
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
@ -480,13 +480,13 @@ $query .= ' ORDER BY descrizione';
|
|||
</div>
|
||||
|
||||
<?php
|
||||
if ($dir == 'uscita') {
|
||||
if ($dir == 'uscita') {
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
{[ "type": "checkbox", "label": "'.tr('Ritenuta pagata dal fornitore').'", "name": "is_ritenuta_pagata", "value": "$is_ritenuta_pagata$" ]}
|
||||
</div>';
|
||||
}
|
||||
if ($dir == 'entrata') {
|
||||
}
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-6">';
|
||||
|
||||
|
@ -497,11 +497,11 @@ $query .= ' ORDER BY descrizione';
|
|||
echo '
|
||||
{[ "type": "select", "label": "'.tr("Dichiarazione d'intento").'", "name": "id_dichiarazione_intento", "help": "'.tr('Elenco delle dichiarazioni d\'intento definite all\'interno dell\'anagrafica del cliente').'.", "ajax-source": "dichiarazioni_intento", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "data": "'.$record['data'].'"},"value": "$id_dichiarazione_intento$", "icon-after": "add|'.Modules::get('Anagrafiche')['id'].'|id_plugin='.Plugins::get('Dichiarazioni d\'Intento')['id'].'&id_parent='.$record['idanagrafica'].'", "extra": "'.((intval($block_edit)) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
echo '
|
||||
</div>';
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
|
@ -520,7 +520,7 @@ $query .= ' ORDER BY descrizione';
|
|||
</div>';
|
||||
|
||||
$bollo = new Bollo($fattura);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
@ -702,7 +702,7 @@ if ($record['descrizione_tipo'] == 'Fattura accompagnatoria di vendita') {
|
|||
echo '
|
||||
</form>';
|
||||
|
||||
//Dich. intento collegata
|
||||
// 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) {
|
||||
|
@ -953,11 +953,11 @@ echo '
|
|||
}
|
||||
}';
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '$("#idsede_destinazione").selectReset();';
|
||||
} else {
|
||||
} else {
|
||||
echo '$("#idsede_partenza").selectReset();';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
});
|
||||
|
|
|
@ -82,7 +82,7 @@ echo '
|
|||
</tr>';
|
||||
|
||||
// Tipo Cessione Prestazione
|
||||
echo '
|
||||
echo '
|
||||
<tr class="fourth-level">
|
||||
<td style="vertical-align: middle;">'.str_repeat($space, 3).'2.2.1.2 TipoCessionePrestazione</td>
|
||||
<td>
|
||||
|
@ -157,7 +157,7 @@ foreach ($result['altri_dati'] as $dato) {
|
|||
++$key;
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
|
||||
</table>';
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ if (!function_exists('aggiungi_movimento')) {
|
|||
{
|
||||
$dbo = database();
|
||||
|
||||
$fattura = Modules\Fatture\Fattura::find($iddocumento);
|
||||
$fattura = Fattura::find($iddocumento);
|
||||
$is_nota = $fattura->isNota();
|
||||
|
||||
// Totale marca da bollo, inps, ritenuta, idagente
|
||||
|
|
|
@ -32,19 +32,19 @@ echo '
|
|||
<thead>
|
||||
<tr>
|
||||
<th width="5" class="text-center">';
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
if (!$block_edit && sizeof($righe) > 0) {
|
||||
echo '
|
||||
<input id="check_all" type="checkbox"/>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</th>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th class="text-left" style="width:30%;">'.tr('Descrizione').'</th>
|
||||
<th class="text-center" width="120">'.tr('Q.tà').'</th>';
|
||||
if ($dir == 'entrata') {
|
||||
if ($dir == 'entrata') {
|
||||
echo '<th class="text-center" width="150">'.tr('Costo unitario').'</th>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
<th class="text-center" width="180">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center" width="140">'.tr('Sconto unitario').'</th>
|
||||
<th class="text-center" width="120">'.tr('Iva unitaria').'</th>
|
||||
|
@ -177,8 +177,8 @@ foreach ($righe as $riga) {
|
|||
|
||||
if (!empty($riga->note)) {
|
||||
if (strlen($riga->note) > 50) {
|
||||
$prima_parte = substr($riga->note, 0, ((strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50));
|
||||
$seconda_parte = substr($riga->note, ((strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50));
|
||||
$prima_parte = substr($riga->note, 0, (strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50);
|
||||
$seconda_parte = substr($riga->note, (strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50);
|
||||
$stringa_modificata = '<small class="label label-default">'.$prima_parte.'</small>
|
||||
<span id="read-more-target-'.$riga->id.'" class="read-more-target"><small class="label label-default">'.$seconda_parte.'</small></span><a href="#read-more-target-'.$riga->id.'" class="read-more-trigger">...</a>';
|
||||
} else {
|
||||
|
|
|
@ -19,12 +19,10 @@
|
|||
|
||||
namespace Modules\Fatture;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Common\Components\Component;
|
||||
use Common\Document;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use InvalidArgumentException;
|
||||
use Models\Upload;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Banche\Banca;
|
||||
|
@ -39,7 +37,6 @@ use Plugins\DichiarazioniIntento\Dichiarazione;
|
|||
use Plugins\ExportFE\FatturaElettronica;
|
||||
use Traits\RecordTrait;
|
||||
use Traits\ReferenceTrait;
|
||||
use Translator;
|
||||
use Util\Generator;
|
||||
|
||||
class Fattura extends Document
|
||||
|
@ -95,7 +92,7 @@ class Fattura extends Document
|
|||
{
|
||||
$model = new static();
|
||||
|
||||
$user = Auth::user();
|
||||
$user = \Auth::user();
|
||||
$database = database();
|
||||
|
||||
// Individuazione dello stato predefinito per il documento
|
||||
|
@ -145,7 +142,7 @@ class Fattura extends Document
|
|||
$model->id_ritenuta_contributi = $id_ritenuta_contributi ?: null;
|
||||
|
||||
// Banca predefinita per l'anagrafica controparte
|
||||
//$model->id_banca_controparte = ;
|
||||
// $model->id_banca_controparte = ;
|
||||
|
||||
// Tipo di pagamento dall'anagrafica controparte
|
||||
$id_pagamento = $database->fetchOne('SELECT id FROM co_pagamenti WHERE id = :id_pagamento', [
|
||||
|
@ -210,8 +207,8 @@ class Fattura extends Document
|
|||
// Registrazione dell'operazione nelle note
|
||||
$notes[] = tr("Operazione non imponibile come da vostra dichiarazione d'intento nr _PROT_ del _PROT_DATE_ emessa in data _RELEASE_DATE_", [
|
||||
'_PROT_' => $dichiarazione->numero_protocollo,
|
||||
'_PROT_DATE_' => Translator::dateToLocale($dichiarazione->data_protocollo),
|
||||
'_RELEASE_DATE_' => Translator::dateToLocale($dichiarazione->data_emissione),
|
||||
'_PROT_DATE_' => \Translator::dateToLocale($dichiarazione->data_protocollo),
|
||||
'_RELEASE_DATE_' => \Translator::dateToLocale($dichiarazione->data_emissione),
|
||||
]).'.';
|
||||
}
|
||||
|
||||
|
@ -490,7 +487,7 @@ class Fattura extends Document
|
|||
|
||||
$file = $this->uploads()->where('name', '=', 'Fattura Elettronica')->first();
|
||||
if (empty($file)) {
|
||||
throw new InvalidArgumentException('Fattura Elettronica non trovata');
|
||||
throw new \InvalidArgumentException('Fattura Elettronica non trovata');
|
||||
}
|
||||
|
||||
return $file->getContent();
|
||||
|
@ -786,9 +783,9 @@ class Fattura extends Document
|
|||
/**
|
||||
* Scope per l'inclusione delle sole fatture con valore contabile.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param Builder $query
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeContabile($query)
|
||||
{
|
||||
|
@ -849,9 +846,9 @@ class Fattura extends Document
|
|||
/**
|
||||
* Scope per l'inclusione delle fatture di vendita.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param Builder $query
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeVendita($query)
|
||||
{
|
||||
|
@ -863,9 +860,9 @@ class Fattura extends Document
|
|||
/**
|
||||
* Scope per l'inclusione delle fatture di acquisto.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param Builder $query
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeAcquisto($query)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ use Modules\PrimaNota\Movimento;
|
|||
class Movimenti
|
||||
{
|
||||
protected $fattura;
|
||||
protected $mastrino = null;
|
||||
protected $mastrino;
|
||||
|
||||
public function __construct(Fattura $fattura)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ include_once __DIR__.'/../../core.php';
|
|||
'name' => 'descrizione',
|
||||
'value' => $record['descrizione'],
|
||||
]);
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -30,4 +30,4 @@ switch (post('op')) {
|
|||
flash()->info(tr('Informazioni salvate correttamente.'));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ if (!empty($record['immagine'])) {
|
|||
<div class="col-md-6">
|
||||
<?php
|
||||
echo Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
?>
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "extra": "", "ajax-source": "clienti" ]}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
@ -90,7 +90,7 @@ if (!empty($record['immagine'])) {
|
|||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "value": "$idsede$", "required": "1", "ajax-source": "sedi", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "placeholder": "'.tr('Sede legale').'" ]}
|
||||
</div>';
|
||||
?>
|
||||
?>
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Proprietario'); ?>", "name": "proprietario", "value": "$proprietario$" ]}
|
||||
</div>
|
||||
|
|
|
@ -21,12 +21,10 @@ namespace Modules\Impianti\Import;
|
|||
|
||||
use Importer\CSVImporter;
|
||||
use Models\Upload;
|
||||
use Modules;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Anagrafiche\Sede;
|
||||
use Modules\Impianti\Categoria;
|
||||
use Modules\Impianti\Impianto;
|
||||
use Uploads;
|
||||
|
||||
/**
|
||||
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Impianti.
|
||||
|
@ -158,14 +156,14 @@ class CSV extends CSVImporter
|
|||
$impianto->save();
|
||||
}
|
||||
|
||||
//Gestione immagine
|
||||
// Gestione immagine
|
||||
if (!empty($url) && !empty($record['import_immagine'])) {
|
||||
$file_content = file_get_contents($url);
|
||||
|
||||
if (!empty($file_content)) {
|
||||
if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) {
|
||||
Uploads::deleteLinked([
|
||||
'id_module' => Modules::get('Impianti')['id'],
|
||||
\Uploads::deleteLinked([
|
||||
'id_module' => \Modules::get('Impianti')['id'],
|
||||
'id_record' => $impianto->id,
|
||||
]);
|
||||
|
||||
|
@ -178,11 +176,11 @@ class CSV extends CSVImporter
|
|||
|
||||
$name = 'immagine_'.$impianto->id.'.'.Upload::getExtensionFromMimeType($file_content);
|
||||
|
||||
$upload = Uploads::upload($file_content, [
|
||||
$upload = \Uploads::upload($file_content, [
|
||||
'name' => 'Immagine',
|
||||
'category' => 'Immagini',
|
||||
'original_name' => $name,
|
||||
'id_module' => Modules::get('Impianti')['id'],
|
||||
'id_module' => \Modules::get('Impianti')['id'],
|
||||
'id_record' => $impianto->id,
|
||||
], [
|
||||
'thumbnails' => true,
|
||||
|
|
|
@ -70,7 +70,7 @@ switch (filter('op')) {
|
|||
$value = implode(',', $value);
|
||||
}
|
||||
|
||||
//Se è un'impostazione editabile
|
||||
// Se è un'impostazione editabile
|
||||
if ($result->editable) {
|
||||
$is_valid = Settings::setValue($id, $value);
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ switch (post('op')) {
|
|||
while (strtotime($data) <= strtotime($data_fine)) {
|
||||
$data = date('Y-m-d', strtotime('+'.$periodicita.' '.$interval.'', strtotime($data)));
|
||||
$w = date('w', strtotime($data));
|
||||
//Escludo sabato e domenica
|
||||
// Escludo sabato e domenica
|
||||
if ($w == '6') {
|
||||
$data = date('Y-m-d', strtotime('+2 day', strtotime($data)));
|
||||
} elseif ($w == '0') {
|
||||
|
@ -331,7 +331,7 @@ switch (post('op')) {
|
|||
for ($i = 0; $i < $ricorrenze; ++$i) {
|
||||
$data = date('Y-m-d', strtotime('+'.$periodicita.' '.$interval.'', strtotime($data)));
|
||||
$w = date('w', strtotime($data));
|
||||
//Escludo sabato e domenica
|
||||
// Escludo sabato e domenica
|
||||
if ($w == '6') {
|
||||
$data = date('Y-m-d', strtotime('+2 day', strtotime($data)));
|
||||
} elseif ($w == '0') {
|
||||
|
@ -362,11 +362,11 @@ switch (post('op')) {
|
|||
$orario_inizio = date('Y-m-d', strtotime($data_ricorrenza)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
|
||||
} else {
|
||||
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
|
||||
$orario_inizio = date('Y-m-d H:i:s', (strtotime($new_sessione->orario_inizio) + $diff));
|
||||
$orario_inizio = date('Y-m-d H:i:s', strtotime($new_sessione->orario_inizio) + $diff);
|
||||
}
|
||||
|
||||
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
|
||||
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine));
|
||||
$orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
|
||||
|
||||
$new_sessione = $sessione->replicate();
|
||||
$new_sessione->idintervento = $new->id;
|
||||
|
@ -590,7 +590,7 @@ switch (post('op')) {
|
|||
$id_documento = post('id_documento');
|
||||
|
||||
// Individuazione del documento originale
|
||||
if (!is_subclass_of($class, \Common\Document::class)) {
|
||||
if (!is_subclass_of($class, Common\Document::class)) {
|
||||
return;
|
||||
}
|
||||
$documento = $class::find($id_documento);
|
||||
|
@ -1026,11 +1026,11 @@ switch (post('op')) {
|
|||
$orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
|
||||
} else {
|
||||
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
|
||||
$orario_inizio = date('Y-m-d H:i:s', (strtotime($new_sessione->orario_inizio) + $diff));
|
||||
$orario_inizio = date('Y-m-d H:i:s', strtotime($new_sessione->orario_inizio) + $diff);
|
||||
}
|
||||
|
||||
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
|
||||
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine));
|
||||
$orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
|
||||
|
||||
$new_sessione = $sessione->replicate();
|
||||
$new_sessione->idintervento = $new->id;
|
||||
|
@ -1063,7 +1063,7 @@ switch (post('op')) {
|
|||
}
|
||||
}
|
||||
|
||||
//copia allegati
|
||||
// copia allegati
|
||||
if (!empty($copia_allegati)) {
|
||||
$allegati = $intervento->uploads();
|
||||
foreach ($allegati as $allegato) {
|
||||
|
@ -1181,7 +1181,7 @@ switch (post('op')) {
|
|||
$numero_totale = 0;
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
if (($riga['id']) != null) {
|
||||
if ($riga['id'] != null) {
|
||||
$articolo = Articolo::find($riga['id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ echo '
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
|
||||
echo input([
|
||||
echo input([
|
||||
'type' => 'ckeditor',
|
||||
'label' => tr('Richiesta'),
|
||||
'name' => 'richiesta',
|
||||
|
@ -218,19 +218,19 @@ echo '
|
|||
'required' => 1,
|
||||
'value' => htmlentities($richiesta),
|
||||
'extra' => 'style=\'max-height:80px;\'',
|
||||
]);
|
||||
echo '
|
||||
]);
|
||||
echo '
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
|
||||
echo input([
|
||||
echo input([
|
||||
'type' => 'ckeditor',
|
||||
'label' => tr('Descrizione'),
|
||||
'name' => 'descrizione',
|
||||
'id' => 'descrizione_add',
|
||||
'value' => htmlentities($descrizione),
|
||||
'extra' => 'style=\'max-height:80px;\'',
|
||||
]);
|
||||
echo '
|
||||
]);
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -276,8 +276,8 @@ echo '
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
//if (empty($id_intervento)) {
|
||||
echo '
|
||||
// if (empty($id_intervento)) {
|
||||
echo '
|
||||
<!-- ASSEGNAZIONE TECNICI -->
|
||||
<div class="box box-info collapsable collapsed-box">
|
||||
<div class="box-header with-border">
|
||||
|
@ -310,7 +310,7 @@ echo '
|
|||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
//}
|
||||
// }
|
||||
|
||||
echo '
|
||||
<!-- ORE LAVORO -->
|
||||
|
@ -677,7 +677,7 @@ echo '
|
|||
}
|
||||
});';
|
||||
|
||||
if (!$origine_dashboard) {
|
||||
if (!$origine_dashboard) {
|
||||
echo '
|
||||
input("idtecnico").change(function() {
|
||||
var value = $(this).val() > 0 ? true : false;
|
||||
|
@ -685,9 +685,9 @@ echo '
|
|||
input("orario_fine").setRequired(value);
|
||||
input("data").setRequired(value);
|
||||
});';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
var ref = "'.get('ref').'";
|
||||
|
||||
async function salva(button) {
|
||||
|
|
|
@ -229,11 +229,11 @@ switch (post('op')) {
|
|||
$orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
|
||||
} else {
|
||||
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
|
||||
$orario_inizio = date('Y-m-d H:i:s', (strtotime($sessione->orario_inizio) + $diff));
|
||||
$orario_inizio = date('Y-m-d H:i:s', strtotime($sessione->orario_inizio) + $diff);
|
||||
}
|
||||
|
||||
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
|
||||
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine));
|
||||
$orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
|
||||
|
||||
$new_sessione = $sessione->replicate();
|
||||
$new_sessione->idintervento = $new->id;
|
||||
|
@ -301,7 +301,7 @@ switch (post('op')) {
|
|||
$id_print = Prints::getPrints()['Riepilogo interventi'];
|
||||
|
||||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&tipo='.post('tipo'));
|
||||
exit();
|
||||
exit;
|
||||
|
||||
case 'send-mail':
|
||||
$template = Template::find(post('id_template'));
|
||||
|
@ -367,7 +367,7 @@ if (App::debug()) {
|
|||
];
|
||||
}
|
||||
|
||||
$operations['export-bulk'] = [
|
||||
$operations['export-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-file-archive-o"></i> '.tr('Esporta stampe'),
|
||||
'data' => [
|
||||
'title' => tr('Vuoi davvero esportare queste stampe in un archivio ZIP?'),
|
||||
|
@ -376,9 +376,9 @@ if (App::debug()) {
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => true,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['crea_fattura'] = [
|
||||
$operations['crea_fattura'] = [
|
||||
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
|
||||
'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>',
|
||||
|
@ -389,9 +389,9 @@ if (App::debug()) {
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['cambia_stato'] = [
|
||||
$operations['cambia_stato'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Cambia stato'),
|
||||
'data' => [
|
||||
'title' => tr('Vuoi davvero cambiare lo stato per questi interventi?'),
|
||||
|
@ -401,9 +401,9 @@ if (App::debug()) {
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['copy-bulk'] = [
|
||||
$operations['copy-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-clone"></i> '.tr('Duplica attività'),
|
||||
'data' => [
|
||||
'title' => tr('Vuoi davvero fare una copia degli interventi selezionati?'),
|
||||
|
@ -417,9 +417,9 @@ if (App::debug()) {
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['stampa-riepilogo'] = [
|
||||
$operations['stampa-riepilogo'] = [
|
||||
'text' => '<span><i class="fa fa-print"></i> '.tr('Stampa riepilogo'),
|
||||
'data' => [
|
||||
'title' => tr('Stampare il riepilogo delle attività selezionate?'),
|
||||
|
@ -428,9 +428,9 @@ if (App::debug()) {
|
|||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => true,
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['send-mail'] = [
|
||||
$operations['send-mail'] = [
|
||||
'text' => '<span><i class="fa fa-envelope"></i> '.tr('Invia mail').'</span>',
|
||||
'data' => [
|
||||
'title' => tr('Inviare mail?'),
|
||||
|
@ -439,9 +439,9 @@ if (App::debug()) {
|
|||
'button' => tr('Invia'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$operations['firma-intervento'] = [
|
||||
$operations['firma-intervento'] = [
|
||||
'text' => '<span><i class="fa fa-pencil"></i> '.tr('Firma interventi').'</span>',
|
||||
'data' => [
|
||||
'title' => tr('Firma'),
|
||||
|
@ -449,6 +449,6 @@ if (App::debug()) {
|
|||
'origine' => 'interventi',
|
||||
'url' => $module->fileurl('modals/firma.php'),
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
return $operations;
|
||||
|
|
|
@ -28,7 +28,7 @@ $module_anagrafiche = Modules::get('Anagrafiche');
|
|||
// Verifica aggiuntive sulla sequenzialità dei numeri
|
||||
$numero_previsto = verifica_numero_intervento($intervento);
|
||||
|
||||
if (!empty($numero_previsto) && intval((setting('Verifica numero intervento')))) {
|
||||
if (!empty($numero_previsto) && intval(setting('Verifica numero intervento'))) {
|
||||
echo '
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<i class="fa fa-warning"></i> '.tr("E' assente una attività con numero _NUM_ in data precedente o corrispondente al _DATE_: potrebbero esserci alcuni errori di continuità con la numerazione delle attività", [
|
||||
|
@ -67,10 +67,10 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-6">';
|
||||
if (!empty($record['idclientefinale'])) {
|
||||
if (!empty($record['idclientefinale'])) {
|
||||
echo '
|
||||
'.Modules::link('Anagrafiche', $record['idclientefinale'], null, null, 'class="pull-right"');
|
||||
}
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Per conto di').'", "name": "idclientefinale", "value": "$idclientefinale$", "ajax-source": "clienti", "readonly": "'.$record['flag_completato'].'" ]}
|
||||
</div>
|
||||
|
@ -93,7 +93,7 @@ echo '
|
|||
|
||||
<div class="col-md-6">';
|
||||
|
||||
$idpreventivo_riga = $dbo->fetchOne('SELECT id FROM co_promemoria WHERE idintervento='.prepare($id_record))['id'];
|
||||
$idpreventivo_riga = $dbo->fetchOne('SELECT id FROM co_promemoria WHERE idintervento='.prepare($id_record))['id'];
|
||||
|
||||
if (!empty($record['idcontratto'])) {
|
||||
echo '
|
||||
|
@ -110,22 +110,22 @@ echo '
|
|||
<div class="row">
|
||||
<div class="col-md-6">';
|
||||
|
||||
$idcontratto_riga = $dbo->fetchOne('SELECT id FROM co_promemoria WHERE idintervento='.prepare($id_record))['id'];
|
||||
$idcontratto_riga = $dbo->fetchOne('SELECT id FROM co_promemoria WHERE idintervento='.prepare($id_record))['id'];
|
||||
|
||||
if (!empty($record['idordine'])) {
|
||||
if (!empty($record['idordine'])) {
|
||||
echo '
|
||||
'.Modules::link('Ordini cliente', $record['idordine'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
|
||||
{[ "type": "select", "label": "'.tr('Ordine').'", "name": "idordine", "value": "'.$record['id_ordine'].'", "ajax-source": "ordini-cliente", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">';
|
||||
if ($record['idagente'] != 0) {
|
||||
if ($record['idagente'] != 0) {
|
||||
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -338,7 +338,7 @@ echo '
|
|||
<!-- RIGA 5 -->
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
|
||||
echo input([
|
||||
echo input([
|
||||
'type' => 'ckeditor',
|
||||
'label' => tr('Richiesta'),
|
||||
'name' => 'richiesta',
|
||||
|
@ -346,34 +346,34 @@ echo '
|
|||
'required' => 1,
|
||||
'value' => $record['richiesta'],
|
||||
'extra' => 'style=\'max-height:80px;\'',
|
||||
]);
|
||||
echo '
|
||||
]);
|
||||
echo '
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
|
||||
echo input([
|
||||
echo input([
|
||||
'type' => 'ckeditor',
|
||||
'label' => tr('Descrizione'),
|
||||
'name' => 'descrizione',
|
||||
'id' => 'descrizione_add',
|
||||
'value' => $record['descrizione'],
|
||||
'extra' => 'style=\'max-height:80px;\'',
|
||||
]);
|
||||
echo '
|
||||
]);
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
// Nascondo le note interne ai clienti
|
||||
if ($user->gruppo != 'Clienti') {
|
||||
// Nascondo le note interne ai clienti
|
||||
if ($user->gruppo != 'Clienti') {
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "'.tr('Note interne').'", "name": "informazioniaggiuntive", "class": "autosize", "value": "$informazioniaggiuntive$", "extra": "rows=\'5\'" ]}
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Conteggio numero articoli intervento per eventuale blocco della sede di partenza
|
||||
$articoli = $intervento->articoli;
|
||||
echo'
|
||||
// Conteggio numero articoli intervento per eventuale blocco della sede di partenza
|
||||
$articoli = $intervento->articoli;
|
||||
echo '
|
||||
<div class="row"><div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Partenza merce').'", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "readonly": "'.(($record['flag_completato'] || !$articoli->isEmpty()) ? 1 : 0).'" ]}
|
||||
</div></div>
|
||||
|
@ -381,16 +381,16 @@ echo '
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
// Visualizzo solo se l'anagrafica cliente è un ente pubblico
|
||||
if (!empty($record['idcontratto'])) {
|
||||
// Visualizzo solo se l'anagrafica cliente è un ente pubblico
|
||||
if (!empty($record['idcontratto'])) {
|
||||
$contratto = $dbo->fetchOne('SELECT num_item,codice_cig,codice_cup,id_documento_fe FROM co_contratti WHERE id = '.prepare($record['idcontratto']));
|
||||
$record['id_documento_fe'] = $contratto['id_documento_fe'];
|
||||
$record['codice_cup'] = $contratto['codice_cup'];
|
||||
$record['codice_cig'] = $contratto['codice_cig'];
|
||||
$record['num_item'] = $contratto['num_item'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
<!-- Fatturazione Elettronica PA-->
|
||||
<div class="panel panel-primary <?php echo ($record['tipo_anagrafica'] == 'Ente pubblico' || $record['tipo_anagrafica'] == 'Azienda') ? 'show' : 'hide'; ?>" >
|
||||
<div class="panel-heading">
|
||||
|
@ -443,7 +443,7 @@ echo '
|
|||
<div class=\"clearfix\"></div>
|
||||
<br>";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="tecnici"></div>
|
||||
|
|
|
@ -26,7 +26,7 @@ if (get('anteprima') !== null) {
|
|||
|
||||
if (empty($rs)) {
|
||||
echo tr('Intervento inesistente!');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Gestione della stampa
|
||||
|
@ -166,4 +166,4 @@ if (setting('Sistema di firma') == 'Base') {
|
|||
});
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ echo '
|
|||
<h3 class="box-title">'.tr('Interventi da firmare').'</h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
if ($interventi_da_firmare) {
|
||||
if ($interventi_da_firmare) {
|
||||
echo '
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
|
@ -79,10 +79,10 @@ echo '
|
|||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
} else {
|
||||
echo 'Nessun Intervento..';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -93,7 +93,7 @@ echo '
|
|||
<h3 class="box-title">'.tr('Interventi firmati non completati').'</h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
if ($interventi_firmati) {
|
||||
if ($interventi_firmati) {
|
||||
echo '
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
|
@ -121,10 +121,10 @@ echo '
|
|||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
} else {
|
||||
echo 'Nessun Intervento..';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -135,7 +135,7 @@ echo '
|
|||
<h3 class="box-title">'.tr('Interventi completati').'</h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
if ($interventi_completati) {
|
||||
if ($interventi_completati) {
|
||||
echo '
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
|
@ -167,10 +167,10 @@ echo '
|
|||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i> '.tr('Questi interventi non verranno firmati').'
|
||||
</div>';
|
||||
} else {
|
||||
} else {
|
||||
echo 'Nessun Intervento..';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue