diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index 5a657732..1d6c8635 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -283,7 +283,18 @@ class amendmentpurchaseorder extends BaseController $DeliverySchedule = ''; } - + $Modeofshipment=$this->input->post('addmodeofshipment'); + $supplierreference=$this->input->post('amendsupplierreference'); + $supplieroffno=$this->input->post('amendsupplierofferno'); + $otherreference=$this->input->post('amendotherreference'); + $fincap=$this->input->post('amendfincap'); + $revenuetype=$this->input->post('PoTypeOptions'); + $insurancestatus=$this->input->post('insurancestatus'); + if($insurancestatus == 1){ + $insuranceno=$this->input->post('insuranceno'); + }else{ + $insuranceno=""; + } $POType = $this->input->post('POType'); @@ -333,8 +344,8 @@ class amendmentpurchaseorder extends BaseController } - $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'CapitalRange'=>$PoRange,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'PaymentTerms'=>$PaymentTerms,'PaymentOtherDescription'=>$Otherpayment,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpecialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'AmendedDetails'=>$MAD); - //print_r($POMaster); + $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'PORange'=>$PoRange,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'PaymentTerms'=>$PaymentTerms,'PaymentOtherDescription'=>$Otherpayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Reference'=>$supplierreference,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'InsuranceNumber'=>$insuranceno,'POSubType'=>$revenuetype,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpecialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'AmendedDetails'=>$MAD); + print_r($POMaster); @@ -372,6 +383,8 @@ class amendmentpurchaseorder extends BaseController $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); $preitemrate=$this->input->post('beforeitemRate'.$i); + $per=$this->input->post('per'.$i); + $servicematerialdescription=$this->input->post('service_description'.$i); $DiscountType = $this->input->post('DisType'.$i); $beforeDiscountType = $this->input->post('beforeDisType'.$i); @@ -542,8 +555,8 @@ class amendmentpurchaseorder extends BaseController - $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'ReceivedQuantity'=>$RecQtyvalue,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'AmendedDetails'=>$CAD); - //print_r($POLineItemList); + $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'ReceivedQuantity'=>$RecQtyvalue,'Quantity'=>$Quantity,'Per'=>$per,'ServiceMaterialDescription'=>$servicematerialdescription,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'AmendedDetails'=>$CAD); + print_r($POLineItemList); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -554,7 +567,7 @@ class amendmentpurchaseorder extends BaseController $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType,'NoOfTrip'=>$NoofTrips,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'SGST'=>$VatValue,'AfterSGST'=>$AfterVatValue,'CGST'=>$GSTValue,'AfterCGST'=>$AfterGSTValue,'IGST'=>$OtherTaxValue,'AfterIGST'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); - // print_r($RevenueTaxList); + print_r($RevenueTaxList); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); } @@ -565,6 +578,7 @@ class amendmentpurchaseorder extends BaseController + function UpdateAmendServicePurchaseOrder() { diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index ab4b02d7..e2513477 100755 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -264,7 +264,7 @@ class emergencypurchaseorder extends BaseController function addNewRevenuePurchaseOrder() { - + //echo "Emergency Revenue PO"; $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -279,6 +279,19 @@ class emergencypurchaseorder extends BaseController $Deliverydt = $this->getDateformat($dt); $DeliverySchedule = ''; } + + $Modeofshipment=$this->input->post('emergmodeofshipment'); + $supplierreference=$this->input->post('emergsupplierreference'); + $supplieroffno=$this->input->post('emergsupplierofferno'); + $otherreference=$this->input->post('emergotherreference'); + $fincap=$this->input->post('emergfincap'); + $revenuetype=$this->input->post('PoTypeOptions'); + $insurancestatus=$this->input->post('insuranceStatus'); + if($insurancestatus == 1){ + $insuranceno=$this->input->post('insuranceNo'); + }else{ + $insuranceno=""; + } $CostCenterName = $this->input->post('CostCenterName'); $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); @@ -290,6 +303,7 @@ class emergencypurchaseorder extends BaseController $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('TextRowCount'); + //echo $RowCount; $DeletedRow = $this->input->post('TextDeletedRowCount'); $RequestedBy = $this->session->userdata ('EmpID'); $ReqStatus = REQITEM_Emergency_PO_CREATED; @@ -314,8 +328,8 @@ class emergencypurchaseorder extends BaseController $RegNo = $Req[0]['ReqNo']; } // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); - + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype); + //print_r($POList); $POMaster = $this->purchaseorder_model->addPOMaster($POList); $PONO = ''; @@ -323,7 +337,7 @@ class emergencypurchaseorder extends BaseController { $PONO = $POMaster[0]['PONO']; } - + //echo $PONO; // PO Line Items $RegDetailsStatus=REQITEM_POCREATED; $LineItemStatus = REQITEM_NEW; @@ -335,7 +349,8 @@ class emergencypurchaseorder extends BaseController $Quantity = $this->input->post('quantity'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); - + $per = $this->input->post('per'.$i); + $DiscountType = $this->input->post('DisType'.$i); $DiscountValue = $this->input->post('DisVal'.$i); $AfterDiscount = $this->input->post('AfterDisVal'.$i); @@ -350,6 +365,7 @@ class emergencypurchaseorder extends BaseController $NOOfTrip = $this->input->post('NoOfTrip'.$i); $InsuranceValue = $this->input->post('Insval'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); + $revenuedescription = $this->input->post('service_description'.$i); $CostCenter = $this->input->post('costCode'.$i); $Cgst = $this->input->post('RevenueCgst'.$i); $Sgst = $this->input->post('RevenueSgst'.$i); @@ -380,8 +396,8 @@ class emergencypurchaseorder extends BaseController $ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails); - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription); + //print_r($POLineItemList); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); $LineItemNo = ''; @@ -395,7 +411,7 @@ class emergencypurchaseorder extends BaseController { // echo 'Success'; $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); - + //print_r($RevenueTaxList); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); //echo 'Revenue tax Success'; } diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 405cebb3..cd919396 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -99,6 +99,20 @@ if(!empty($INRSYMBOL)) tinymce.init({ selector: "textarea#EdittxtSpcialInstructionSingle", //service Edit model description service + menubar: false, + statusbar: false, + toolbar: false + }); + tinymce.init({ + selector: "textarea#Add_Service_Description", //service Edit model description service + + menubar: false, + statusbar: false, + toolbar: false + }); + tinymce.init({ + selector: "textarea#Edit_Service_Description", //service Edit model description service + menubar: false, statusbar: false, toolbar: false @@ -2529,6 +2543,7 @@ function populateValueMainFormForDeleteItem(rowid) ?> + @@ -3372,6 +3387,14 @@ function populateValueMainFormForDeleteItem(rowid) ?> + +
+ 'Edit_Service_Description','value' => set_value('Edit_Service_Description'),'id'=>'Edit_Service_Description', 'class' => 'form-control','rows'=>'2','cols'=>'100'); + echo form_textarea($data);; + ?> + +

  Edit Revenue
