Report Aged Supplier Analysis, Show Also Allocated = No. SQL Problem fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 16 Jun 2018 05:47:23 +0000 (07:47 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 16 Jun 2018 05:47:23 +0000 (07:47 +0200)
purchasing/includes/db/suppliers_db.inc

index 2125e6a57a3f5f47e636a27a07cc85cb22661666..d66c89fc7941fb20c3912d1175eb0413b366fb2a 100644 (file)
@@ -93,7 +93,7 @@ function get_supplier_details($supplier_id, $to=null, $all=true)
     else       
        $value = "IF (trans.type=".ST_SUPPINVOICE." OR trans.type=".ST_BANKDEPOSIT."
        OR (trans.type=".ST_JOURNAL." AND (trans.ov_amount + trans.ov_gst + trans.ov_discount)>0), 1, -1)*
-               ABS(trans.ov_amount + trans.ov_gst + trans.ov_discount) - trans.alloc)";
+               ABS(trans.ov_amount + trans.ov_gst + trans.ov_discount) - trans.alloc";
 
        $due = "IF (trans.type=".ST_SUPPINVOICE." OR trans.type=".ST_SUPPCREDIT.",trans.due_date,trans.tran_date)";
     $sql = "SELECT supp.supp_name, supp.curr_code, ".TB_PREF."payment_terms.terms,