diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php
index 2326d5af..e1af72e6 100755
--- a/application/controllers/purchaseorder.php
+++ b/application/controllers/purchaseorder.php
@@ -1655,6 +1655,13 @@ function addNewImportPurchaseOrder()
//$ExciseDutySH = $this->input->post('ExcisedutySH'.$i);
$Totalvalueitem=$this->input->post('TotalValue'.$i);
+
+
+
+ $FreightType=$this->input->post('FreightType'.$i);
+ $Nosoftrip=$this->input->post('NoOfTrip'.$i);
+ $FreightRate=$this->input->post('FreightValue'.$i);
+ $FreightAmount=$this->input->post('AfterFreightValue'.$i);
// echo $Totalvalueitem;
//die();
$LineItemNo = '';
@@ -1708,10 +1715,10 @@ function addNewImportPurchaseOrder()
//die();
if(count($isExists) == 0)
{
- print_r(count($isExists));
+ // print_r(count($isExists));
//echo $isExists;
//die();
- $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,'UpdatedOn'=>$updateddt,'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,'UpdatedOn'=>$updateddt,'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'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount);
//print_r($ImportTaxList);
@@ -1723,7 +1730,7 @@ function addNewImportPurchaseOrder()
{
//echo "xxcx";
//die();
- $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,'UpdatedOn'=>$updateddt,'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,'UpdatedOn'=>$updateddt,'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'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount);
//echo "cxvc ";
//die();
//print_r($ImportTaxList);
diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php
index e6d8fb78..c487e986 100755
--- a/application/models/purchaseorder_model.php
+++ b/application/models/purchaseorder_model.php
@@ -865,7 +865,7 @@ function GetImportPurchaseOrderDetails($PONO = '')
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue,ReceivedQuantity,
QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,
- AfterCustomEdCess,ROUND((Quantity *Rate),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,ReceivedQuantity,
+ AfterCustomEdCess,ROUND((Quantity *Rate),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,ReceivedQuantity,Tax.*,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php
index 465a3ff5..aced1382 100755
--- a/application/views/editimportpo.php
+++ b/application/views/editimportpo.php
@@ -1841,11 +1841,11 @@ if($PONOStatus == PO_RELEASED)
?>
-
+
NO Of Trips
'editNOOfTrips','value' => set_value('editNOOfTrips'),'id'=>'editNOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(0);' );
+ $data = array('name' => 'editNOOfTrips','value' => set_value('editNOOfTrips'),'id'=>'editNOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(1);' );
echo form_input($data);
?>
@@ -1854,7 +1854,7 @@ if($PONOStatus == PO_RELEASED)
Freight Rate
'edittxtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(0);');
+ $data = array('name' => 'edittxtFreight','value' => set_value('edittxtFreight'),'id'=>'edittxtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(1);');
echo form_input($data);
?>
@@ -1864,7 +1864,7 @@ if($PONOStatus == PO_RELEASED)
Freight Amt In INR
'edittxtAfterFreight','value' => set_value('txtAfterFreight'),'id'=>'txtAfterFreight', 'class' => 'form-control num' ,'readonly' => 'true');
+ $data = array('name' => 'edittxtAfterFreight','value' => set_value('edittxtAfterFreight'),'id'=>'edittxtAfterFreight', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
@@ -2720,6 +2720,17 @@ if($PONOStatus == PO_RELEASED)
+
+
+
+
+
+
+
+
+
+
+
;
@@ -5136,6 +5197,25 @@ if(validateEditExceedLimit() && ExceedEditQuantityCheck()&&EditQtyZerocheck())
//console.log(GrossDuty);
+ var FreightType=$('#drpeditFreight').val();
+ var FreightRate=$('#edittxtFreight').val();
+ var FreightRateAmount=$('#edittxtAfterFreight').val();
+ var Nooftrip=$('#editNOOfTrips').val();
+
+ var FreightTypename = $('#drpeditFreight').val();
+ if (FreightTypename != "PER TRIP")
+ {
+
+ Nooftrip='';
+ }
+
+ // console.log(FreightType);
+ // console.log(Nooftrip);
+ // console.log(FreightRate);
+ // console.log(FreightRateAmount);
+
+
+
var tr= document.getElementById(userid);
var cellval = tr.cells;
@@ -5183,8 +5263,25 @@ if(validateEditExceedLimit() && ExceedEditQuantityCheck()&&EditQtyZerocheck())
$('#RMCIncludingCustomersPerKG'+userid).val(RMC);
$('#TotalValue'+userid).val(TotalExp);
$('#AvailableModvat'+userid).val(AvailaleModvat);
+
+ $('#FreightType'+userid).val(FreightType);
+ $('#NoOfTrip'+userid).val(Nooftrip);
+ $('#FreightValue'+userid).val(FreightRate);
+ $('#AfterFreightValue'+userid).val(FreightRateAmount);
// var a=parseFloat($('#ProductPrice'+userid).val());
// console.log(a);
+ // 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);
+
+
populateValueMainFormForEditImportTax();
}
@@ -5670,8 +5767,13 @@ if (FreightType == "PER TRIP")
}
});
+
+
+
$('#drpeditFreight').change(function(){
var FreightType = $('#drpeditFreight').val();
+
+
if (FreightType == "PER TRIP")
{
@@ -5682,8 +5784,45 @@ if (FreightType == "PER TRIP")
$('#EditTripsValue').hide();
}
+
+$('#editNOOfTrips').val('');
+$('#edittxtFreight').val('');
+$('#edittxtAfterFreight').val('');
+
+ if($('#EditRate').val() != '' && $('#EditMaterialCode').val() != "0" )
+ {
+ selValue = $("#drpEditFreight").val() ;
+ $('#txtEditFreight').val('');
+ $('#edittxtAfterFreight').val('');
+
+ if (selValue == NilType)
+ {
+
+ $('#txtEditFreight').attr('readonly', 'true');
+ $('#txtEditFreight').val('0.00');
+
+ }
+
+ else
+ {
+ $('#txtEditFreight').removeAttr( 'readonly','true' );
+ $('#txtEditFreight').val('');
+ }
+ }
+ else
+ {
+ alert('Please Select MaterialCode and Rate Field Value');
+ $('#drpEditFreight').val("0");
+ $('#EditRate').focus();
+ }
+calculateFreight(1);
+
});
+
+
+
$('#drpaddFreight').change(function(){
+ //alert();
var FreightType = $('#drpaddFreight').val();
if (FreightType == "PER TRIP")
{
@@ -5695,7 +5834,223 @@ if (FreightType == "PER TRIP")
$('#AddTripsValue').hide();
}
+
+
+if($('#Rate').val() != '' && $('#MaterialCode').val() != "0" )
+ {
+ selValue = $("#drpaddFreight").val() ;
+ $('#txtFreight').val('');
+ $('#txtAfterFreight').val('');
+
+ if (selValue == NilType)
+ {
+
+ $('#txtFreight').attr('readonly', 'true');
+ $('#txtFreight').val('0.00');
+
+ }
+ else
+ {
+ $('#txtFreight').removeAttr( 'readonly','true' );
+ $('#txtFreight').val('');
+
+
+ }
+ }
+ else
+ {
+ alert('Please Select MaterialCode and Rate Field Value');
+ $('#drpaddFreight').val("0");
+ $('#Rate').focus();
+ }
+ calculateFreight(0);
+
});
+
+
+
+
+function calculateFreight(isEdit)
+{
+
+
+ //alert();
+ if(isEdit == '0')
+ { //alert();
+ if($('#MaterialCode').val() == "0")
+ {
+ alert('Please Select the Material Code');
+ $('#MaterialCode').focus();
+ $('#txtFreight').val('') ;
+ return false;
+ }
+ else if($('#Rate').val() == '')
+ {
+ alert('Please Enter the Rate value');
+ $('#Rate').focus();
+ $('#addtxtFreight').val('') ;
+ return false;
+ }
+ else
+ {
+ // var basicValue = parseFloat($('#txtBasicValue').val());
+ var basicValue = parseFloat($('#INRBasicvalue').val());
+ var FreightType =$("#drpaddFreight").val();
+ if(FreightType == "0")
+ {
+ alert('Please select Freight Type');
+ $('#addtxtFreight').val('');
+ $("#drpaddFreight").focus();
+ }
+ else if( $('#addtxtFreight').val() != "0" && $('#addtxtFreight').val() != '')
+ {
+ var FreightValue = parseFloat($('#addtxtFreight').val());
+ var UOM = parseFloat($('#UOM').val());
+ var Quantity = parseFloat($('#Quantity').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($('#addNOOfTrips').val()=='')
+ {
+ alert('Please Enter No of Trip');
+
+ $("#addNOOfTrips").focus();
+ $('#addtxtFreight').val(0)
+ AfterFreight=0;
+ $('#addtxtAfterFreight').val("0.00");
+ return false;
+ }
+ else
+ {
+ var noOftrip = $("#addNOOfTrips").val();
+ AfterFreight = ;
+ AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
+ }
+
+
+ }
+
+ else
+ {
+ AfterFreight = $("#addtxtFreight").val();
+ }
+ var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
+
+ $('#addtxtAfterFreight').val(AfterFreightval);
+ }
+ else
+ {
+ $('#addtxtAfterFreight').val("0.00");
+ }
+
+ }
+ // calculateTotalValue();
+ }
+ else
+ {
+
+
+
+
+ // 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();
+ $('#edittxtFreight').val('');
+ return false;
+ }
+ else
+ {
+ var basicValue = parseFloat($('#EditINRBasicvalue').val());
+ var FreightType =$("#drpeditFreight").val();
+ if(FreightType == "0")
+ {
+ alert('Please select Freight Type');
+ $('#edittxtFreight').val('');
+ $("#drpeditFreight").focus();
+ }
+ else if( $('#edittxtFreight').val() != "0" && $('#edittxtFreight').val() != '')
+ {
+ var FreightValue = parseFloat($('#edittxtFreight').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($('#editNOOfTrips').val()==''){
+ alert('Please Enter No of Trip');
+
+ $("#editNOOfTrips").focus();
+ $('#edittxtFreight').val(0)
+ AfterFreight=0;
+ $('#edittxtAfterFreight').val("0.00");
+ return false;
+ }
+ else{
+ var noOftrip = $("#editNOOfTrips").val();
+ AfterFreight = ;
+ AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
+ }
+ }
+ else {
+ AfterFreight = $("#edittxtFreight").val();
+ }
+ var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
+
+ $('#edittxtAfterFreight').val(AfterFreightval);
+ }
+ else
+ {
+ $('#edittxtAfterFreight').val("0.00");
+ }
+
+ }
+ // calculateEditTotalValue();
+
+ }
+ }