mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-15 08:56:20 +01:00
Fix #1112 - Aggiunta colonna inviato in DDT uscita
This commit is contained in:
parent
fa590871f5
commit
84867671b2
@ -71,3 +71,30 @@ HAVING
|
||||
2=2
|
||||
ORDER BY
|
||||
`co_preventivi`.`id` DESC" WHERE `name` = 'Preventivi';
|
||||
|
||||
-- Aggiunta colonna Inviato in DDT in uscita
|
||||
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `html_format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
|
||||
('26', 'icon_Inviato', "IF(`email`.`id_email` IS NOT NULL, 'fa fa-envelope text-success', '')", '13', '1', '0', '0', '0', NULL, NULL, '0', '0', '0');
|
||||
|
||||
UPDATE `zz_modules` SET `options` = "SELECT
|
||||
|select|
|
||||
FROM
|
||||
`dt_ddt`
|
||||
LEFT JOIN `an_anagrafiche` ON `dt_ddt`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`
|
||||
LEFT JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt` = `dt_tipiddt`.`id`
|
||||
LEFT JOIN `dt_causalet` ON `dt_ddt`.`idcausalet` = `dt_causalet`.`id`
|
||||
LEFT JOIN `dt_spedizione` ON `dt_ddt`.`idspedizione` = `dt_spedizione`.`id`
|
||||
LEFT JOIN `an_anagrafiche` `vettori` ON `dt_ddt`.`idvettore` = `vettori`.`idanagrafica`
|
||||
LEFT JOIN `an_sedi` AS sedi ON `dt_ddt`.`idsede_partenza` = sedi.`id`
|
||||
LEFT JOIN `an_sedi` AS `sedi_destinazione`ON `dt_ddt`.`idsede_destinazione` = `sedi_destinazione`.`id`
|
||||
LEFT JOIN (SELECT `idddt`, SUM(`subtotale` - `sconto`) AS `totale_imponibile`, SUM(`subtotale` - `sconto` + `iva`) AS `totale` FROM `dt_righe_ddt` GROUP BY `idddt`) AS righe ON `dt_ddt`.`id` = `righe`.`idddt`
|
||||
LEFT JOIN `dt_statiddt` ON `dt_statiddt`.`id` = `dt_ddt`.`idstatoddt`
|
||||
LEFT JOIN (SELECT `zz_operations`.`id_email`, `zz_operations`.`id_record` FROM `zz_operations` INNER JOIN `em_emails` ON `zz_operations`.`id_email` = `em_emails`.`id` INNER JOIN `em_templates` ON `em_emails`.`id_template` = `em_templates`.`id` INNER JOIN `zz_modules` ON `zz_operations`.`id_module` = `zz_modules`.`id` WHERE `zz_modules`.`name` = 'Ddt di vendita' AND `zz_operations`.`op` = 'send-email' GROUP BY `zz_operations`.`id_record`) AS `email` ON `email`.`id_record` = `dt_ddt`.`id`
|
||||
WHERE
|
||||
1=1 AND `dir` = 'entrata' AND (`data` BETWEEN '2023-01-01' AND '2023-12-31 23:59:59')
|
||||
HAVING
|
||||
2=2
|
||||
ORDER BY
|
||||
`data` DESC,
|
||||
CAST(`numero_esterno` AS UNSIGNED) DESC,
|
||||
`dt_ddt`.created_at DESC" WHERE `name` = 'Ddt di vendita';
|
Loading…
Reference in New Issue
Block a user