From: Janusz Dobrowolski Date: Sun, 6 Jul 2008 21:15:23 +0000 (+0000) Subject: factor parameter in get_price() is now optional X-Git-Tag: v2.4.2~19^2~1932 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=a7745dcfcf7cb50ab0e5301785dbd28f44601ea6;p=fa-stable.git factor parameter in get_price() is now optional --- diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index 75fca059..5c9d1142 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -6,6 +6,7 @@ include_once($path_to_root . "/sales/includes/db/sales_order_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_credit_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_invoice_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_delivery_db.inc"); +include_once($path_to_root . "/sales/includes/db/sales_types_db.inc"); include_once($path_to_root . "/sales/includes/db/custalloc_db.inc"); include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc"); include_once($path_to_root . "/sales/includes/db/cust_trans_details_db.inc"); @@ -46,10 +47,16 @@ function add_gl_trans_customer($type, $type_no, $date_, $account, $dimension, $d //---------------------------------------------------------------------------------------- -function get_price ($stock_id, $currency, $sales_type_id, $factor, $date=null) +function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=null) { if ($date == null) $date = Today(); + + if ($factor == null) + { + $myrow = get_sales_type(get_post('sales_type_id')); + $factor = $myrow['factor']; + } $sql = "SELECT ".TB_PREF."prices.price FROM ".TB_PREF."prices