Changed all numeric constants to the new defined constants. A huge task.
[fa-stable.git] / reporting / rep102.php
index f8a2a52dfa44715b943e022edb2297ac08afda70..9070ae186a9a45a92e7690e3a1ed96eab08f1844 100644 (file)
@@ -37,7 +37,7 @@ function get_invoices($costomer_id, $to)
     $value = "(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + "
                .TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax + "
                .TB_PREF."debtor_trans.ov_discount)";
-       $due = "IF (".TB_PREF."debtor_trans.type=10,".TB_PREF."debtor_trans.due_date,".TB_PREF."debtor_trans.tran_date)";
+       $due = "IF (".TB_PREF."debtor_trans.type=".ST_SALESINVOICE.",".TB_PREF."debtor_trans.due_date,".TB_PREF."debtor_trans.tran_date)";
        $sql = "SELECT ".TB_PREF."debtor_trans.type, ".TB_PREF."debtor_trans.reference,
                ".TB_PREF."debtor_trans.tran_date,
                $value as Balance,
@@ -49,7 +49,7 @@ function get_invoices($costomer_id, $to)
                        ".TB_PREF."payment_terms,
                        ".TB_PREF."debtor_trans
 
-               WHERE ".TB_PREF."debtor_trans.type <> 13
+               WHERE ".TB_PREF."debtor_trans.type <> ".ST_CUSTDELIVERY."
                        AND ".TB_PREF."debtors_master.payment_terms = ".TB_PREF."payment_terms.terms_indicator
                        AND ".TB_PREF."debtors_master.debtor_no = ".TB_PREF."debtor_trans.debtor_no
                        AND ".TB_PREF."debtor_trans.debtor_no = $costomer_id
@@ -177,7 +177,7 @@ function print_aged_customer_analysis()
                        $rep->TextCol(0, 1, $systypes_array[$trans['type']], -2);
                                $rep->TextCol(1, 2,     $trans['reference'], -2);
                                $rep->DateCol(2, 3, $trans['tran_date'], true, -2);
-                               if ($trans['type'] == 11 || $trans['type'] == 12 || $trans['type'] == 2)
+                               if ($trans['type'] == ST_CUSTCREDIT || $trans['type'] == ST_CUSTPAYMENT || $trans['type'] == ST_BANKDEPOSIT)
                                {
                                        $trans['Balance'] *= -1;
                                        $trans['Due'] *= -1;