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',
LEFT(reason,LENGTH(reason) - 2)
)
))errors
)
)errors
FROM (
SELECT ticketFk,
CONCAT_WS('',
@ -107,14 +108,13 @@ module.exports = Self => {
AND itc.countryFk = su.countryFk
LEFT JOIN vn.invoiceOutSerial ios ON ios.taxAreaFk = 'WORLD'
AND ios.code = invoiceSerial(t.clientFk, t.companyFk, 'M')
WHERE (al.code = 'PACKED'
OR (am.code = 'refund' AND al.code != 'delivered'))
WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code <> 'delivered'))
AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY) AND util.dayEnd(?)
AND t.refFk IS NULL
AND IFNULL(a.hasDailyInvoice, co.hasDailyInvoice)
GROUP BY ticketFk
HAVING hasErrorToInvoice
OR NOT hasErrorTaxDataChecked
OR hasErrorTaxDataChecked
OR hasErrorDeleted
OR hasErrorItemTaxCountry
OR hasErrorAddress