7383-testToMaster #2445
|
@ -11,7 +11,7 @@ BEGIN
|
|||
SELECT d.client, d.amount, pm.graceDays
|
||||
FROM bi.defaulters d
|
||||
JOIN vn.client c ON c.id = d.client
|
||||
JOIN vn.payMethod pm ON pm.id = c.pay_met_id
|
||||
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
|
||||
WHERE hasChanged AND date = vDate;
|
||||
|
||||
DECLARE invoices CURSOR FOR
|
||||
|
|
|
@ -58,7 +58,7 @@ BEGIN
|
|||
JOIN vn.address a on a.id = t.addressFk
|
||||
JOIN vn.client c on c.id = a.clientFk
|
||||
JOIN tmp.ticket_list tt on tt.id = t.id
|
||||
JOIN vn.item i on s.itemFk = i.Id_Ticket
|
||||
JOIN vn.item i on s.itemFk = i.id
|
||||
JOIN vn.company co on co.id = t.companyFk
|
||||
LEFT JOIN vn.company co2 on co2.clientFk = c.id
|
||||
JOIN vn.itemType it on it.id = i.typeFk
|
||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`solunionCAP_afterInse
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE client c
|
||||
JOIN creditClassification cc ON cc.client = c.clientFk
|
||||
JOIN creditClassification cc ON cc.client = c.id
|
||||
JOIN creditInsurance ci ON ci.creditClassification = cc.id
|
||||
SET creditInsurance = ci.credit * 2 WHERE ci.id = NEW.creditInsurance;
|
||||
END$$
|
||||
|
|
|
@ -5,12 +5,12 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`solunionCAP_afterUpda
|
|||
BEGIN
|
||||
IF NEW.dateLeaving IS NOT NULL THEN
|
||||
UPDATE client c
|
||||
JOIN creditClassification cc ON cc.client = c.clientFk
|
||||
JOIN creditClassification cc ON cc.client = c.id
|
||||
JOIN creditInsurance ci ON ci.creditClassification = cc.id
|
||||
SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance;
|
||||
ELSE
|
||||
UPDATE client c
|
||||
JOIN creditClassification cc ON cc.client = c.clientFk
|
||||
JOIN creditClassification cc ON cc.client = c.id
|
||||
JOIN creditInsurance ci ON ci.creditClassification = cc.id
|
||||
SET creditInsurance = ci.credit * 2 WHERE ci.id = OLD.creditInsurance;
|
||||
END IF;
|
||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`solunionCAP_beforeDel
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE client c
|
||||
JOIN creditClassification cc ON cc.client = c.clientFk
|
||||
JOIN creditClassification cc ON cc.client = c.id
|
||||
JOIN creditInsurance ci ON ci.creditClassification = cc.id
|
||||
SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance;
|
||||
END$$
|
||||
|
|
Loading…
Reference in New Issue