Skip to content

Commit

Permalink
fix(cash): remove fault SQL exception handlers
Browse files Browse the repository at this point in the history
This commit removes problematic SQL exception handlers from the
CalculateCashInvoiceBalances() stored procedure.  All exception handling
should be done with the `db.transaction()` framework ... having these
extra handler in the SQL code led to confusing error messages when
strict mode throws exceptions.

With these exceptions removed, and the Vanga database re-created, the
issues posting USD cash payments disappears.

Closes #1445.
  • Loading branch information
Jonathan Niles authored and sfount committed Apr 11, 2017
1 parent 8a3886e commit f940cf9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions server/models/procedures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,6 @@ BEGIN
DECLARE enterpriseCurrencyId INT;
DECLARE currentExchangeRate DECIMAL(19,4);

DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;

-- copy cash payment values into working variables
SELECT cash.date, cash.currency_id, enterprise.id, enterprise.currency_id, cash.debtor_uuid
INTO cashDate, cashCurrencyId, cashEnterpriseId, enterpriseCurrencyId, cashDebtorUuid
Expand Down

0 comments on commit f940cf9

Please sign in to comment.