X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep101.php;h=c98253f2ce46e94887ec38f3b8c9acf80d83bc9f;hb=4763f9316d59363edaffd38e49655ad5ff29611d;hp=fa6d832841a7f508cd0c6c0f059ca84ff0356829;hpb=7a50c189ea995d5fe6785feb7710c00396065d2b;p=fa-stable.git diff --git a/reporting/rep101.php b/reporting/rep101.php index fa6d8328..c98253f2 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -30,7 +30,9 @@ 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' AND ".TB_PREF."debtor_trans.debtor_no = '$debtorno' + 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 ORDER BY ".TB_PREF."debtor_trans.tran_date"; @@ -82,8 +84,7 @@ function print_customer_balances() $rep->Info($params, $cols, $headers, $aligns); $rep->Header(); - $total = array(); - $grandtotal = array(); + $grandtotal = array(0,0,0,0); $sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master "; if ($fromcust != reserved_words::get_all_numeric()) @@ -105,7 +106,7 @@ function print_customer_balances() if (db_num_rows($res)==0) continue; $rep->Line($rep->row + 4); - $total[0] = $total[1] = $total[2] = $total[3] = 0.0; + $total = array(0,0,0,0); while ($trans = db_fetch($res)) { $rep->NewLine(1, 2); @@ -120,6 +121,8 @@ function print_customer_balances() $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $date); 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;