diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index e496cd7f..21879290 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -142,7 +142,7 @@ class amendmentpurchaseorder extends BaseController // print_r($data); $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO); $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - + $data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026'); foreach($data['POMaster'] as $CUR) { @@ -1156,6 +1156,8 @@ function UpdateAmendServicePurchaseOrder() $otherRef=$this->input->post('amendotherreference'); $finCap=$this->input->post('amendfincap'); + $OtherPayment=$this->input->post('Otherpayment'); + @@ -1189,7 +1191,7 @@ function UpdateAmendServicePurchaseOrder() //echo $RowCount; // PO Master // PO Master - $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'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,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'Import_PlaceofOrgin'=>$Palaceoforigin,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'AmendedDetails'=>$MAD); + $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'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,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'Import_PlaceofOrgin'=>$Palaceoforigin,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'AmendedDetails'=>$MAD,'PaymentOtherDescription'=>$OtherPayment); //print_r($POMaster); //die(); diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index c3f7bdfe..5a8ac0d6 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -214,7 +214,10 @@ class purchaseorder extends BaseController $data['AvlimportBudAmt'] = $AvlimportBudget[0]['BudgetAmount'] - $AvlimportBudget[0]['Totalvalue']; } - //print_r($data['AvlimportBudAmt']); + + $data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026'); + + //print_r($data['PoTypeOptions']); // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; @@ -426,6 +429,7 @@ class purchaseorder extends BaseController // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); + $data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026'); //print_r($data['PaymentTerms']); $unicode =''; foreach ($data['CurrencyDetail'] as $Detail) @@ -1349,6 +1353,10 @@ function addNewImportPurchaseOrder() $otherRef=$this->input->post('addotherreference'); $finCap=$this->input->post('addfincap'); + $importoption=$this->input->post('Importoption'); + // echo $importoption; + // die(); + // $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); diff --git a/application/views/editImportAmendPO.php b/application/views/editImportAmendPO.php index eec0e074..29c69a8a 100755 --- a/application/views/editImportAmendPO.php +++ b/application/views/editImportAmendPO.php @@ -147,9 +147,12 @@ if(!empty($POMaster)) $Otherref=$Req->Other_Reference; $Fincap=$Req->Fincap; + $Otherpay=$Req->PaymentOtherDescription; + } } //$AvilableBudget=0; +//echo $Otherpay; $SavedSum=$Orderedsum*$ExchangeRate; //echo $SavedSum; $AvilableBudget=$SavedSum+$AvlAmount; @@ -686,11 +689,70 @@ if(!empty($RequistionDetails))
'Otherpayment','Otherpayment' => set_value('Otherpayment'),'id'=>'Otherpayment', 'class' => 'form-control' ,'required' => 'true'); + $data = array('name' => 'Otherpayment','Otherpayment' => set_value('Otherpayment',$Otherpay),'id'=>'Otherpayment', 'class' => 'form-control' ,'required' => 'true'); echo form_input($data); ?>
+ + + +
+ + + 'Select Import Option'); + + if(!empty($PoTypeOptions)) + { + foreach ($PoTypeOptions as $payment): + + $options1[$payment->ConfigValue] = $payment->ConfigValue; + //$options6[$pay->PaymentID] = $pay->PaymentTerms; + + endforeach; + } + + echo form_dropdown('Importoption', $options1,set_value('Importoption'),'id="Importoption"' ,'class="form-control"'); ?> +
+ + + + + +
+ + + + + 'NO',"1"=>'YES'); + + echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?> + +
+ + + + + + + + + + + @@ -1907,6 +1969,34 @@ var NilType = ''; }; +$('#Insurance').change(function() { +var insure=$('#Insurance').val(); +if(insure=='1') +{ + $('#insurancenum').show(); +} +else +{ + $('#insurancenum').hide(); +} + +}); + + + + + +var paymentoption=; +var payvalue=; + +//alert(payvalue); +if(paymentoption=='PT08') +{ + $('#otheroptiondiv').show(); + $('#Otherpayment').val(payvalue); +} + + var AvlBudAmt = ''; //alert(AvlBudAmt); //$('#EditAvlBud').val(AvlBudAmt); @@ -1986,18 +2076,65 @@ $('#drpSupplier').change(function() { if(id != '0') { var y = ; - + var Payment = ; $.each(y, function(idx, obj) { if(obj.SupplierID === id) { $("#SupAddress").val(obj.Address); + PaymentID = obj.PaymentID; //$("#PayableAT").val(obj.PayableAT); var a=obj.PaymentDays; //console.log(a); } }); + + + + + if(PaymentID=='PT08') + { + $('#otheroptiondiv').show(); + $('#Otherpayment').val(''); + } + else + { + $('#otheroptiondiv').hide(); + $('#Otherpayment').show(); + } + + $('#PaymentTerms').empty(); + var paymentList = ; + + + $.each(paymentList, function(pay, payobj) + + { + if(payobj.PaymentID == PaymentID) + { + + + $("#PaymentTerms").append( $('').val(payobj.PaymentID).html(payobj.PaymentTerms)); + + } + + + }); + + $.each(Payment, function(pay, payobj) { + if(payobj.PaymentID == PaymentID) + { + + } + else{ + $("#PaymentTerms").append( $('').val(payobj.PaymentID).html(payobj.PaymentTerms)); + + } + + }); + + } else diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index efa8deee..47135f01 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -676,6 +676,66 @@ if(!empty($RequistionDetails)) ?> + + + + +
+ + + + + 'Select Import Option'); + + + + if(!empty($PoTypeOptions)) + { + foreach ($PoTypeOptions as $payment): + + $options1[$payment->ConfigValue] = $payment->ConfigValue; + //$options6[$pay->PaymentID] = $pay->PaymentTerms; + + endforeach; + } + + echo form_dropdown('Importoption', $options1,set_value('Importoption'),'id="Importoption"' ,'class="form-control"'); ?> + +
+ + + + + +
+ + + + + 'NO',"1"=>'YES'); + + echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?> + +
+ + + + + @@ -3059,6 +3119,27 @@ var NilType = ''; + +$('#Insurance').change(function() { + +var insure=$('#Insurance').val(); + + + +if(insure=='1') +{ + $('#insurancenum').show(); +} + +else +{ + $('#insurancenum').hide(); +} + +}); + + + var paymentoption=; var payvalue=; //alert(payvalue); @@ -3152,24 +3233,78 @@ $('#drpSupplier').change(function() { if(id != '0') { var y = ; - + var Payment = ; $.each(y, function(idx, obj) { if(obj.SupplierID === id) { $("#SupAddress").val(obj.Address); + PaymentID = obj.PaymentID; $("#PayableAT").val(obj.PayableAT); var a=obj.PaymentDays; // console.log(a); - if (a=="After") + // if (a=="After") + // { + // //alert(); + // document.getElementById("After").checked = true; + + // } + // else + // document.getElementById("Before").checked = true; + + if(PaymentID=='PT08') + { + $('#otheroptiondiv').show(); + $('#Otherpayment').val(''); + } + else + { + $('#otheroptiondiv').hide(); + $('#Otherpayment').show(); + } + + + + $('#PaymentTerms').empty(); + var paymentList = ; + + + $.each(paymentList, function(pay, payobj) + + { + if(payobj.PaymentID == PaymentID) { - //alert(); - document.getElementById("After").checked = true; + + + $("#PaymentTerms").append( $('').val(payobj.PaymentID).html(payobj.PaymentTerms)); } - else - document.getElementById("Before").checked = true; - + // else + // { + // // $("#PaymentTerms").append( $('').val(payobj.PaymentID).html(payobj.PaymentTerms)); + + // } + + }); + + + + $.each(Payment, function(pay, payobj) { + if(payobj.PaymentID == PaymentID) + { + + } + else{ + $("#PaymentTerms").append( $('').val(payobj.PaymentID).html(payobj.PaymentTerms)); + + } + + }); + + + + + } diff --git a/application/views/importpo.php b/application/views/importpo.php index fee9a893..4fefc868 100755 --- a/application/views/importpo.php +++ b/application/views/importpo.php @@ -554,32 +554,7 @@ else if($('#addsupplierreference').val()=='') $options1 = array("0"=>'Select Payment method'); - // if(!empty($Payment)) - // { - - // foreach ($Payment as $pay2) - - // if($Terms==$pay2->PaymentID){ - // //echo "$Terms"; - // //echo "$pay2->PaymentTerms"; - - - // PaymentID] = $pay2->PaymentTerms; - - // } - - // foreach ($Payment as $pay1): - - // if($Terms!=$pay1->PaymentID){ - - // $optionsPay[$pay1->PaymentID] = $pay1->PaymentTerms; - - // } - // endforeach; - // } echo form_dropdown('PaymentTerms', $optionsPay,set_value('PaymentTerms'),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); - + if(!empty($Payment)) { @@ -606,6 +581,82 @@ else if($('#addsupplierreference').val()=='') ?> + + + + + +
+ + + + + 'Select Import Option'); + + + + if(!empty($PoTypeOptions)) + { + foreach ($PoTypeOptions as $payment): + + $options1[$payment->ConfigValue] = $payment->ConfigValue; + //$options6[$pay->PaymentID] = $pay->PaymentTerms; + + endforeach; + } + + echo form_dropdown('Importoption', $options1,set_value('Importoption'),'id="Importoption"' ,'class="form-control"'); ?> + +
+ + + + + +
+ + + + + 'NO',"1"=>'YES'); + + + + // if(!empty($PoTypeOptions)) + // { + // foreach ($PoTypeOptions as $payment): + + // $options1[$payment->ConfigValue] = $payment->ConfigValue; + // //$options6[$pay->PaymentID] = $pay->PaymentTerms; + + // endforeach; + // } + + echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?> + +
+ + + + + + + + @@ -1731,7 +1782,7 @@ else if($('#addsupplierreference').val()=='') ?> -