X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep101.php;h=1a800d0077336c50c097970e6ba35382c9341b6b;hb=9561c66909d960cd75bcbb08bae2132f3de7e6da;hp=667604c86c32621c7f72cd7e67ca95b5ce35c719;hpb=1b9208f6334e4371fa433d3b6cdc506ae0f95f98;p=fa-stable.git diff --git a/reporting/rep101.php b/reporting/rep101.php index 667604c8..1a800d00 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -157,7 +157,7 @@ function print_customer_balances() $grandtotal = array(0,0,0,0); - $sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master "; + $sql = "SELECT debtor_no, name, curr_code, inactive FROM ".TB_PREF."debtors_master "; if ($fromcust != ALL_TEXT) $sql .= "WHERE debtor_no=".db_escape($fromcust); $sql .= " ORDER BY name"; @@ -172,22 +172,22 @@ function print_customer_balances() $bal = get_open_balance($myrow['debtor_no'], $from); $init = array(); - $init[0] = round2(abs($bal['charges']*$rate), $dec); - $init[1] = round2(abs($bal['credits']*$rate), $dec); - $init[2] = round2($bal['Allocated']*$rate, $dec); + $init[0] = round2(($bal != false ? abs($bal['charges']) : 0)*$rate, $dec); + $init[1] = round2(($bal != false ? abs($bal['credits']) : 0)*$rate, $dec); + $init[2] = round2(($bal != false ? $bal['Allocated'] : 0)*$rate, $dec); if ($show_balance) { $init[3] = $init[0] - $init[1]; $accumulate += $init[3]; } else - $init[3] = round2($bal['OutStanding']*$rate, $dec); + $init[3] = round2(($bal != false ? $bal['OutStanding'] : 0)*$rate, $dec); $res = get_transactions($myrow['debtor_no'], $from, $to); if ($no_zeros && db_num_rows($res) == 0) continue; $rep->fontSize += 2; - $rep->TextCol(0, 2, $myrow['name']); + $rep->TextCol(0, 2, $myrow['name'].($myrow['inactive']==1 ? " ("._("Inactive").")" : "")); if ($convert) $rep->TextCol(2, 3, $myrow['curr_code']); $rep->fontSize -= 2;