diff --git a/schema/triggers/rebalanceIncreasedCredit.sql b/schema/triggers/rebalanceIncreasedCredit.sql index 43a0841..d3031ab 100644 --- a/schema/triggers/rebalanceIncreasedCredit.sql +++ b/schema/triggers/rebalanceIncreasedCredit.sql @@ -7,7 +7,7 @@ CREATE TRIGGER rebalanceIncreasedCredit BEGIN INSERT INTO __INTERNAL_TRIGGER_STACK - SELECT t.ROWID, NEW.value, ca.difference, + SELECT t.ROWID, t.billId, t.credId, min(ca.difference, NEW.value - OLD.value) FROM Transfer t JOIN CurrentArrears ca ON t.billId = ca.billId