$sql .= ",bank_act,".TB_PREF."bank_accounts.bank_name, ".TB_PREF."bank_accounts.bank_account_name,
".TB_PREF."bank_accounts.account_type AS BankTransType,
".TB_PREF."bank_accounts.bank_curr_code,
- ".TB_PREF."bank_trans.amount as bank_amount";
+ bt.amount as bank_amount, bt.charge bank_charge";
}
if ($trans_type == ST_SALESINVOICE || $trans_type == ST_CUSTCREDIT || $trans_type == ST_CUSTDELIVERY) {
if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
// it's a payment so also get the bank account
- $sql .= ", ".TB_PREF."bank_trans, ".TB_PREF."bank_accounts";
+ $sql .= ", ".TB_PREF."bank_trans bt, ".TB_PREF."bank_accounts";
}
if ($trans_type == ST_SALESINVOICE || $trans_type == ST_CUSTCREDIT || $trans_type == ST_CUSTDELIVERY) {
if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
// it's a payment so also get the bank account
- $sql .= " AND ".TB_PREF."bank_trans.trans_no =".db_escape($trans_id)."
- AND ".TB_PREF."bank_trans.type=$trans_type
- AND ".TB_PREF."bank_trans.amount != 0
- AND ".TB_PREF."bank_accounts.id=".TB_PREF."bank_trans.bank_act ";
+ $sql .= " AND bt.trans_no =".db_escape($trans_id)."
+ AND bt.type=$trans_type
+ AND bt.amount != 0
+ AND ".TB_PREF."bank_accounts.id=bt.bank_act ";
}
if ($trans_type == ST_SALESINVOICE || $trans_type == ST_CUSTCREDIT || $trans_type == ST_CUSTDELIVERY) {
// it's an invoice so also get the shipper