amendment import freight

This commit is contained in:
venbatechnologies@gmail.com 2017-09-07 18:21:43 +05:30
parent 5e9590a711
commit 697297fcc7
2 changed files with 274 additions and 7 deletions

View File

@ -1301,6 +1301,21 @@ function UpdateAmendServicePurchaseOrder()
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
$beforeRMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
$FreightType=$this->input->post('FreightType'.$i);
$NoOfTrip=$this->input->post('NoOfTrip'.$i);
$Freightrate=$this->input->post('FreightValue'.$i);
$Freightamount=$this->input->post('AfterFreightValue'.$i);
$beforeFreightType=$this->input->post('beforeFreightType'.$i);
$beforeNoOfTrip=$this->input->post('beforeNoOfTrip'.$i);
$beforeFreightrate=$this->input->post('beforeFreightValue'.$i);
$beforeFreightamount=$this->input->post('beforeAfterFreightValue'.$i);
// if($RMCIncludingCustomersPerKG-$beforeRMCIncludingCustomersPerKG )
// {
// $CAD="Amended RMC Including Customs".$beforeRMCIncludingCustomersPerKG ."</br>";
@ -1409,6 +1424,41 @@ function UpdateAmendServicePurchaseOrder()
}
if($FreightType!=$beforeFreightType)
{
//$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended Freight Type: ".$beforeFreightType ."</td><td>Current Additional Excise duty:".$FreightType."</td></tr>";
}
if($NoOfTrip-$beforeNoOfTrip)
{
//$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended No of Trip: ".$beforeNoOfTrip ."</td><td>Current Additional Excise duty:".$NoOfTrip."</td></tr>";
}
if($Freightrate-$beforeFreightrate)
{
//$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended Freightrate: ".$beforeFreightrate ."</td><td>Current Freightrate:".$Freightrate."</td></tr>";
}
if($Freightamount-$beforeFreightamount)
{
//$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended Freight Amount: ".$beforeFreightamount ."</td><td>Current Freight Amount:".$Freightamount."</td></tr>";
}
if($rowspanvalue>0)
{
$rowspanvalue++;
@ -1440,7 +1490,7 @@ function UpdateAmendServicePurchaseOrder()
// endforeach;
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$NoOfTrip,'FreightValue'=>$Freightrate,'AfterFreightValue'=>$Freightamount);
// print_r($ImportTaxList);
//die();
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);

View File

