- ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_discount) * rate * -1, 0)) AS credits,
- SUM(".TB_PREF."debtor_trans.alloc * rate) AS Allocated,
+ ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_discount)";
+ if ($convert)
+ $sql .= " * rate";
+ $sql .= " * -1, 0)) AS credits,
+ SUM(".TB_PREF."debtor_trans.alloc";
+ if ($convert)
+ $sql .= " * rate";
+ $sql .= ") AS Allocated,