From dcecd50670ab9f7eb9e1f6beb8b425374e4d22a8 Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Thu, 19 Apr 2018 17:28:57 +0530 Subject: [PATCH] all edit po changes --- application/controllers/purchaseorder.php | 64 +++++++++++++++++-- .../controllers/servicepurchaseorder.php | 14 ++++ application/models/purchaseorder_model.php | 21 +++++- .../views/EditservicePurchaseorder.php | 29 +++++---- application/views/editCapitalPo.php | 34 +++++----- .../views/editRevenuepurchaseorder.php | 42 ++++++------ application/views/editimportpo.php | 38 +++++------ application/views/includes/header.php | 2 +- 8 files changed, 169 insertions(+), 75 deletions(-) diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 660399b4..15e2911d 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1217,9 +1217,11 @@ function edited(){ $SpcialInstruction = $this->input->post('SpcialInstruction'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); - $POStatus = $this->input->post('txtStatus'); + $POStatus = $this->input->post('txtStatus'); - $updatedBy = $this->session->userdata ( 'userId' ); + $updatedBy = $this->session->userdata('userId'); + + //echo($updatedBy); $RowCount = $this->input->post('txtRowCount'); $DeletedRow = $this->input->post('txtDeletedRow'); //echo $RowCount . "-" . $DeletedRow; @@ -1238,7 +1240,8 @@ function edited(){ $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); //print_r($POList); //die(); - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); + $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); + $LineItemStatus = REQITEM_NEW; @@ -1273,6 +1276,8 @@ function edited(){ $POLineItemNo = $this->input->post('LineItemNo'.$i); $CostCenter = $this->input->post('costCode'.$i); $LineItemNo = ''; + + $SkipInsert = "False"; @@ -1291,7 +1296,21 @@ function edited(){ } } - if($SkipInsert == "False") + /*------------------------------*/ + //if($MaterialCode!= ''){ + + $ReqDetails = array( 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt); +//print_r($ReqDetails); + + $this->purchaseorder_model->updateReqDetails($Reqnumber,$ReqDetails); + // } + + + /*------------------------------*/ + + + + if($SkipInsert == "False") { if(strlen($POLineItemNo) == 0) @@ -1331,7 +1350,10 @@ function edited(){ $this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList); } - } + } + + + } @@ -2214,6 +2236,19 @@ function addNewImportPurchaseOrder() } } + + + /*------------------------------*/ + //if($MaterialCode!= ''){ + + $ReqDetails = array( 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt); +//print_r($ReqDetails); + + $this->purchaseorder_model->updateReqDetails($Reqnumber,$ReqDetails); + // } + + + /*------------------------------*/ if($SkipInsert == "False") { if(strlen($POLineItemNo) == 0) @@ -2854,6 +2889,25 @@ function addNewImportPurchaseOrder() } } + + /*------------------------------*/ + //if($MaterialCode!= ''){ + + $ReqDetails = array( 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt); +//print_r($ReqDetails); + + $this->purchaseorder_model->updateReqDetails($Reqnumber,$ReqDetails); + // } + + + /*------------------------------*/ + + + + + + + if($SkipInsert == "False") { if(strlen($POLineItemNo) == 0) diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 84c05e36..004d9011 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -414,6 +414,20 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); $ItemDescription = $this->input->post('ItemDescription'.$i); $OtherAmt = $this->input->post('OtherAmt'.$i); $Per = $this->input->post('per'.$i); + + + + /*------------------------------*/ + //if($MaterialCode!= ''){ + + $ReqDetails = array( 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt); +//print_r($ReqDetails); + + $this->purchaseorder_model->updateReqDetails($Reqnumber,$ReqDetails); + // } + + + /*------------------------------*/ $POLineItem = array(); $LineItemNo = ''; diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 8952adcc..d56f38d2 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1,4 +1,4 @@ -db->where('ReqNo',$Reqnumber); + + $this->db->update('T_Requestion_Details',$ReqDetails); + + $r = $this->db->affected_rows(); + return $r; +} + + + + +/*------------------------------*/ + + /////////////////// start this function used to pono reset financeyear configuration function ponoreset($ponoreset) diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 32a1b141..d4c502da 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -248,10 +248,10 @@ var AvilBudAmt = ''; }; $(function() { $("#PODate").datepicker({ - minDate : d, - maxDate : 'now', - dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' -}); + //minDate : d, + //maxDate : 'now', + dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true +}); //yearRange: '-100:+0' $("#Deliverydt").datepicker({ minDate : 'now', dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10' @@ -506,13 +506,14 @@ function ExceedQuantityCheck() var EnterQuantity = $("#Quantity").val()== '' ? "0.00" : parseFloat($("#Quantity").val()); var ReqQuantity = parseFloat(RequistQuantity); if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#Quantity').focus(); - return false; - } - else { + // $('#Quantity').focus(); + // return false; + // } + // else + { return true; } } @@ -522,12 +523,12 @@ function ExceedQuantityCheck() var EnterQuantity = $("#EditQuantity").val()== '' ? "0.00" : parseFloat($("#EditQuantity").val()); var ReqQuantity = parseFloat(RequistQuantity); //alert(ReqQuantity); - if(EnterQuantity > ReqQuantity) + if(EnterQuantity != ReqQuantity) { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#EditQuantity').focus(); - return false; + // $('#EditQuantity').focus(); + return true; } } diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 6f3dc480..0e5f4d9a 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -390,9 +390,9 @@ $("#PaymentMethod").select2(); $("#PODate").datepicker({ //minDate : d, - maxDate : 'now', - dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' - }); + // maxDate : 'now', + dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true + });//,yearRange: '-100:+0' $("#Deliverydt").datepicker({ minDate : 'now', dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10' @@ -4442,13 +4442,14 @@ Calculateloadingcharge(); var ReqQuantity = parseFloat(RequistQuantity); //alert(ReqQuantity); if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#CPQuantity').focus(); - return false; - } - else { + // $('#CPQuantity').focus(); + // return false; + // } + // else + { return true; } @@ -6497,14 +6498,15 @@ var Freight=parseFloat($('#txtAfterFreightlocview').val() == '' ? '0.00' : $('#t var ReqQuantity = parseFloat(RequistQuantity); //alert(ReqQuantity); - if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + if(EnterQuantity != ReqQuantity) + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#EditCPQuantity').focus(); - return false; - } - else { + // $('#EditCPQuantity').focus(); + // return false; + // } + // else + { return true; diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index 20754a24..90e6d37c 100755 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -315,10 +315,10 @@ var SelectedMaterialCode = []; $(function() { $("#PODate").datepicker({ - minDate : d, - maxDate : 'now', - dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' -}); + //minDate : d, + //maxDate : 'now', + dateFormat: 'dd-mm-yy',changeMonth: false, changeYear: false +});//,yearRange: '-100:+0' $("#Deliverydt").datepicker({ minDate : 'now', dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10' @@ -2014,13 +2014,14 @@ SetVatorCST(); var EnterQuantity = $("#Quantity").val()== '' ? "0.00" : parseFloat($("#Quantity").val()); var ReqQuantity = parseFloat(RequistQuantity); if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - //$('#Quantity').val(RequistQuantity); - $('#Quantity').focus(); - return false; - } - else{ + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // //$('#Quantity').val(RequistQuantity); + // $('#Quantity').focus(); + // return false; + // } + //else + { return true; } } @@ -2030,13 +2031,14 @@ SetVatorCST(); // RequistQuantity var EnterQuantity = $("#EditQuantity").val()== '' ? "0.00" : parseFloat($("#EditQuantity").val()); var ReqQuantity = parseFloat(RequistQuantity); - if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#EditQuantity').focus(); - return false; - } - else{ + if(EnterQuantity != ReqQuantity) + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // $('#EditQuantity').focus(); + // return false; + // } + //else + { return true; } } @@ -5073,8 +5075,8 @@ $('#Scheduleby').change(function(){ $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' - }); + dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true + }); //,yearRange: '0:+10's }); $('#Deliverydt').change(function(){ diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index b0dfd466..d35a9b20 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -295,10 +295,10 @@ tinymce.init({ var m=new Date(t); $("#PODate").datepicker({ - minDate : d, - maxDate : 'now', - dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' - }); + //minDate : d, + //maxDate : 'now', + dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true + });//,yearRange: '-100:+0' // $("#PayableAT").datepicker({ // minDate : m, @@ -3841,13 +3841,14 @@ function ExceedEditQuantityCheck() //alert(reqq); //var ReqQuantity=parseFloat($('#EditQuantity').val()); - if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#EditQuantity').focus(); - return false; - } - else{ + if(EnterQuantity != ReqQuantity) + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // $('#EditQuantity').focus(); + // return false; + // } + // else + { return true; } } @@ -4343,13 +4344,14 @@ function ExceedQuantityCheck() var EnterQuantity = $("#Quantity").val()== '' ? "0.00" : parseFloat($("#Quantity").val()); var ReqQuantity = parseFloat(RequistQuantity); if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - //$('#Quantity').val(RequistQuantity); - $('#Quantity').focus(); - return false; - } -else{ +// { +// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); +// //$('#Quantity').val(RequistQuantity); +// $('#Quantity').focus(); +// return false; +// } +// else +{ return true; } } diff --git a/application/views/includes/header.php b/application/views/includes/header.php index a8267efc..9c48483f 100755 --- a/application/views/includes/header.php +++ b/application/views/includes/header.php @@ -279,7 +279,7 @@ $(function() { AssDep; - if($assd == PURCHASE){?> + if($assd == PURCHASE || $DEPCode == PURCHASE){?>