$items_added_tax, $invoice->freight_cost, $freight_added_tax,
$invoice->sales_type, $sales_order, $invoice->ship_via,
$invoice->due_date, 0, 0, $invoice->dimension_id,
- $invoice->dimension2_id, $invoice->payment);
+ $invoice->dimension2_id, $invoice->payment, $invoice->tax_included);
// 2008-06-14 extra $alloc, 2008-11-12 added dimension_id Joe Hunt
if ($trans_no == 0) {
$taxitem['rate'], $invoice->tax_included, $taxitem['Value'],
$taxitem['Net'], $ex_rate, $date_, $invoice->reference);
- $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $taxitem['sales_gl_code'], 0, 0,
- (-$taxitem['Value']), $invoice->customer_id,
- "A tax GL posting could not be inserted");
+ if (isset($taxitem['sales_gl_code']))
+ $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $taxitem['sales_gl_code'], 0, 0,
+ (-$taxitem['Value']), $invoice->customer_id,
+ "A tax GL posting could not be inserted");
}
}