@ -1195,7 +1195,7 @@ if(!empty($RequistionDetails))
?>
</div>
</div>
<div class="col-md-3" id="AmendTripsValue" style="display:none;">
<div class="col-md-3" id="AmendTripsValue" style="display:block;">
<span>NO Of Trips</span>
<div class="form-group">
<?php
@ -1603,6 +1603,27 @@ if(!empty($RequistionDetails))
<input type="hidden" name="<?php echo 'beforeTotalValue'.$index ?>" id="<?php echo 'beforeTotalValue'.$index ?>" value="<?php echo $record->TotalOrderValue; ?>" />
<input type="hidden" name="<?php echo 'FreightType'.$index ?>" id="<?php echo 'FreightType'.$index ?>" value="<?php echo $record->FreightType; ?>" />
<input type="hidden" name="<?php echo 'beforeFreightType'.$index ?>" id="<?php echo 'beforeFreightType'.$index ?>" value="<?php echo $record->FreightType; ?>" />
<input type="hidden" name="<?php echo 'NoOfTrip'.$index ?>" id="<?php echo 'NoOfTrip'.$index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input type="hidden" name="<?php echo 'beforeNoOfTrip'.$index ?>" id="<?php echo 'beforeNoOfTrip'.$index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input type="hidden" name="<?php echo 'FreightValue'.$index ?>" id="<?php echo 'FreightValue'.$index ?>" value="<?php echo $record->FreightValue; ?>" />
<input type="hidden" name="<?php echo 'beforeFreightValue'.$index ?>" id="<?php echo 'beforeFreightValue'.$index ?>" value="<?php echo $record->FreightValue; ?>" />
<input type="hidden" name="<?php echo 'AfterFreightValue'.$index ?>" id="<?php echo 'AfterFreightValue'.$index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
<input type="hidden" name="<?php echo 'beforeAfterFreightValue'.$index ?>" id="<?php echo 'beforeAfterFreightValue'.$index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
@ -3234,7 +3255,7 @@ $('#editimportpomodel').on("shown.bs.modal", function(e) {
var a=parseFloat($('#EdittxtBasicValue').val())
var b=parseFloat($('#ExchangeRate').val());
var c=a*b;
console.log(c);
//console.log(c);
$('#EditINRBasicvalue').val(parseFloat(c).toFixed(2));
$('#EditAfterBasicPriceTax').val(parseFloat(c).toFixed(2));
@ -3267,6 +3288,31 @@ $('#editimportpomodel').on("shown.bs.modal", function(e) {
$('#EditAvailableModvat').val($("#AvailableModvat"+userid).val());
$('#EditTotalExp').val($("#TotalValue"+userid).val());
//$('#EditINRBasicvalue').val($("#BasicINRValue"+userid).val());
$('#drpamendFreight').val($("#FreightType"+userid).val());
$('#AmendNOOfTrips').val($("#NoOfTrip"+userid).val());
$('#AmendtxtFreight').val($("#FreightValue"+userid).val());
$('#AmendtxtAfterFreight').val($("#AfterFreightValue"+userid).val());
var FreightType = $('#drpamendFreight').val();
if (FreightType == "PER TRIP")
{
$('#AmendTripsValue').show();
}
else
{
$('#AmendTripsValue').hide();
}
$('#EditTotalOrderValue').val(cellval[6].innerHTML);
$("#EditMaterialCode").empty();
@ -3360,6 +3406,29 @@ $('.EditImport').click(function(){
var TotalExp=$('#EdittxtBasicValue').val();
//alert(itemRate);
var FreightType=$('#drpamendFreight').val();
var FreightRate=$('#AmendtxtFreight').val();
var FreightRateAmount=$('#AmendtxtAfterFreight').val();
var Nooftrip=$('#AmendNOOfTrips').val();
var FreightTypename = $('#drpamendFreight').val();
if (FreightTypename != "PER TRIP")
{
Nooftrip='';
}
// console.log(FreightType);
// console.log(Nooftrip);
// console.log(FreightRate);
// console.log(FreightRateAmount);
///console.log(TotalExp);
var tr= document.getElementById(userid);
@ -3410,6 +3479,27 @@ $('.EditImport').click(function(){
$('#TotalValue'+userid).val(BasicValue);
$('#AvailableModvat'+userid).val(AvailaleModvat);
$('#FreightType'+userid).val(FreightType);
$('#NoOfTrip'+userid).val(Nooftrip);
$('#FreightValue'+userid).val(FreightRate);
$('#AfterFreightValue'+userid).val(FreightRateAmount);
// var a=$('#FreightType'+userid).val();
// var b=$('#NoOfTrip'+userid).val();
// var c=$('#FreightValue'+userid).val();
// var d=$('#AfterFreightValue'+userid).val();
// console.log(a);
// console.log(b);
// console.log(c);
// console.log(d);
//var a=parseFloat($('#TotalValue'+userid).val());
//console.log(a);
//console.log(userid);
@ -3510,8 +3600,8 @@ var Grossexpenses=$('#Grossexpensesduetocustomduty'+rowid).val()==''?'0.00':$('#
//var Totalvalue=$('#TotalValue'+rowid).val()==''?'0.00':$('#TotalValue'+rowid).val();
var Total= $('#ProductPrice'+rowid).val() == '' ? '0.00' : $('#ProductPrice'+rowid).val();
console.log(rowid);
console.log(Total);
//console.log(rowid);
//console.log(Total);
//var RMC=$('#RMCIncludingCustomers'+rowid).val()==''?'0.00':$('#RMCIncludingCustomers'+rowid).val();
//console.log(Totalvalue);
@ -3696,9 +3786,15 @@ var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
$('#otheroptiondiv').hide();
}
});
$('#drpamendFreight').change(function(){
$('#drpamendFreight').change(function(){
//alert();
var FreightType = $('#drpamendFreight').val();
if (FreightType == "PER TRIP")
if (FreightType == "PER TRIP")
{
$('#AmendTripsValue').show();
@ -3708,7 +3804,128 @@ if (FreightType == "PER TRIP")
$('#AmendTripsValue').hide();
}
if($('#EditRate').val() != '' && $('#EditMaterialCode').val() != "0" )
{
selValue = $("#drpamendFreight").val() ;
$('#AmendtxtFreight').val('');
$('#edittxtAfterFreight').val('');
if (selValue == NilType)
{
$('#AmendtxtFreight').attr('readonly', 'true');
$('#AmendtxtFreight').val('0.00');
}
else
{
$('#AmendtxtFreight').removeAttr( 'readonly','true' );
$('#AmendtxtFreight').val('');
}
}
else
{
alert('Please Select MaterialCode and Rate Field Value');
$('#drpamendFreight').val("0");
$('#EditRate').focus();
}
calculateFreight();
});
function calculateFreight()
{
//alert('af');
if($('#EditMaterialCode').val() == '')
{
alert('Please Select the Material Code');
$('#EditMaterialCode').focus();
$('#edittxtFreight').val('');
return false;
}
else if($('#EditRate').val() == '')
{
alert('Please Enter the Rate value');
$('#EditRate').focus();
$('#AmendtxtFreight').val('');
return false;
}
else
{
var basicValue = parseFloat($('#EditINRBasicvalue').val());
var FreightType =$("#drpamendFreight").val();
if(FreightType == "0")
{
alert('Please select Freight Type');
$('#AmendtxtFreight').val('');
$("#drpamendFreight").focus();
}
else if( $('#AmendtxtFreight').val() != "0" && $('#AmendtxtFreight').val() != '')
{
var FreightValue = parseFloat($('#AmendtxtFreight').val());
var UOM = parseFloat($('#EditUOM').val());
var Quantity = parseFloat($('#EditQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if(FreightType == PercentageType)
{
AfterFreight = <?php echo FREIGHT_PERCENTAGE;?>;
}
else if(FreightType == NilType)
{
AfterFreight = 0.0;
}
else if(FreightType == '<?php echo LUMPSUM;?>')
{
AfterFreight = <?php echo FREIGHT_LUMPSUM;?>;
}
else if(FreightType == '<?php echo PERUOM;?>')
{
AfterFreight = <?php echo FREIGHT_PERUOM;?>;
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
if($('#AmendNOOfTrips').val()==''){
alert('Please Enter No of Trip');
$("#AmendNOOfTrips").focus();
$('#AmendtxtFreight').val(0)
AfterFreight=0;
$('#AmendtxtAfterFreight').val("0.00");
return false;
}
else{
var noOftrip = $("#AmendNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
}
else {
AfterFreight = $("#AmendtxtFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#AmendtxtAfterFreight').val(AfterFreightval);
}
else
{
$('#AmendtxtAfterFreight').val("0.00");
}
}
// calculateEditTotalValue();
}