From a70c655ab14103302b017247b308bc42e748e13b Mon Sep 17 00:00:00 2001 From: Smart Date: Thu, 26 Sep 2024 11:34:26 +0530 Subject: [PATCH] Live service po issue related changes : GWM --- app/Controllers/Servicepurchaseorder.php | 32 +++++++++++++++--------- app/Views/EditservicePurchaseorder.php | 21 +++++++++++----- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/app/Controllers/Servicepurchaseorder.php b/app/Controllers/Servicepurchaseorder.php index 9d980446..cc35371f 100755 --- a/app/Controllers/Servicepurchaseorder.php +++ b/app/Controllers/Servicepurchaseorder.php @@ -341,6 +341,7 @@ class Servicepurchaseorder extends BaseController //update service po function UpdateServicePurchaseOrder() { + // print_r($this->request->getPost());die; $PONO = $this->request->getPost('txtPONO'); $newsup = $this->request->getPost('newsup'); // $newSupId = split("[ - ]+", $newsup); @@ -408,23 +409,30 @@ class Servicepurchaseorder extends BaseController $POList['ReleasedOn'] = get_current_date_time(); $POList['ReleasedBy'] = $this->session->get('userId'); } + + $file = $this->request->getFile('POFile'); - $requestfilename = $file->getName(); - if (!empty($requestfilename)) { - if ($file && $file->isValid() && !$file->hasMoved()) { - $path = ROOTPATH . 'public/uploads/POfiles/'; - if (!is_dir($path)) { - mkdir($path, 0777, true); - } - if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { - log_message('error', 'File already exists in the database' . $requestfilename); - } else { - $file->move($path, $requestfilename); - $POList['POFile'] = $requestfilename; + if ($file !== null) { + $requestfilename = $file->getName(); + if (!empty($requestfilename)) { + if ($file->isValid() && !$file->hasMoved()) { + $path = ROOTPATH . 'public/uploads/POfiles/'; + if (!is_dir($path)) { + mkdir($path, 0777, true); + } + if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { + log_message('error', 'File already exists in the database: ' . $requestfilename); + } else { + $file->move($path, $requestfilename); + $POList['POFile'] = $requestfilename; + } } } + } else { + log_message('error', 'No file was uploaded'); } + $POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList); diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index b3eaf166..64fce0d3 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -2995,16 +2995,16 @@ if (!empty($getlogpodtl)) { var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val(); if (validate()) { - if (document.getElementById('ServiceTable').rows.length < 2) { + if (document.getElementById('ServiceTable').rows.length < 2) + { alert('Please Select Line item to Create PO'); $('#Deliverydt').focus(); return false; } - // else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { - // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - + // else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // return false; - // } + // } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { alert('Please Enter Payable Terms'); $('#Otherpayment').focus(); @@ -3025,7 +3025,16 @@ if (!empty($getlogpodtl)) { processData: false, contentType: false, success: function(data) { - // console.log(data); + + + +// var newWindow = window.open("", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=1024,height=768"); +// newWindow.document.write("Response"); +// newWindow.document.write("
" + data + "
"); // Using
 to preserve formatting
+// newWindow.document.write("");
+// newWindow.document.close();
+// newWindow.moveTo(0, 0);
+// newWindow.resizeTo(screen.width, screen.height);
 						if (data) {
 							$('#loader').hide();
 							alert(data);