Fix minore

This commit is contained in:
valentina 2024-06-28 11:46:25 +02:00
parent fc7bc65602
commit d4a8ffc504
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ if (setting('Cambia automaticamente stato ddt fatturati')) {
$id_stato_fatt = Stato::where('name', 'Fatturato')->first()->id;
$id_stato_parz_fatt = Stato::where('name', 'Parzialmente fatturato')->first()->id;
if ($ordine->stato->id == $id_stato_fatt || $ordine->stato->id == $id_stato_parz_fatt) {
if ($ddt->stato->id == $id_stato_fatt || $ddt->stato->id == $id_stato_parz_fatt) {
echo '
{[ "type": "select", "label": "'.tr('Stato').'", "name": "idstatoddt", "required": 1, "values": "query=SELECT `dt_statiddt`.*, `dt_statiddt_lang`.`title` as descrizione, `colore` AS _bgcolor_ FROM `dt_statiddt` LEFT JOIN `dt_statiddt_lang` ON (`dt_statiddt`.`id` = `dt_statiddt_lang`.`id_record` AND `dt_statiddt_lang`.`id_lang`= '.prepare(Models\Locale::getDefault()->id).') ORDER BY `title`", "value": "$idstatoddt$", "extra": "readonly", "class": "unblockable" ]}';
} else {

View File

@ -50,7 +50,7 @@ $id_anagrafica = $documento_finale->idanagrafica;
echo '
<div class="row">
<div class="col-md-12">
{[ "type": "select", "label": "'.tr('Ddt').'", "name": "id_documento", "values": "query=SELECT `dt_ddt`.`id`, CONCAT(\'DDT num. \', IF(`numero_esterno` != \'\', `numero_esterno`, `numero`), \' del \', DATE_FORMAT(`data`, \'%d-%m-%Y\'), \' [\', `dt_statiddt_lang`.`title`, \']\') AS descrizione FROM `dt_ddt` LEFT JOIN `dt_causalet` ON `dt_causalet`.`id` = `dt_ddt`.`idcausalet` INNER JOIN `dt_statiddt` ON `dt_ddt`.`idstatoddt` = `dt_statiddt`.`id` LEFT JOIN `dt_statiddt_lang` ON (`dt_statiddt`.`id` = `dt_statiddt_lang`.`id_record` AND `dt_statiddt_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt` = `dt_tipiddt`.`id` INNER JOIN `dt_righe_ddt ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt` WHERE `idanagrafica`='.prepare($id_anagrafica).' AND `dt_statiddt_lang`.`title` IN("Evaso", "Parzialmente evaso", "Parzialmente fatturato") AND `dt_tipiddt`.`dir`='.prepare($dir).' AND `dt_causalet`.`is_importabile` = 1 AND (`dt_righe_ddt`.`qta` - `dt_righe_ddt`.`qta_evasa`) > 0 ORDER BY `data` DESC, `numero` DESC" ]}
{[ "type": "select", "label": "'.tr('Ddt').'", "name": "id_documento", "values": "query=SELECT `dt_ddt`.`id`, CONCAT(\'DDT num. \', IF(`numero_esterno` != \'\', `numero_esterno`, `numero`), \' del \', DATE_FORMAT(`data`, \'%d-%m-%Y\'), \' [\', `dt_statiddt_lang`.`title`, \']\') AS descrizione FROM `dt_ddt` LEFT JOIN `dt_causalet` ON `dt_causalet`.`id` = `dt_ddt`.`idcausalet` INNER JOIN `dt_statiddt` ON `dt_ddt`.`idstatoddt` = `dt_statiddt`.`id` LEFT JOIN `dt_statiddt_lang` ON (`dt_statiddt`.`id` = `dt_statiddt_lang`.`id_record` AND `dt_statiddt_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt` = `dt_tipiddt`.`id` INNER JOIN `dt_righe_ddt` ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt` WHERE `idanagrafica`='.prepare($id_anagrafica).' AND `dt_statiddt_lang`.`title` IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\') AND `dt_tipiddt`.`dir`='.prepare($dir).' AND `dt_causalet`.`is_importabile` = 1 AND (`dt_righe_ddt`.`qta` - `dt_righe_ddt`.`qta_evasa`) > 0 GROUP BY `dt_ddt`.`id` ORDER BY `data` DESC, `numero` DESC" ]}
</div>
</div>