X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=reporting%2Frep101.php;h=d8f37c77a74e3ad6bc5553625517bfe183461e2e;hb=95303d7b5280820af76ddbd8908b120813f1e763;hp=370ad954133b43c613c571c960e2154b452ee6e0;hpb=34f8e554ed5ac52648b5a542f02b39b6c6e3fc46;p=fa-stable.git diff --git a/reporting/rep101.php b/reporting/rep101.php index 370ad954..d8f37c77 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -71,17 +71,16 @@ function get_transactions($debtorno, $from, $to) $from = date2sql($from); $to = date2sql($to); - $sql = "SELECT ".TB_PREF."debtor_trans.*, ".TB_PREF."sys_types.type_name, + $sql = "SELECT ".TB_PREF."debtor_trans.*, (".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_discount) AS TotalAmount, ".TB_PREF."debtor_trans.alloc AS Allocated, ((".TB_PREF."debtor_trans.type = 10) AND ".TB_PREF."debtor_trans.due_date < '$to') AS OverDue - FROM ".TB_PREF."debtor_trans, ".TB_PREF."sys_types + FROM ".TB_PREF."debtor_trans WHERE ".TB_PREF."debtor_trans.tran_date >= '$from' AND ".TB_PREF."debtor_trans.tran_date <= '$to' 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"; return db_query($sql,"No transactions were returned"); @@ -178,7 +177,7 @@ function print_customer_balances() while ($trans = db_fetch($res)) { $rep->NewLine(1, 2); - $rep->TextCol(0, 1, $trans['type_name']); + $rep->TextCol(0, 1, systypes::name($trans['type'])); $rep->TextCol(1, 2, $trans['reference']); $rep->DateCol(2, 3, $trans['tran_date'], true); if ($trans['type'] == 10) @@ -208,7 +207,7 @@ function print_customer_balances() else $item[3] = ($trans['TotalAmount'] + $trans['Allocated']) * $rate; */ - if ($trans['type'] == 10) + if ($trans['type'] == 10 || $trans['type'] == 1) $item[3] = $item[0] + $item[1] - $item[2]; else $item[3] = $item[0] - $item[1] + $item[2];