- } /*end of if sales integrated with debtors */
-}
-
-//----------------------------------------------------------------------------------------
-
-function add_g_trans_credit_common($order, $credit_no, $date_,
- $credit_items_total, $freight, $taxes, $tax_total, &$branch_data)
-{
- $company_data = get_company_prefs();
-
- /*Post credit note transaction to GL credit debtors,
- debit freight re-charged and debit sales */
-
- if (($credit_items_total + $freight + $tax_total) != 0)
- {
-
- add_gl_trans_customer(11, $credit_no, $date_, $branch_data["receivables_account"], 0, 0,
- -($credit_items_total + $freight + $tax_total), $order->customer_id,
- "The total debtor GL posting for the credit note could not be inserted");
- }
-
- if ($freight !=0)
- {
- add_gl_trans_customer(11, $credit_no, $date_, $company_data["freight_act"], 0, 0,
- $freight, $order->customer_id,
- "The freight GL posting for this credit note could not be inserted");
- }
-
- foreach ($taxes as $taxitem)
- {
- if ($taxitem['Value'] != 0)
- {
-
- add_customer_trans_tax_detail_item(11, $credit_no, $taxitem['tax_type_id'],
- $taxitem['rate'], $taxitem['included_in_price'], $taxitem['Value']);
-
- add_gl_trans_customer(11, $credit_no, $date_, $taxitem['sales_gl_code'], 0, 0,
- $taxitem['Value'], $order->customer_id,
- "A tax GL posting for this credit note could not be inserted");
- }
- }