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/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php
index 678535cc..0f8a68c4 100755
--- a/app/Views/editRevenuepurchaseorder.php
+++ b/app/Views/editRevenuepurchaseorder.php
@@ -2219,20 +2219,20 @@ if (!empty($getlogpodtl)) {
- SNo
- Requisition No
- Item Code
- Item Description
- Quantity
- UOM
- Rate
- Basic Amount
- Tax Amount
- Total Order Amount
+ SNo
+ Requisition No
+ Item Code
+ Item Description
+ Quantity
+ UOM
+ Rate
+ Basic Amount
+ Tax Amount
+ Total Order Amount
- Action
+ Action
@@ -2244,12 +2244,12 @@ if (!empty($getlogpodtl)) {
$index = $index + 1;
?>
-
- ReqNo ?>
- MaterialCode ?>
- MaterialName ?>
- Quantity ?>
- UOM ?>
+
+ ReqNo ?>
+ MaterialCode ?>
+ MaterialName ?>
+ Quantity ?>
+ UOM ?>
Rate ?>
BasicValue, 2, '.', ''); ?>
@@ -2297,12 +2297,14 @@ if (!empty($getlogpodtl)) {
-
+
+
-
+
+
@@ -2330,6 +2332,9 @@ if (!empty($getlogpodtl)) {
+
+
+
@@ -2378,6 +2383,9 @@ if (!empty($getlogpodtl)) {
+
+
+
@@ -2415,6 +2423,10 @@ if (!empty($getlogpodtl)) {
?>
+
+
+
+
+
+
+
+