diff --git a/application/views/EditPurchaseOrder.php b/application/views/EditPurchaseOrder.php old mode 100755 new mode 100644 index 8f1d6f17..69fdc0a7 --- a/application/views/EditPurchaseOrder.php +++ b/application/views/EditPurchaseOrder.php @@ -34,6 +34,7 @@ if(!empty($PODetail)) { foreach ($PODetail as $PO) { + //print_r($PODetail); $PONO = $PO->PONO; $POType = $PO->POType; $PODate = $PO->PODate; diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php old mode 100755 new mode 100644 index 982ed3e5..44e91b74 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -37,6 +37,10 @@ if(!empty($INRSYMBOL)) #packagingcalmodel { margin-top:200px; z-index: 1080 !important; + } + #freightmodel { + margin-top:200px; + z-index: 1080 !important; } #ExciseDutyCalModel { margin-top:200px; @@ -146,6 +150,7 @@ if(!empty($INRSYMBOL)) var PercentageType = ''; var POMaxDate = ''; var PackagingCalculation = ''; + var freightCalculation = ''; var ExciseCalculation = ''; var StateTaxCheck = ''; var VatCalculation = ''; @@ -313,6 +318,7 @@ var SelectedMaterialList = { $('#txtDiscount').attr('readonly', 'true'); $('#txtDiscount').val('0.00'); $('#txtAfterDiscount').val('0.00'); + change(); } else @@ -336,13 +342,15 @@ var SelectedMaterialList = { $('#txtEditDiscount').attr('readonly', 'true'); $('#txtEditDiscount').val('0.00'); $('#txtEditAfterDiscount').val('0.00'); - + change(); + } else { $('#txtEditDiscount').removeAttr( 'readonly','true' ); $('#txtEditDiscount').val(''); $('#txtEditAfterDiscount').val(''); + change(); } } else @@ -372,13 +380,14 @@ var SelectedMaterialList = { $('#txtPackaging').attr('readonly', 'true'); $('#txtPackaging').val('0.00'); $('#txtAfterPackaging').val('0.00'); + change(); } else { $('#txtPackaging').removeAttr( 'readonly','true' ); } } - calculatePackaging(0); + change(); }); $('#EditPackagingType').change(function() { $('#txtEditPackaging').val(''); @@ -397,13 +406,14 @@ var SelectedMaterialList = { $('#txtEditPackaging').attr('readonly', 'true'); $('#txtEditPackaging').val('0.00'); + change(); } else { $('#txtEditPackaging').removeAttr( 'readonly','true' ); } } - calculatePackaging(1); + change(); }); $('#txtExciseDuty').change(function() { @@ -432,9 +442,17 @@ var SelectedMaterialList = { }); $('#drpEditFreight').change(function() { + $('#txtEditFreight').val(''); + $('#txtEditAfterFreight').val(''); var FreightType =$("#drpEditFreight").val(); - - if (FreightType == "PER TRIP") + // selValue = $("#drpFreight").val() ; + if(FreightType == PercentageType) + { + var freightCalculation = ''; + $('#freightmodel').modal('show'); + // $('#txtEditAfterFreight').removeAttr( 'readonly','true' ); + } + else if (FreightType == "PER TRIP") { $('#EditTripsValue').show(); @@ -445,6 +463,7 @@ var SelectedMaterialList = { } calculateFreight(1); }); + //add // $('#drpFreight').change(function() { var FreightType =$("#drpFreight").val(); @@ -459,14 +478,19 @@ var SelectedMaterialList = { } selValue = $("#drpFreight").val() ; - - if (selValue == NilType) + if(selValue == PercentageType) + { + var freightCalculation = ''; + $('#freightmodel').modal('show'); + $('#txtFreight').removeAttr( 'readonly','true' ); + } + else if (selValue == NilType) { $('#txtFreight').attr('readonly', 'true'); $('#txtFreight').val('0.00'); $('#txtAfterFreight').val('0.00'); - + change(); } else { @@ -475,7 +499,7 @@ var SelectedMaterialList = { } - calculateFreight(0); + change(); }); }); @@ -525,7 +549,8 @@ function calculateDiscount(isEdit) } else if(DiscountType == NilType ) { - AfterDiscount = "0.00"; + AfterDiscount = "0.00"; + } else { @@ -659,7 +684,8 @@ function calculatePackaging(isEdit) } else if(PackagingType == NilType ) { - AfterPackaging = "0.00"; + AfterPackaging = 0.00; + //Change(); } else @@ -672,6 +698,7 @@ function calculatePackaging(isEdit) var Packaging = parseFloat(AfterPackaging).toFixed(2); $('#txtAfterPackaging').val(Packaging); + //RevenueChangeSgst(); } else { @@ -736,6 +763,8 @@ function calculatePackaging(isEdit) else if(PackagingType == NilType ) { AfterPackaging = "0.00"; + // $('#txtEditAfterPackaging').val(AfterPackaging); + //RevenueChangeSgst(); } else { @@ -746,6 +775,7 @@ function calculatePackaging(isEdit) var Packaging = parseFloat(AfterPackaging).toFixed(2); $('#txtEditAfterPackaging').val(Packaging); + //RevenueChangeEditSgst(); } else { @@ -1471,7 +1501,7 @@ function calculatePackaging(isEdit) { alert('Please Enter the Rate value'); $('#Rate').focus(); - $('#txtFreight').val('') ; + $('#txtFreight').val(''); return false; } else @@ -1492,13 +1522,30 @@ function calculatePackaging(isEdit) var Quantity = parseFloat($('#Quantity').val()); //alert(FreightType); var AfterFreight = 0.0; + // if(FreightType == PercentageType) + // { + // AfterFreight = ; + // } if(FreightType == PercentageType) - { - AfterFreight = ; + { + if($(freightCalculation != 0 && '#txtAfterDiscount').val() == '') + { + alert('Please Enter the Discount value'); + $('#txtFreight').val(''); + $('#DiscountType').focus(); + + return false; } + else + { + var AfterDiscount =parseFloat($('#txtAfterDiscount').val()); + AfterFreight = freightCalculation == 0 ? : ; + } + } else if(FreightType == NilType) { - AfterFreight = 0.0; + AfterFreight = 0.0; + } else if(FreightType == '') { @@ -1533,6 +1580,7 @@ function calculatePackaging(isEdit) var AfterFreightval = parseFloat(AfterFreight).toFixed(2); $('#txtAfterFreight').val(AfterFreightval); + } else { @@ -1540,6 +1588,8 @@ function calculatePackaging(isEdit) } } + + calculateTotalValue(); } else @@ -1575,10 +1625,26 @@ function calculatePackaging(isEdit) var Quantity = parseFloat($('#EditRevenueQuantity').val()); //alert(FreightType); var AfterFreight = 0.0; + // if(FreightType == PercentageType) + // { + // AfterFreight = ; + // } if(FreightType == PercentageType) - { - AfterFreight = ; + { + if($(freightCalculation != 0 && '#txtEditAfterDiscount').val() == '') + { + alert('Please Enter the Discount value'); + $('#txtEditFreight').val(''); + $('#DiscountType').focus(); + + return false; } + else + { + var AfterDiscount =parseFloat($('#txtEditAfterDiscount').val()); + AfterFreight = freightCalculation == 0 ? : ; + } + } else if(FreightType == NilType) { AfterFreight = 0.0; @@ -1614,6 +1680,7 @@ function calculatePackaging(isEdit) var AfterFreightval = parseFloat(AfterFreight).toFixed(2); $('#txtEditAfterFreight').val(AfterFreightval); + //Editchange(); } else { @@ -1631,6 +1698,11 @@ function calculatePackaging(isEdit) { PackagingCalculation = $("input:radio[name='optPackaging']:checked").val(); $('#packagingcalmodel').modal('hide'); + } + function setfreightOption() + { + freightCalculation = $("input:radio[name='optfreight']:checked").val(); + $('#freightmodel').modal('hide'); } /* Set the Packaging calculation option for calculating Packaging */ function SetExciseCalculation() @@ -1699,11 +1771,18 @@ function SetExciseCalculationCancel() if($("#EditDiscountType").val()!=0){ calculateDiscount(isEdit); } - var discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(); - var basic = $('#txtEditRevenueBasicValue').val(); - var basicValue = parseFloat(basic-discount); - + var discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(); + var basic = $('#txtEditRevenueBasicValue').val() == '' ? '0.00' : $('#txtEditRevenueBasicValue').val(); + var basicValue1 = parseFloat(basic-discount); + var packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(); + //alert(packaging); + var freight =$('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val(); + //alert(freight); + var packfreight = parseFloat(packaging)+parseFloat(freight); + var basicValue = parseFloat(basicValue1+packfreight); + //alert(basicValue); if($("#RevenueEditCgst").val()!=''){ + $('#RevenueEditAfterCgst').val(calculateCgstTax(basicValue,$('#RevenueEditCgst').val())); } else{ @@ -1737,9 +1816,13 @@ function SetExciseCalculationCancel() } } -function RevenueChangeSgst(){ +function RevenueChangeSgst() +{ + var getTypeOfTax= $("input:radio[name='Range']:checked").val(); + if(getTypeOfTax==0){ + $('#RevenueSgst').val($('#RevenueCgst').val()); change(); } @@ -1770,9 +1853,14 @@ Editchange(); calculatePackaging(isEdit); } - var discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(); - var basic = $('#txtBasicValue').val(); - var basicValue = parseFloat(basic-discount); + var discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(); + var basic = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val(); + var basicValue1 = parseFloat(basic-discount); + var packaging = $('#txtAfterPackaging').val()== '' ? '0.00' : $('#txtAfterPackaging').val(); + var freight =$('#txtAfterFreight').val()== '' ? '0.00' : $('#txtAfterFreight').val(); + var packfreight = parseFloat(packaging)+parseFloat(freight); + var basicValue = parseFloat(basicValue1+packfreight); + //alert(basicValue); if($("#RevenueCgst").val()!=''){ $('#RevenueAfterCgst').val(calculateCgstTax(basicValue,$('#RevenueCgst').val())); @@ -1798,6 +1886,7 @@ Editchange(); if($("#drpFreight").val()!=0){ calculateFreight(isEdit); + } @@ -1898,6 +1987,7 @@ Editchange(); $('#txtTotalOrderValue').val(''); ExciseCalculation = ''; PackagingCalculation = ''; + freightCalculation=''; VatCalculation = ''; CSTCalculation = ''; } @@ -2630,6 +2720,35 @@ function populateValueMainFormForDeleteItem(rowid) + + +