NO Of Trips
" id="" value="TotalOrderValue; ?>" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -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 = ;
$('#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 = ;
+ }
+ else if(FreightType == NilType)
+ {
+ AfterFreight = 0.0;
+ }
+ else if(FreightType == '')
+ {
+ AfterFreight = ;
+ }
+ else if(FreightType == '')
+ {
+ AfterFreight = ;
+ }
+ else if(FreightType == '')
+ {
+ 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 = ;
+ 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();
+
+
+ }
+