@@ -3701,6 +3724,14 @@ function populateValueMainFormForDeleteItem(rowid) ?> + +
+ 'Add_Service_Description','value' => set_value('Add_Service_Description'),'id'=>'Add_Service_Description', 'class' => 'form-control','rows'=>'2','cols'=>'100'); + echo form_textarea($data);; + ?> + +

  Add Revenue
@@ -5257,8 +5288,12 @@ function populateValueMainFormForDeleteItem(rowid) var userid = ''; $('.AddRevenue').click(function(){ - - if(validateRevenueTax() && ExceedBudget($('#txtTotalOrderValue').val(), $('#AvalBuget').val())) + tinyMCE.triggerSave(); + var basic = $('#txtBasicValue').val(); + var discount = $('#txtAfterDiscount').val(); + var finalbasic = basic - discount; + //alert(basic+'-'+discount+'-'+finalbasic); + if(validateRevenueTax() && ExceedBudget(finalbasic, $('#AvalBuget').val())) { @@ -5272,7 +5307,10 @@ function populateValueMainFormForDeleteItem(rowid) var uom = $("#UOM").val(); var quantity = parseFloat($("#Quantity").val()).toFixed(2); var itemRate = parseFloat($("#Rate").val()).toFixed(2); - + var PER = $("#addrevenueEmergPer").val() + if(PER == ''){ + PER = $("#UOM").val(); + } var DisType = $("#DiscountType").val(); var DisVal = $("#txtDiscount").val(); var AfterDisVal = $("#txtAfterDiscount").val(); @@ -5284,8 +5322,8 @@ function populateValueMainFormForDeleteItem(rowid) - var Cgst = $("#RevenueCgst").val(); - var AfterCgst = $("#RevenueAfterCgst").val(); + var Cgst = $("#RevenueCgst").val(); + var AfterCgst = $("#RevenueAfterCgst").val(); var Sgst = $("#RevenueSgst").val(); var AfterSgst = $("#RevenueAfterSgst").val(); var Igst = $("#RevenueIgst").val(); @@ -5300,6 +5338,7 @@ function populateValueMainFormForDeleteItem(rowid) var Insval = $("#txtInsurance").val(); var TotalOrderValue = $("#txtTotalOrderValue").val(); var CheckLocalInter = $("input:radio[name='Range']:checked").val(); + var servicedescription = $("#Add_Service_Description").val(); var TotalTaxValue = calculateRevenueTaxValue(); @@ -5332,6 +5371,7 @@ function populateValueMainFormForDeleteItem(rowid) addHidden(theForm,"uom"+temp,uom); addHidden(theForm,"quantity"+temp,quantity); addHidden(theForm,"itemRate"+temp,itemRate); + addHidden(theForm,"per"+temp,PER); addHidden(theForm,"DisType"+temp,DisType); addHidden(theForm,"DisVal"+temp,DisVal); addHidden(theForm,"AfterDisVal"+temp,AfterDisVal); @@ -5347,7 +5387,7 @@ function populateValueMainFormForDeleteItem(rowid) addHidden(theForm,"basicval"+temp,basicval); addHidden(theForm,"Insval"+temp,Insval); - + addHidden(theForm,"service_description"+temp,servicedescription); addHidden(theForm,"TotalOrderValue"+temp,TotalOrderValue); addHidden(theForm,"CheckLocalInter"+temp,CheckLocalInter); addHidden(theForm,"RevenueCgst"+temp,Cgst); @@ -5376,9 +5416,9 @@ function populateValueMainFormForDeleteItem(rowid) { var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val(); - var Cgst = $('#RevenueCgst').val() == '' ? '0.00' : $('#RevenueCgst').val(); - var Sgst = $('#RevenueSgst').val() == '' ? '0.00' : $('#RevenueSgst').val(); - var Igst = $('#RevenueIgst').val() == '' ? '0.00' : $('#RevenueIgst').val(); + var Cgst = $('#RevenueAfterCgst').val() == '' ? '0.00' : $('#RevenueAfterCgst').val(); + var Sgst = $('#RevenueAfterSgst').val() == '' ? '0.00' : $('#RevenueAfterSgst').val(); + var Igst = $('#RevenueAfterIgst').val() == '' ? '0.00' : $('#RevenueAfterIgst').val(); var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val(); var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val(); @@ -5423,6 +5463,7 @@ function populateValueMainFormForDeleteItem(rowid) $('#UOM').val(''); $('#Quantity').val(''); $("#Rate").val(''); + $("#addrevenueEmergPer").val(''); $("#DiscountType").val('0'); $("#txtDiscount").val(''); @@ -5450,6 +5491,9 @@ function populateValueMainFormForDeleteItem(rowid) $("#txtBasicValue").val(''); $("#txtInsurance").val(''); $("#txtTotalOrderValue").val(''); + tinyMCE.get('Add_Service_Description').setContent(''); + + } @@ -154,7 +178,18 @@ foreach ($POSTATUS as $PST ) var others =''; var DelDt = ''; +var insurancestatus = ''; + var insuranceno = ''; $(document).ready(function () { + + $('#RequistionNo').attr("style", "pointer-events: none;"); + $('#drpSupplier').attr("style", "pointer-events: none;"); + $('#PoTypeOptions').attr("style", "pointer-events: none;"); + $('#insurancestatus').attr("style", "pointer-events: none;"); + $('#insuranceno').attr("style", "pointer-events: none;"); + + + if(DelOpt=="0"){ $('#Deliverydtdiv').show(); $('#Schedulediv').hide(); @@ -178,6 +213,22 @@ $('#Otherpayment').val(others); } +if(insurancestatus == 1) +{ + + $('#insurancestatus').val(insurancestatus); + $("#insurancenodiv").show(); + $('#insuranceno').val(insuranceno); + + + } + else + { + $('#insurancestatus').val(insurancestatus); + $('#insuranceno').val(""); + $("#insurancenodiv").hide(); + } + }); + \ No newline at end of file