From 61af570a407ed30eaad4816a4394af267ec45e67 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 8 Sep 2009 18:57:09 +0000 Subject: [PATCH] date_diff function name changed to date_diff for php5.3 compatibility. --- CHANGELOG.txt | 9 +++++++++ dimensions/inquiry/search_dimensions.php | 2 +- includes/date_functions.inc | 2 +- manufacturing/search_work_orders.php | 2 +- manufacturing/work_order_add_finished.php | 2 +- manufacturing/work_order_costs.php | 2 +- sales/includes/cart_class.inc | 2 +- sales/includes/ui/sales_order_ui.inc | 2 +- sales/sales_order_entry.php | 2 +- 9 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26318b67..73b55b55 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -40,6 +40,15 @@ $ /includes/systypes.inc # Removed obsolete field in sys_types $ /sql/en_US-demo.sql /sql/en_US-new.sql +# date_diff function name changed to date_diff2 for php5.3 compatibility +$ /dimensions/inquiry/search_dimensions.php + /includes/date_functions.inc + /manufacturing/search_work_orders.php + /manufacturing/work_order_add_finished.php + /manufacturing/work_order_costs.php + /sales/sales_order_entry.php + /sales/includes/cart_class.inc + /sales/includes/ui/sales_order_ui.inc 08-Sep-2009 Joe Hunt + Added Sales Quotations, inquiry and report diff --git a/dimensions/inquiry/search_dimensions.php b/dimensions/inquiry/search_dimensions.php index 8006a1c4..eaf74c19 100644 --- a/dimensions/inquiry/search_dimensions.php +++ b/dimensions/inquiry/search_dimensions.php @@ -118,7 +118,7 @@ function sum_dimension($row) function is_overdue($row) { - return date_diff(Today(), sql2date($row["due_date"]), "d") > 0; + return date_diff2(Today(), sql2date($row["due_date"]), "d") > 0; } function edit_link($row) diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 089eeb7e..5f9f0bc8 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -418,7 +418,7 @@ function date1_greater_date2 ($date1, $date2) } -function date_diff ($date1, $date2, $period) +function date_diff2 ($date1, $date2, $period) { /* expects dates in the format specified in $DefaultDateFormat - period can be one of 'd','w','y','m' diff --git a/manufacturing/search_work_orders.php b/manufacturing/search_work_orders.php index dfd74f8e..e03538b5 100644 --- a/manufacturing/search_work_orders.php +++ b/manufacturing/search_work_orders.php @@ -85,7 +85,7 @@ end_form(); function check_overdue($row) { return (!$row["closed"] - && date_diff(Today(), sql2date($row["required_by"]), "d") > 0); + && date_diff2(Today(), sql2date($row["required_by"]), "d") > 0); } function view_link($dummy, $order_no) diff --git a/manufacturing/work_order_add_finished.php b/manufacturing/work_order_add_finished.php index 2804ea1e..8ba7fd6e 100644 --- a/manufacturing/work_order_add_finished.php +++ b/manufacturing/work_order_add_finished.php @@ -104,7 +104,7 @@ function can_process() set_focus('date_'); return false; } - if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) + if (date_diff2(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) { display_error(_("The production date cannot be before the release date of the work order.")); set_focus('date_'); diff --git a/manufacturing/work_order_costs.php b/manufacturing/work_order_costs.php index 107c073b..b6f6ba23 100644 --- a/manufacturing/work_order_costs.php +++ b/manufacturing/work_order_costs.php @@ -89,7 +89,7 @@ function can_process() set_focus('date_'); return false; } - if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) + if (date_diff2(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) { display_error(_("The additional cost date cannot be before the release date of the work order.")); set_focus('date_'); diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index 719f6617..e865b245 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -188,7 +188,7 @@ class cart if (!$pos['cash_sale'] || !$pos['credit_sale']) $this->pos = -1; // mark not editable payment type else - $this->cash = date_diff($this->due_date, Today(), 'd')<2; + $this->cash = date_diff2($this->due_date, Today(), 'd')<2; if ($this->cash) { $this->Location = $pos['pos_location']; $this->location_name = $pos['location_name']; diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 3fa6c32b..1b98e41e 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -114,7 +114,7 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) if ($order->trans_type == 10) { $order->due_date = get_invoice_duedate($customer_id, $order->document_date); if ($order->pos != -1) - $order->cash = date_diff($order->due_date, Today(), 'd')<2; + $order->cash = date_diff2($order->due_date, Today(), 'd')<2; } if($order->cash ) { if($order->pos != -1) { diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index e1c6b759..fccbc3a3 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -532,7 +532,7 @@ function create_cart($type, $trans_no) if (!$pos['cash_sale'] || !$pos['credit_sale']) $doc->pos = -1; // mark not editable payment type else - $doc->cash = date_diff($doc->due_date, Today(), 'd')<2; + $doc->cash = date_diff2($doc->due_date, Today(), 'd')<2; } else $doc->due_date = $doc->document_date; $doc->reference = references::get_next($doc->trans_type); -- 2.30.2