diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 5a8ac0d6..6072c261 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1356,13 +1356,22 @@ function addNewImportPurchaseOrder() $importoption=$this->input->post('Importoption'); // echo $importoption; // die(); - - + $Insurance=$this->input->post('Insurance'); + + if($Insurance==1) + { + + $Insurancenumber=$this->input->post('insurancenumber'); + } + else + { + $Insurancenumber=''; + } // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber); //print_r($POList); //die(); @@ -1580,13 +1589,32 @@ function addNewImportPurchaseOrder() $SupplierOffer=$this->input->post('editsupplierofferno'); $otherRef=$this->input->post('editotherreference'); $finCap=$this->input->post('editfincap'); + + + + $importoption=$this->input->post('Importoption'); + // echo $importoption; + // die(); + $Insurance=$this->input->post('Insurance'); + + if($Insurance=='YES') + { + + $Insurancenumber=$this->input->post('insurancenumber'); + $insurestatus='1'; + } + else + { + $Insurancenumber=''; + $insurestatus='0'; + } // PO Master // PO Master // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber); //echo $PONO; //echo $TotalOrder; //print_r($POList); diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index 47135f01..93f7d453 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -158,9 +158,28 @@ if(!empty($POMaster)) $SupOfferno=$Req->Supplier_Offer_No; $Otherref=$Req->Other_Reference; $Fincap=$Req->Fincap; + + $Insurance=$Req->InsuranceStatus; + $InsuranceNo=$Req->InsuranceNumber; } } -//echo $ServiceDescription; + +//echo $InsuranceNo; + +$ins=''; +if($Insurance==1) +{ + $ins='YES'; +} +else +{ + $ins='NO'; +} + + + + + $SavedSum=$Orderedsum*$ExchangeRate; //echo $SavedSum; $AvilableBudget=$SavedSum+$AvlAmount; @@ -714,11 +733,24 @@ if(!empty($RequistionDetails)) - 'NO',"1"=>'YES'); - - echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?> + + @@ -3122,11 +3154,15 @@ var NilType = ''; $('#Insurance').change(function() { -var insure=$('#Insurance').val(); +//var insure=$('#Insurance').val(); + +var insure=$("#Insurance :selected").text(); +// var insure=$('#Insurance').Value(); +//console.log(insure); -if(insure=='1') +if(insure=='YES') { $('#insurancenum').show(); } @@ -3139,6 +3175,21 @@ else }); +var insureoption=; +var insureno=; +//console.log(insureoption); + + +if(insureoption==1) +{ + $('#insurancenum').show(); + $('#insurancenumber').val(insureno); +} + +else +{ + $('#insurancenum').hide(); +} var paymentoption=; var payvalue=;