Aggiunta stampa scadenza

This commit is contained in:
MatteoPistorello 2022-06-10 11:25:02 +02:00
parent dc48fd2b17
commit 3c3dd2d68c
3 changed files with 32 additions and 6 deletions

View File

@ -19,6 +19,8 @@
include_once __DIR__.'/../../core.php'; include_once __DIR__.'/../../core.php';
use Modules\Fatture\Fattura;
$date_start = $_SESSION['period_start']; $date_start = $_SESSION['period_start'];
$date_end = $_SESSION['period_end']; $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); $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) // Filtri derivanti dai permessi (eventuali)
$module_query = Modules::replaceAdditionals($id_module, $module_query); $module_query = Modules::replaceAdditionals($id_module, $module_query);

View File

@ -19,12 +19,21 @@
include_once __DIR__.'/../../core.php'; 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 ' echo '
<h4><b>'.tr('Scadenze dal _START_ al _END_', [ <h4><b>'.tr('Scadenze dal _START_ al _END_', [
'_START_' => Translator::dateToLocale($date_start), '_START_' => Translator::dateToLocale($date_start),
'_END_' => Translator::dateToLocale($date_end), '_END_' => Translator::dateToLocale($date_end),
], ['upper' => true]).'</b></h4> ], ['upper' => true]).'</b>
</h4>';
}
echo '
<table class="table table-striped table-bordered" id="contents"> <table class="table table-striped table-bordered" id="contents">
<thead> <thead>
<tr> <tr>

View File

@ -47,3 +47,7 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `in_fasceorarie` WHERE
-- Stampa Barcode bulk -- 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'); 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);