mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-15 18:00:16 +01:00
28 lines
2.4 KiB
SQL
28 lines
2.4 KiB
SQL
-- Ampliamento decimali fattore moltiplicativo per unità di misura secondaria
|
|
ALTER TABLE `mg_articoli` CHANGE `fattore_um_secondaria` `fattore_um_secondaria` DECIMAL(19,10) NULL DEFAULT NULL;
|
|
|
|
-- Fix query vista ordini fornitore
|
|
UPDATE `zz_modules` SET `options` = "SELECT
|
|
|select|
|
|
FROM
|
|
`or_ordini`
|
|
LEFT JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine` = `or_tipiordine`.`id`
|
|
LEFT JOIN `an_anagrafiche` ON `or_ordini`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`
|
|
LEFT JOIN (SELECT `idordine`, SUM(`qta` - `qta_evasa`) AS `qta_da_evadere`, SUM(`subtotale` - `sconto`) AS `totale_imponibile`, SUM(`subtotale` - `sconto` + `iva`) AS `totale` FROM `or_righe_ordini` GROUP BY `idordine`) AS righe ON `or_ordini`.`id` = `righe`.`idordine`
|
|
LEFT JOIN (SELECT `idordine`, MIN(`data_evasione`) AS `data_evasione` FROM `or_righe_ordini` WHERE (`qta` - `qta_evasa`)>0 GROUP BY `idordine`) AS `righe_da_evadere` ON `righe`.`idordine`=`righe_da_evadere`.`idordine`
|
|
LEFT JOIN `or_statiordine` ON `or_statiordine`.`id` = `or_ordini`.`idstatoordine`
|
|
LEFT JOIN (SELECT GROUP_CONCAT(DISTINCT co_documenti.numero_esterno SEPARATOR ', ') AS info, co_righe_documenti.original_document_id AS idordine FROM co_documenti INNER JOIN co_righe_documenti ON co_documenti.id = co_righe_documenti.iddocumento WHERE original_document_type='Modules\\\\Ordini\\\\Ordine' GROUP BY idordine, original_document_id) AS fattura ON fattura.idordine = or_ordini.id
|
|
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` = 'Ordini fornitore' AND `zz_operations`.`op` = 'send-email' GROUP BY `zz_operations`.`id_record`) AS `email` ON `email`.`id_record` = `or_ordini`.`id`
|
|
WHERE
|
|
1=1 |segment(`or_ordini`.`id_segment`)| AND `dir` = 'uscita' |date_period(`or_ordini`.`data`)|
|
|
HAVING
|
|
2=2
|
|
ORDER BY
|
|
`data` DESC,
|
|
CAST(`numero_esterno` AS UNSIGNED) DESC" WHERE `name` = 'Ordini fornitore';
|
|
|
|
-- Correzione dimensione widget
|
|
UPDATE `zz_settings` SET `valore` = 'col-md-3', `tipo` = 'list[col-md-1,col-md-2,col-md-3,col-md-4,col-md-6]', `nome` = 'Dimensione widget predefinita' WHERE `nome` = 'Numero massimo Widget per riga';
|
|
|
|
-- Reset class widget
|
|
UPDATE `zz_widgets` SET `class` = NULL; |