From df7907fb8f168cd84b70f658156f936cd0f43e16 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 20 Jun 2015 17:03:36 +0200 Subject: [PATCH] Don't lose date precision when editing sale or receiving Extend date validator to allow timestamps as well (sale + receiving) Fix receiving edit --- .gitattributes | 2 +- application/controllers/receivings.php | 2 +- application/controllers/sales.php | 2 +- application/views/partial/header.php | 2 +- application/views/receivings/form.php | 23 +++++++++++++++-------- application/views/sales/form.php | 22 +++++++++++++++------- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.gitattributes b/.gitattributes index 123fd7620..1858a6507 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ dist/ merge=ours -application/languages/**/*.php merge=ours +application/language/**/*.php merge=ours diff --git a/application/controllers/receivings.php b/application/controllers/receivings.php index 463627b9c..b42df50e4 100644 --- a/application/controllers/receivings.php +++ b/application/controllers/receivings.php @@ -374,7 +374,7 @@ class Receivings extends Secure_area function save($receiving_id) { $receiving_data = array( - 'receiving_time' => date('Y-m-d', strtotime($this->input->post('date'))), + 'receiving_time' => date('Y-m-d H:i:s', strtotime($this->input->post('date'))), 'supplier_id' => $this->input->post('supplier_id') ? $this->input->post('supplier_id') : null, 'employee_id' => $this->input->post('employee_id'), 'comment' => $this->input->post('comment'), diff --git a/application/controllers/sales.php b/application/controllers/sales.php index f7053ef90..9667c574d 100644 --- a/application/controllers/sales.php +++ b/application/controllers/sales.php @@ -602,7 +602,7 @@ class Sales extends Secure_area function save($sale_id) { $sale_data = array( - 'sale_time' => date('Y-m-d', strtotime($this->input->post('date'))), + 'sale_time' => date('Y-m-d H:i:s', strtotime($this->input->post('date'))), 'customer_id' => $this->input->post('customer_id') ? $this->input->post('customer_id') : NULL, 'employee_id' => $this->input->post('employee_id'), 'comment' => $this->input->post('comment'), diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 084d00071..4413dcc58 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -7,7 +7,7 @@ <?php echo $this->config->item('company').' -- '.$this->lang->line('common_powered_by').' OS Point Of Sale' ?> - input->cookie('debug') == "true" || $this->input->post("debug") == "true") : ?> + input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?> diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index dbf05a69a..90c1494dc 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -16,7 +16,7 @@
lang->line('recvs_date').':', 'date', array('class'=>'required')); ?>
- 'date','value'=>date('m/d/Y', strtotime($receiving_info['receiving_time'])), 'id'=>'date'));?> + 'date','value'=>date('Y-m-d H:i:s', strtotime($receiving_info['receiving_time'])), 'id'=>'date'));?>
@@ -73,8 +73,15 @@