diff --git a/assets/src/css/style.css b/assets/src/css/style.css index 6cb3e9fc3..582a9a2a1 100755 --- a/assets/src/css/style.css +++ b/assets/src/css/style.css @@ -1658,6 +1658,9 @@ body:not(.sidebar-collapse) .sidebar .nav-treeview .nav-treeview .nav-link { list-style: none; } +.readmore{ + overflow: hidden; +} @media screen and (max-width: 767px) { .navbar-left { diff --git a/assets/src/js/base/custom.js b/assets/src/js/base/custom.js index 986db2896..1a8d0fd89 100644 --- a/assets/src/js/base/custom.js +++ b/assets/src/js/base/custom.js @@ -98,6 +98,18 @@ $(document).ready(function () { }); }, 1000); + // Plugin readmore.js + $('.readmore').each( function(){ + height = $(this).data('height') ? parseInt($(this).data('height')) : 50; + + $(this).readmore({ + collapsedHeight: height, + moreLink: '' + globals.translations.readmore + '', + lessLink: '' + globals.translations.readless + '', + beforeToggle: function(){ setTimeout( 'alignMaxHeight(".module-header .card");', 300 ); }, + }); + }); + alignMaxHeight(".module-header .card"); $("#main_loading").fadeOut() @@ -130,6 +142,9 @@ function sendWhatsAppMessage(phoneNumber, message) { } function alignMaxHeight(element){ + // Azzera l'altezza fissa + $(element).css('height', 'auto'); + max_height = 0; $(element).each( function(){ if($(this).height() > max_height){ diff --git a/gulpfile.js b/gulpfile.js index 4d74e7058..e3020a593 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -127,6 +127,7 @@ const JS = gulp.parallel(() => { 'leaflet.fullscreen/Control.FullScreen.js', 'ismobilejs/dist/isMobile.min.js', 'ua-parser-js/dist/ua-parser.min.js', + 'readmore.js/readmore.js', ]; for (const i in vendor) { diff --git a/include/top.php b/include/top.php index be6aacb9d..21e04534a 100755 --- a/include/top.php +++ b/include/top.php @@ -124,6 +124,8 @@ if (Auth::check()) { 'singleCalendar' => tr("E' presente un solo periodo."), 'noResults' => tr('Nessun elemento trovato'), 'signatureMissing' => tr('Firma mancante.'), + 'readmore' => tr('Mostra tutto'), + 'readless' => tr('Mostra meno'), ]; foreach ($translations as $key => $value) { echo ' diff --git a/mail.php b/mail.php index 317acc898..7dec7e070 100755 --- a/mail.php +++ b/mail.php @@ -135,7 +135,7 @@ echo '
'.(count($interventi_programmati) == 0 ? tr('Non sono presenti altre attività programmate') : 'Attività aperte:'); if (count($interventi_programmati) != 0) { + echo '
'.tr('Per vedere le fatture da importare utilizza il pulsante _BUTTON_', [ + '_BUTTON_' => '"'.tr('Ricerca fatture di acquisto').'"', + ]).'.
'; +} else { + include $structure->filepath('list.php'); +} + +echo ' + +'.tr("Errore durante l'apertura della fattura elettronica _NAME_", [ + '_NAME_' => $record['name'], + ]).'.
'; + } elseif (!empty($imported)) { + echo ' +'.tr('La fattura elettronica _NAME_ è già stata importata in passato', [ + '_NAME_' => $record['name'], + ]).'.
'; + } + + echo ' +'.tr('Descrizione').' | +'.tr('Cliente').' | +'.tr('Data di registrazione').' | +'.tr('Totale imponibile').' | +# | +|||||
---|---|---|---|---|---|---|---|---|---|
+ '.$name.' + |
+
+ - | +- | +- | + ++ '; + } else { + $date = new DateTime($element['date']); + + $descrizione = ''; + if ($element['type'] == 'TD01') { + $descrizione = tr('Fattura num. _NUM_ del _DATE_', [ + '_NUM_' => $element['number'], + '_DATE_' => dateFormat($date), + ]); + } elseif ($element['type'] == 'TD04') { + $descrizione = tr('Nota di credito num. _NUM_ del _DATE_', [ + '_NUM_' => $element['number'], + '_DATE_' => dateFormat($date), + ]); + } elseif ($element['type'] == 'TD05') { + $descrizione = tr('Nota di debito num. _NUM_ del _DATE_', [ + '_NUM_' => $element['number'], + '_DATE_' => dateFormat($date), + ]); + } elseif ($element['type'] == 'TD06') { + $descrizione = tr('Parcella num. _NUM_ del _DATE_', [ + '_NUM_' => $element['number'], + '_DATE_' => dateFormat($date), + ]); + } + + $date = new DateTime($element['date']); + $date = $date->format('Y-m-d'); + + echo ' + | + '.$descrizione.' ['.$name.'] + | + +'.$element['sender'].' | +'.dateFormat(new Carbon($element['date_sent'])).' | +'.moneyFormat($element['amount']).' | + ++ '; + } + + if (file_exists($directory.'/'.$name)) { + echo ' + '; + } + + echo ' + + + | +
'.tr('Nessuna fattura da importare').'.
'; +} + +echo ' +'; diff --git a/plugins/importFE_ZIP/riferimento.php b/plugins/importFE_ZIP/riferimento.php new file mode 100644 index 000000000..9b8d3c6c4 --- /dev/null +++ b/plugins/importFE_ZIP/riferimento.php @@ -0,0 +1,145 @@ +. + */ + +use Modules\DDT\DDT; +use Modules\Ordini\Ordine; + +include_once __DIR__.'/../../core.php'; +include_once __DIR__.'/init.php'; + +$direzione = 'entrata'; +$id_riga = get('id_riga'); +$qta = get('qta'); +$descrizione = get('descrizione'); +$prezzo_unitario = get('prezzo_unitario'); + +$id_documento = get('id_documento'); +$tipo_documento = get('tipo_documento'); +$dir = get('dir'); +if ($tipo_documento == 'ordine') { + $documento = Ordine::find($id_documento); + $righe_utilizzate = get('righe_ordini'); +} else { + $documento = DDT::find($id_documento); + $righe_utilizzate = get('righe_ddt'); +} + +echo ' +'.tr('Descrizione').' | ++ '.tr('Q.tà').' + | +'.tr('Prezzo unitario').' | +# | +
---|---|---|---|
'.(!empty($riga->codice) ? $riga->codice.' - ' : '').$riga->descrizione.' | +'.numberFormat($qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').' '.$riga->um.' | +'.moneyFormat($riga->prezzo_unitario_corrente).' | +'; + + if ($qta_rimanente >= $qta || !empty(setting('Permetti il superamento della soglia quantità dei documenti di origine'))) { + echo ' + '; + } + + echo ' + | +
'.tr('Note', [], ['upper' => true]).':
-'.nl2br((string) $record['note']).'
'; +'.nl2br((string) $record['note']).'
'; $autofill->count($record['note'], true); } diff --git a/templates/ordini/body.php b/templates/ordini/body.php index 7422c3200..800733d6d 100755 --- a/templates/ordini/body.php +++ b/templates/ordini/body.php @@ -49,20 +49,18 @@ $has_image = $righe->search(fn ($item) => !empty($item->articolo->immagine)) !== if ($has_image) { ++$columns; - $char_number = $options['pricing'] ? 26 : 63; + } if ($documento->direzione == 'uscita') { $columns += 2; - $char_number = $options['pricing'] ? 26 : 63; -} else { - $char_number = $options['pricing'] ? 45 : 82; -} +} + $columns = $options['pricing'] ? $columns : $columns - 3; // Creazione righe fantasma $autofill = new Util\Autofill($columns); -$autofill->setRows(20, 10); +$autofill->setRows(27, 0, 32); // Intestazione tabella per righe echo " @@ -107,8 +105,6 @@ foreach ($righe as $riga) { ++$num; $r = $riga->toArray(); - $autofill->count($r['descrizione']); - echo ''.tr('Note', [], ['upper' => true]).':
-'.nl2br((string) $documento['note']).'
'; +'.nl2br((string) $documento['note']).'
'; } diff --git a/templates/ordini/header.php b/templates/ordini/header.php index 76e3b1684..819a41b7b 100755 --- a/templates/ordini/header.php +++ b/templates/ordini/header.php @@ -60,6 +60,37 @@ echo '+ '.tr('Porto', [], ['upper' => true]).' + | + ++ '.tr('Tipo di spedizione', [], ['upper' => true]).' + | + ++ '.tr('Vettore', [], ['upper' => true]).' + | +
+ $porto$ + | + ++ $spedizione$ + | + ++ $vettore$ + | +