new field add,edit,amendment import
This commit is contained in:
parent
ef0a615b85
commit
1f79e199b4
@ -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();
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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))
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$data = array('name' => '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);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Import Options</label>
|
||||
|
||||
<?php
|
||||
$options1 = array("0"=>'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"'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<label for="payablefrom">Insurance</label>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$options1 = array("0"=>'NO',"1"=>'YES');
|
||||
|
||||
echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2" id="insurancenum" style="display:none;">
|
||||
<label>Insurance Number<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5
|
||||
;">*</span></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'insurancenumber','insurancenumber' => set_value('insurancenumber'),'id'=>'insurancenumber', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@ -1907,6 +1969,34 @@ var NilType = '<?php echo NILTYPE;?>';
|
||||
};
|
||||
|
||||
|
||||
$('#Insurance').change(function() {
|
||||
var insure=$('#Insurance').val();
|
||||
if(insure=='1')
|
||||
{
|
||||
$('#insurancenum').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#insurancenum').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var paymentoption=<?php echo json_encode($PaymentTerms,JSON_PRETTY_PRINT)?>;
|
||||
var payvalue=<?php echo json_encode($Otherpay,JSON_PRETTY_PRINT)?>;
|
||||
|
||||
//alert(payvalue);
|
||||
if(paymentoption=='PT08')
|
||||
{
|
||||
$('#otheroptiondiv').show();
|
||||
$('#Otherpayment').val(payvalue);
|
||||
}
|
||||
|
||||
|
||||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||||
//alert(AvlBudAmt);
|
||||
//$('#EditAvlBud').val(AvlBudAmt);
|
||||
@ -1986,18 +2076,65 @@ $('#drpSupplier').change(function() {
|
||||
if(id != '0')
|
||||
{
|
||||
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
$.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 = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
|
||||
$.each(paymentList, function(pay, payobj)
|
||||
|
||||
{
|
||||
if(payobj.PaymentID == PaymentID)
|
||||
{
|
||||
|
||||
|
||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$.each(Payment, function(pay, payobj) {
|
||||
if(payobj.PaymentID == PaymentID)
|
||||
{
|
||||
|
||||
}
|
||||
else{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@ -676,6 +676,66 @@ if(!empty($RequistionDetails))
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Import Options</label>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$options1 = array("0"=>'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"'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<label for="payablefrom">Insurance</label>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$options1 = array("0"=>'NO',"1"=>'YES');
|
||||
|
||||
echo form_dropdown('Insurance', $options1,set_value('Insurance'),'id="Insurance"' ,'class="form-control"'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2" id="insurancenum" style="display:none;">
|
||||
<label>Insurance Number<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5
|
||||
;">*</span></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'insurancenumber','insurancenumber' => set_value('insurancenumber'),'id'=>'insurancenumber', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@ -3059,6 +3119,27 @@ var NilType = '<?php echo NILTYPE;?>';
|
||||
|
||||
|
||||
|
||||
|
||||
$('#Insurance').change(function() {
|
||||
|
||||
var insure=$('#Insurance').val();
|
||||
|
||||
|
||||
|
||||
if(insure=='1')
|
||||
{
|
||||
$('#insurancenum').show();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$('#insurancenum').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
var paymentoption=<?php echo json_encode($PaymentTerms,JSON_PRETTY_PRINT)?>;
|
||||
var payvalue=<?php echo json_encode($PaymentTermsCode,JSON_PRETTY_PRINT)?>;
|
||||
//alert(payvalue);
|
||||
@ -3152,24 +3233,78 @@ $('#drpSupplier').change(function() {
|
||||
if(id != '0')
|
||||
{
|
||||
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
$.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 = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
|
||||
$.each(paymentList, function(pay, payobj)
|
||||
|
||||
{
|
||||
if(payobj.PaymentID == PaymentID)
|
||||
{
|
||||
//alert();
|
||||
document.getElementById("After").checked = true;
|
||||
|
||||
|
||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||
|
||||
}
|
||||
else
|
||||
document.getElementById("Before").checked = true;
|
||||
|
||||
// else
|
||||
// {
|
||||
// // $("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||
|
||||
// }
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$.each(Payment, function(pay, payobj) {
|
||||
if(payobj.PaymentID == PaymentID)
|
||||
{
|
||||
|
||||
}
|
||||
else{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
// <?php
|
||||
|
||||
// $optionsPay[$pay2->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()=='')
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="payablefrom">Import Options</label>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$options1 = array("0"=>'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"'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<label for="payablefrom">Insurance</label>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$options1 = array("0"=>'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"'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2" id="insurancenum" style="display:none;">
|
||||
<label>Insurance Number<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5
|
||||
;">*</span></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'insurancenumber','insurancenumber' => set_value('insurancenumber'),'id'=>'insurancenumber', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -1731,7 +1782,7 @@ else if($('#addsupplierreference').val()=='')
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" id="editTripsValue" style="display:none;">
|
||||
<div class="col-md-3" id="editTripsValue" style="display:block;">
|
||||
<label>NO Of Trips</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
@ -2115,11 +2166,20 @@ var NilType = '<?php echo NILTYPE;?>';
|
||||
};
|
||||
|
||||
|
||||
$('#Insurance').change(function() {
|
||||
|
||||
var insure=$('#Insurance').val();
|
||||
if(insure=='1')
|
||||
{
|
||||
$('#insurancenum').show();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$('#insurancenum').hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -4223,6 +4283,12 @@ $("#editimportpomodel").on("shown.bs.modal", function(e) {
|
||||
$('#editTripsValue').show();
|
||||
}
|
||||
|
||||
else
|
||||
{//alert();
|
||||
|
||||
$('#editTripsValue').hide();
|
||||
}
|
||||
|
||||
|
||||
$('#EditPer').val($('#Per'+userid).val());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user