X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep102.php;h=90f7db024a9b246bf5fa5795da37bd9919679459;hb=107a22ab168c1102f3f534a22cd5b8290331f17d;hp=beea87bcae78a995e0d93ec27de278231c2318b2;hpb=7c5836f0236b223954d803717762a15942ec0ca2;p=fa-stable.git diff --git a/reporting/rep102.php b/reporting/rep102.php index beea87bc..90f7db02 100644 --- a/reporting/rep102.php +++ b/reporting/rep102.php @@ -30,8 +30,9 @@ print_aged_customer_analysis(); function get_invoices($customer_id, $to, $all=true) { $todate = date2sql($to); - $PastDueDays1 = get_company_pref('past_due_days'); - $PastDueDays2 = 2 * $PastDueDays1; + $current = 1; + $PastDueDays1 = get_company_pref('past_due_days') + $current; + $PastDueDays2 = 2 * $PastDueDays1 + $current; // Revomed allocated from sql if ($all) @@ -46,7 +47,7 @@ function get_invoices($customer_id, $to, $all=true) $sql = "SELECT ".TB_PREF."debtor_trans.type, ".TB_PREF."debtor_trans.reference, ".TB_PREF."debtor_trans.tran_date, $value as Balance, - IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= 0,$value,0) AS Due, + IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $current,$value,0) AS Due, IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays1,$value,0) AS Overdue1, IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays2,$value,0) AS Overdue2