fix: closeTicket idem salix Refs: #6549
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-04-04 14:46:51 +02:00
parent 75a4d6947f
commit 9fcad457a7
1 changed files with 19 additions and 19 deletions

View File

@ -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