From a7745dcfcf7cb50ab0e5301785dbd28f44601ea6 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 6 Jul 2008 21:15:23 +0000 Subject: [PATCH] factor parameter in get_price() is now optional --- sales/includes/sales_db.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.30.2