Fixed upgrade procedures (obsolete columns dropped in post_install phase), restored...
[fa-stable.git] / admin / db / voiding_db.inc
index 5a6831359de6a81536aee88e09aa8646a1a33782..70878ad40281d98b79446826d8e782165411e678 100644 (file)
@@ -43,6 +43,8 @@ function void_transaction($type, $type_no, $date_, $memo_)
                        if (!check_void_bank_trans($type, $type_no))
                                return _('This transaction cannot be voided because the operation would decrease account balance below allowed limit in some point of account history.');
                case ST_SALESINVOICE : // it's a customer invoice
+                       if (is_cust_invoice_credited($type_no))
+                               return _('This invoice cannot be voided because it was already credited.');
                case ST_CUSTCREDIT : // it's a customer credit note
                case ST_CUSTDELIVERY : // it's a customer dispatch
                        if (!exists_customer_trans($type, $type_no))