diff --git a/modules/primanota/bulk.php b/modules/primanota/bulk.php new file mode 100755 index 000000000..0b1bf4989 --- /dev/null +++ b/modules/primanota/bulk.php @@ -0,0 +1,48 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +use Modules\PrimaNota\Mastrino; +use Util\Zip; + +switch (post('op')) { + case 'export-bulk': + + $_SESSION['superselect']['mastrini'] = $id_records; + + $print = Prints::getModulePredefinedPrint($id_module); + header("location: ".$rootdir."/pdfgen.php?id_print=".$print['id']."&id_record=".$id_records[0]); + exit; + + break; +} + +return [ + 'export-bulk' => [ + 'text' => ' '.tr('Esporta PDF'), + 'data' => [ + 'title' => tr('Vuoi davvero esportare il PDF?'), + 'msg' => '', + 'button' => tr('Procedi'), + 'class' => 'btn btn-lg btn-warning', + 'blank' => true, + ], + ], +]; diff --git a/templates/prima_nota/body.php b/templates/prima_nota/body.php new file mode 100755 index 000000000..0704d407b --- /dev/null +++ b/templates/prima_nota/body.php @@ -0,0 +1,64 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + + +echo ' +
+
+

'.tr('Prima nota').'

+
+
'; + +echo ' + + + '; + + foreach($campi as $campo){ + echo ' + '; + } + +echo ' + '; + $index = 0; + + foreach($records['results'] as $record){ + $record['Data'] = Translator::dateToLocale($record['Data']); + $record['Dare'] = Translator::numberToLocale($record['Dare'],'qta'); + $record['Avere'] = Translator::numberToLocale($record['Avere'],'qta'); + ++$index; + + echo ' + + '; + + foreach($campi as $campo){ + echo ' + '; + } + + echo ' + '; + } + +echo ' +
#'.$campo.'
'.$index.''.$record[$campo].'
'; \ No newline at end of file diff --git a/templates/prima_nota/header.php b/templates/prima_nota/header.php new file mode 100755 index 000000000..581526fc5 --- /dev/null +++ b/templates/prima_nota/header.php @@ -0,0 +1,3 @@ +'; diff --git a/templates/prima_nota/init.php b/templates/prima_nota/init.php new file mode 100755 index 000000000..0b825706a --- /dev/null +++ b/templates/prima_nota/init.php @@ -0,0 +1,48 @@ +. + */ + +use Util\Query; + +include_once __DIR__.'/../../core.php'; + +$id_module = Modules::get('Prima nota')['id']; +$structure = Modules::get($id_module); + +if( !empty($_SESSION['superselect']['mastrini']) ){ + $id_record = $_SESSION['superselect']['mastrini']; + $where = "co_movimenti.idmastrino IN (".implode(",",$id_record).")"; + $id_record = json_decode($righe); + unset($_SESSION['superselect']['mastrini']); +}else{ + $where = "co_movimenti.idmastrino=".prepare($id_record); +} + +// RISULTATI VISIBILI +Util\Query::setSegments(false); +$query = Query::getQuery($structure, $where, 0, []); +$query = Modules::replaceAdditionals($id_module, $query); +$query = str_replace("1=1","1=1 AND ".$where,$query); + +$records = Query::executeAndCount($query); + +$campi = []; +foreach($records['results'][0] as $key=>$value){ + $campi[] = $key; +} +unset($campi[0]); \ No newline at end of file diff --git a/templates/prima_nota/settings.php b/templates/prima_nota/settings.php new file mode 100755 index 000000000..ee359be1f --- /dev/null +++ b/templates/prima_nota/settings.php @@ -0,0 +1,23 @@ +. + */ + +return [ + 'orientation' => 'L', + 'font-size' => '11pt', +]; diff --git a/update/2_4_31.sql b/update/2_4_31.sql index 53a87856c..88b4e0732 100644 --- a/update/2_4_31.sql +++ b/update/2_4_31.sql @@ -94,4 +94,7 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, ((SELECT `id` FROM `zz_modules` WHERE `name` = 'Listini'), 'Barcode', '(SELECT barcode_fornitore FROM mg_fornitore_articolo WHERE id_articolo=mg_prezzi_articoli.id_articolo AND id_fornitore=mg_prezzi_articoli.id_anagrafica AND deleted_at IS NULL)', 9, 1, 0, 0, 1, '', '', 0, 0, 1); -- Rimozione widget Stampa riepilogo -DELETE FROM `zz_widgets` WHERE `zz_widgets`.`name` = 'Stampa riepilogo'; \ No newline at end of file +DELETE FROM `zz_widgets` WHERE `zz_widgets`.`name` = 'Stampa riepilogo'; + + +INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `zz_modules`.`id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Prima nota'), (SELECT `zz_modules`.`id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Prima nota'), 'Prima nota', 'Prima nota', 'Prima nota del {data}', 'prima_nota', 'idmastrino', '', 'fa fa-print', '', '', '0', '1', '1', '1');