$due = "IF (trans.type=".ST_SALESINVOICE.", trans.due_date, trans.tran_date)";
$sql = "SELECT debtor.name, debtor.curr_code, terms.terms, debtor.credit_limit,
credit_status.dissallow_invoices, credit_status.reason_description,
$due = "IF (trans.type=".ST_SALESINVOICE.", trans.due_date, trans.tran_date)";
$sql = "SELECT debtor.name, debtor.curr_code, terms.terms, debtor.credit_limit,
credit_status.dissallow_invoices, credit_status.reason_description,