Small bug in invoice view fixed.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 8 May 2009 10:15:11 +0000 (10:15 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 8 May 2009 10:15:11 +0000 (10:15 +0000)
sales/includes/db/sales_invoice_db.inc

index de507e635ae5fdbfffa270c94f6077dbab6a0012..71db48b73560f55155f47eb8334f6618554689ee 100644 (file)
@@ -166,7 +166,7 @@ function write_sales_invoice(&$invoice)
        add_comments(10, $invoice_no, $date_, $invoice->Comments);
 
        if ($trans_no == 0) {
-               references::save_last($invoice->reference, 10);
+               references::save(10, $invoice_no, $invoice->reference);
                if ($invoice->cash) {
                        $amount = $items_total + $items_added_tax + $invoice->freight_cost 
                                + $freight_added_tax;
@@ -178,7 +178,7 @@ function write_sales_invoice(&$invoice)
                        $pmtno = write_customer_payment(0, $invoice->customer_id, 
                                $invoice->Branch, $invoice->cash_account, $date_,
                                references::get_next(12), $amount-$discount, $discount,
-                               _('Cash invoice').' '.$invoice->trans_no);
+                               _('Cash invoice').' '.$invoice_no);
                        add_cust_allocation($amount, 12, $pmtno, 10, $invoice_no);
 
                        update_debtor_trans_allocation(10, $invoice_no, $amount);