! -> Note
$ -> Affected files
+26-Sep-2008 Joe Hunt
+# Bug [0000064] Credit This on an invoice should automatically allocate the credit to that invoice
+$ /sales/includes/db/sales_credit_db.inc
+
26-Sep-2008 Janusz Dobrowolski
# Bug [0000062] Delivery Modifitication - duplicated tax details.
$ /sales/includes/db/sales_delivery_db.inc
$ci = new Cart(10, $_GET['InvoiceNumber'], true);
$ci->trans_type = 11;
+ //$ci->src_docs = array($_GET['InvoiceNumber'], $ci->trans_no);
$ci->src_docs = $ci->trans_no;
$ci->src_date = $ci->document_date;
$ci->trans_no = 0;
//
function write_credit_note($credit_note, $write_off_acc)
{
- $credit_invoice = count($credit_note->src_docs) ? reset($credit_note->src_docs) : 0;
-
+ // Changed 2008-09-26 Joe Hunt -------
+ $credit_invoice = count(array_keys($credit_note->src_docs)) ? reset(array_keys($credit_note->src_docs)) : 0;
$credit_date = $credit_note->document_date;
$tax_group_id = $credit_note->tax_group_id;
update_debtor_trans_allocation(10, $credit_invoice, $allocate_amount);
update_debtor_trans_allocation(11, $credit_no, $allocate_amount); // ***
add_cust_allocation($allocate_amount, 11, $credit_no, 10, $credit_invoice);
+ // Exchange Variations Joe Hunt 2008-09-20 ////////////////////////////////////////
+
+ exchange_variation(11, $credit_no, 10, $credit_invoice, $credit_date,
+ $allocate_amount, payment_person_types::customer());
+
+ ///////////////////////////////////////////////////////////////////////////
+
}
}
}