- $supplier_currency = get_supplier_currency($supplier_id);
- $bank_account_currency = get_bank_account_currency($bank_account);
- $bank_gl_account = get_bank_gl_account($bank_account);
-
- if ($rate == 0)
- {
- $supp_amount = exchange_from_to($amount, $bank_account_currency, $supplier_currency, $date_);
- $supp_discount = exchange_from_to($discount, $bank_account_currency, $supplier_currency, $date_);
- $supp_charge = exchange_from_to($charge, $bank_account_currency, $supplier_currency, $date_);
+ if ($trans_no != 0) {
+ delete_comments(ST_SUPPAYMENT, $trans_no);
+ void_bank_trans(ST_SUPPAYMENT, $trans_no, true);
+ void_gl_trans(ST_SUPPAYMENT, $trans_no, true);
+ void_cust_allocations(ST_SUPPAYMENT, $trans_no, $date_);