Skip to content

Commit cda02f0

Browse files
committed
fix: query di installazione
1 parent 93994b2 commit cda02f0

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

update/2_8_3.sql

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FROM
1111
LEFT JOIN `co_statipreventivi_lang`
1212
ON (
1313
`co_statipreventivi`.`id` = `co_statipreventivi_lang`.`id_record`
14-
AND co_statipreventivi_lang.|lang|
14+
AND co_statipreventivi_lang.id_lang = |lang|
1515
)
1616
LEFT JOIN (
1717
SELECT
@@ -48,7 +48,7 @@ FROM
4848
ON `fattura`.`idpreventivo` = `co_preventivi`.`id`
4949
LEFT JOIN (
5050
SELECT
51-
COUNT(en_emails.id) AS emails,
51+
COUNT(em_emails.id) AS emails,
5252
em_emails.id_record
5353
FROM
5454
em_emails
@@ -68,14 +68,7 @@ FROM
6868
WHERE
6969
1 = 1
7070
|segment(`co_preventivi`.`id_segment`)|
71-
|date_period(
72-
custom,
73-
\'|period_start|\' >= `data_bozza` AND \'|period_start|\' <= `data_conclusione`,
74-
\'|period_end|\' >= `data_bozza` AND \'|period_end|\' <= `data_conclusione`,
75-
`data_bozza` >= \'|period_start|\' AND `data_bozza` <= \'|period_end|\',
76-
`data_conclusione` >= \'|period_start|\' AND `data_conclusione` <= \'|period_end|\',
77-
`data_bozza` >= \'|period_start|\' AND `data_conclusione` = NULL
78-
)|
71+
|date_period(custom,\'|period_start|\' >= `data_bozza` AND \'|period_start|\' <= `data_conclusione`,\'|period_end|\' >= `data_bozza` AND \'|period_end|\' <= `data_conclusione`,`data_bozza` >= \'|period_start|\' AND `data_bozza` <= \'|period_end|\',`data_conclusione` >= \'|period_start|\' AND `data_conclusione` <= \'|period_end|\',`data_bozza` >= \'|period_start|\' AND `data_conclusione` = NULL)|
7972
AND `default_revision` = 1
8073
GROUP BY
8174
`co_preventivi`.`id`,
@@ -192,7 +185,7 @@ FROM
192185
FROM `co_tipidocumento`
193186
WHERE `dir` = \'entrata\'
194187
)
195-
AND `numero_esterno` != \'\'
188+
AND `numero_esterno` != \'\'
196189
|date_period(`co_documenti`.`data`)|
197190
GROUP BY
198191
`id_segment`, `numero_esterno`, `idtipodocumento`
@@ -730,4 +723,4 @@ HAVING
730723
2 = 2
731724
ORDER BY
732725
`id`,
733-
`nome` ASC' WHERE `zz_modules`.`name` = 'Utenti e permessi';
726+
`nome` ASC' WHERE `zz_modules`.`name` = 'Utenti e permessi';

0 commit comments

Comments
 (0)