diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 6ebc72d9..fe55e59a 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -439,13 +439,10 @@ class Inwardgateregister extends BaseController // var_dump($grossWeightDate); // var_dump($tareWeightDate); - if (is_string($grossWeightDate) && is_string($tareWeightDate)) { - $GrossWeightDate = date('Y-m-d H:i:s', strtotime($grossWeightDate)); - $TareWeightDate = date('Y-m-d H:i:s', strtotime($tareWeightDate)); - } else { - $GrossWeightDate = null; - $TareWeightDate = null; - } + $GrossWeightDate = !empty($grossWeightDate) && is_string($grossWeightDate) ? date('Y-m-d H:i:s', strtotime($grossWeightDate)) : null; + $TareWeightDate = !empty($tareWeightDate) && is_string($tareWeightDate) ? date('Y-m-d H:i:s', strtotime($tareWeightDate)) : null; + log_message('error', "TareWeightDate" . $TareWeightDate); + if (strlen($QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') { $Remarks = $this->request->getPost('txtRemarks' . $i); $ItemStatus = '';