X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fsuppliers_db.inc;h=602b86bf60049a52f50d3c385785510480909acb;hb=2f3375b4493c1b1e0b17c2801298275f22f8d76e;hp=2125e6a57a3f5f47e636a27a07cc85cb22661666;hpb=7735892d35bda5a3c4f47893dc44a5b2e89e0531;p=fa-stable.git diff --git a/purchasing/includes/db/suppliers_db.inc b/purchasing/includes/db/suppliers_db.inc index 2125e6a5..602b86bf 100644 --- a/purchasing/includes/db/suppliers_db.inc +++ b/purchasing/includes/db/suppliers_db.inc @@ -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, @@ -187,7 +187,7 @@ function get_supplier_currency($supplier_id) $result = db_query($sql, "Retreive currency of supplier $supplier_id"); $myrow=db_fetch_row($result); - return $myrow[0]; + return $myrow ? $myrow[0] : get_company_currency(); } function get_suppliers_search($supplier)