- if ($trans_type == ST_SUPPCREDIT)
- $taxitem['Value'] = -$taxitem['Value'];
- $total += add_gl_trans_supplier($trans_type, $invoice_id, $date_,
- $taxitem['purchasing_gl_code'], 0, 0, $taxitem['Value'],
- $supp_trans->supplier_id,
- "A general ledger transaction for the tax amount could not be added");
+ if (isset($taxitem['purchasing_gl_code']))
+ {
+ if ($trans_type == ST_SUPPCREDIT)
+ $taxitem['Value'] = -$taxitem['Value'];
+ $total += add_gl_trans_supplier($trans_type, $invoice_id, $date_,
+ $taxitem['purchasing_gl_code'], 0, 0, $taxitem['Value'],
+ $supp_trans->supplier_id,
+ "A general ledger transaction for the tax amount could not be added");
+ }