((".TB_PREF."debtor_trans.type = 10)
AND ".TB_PREF."debtor_trans.due_date < '$date') AS OverDue
FROM ".TB_PREF."debtor_trans, ".TB_PREF."sys_types
- WHERE ".TB_PREF."debtor_trans.tran_date <= '$date'
+ WHERE ".TB_PREF."debtor_trans.tran_date <= '$date'
AND ".TB_PREF."debtor_trans.debtor_no = '$debtorno'
AND ".TB_PREF."debtor_trans.type != 13
AND ".TB_PREF."debtor_trans.type = ".TB_PREF."sys_types.type_id
$rep->Info($params, $cols, $headers, $aligns);
$rep->Header();
- $total = array(0,0,0,0);
$grandtotal = array(0,0,0,0);
$sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master ";
if (db_num_rows($res)==0)
continue;
$rep->Line($rep->row + 4);
+ $total = array(0,0,0,0);
while ($trans = db_fetch($res))
{
$rep->NewLine(1, 2);
$rep->TextCol(3, 4, sql2date($trans['due_date']));
$item[0] = $item[1] = 0.0;
if ($convert)
- $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $date);
+ $rate = $trans['rate'];
else
$rate = 1.0;
+ if ($trans['type'] == 11 || $trans['type'] == 12 || $trans['type'] == 2)
+ $trans['TotalAmount'] *= -1;
if ($trans['TotalAmount'] > 0.0)
{
$item[0] = abs($trans['TotalAmount']) * $rate;