This commit is contained in:
parent
75a4d6947f
commit
9fcad457a7
|
@ -69,7 +69,8 @@ module.exports = Self => {
|
||||||
'reason',
|
'reason',
|
||||||
LEFT(reason,LENGTH(reason) - 2)
|
LEFT(reason,LENGTH(reason) - 2)
|
||||||
)
|
)
|
||||||
))errors
|
)
|
||||||
|
)errors
|
||||||
FROM (
|
FROM (
|
||||||
SELECT ticketFk,
|
SELECT ticketFk,
|
||||||
CONCAT_WS('',
|
CONCAT_WS('',
|
||||||
|
@ -107,14 +108,13 @@ module.exports = Self => {
|
||||||
AND itc.countryFk = su.countryFk
|
AND itc.countryFk = su.countryFk
|
||||||
LEFT JOIN vn.invoiceOutSerial ios ON ios.taxAreaFk = 'WORLD'
|
LEFT JOIN vn.invoiceOutSerial ios ON ios.taxAreaFk = 'WORLD'
|
||||||
AND ios.code = invoiceSerial(t.clientFk, t.companyFk, 'M')
|
AND ios.code = invoiceSerial(t.clientFk, t.companyFk, 'M')
|
||||||
WHERE (al.code = 'PACKED'
|
WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code <> 'delivered'))
|
||||||
OR (am.code = 'refund' AND al.code != 'delivered'))
|
|
||||||
AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY) AND util.dayEnd(?)
|
AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY) AND util.dayEnd(?)
|
||||||
AND t.refFk IS NULL
|
AND t.refFk IS NULL
|
||||||
AND IFNULL(a.hasDailyInvoice, co.hasDailyInvoice)
|
AND IFNULL(a.hasDailyInvoice, co.hasDailyInvoice)
|
||||||
GROUP BY ticketFk
|
GROUP BY ticketFk
|
||||||
HAVING hasErrorToInvoice
|
HAVING hasErrorToInvoice
|
||||||
OR NOT hasErrorTaxDataChecked
|
OR hasErrorTaxDataChecked
|
||||||
OR hasErrorDeleted
|
OR hasErrorDeleted
|
||||||
OR hasErrorItemTaxCountry
|
OR hasErrorItemTaxCountry
|
||||||
OR hasErrorAddress
|
OR hasErrorAddress
|
||||||
|
|
Loading…
Reference in New Issue