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("
" + 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);
diff --git a/app/Views/editImportAmendPO.php b/app/Views/editImportAmendPO.php
index 24e93d06..3790585a 100755
--- a/app/Views/editImportAmendPO.php
+++ b/app/Views/editImportAmendPO.php
@@ -723,7 +723,7 @@ if (!empty($RequistionDetails)) {
-
+
@@ -741,7 +741,7 @@ if (!empty($RequistionDetails)) {
-
+
-
+
-
+
-
+
+
+
+
+
+
@@ -781,12 +786,12 @@ if (!empty($RequistionDetails)) {
?>
-
+
'EditAmendPer', 'value' => set_value('EditAmendPer'), 'id' => 'EditAmendPer', 'class' => 'form-control');
echo form_input($data); ?>
-
+
@@ -800,6 +805,8 @@ if (!empty($RequistionDetails)) {
+
+
@@ -813,9 +820,7 @@ if (!empty($RequistionDetails)) {
-
-
-
+
'EditExchangeRt', 'value' => set_value('EditExchangeRt'), 'id' => 'EditExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
@@ -828,7 +833,7 @@ if (!empty($RequistionDetails)) {
-
+
-->
-
-
-
-
-
-
-
-
-