- $allocate_amount = ($invoice_alloc_balance > $total) ? $total : $invoice_alloc_balance;
- /*Now insert the allocation record if > 0 */
- if ($allocate_amount != 0) {
- update_debtor_trans_allocation(ST_SALESINVOICE, $credit_invoice, $allocate_amount);
- update_debtor_trans_allocation(ST_CUSTCREDIT, $credit_no, $allocate_amount); // ***
- add_cust_allocation($allocate_amount, ST_CUSTCREDIT, $credit_no, ST_SALESINVOICE, $credit_invoice);
- // Exchange Variations Joe Hunt 2008-09-20 ////////////////////////////////////////