X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep101.php;h=a206239a7ba82ef0c388109d2b957371399eaebc;hb=b76384515a4eca6456b6f045836e3c913244c78f;hp=3fd3e979030e69771a01e5a1d900f94ee201135f;hpb=f474e197d8af7acfea554f560a5c45f7d0bef1f7;p=fa-stable.git diff --git a/reporting/rep101.php b/reporting/rep101.php index 3fd3e979..a206239a 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -30,7 +30,7 @@ function get_transactions($debtorno, $date) ((".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 @@ -84,7 +84,6 @@ function print_customer_balances() $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 "; @@ -107,6 +106,7 @@ function print_customer_balances() 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); @@ -118,9 +118,11 @@ function print_customer_balances() $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;