-
- $payment_no = add_customer_trans(systypes::cust_payment(), $customer_id, $branch_id, $date_,
- $ref, -($amount), -($discount));
-
+
+ $payment_no = write_customer_trans(12, $trans_no,
+ $customer_id, $branch_id, $date_, $ref, $amount, $discount);
+
+ if ($trans_no != 0) {
+ delete_comments(12, $trans_no);
+ void_bank_trans(12, $trans_no, true);
+ void_gl_trans(12, $trans_no, true);
+ void_cust_allocations(12, $trans_no, $date_);
+ }
+