Improved journal trans: added currency support, tax and source document date. Allowed...
[fa-stable.git] / sales / includes / db / sales_invoice_db.inc
index c38d69542bedb45202737421c31a1f5ef1edc989..f1ead0c6d8a55c48964e31396e404e2940aad201 100644 (file)
@@ -197,7 +197,7 @@ function write_sales_invoice(&$invoice)
                                $invoice->Branch, $invoice->pos['pos_account'], $date_,
                                $Refs->get_next(ST_CUSTPAYMENT), $amount-$discount, $discount,
                                _('Cash invoice').' '.$invoice_no);
-                       add_cust_allocation($amount, ST_CUSTPAYMENT, $pmtno, ST_SALESINVOICE, $invoice_no);
+                       add_cust_allocation($amount, ST_CUSTPAYMENT, $pmtno, ST_SALESINVOICE, $invoice_no, $invoice->customer_id, $date_);
 
                        update_debtor_trans_allocation(ST_SALESINVOICE, $invoice_no);
                        update_debtor_trans_allocation(ST_CUSTPAYMENT, $pmtno);