Aggiunta stampa scadenza
This commit is contained in:
parent
dc48fd2b17
commit
3c3dd2d68c
|
@ -19,6 +19,8 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\Fatture\Fattura;
|
||||
|
||||
$date_start = $_SESSION['period_start'];
|
||||
$date_end = $_SESSION['period_end'];
|
||||
|
||||
|
@ -49,6 +51,17 @@ if (!empty($search_filters)) {
|
|||
|
||||
$module_query = str_replace('1=1', '1=1 AND ABS(`co_scadenziario`.`pagato`) < ABS(`co_scadenziario`.`da_pagare`) ', $module_query);
|
||||
|
||||
// Scelgo la query in base alla scadenza
|
||||
if (isset($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT * FROM co_scadenziario WHERE id = '.prepare($id_record));
|
||||
$documento = Fattura::find($record['iddocumento']);
|
||||
if (!empty($documento)) {
|
||||
$module_query = str_replace('1=1', '1=1 AND co_scadenziario.iddocumento='.prepare($documento->id), $module_query);
|
||||
} else {
|
||||
$module_query = str_replace('1=1', '1=1 AND co_scadenziario.id='.prepare($id_record), $module_query);
|
||||
}
|
||||
}
|
||||
|
||||
// Filtri derivanti dai permessi (eventuali)
|
||||
$module_query = Modules::replaceAdditionals($id_module, $module_query);
|
||||
|
||||
|
|
|
@ -19,12 +19,21 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
echo '
|
||||
<h4><b>'.tr('Scadenza _ANAG_', [
|
||||
'_ANAG_' => $records[0]['Anagrafica'],
|
||||
], ['upper' => true]).'</b></h4>';
|
||||
} else {
|
||||
echo '
|
||||
<h4><b>'.tr('Scadenze dal _START_ al _END_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
], ['upper' => true]).'</b></h4>
|
||||
], ['upper' => true]).'</b>
|
||||
</h4>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<table class="table table-striped table-bordered" id="contents">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -47,3 +47,7 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `in_fasceorarie` WHERE
|
|||
|
||||
-- Stampa Barcode bulk
|
||||
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`, `created_at`, `updated_at`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli'), '0', 'Barcode bulk', 'Barcode', 'Barcode', 'barcode_bulk', '', '', 'fa fa-print', '', '', '0', '1', '1', '1');
|
||||
|
||||
-- Stampa scadenza
|
||||
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 `id` FROM `zz_modules` WHERE `name` = 'Scadenzario'), 1, 'Scadenza', 'Scadenza', 'Scadenza', 'scadenzario', '', '', 'fa fa-print', '', '', 0, 0, 1, 1);
|
||||
|
|
Loading…
Reference in New Issue