From 452ec3d7319491df73c9416ea671341a80f2a695 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 13 Dec 2024 08:29:14 +0100 Subject: [PATCH] fix: refs #247552 ticket 247552 claimRatio_add --- db/routines/vn/procedures/claimRatio_add.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/claimRatio_add.sql b/db/routines/vn/procedures/claimRatio_add.sql index 8c3213644..5e2e66a8e 100644 --- a/db/routines/vn/procedures/claimRatio_add.sql +++ b/db/routines/vn/procedures/claimRatio_add.sql @@ -46,7 +46,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved'; @@ -71,7 +71,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved' AND c.isChargedToMana; @@ -82,7 +82,7 @@ BEGIN JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk SET ce.isGreuge = TRUE - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved'; @@ -161,7 +161,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND cs.code = 'resolved' AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR GROUP BY c.clientFk -- 2.40.1