From: Jan Büren Date: Thu, 14 Mar 2019 15:08:23 +0000 (+0100) Subject: Bankbewegung: Zuweisungsüberbuchungen per Constraint verbieten X-Git-Tag: release-3.5.4~94 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=feeb3fc83528236c9f5377c75020984f22515c2a;p=kivitendo-erp.git Bankbewegung: Zuweisungsüberbuchungen per Constraint verbieten --- diff --git a/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql b/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql new file mode 100644 index 000000000..cb812937c --- /dev/null +++ b/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql @@ -0,0 +1,5 @@ +-- @tag: bank_transactions_check_constraint_invoice_amount +-- @description: Bank-Transaktionen dürfen mehrfach verbucht werden - Sicherheitscheck auf DB-Ebene, Überbuchen der Bankbewegung verbieten +-- @depends: bank_transactions_type2 release_3_5_3 + +ALTER TABLE bank_transactions ADD CHECK (abs(invoice_amount) <= abs(amount));