diff --git a/application/config/constants.php b/application/config/constants.php index eebb4ee1..466eccd1 100755 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -241,5 +241,36 @@ define('SERVICETAX_IGST', '((Igst/100 + +/*New import Calculation*/ +define('LOADING_CHARGE1', '(txtlanding*txtbasicprice/100)'); +define('HIGHSEAS_SALES1', '(totalhighsess*highsesspercentage/100)'); +define('CUSTOM_DUTY1', '(accessible*txtcustompercentage)/100'); +define('EXCISE_DUTY1', '(txtexcisesum*txtpercentage)/100'); +define('EXCISE_ED1', '(txtexcise*txtexcisepercentage)/100'); +define('EXCISE_SH1', '(excisetxt*exciseshcess)/100'); +define('CUSTOM_ED1', '(txtcustomduty1*txtedcesspercentage)/100'); +define('CUSTOM_SH1', '(customch*txtshpercentage)/100'); +define('ADDTNL_EXCISEDUTY1', '(totaddtnlexcise*addtnpercentage)/100'); +define('GROSS_EXP1', '(txtgrossdutypayable-txtmodvat)'); +define('AVL_MODVAT1', 'txtexciseduty1+txtexciseedcess+txtexciseshcess+txtaddtnlexcise'); +define('GROSS_DUTY1', 'custom+customsh+customed+afterigst'); +define('PURCHASE_RATE1', '(dutyimpact)/quantity'); +define('CUSTOMDUTY_EXP1', 'txtgrossexp/quantity'); +define('RMC_CAL1', 'txtpurchaserate+txtcustomdutyexp'); +define('CALCULATE_TOTAL1', '(txtrmc*quantity)+basicprice'); + +define('IGST', '(tot*igstpercentage)/100'); +define('SUBTOTAL', '(assessble+custom+customsh+customed)'); + +define('ASSESSBLE', '(result+txtbasicprice)'); +define('DUTYIMPACT', '(totduty-igst)'); +define('MATBYQTY', '(basicqtyval)/qty'); +define('CLEARINGQTY', '(clearing/qty)'); +define('NETTPERUOM', '(basicres+clear+customdutyexp)'); + + + + /* End of file constants.php */ /* Location: ./application/config/constants.php */ diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 14b728f0..91394b43 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1512,14 +1512,10 @@ function addNewImportPurchaseOrder() $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); $DeliveryAddr = $this->input->post('DeliveryAddr'); - //$dt = $this->input->post('Deliverydt'); - //$Deliverydt = $this->getDateformat($dt); + $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); - //$Dispatchinstruction=$this->post('Dispatch'); - //echo $Dispatchinstruction; - //die(); - //$Schedule=$this->post('Scheduleby'); + $DeliveryOption = $this->input->post('DateRange'); //echo $DeliveryOption; @@ -1538,26 +1534,11 @@ function addNewImportPurchaseOrder() $Dispatch = $this->input->post('Dispatch'); $DeliverySchedule = ''; } - - - // $PaymentDate=$this->input->post('Payment'); - // if($PaymentDate==1) - // { - // $PaymentDays='After'; - // } - // else - // { - // $PaymentDays='Before'; - // } - - //echo $PaymentDays; - //die(); - + $SpcialInstruction = $this->input->post('txtSpcialInstruction'); $TotalOrder = $this->input->post('txtToatlOrder'); $POStatus = $this->input->post('textStatus'); - //echo "$POStatus"; - //die(); + $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -1634,35 +1615,15 @@ function addNewImportPurchaseOrder() $Productprice = $this->input->post('BasicAmt'.$i); $LandingCharge = $this->input->post('LandingChargee'.$i); $AfterLandingCharge = $this->input->post('AfterLandingChargee'.$i); - $HighSeas = $this->input->post('Highseass'.$i); - $AfterHighSeas = $this->input->post('AfterHighseass'.$i); - $CustomDuty = $this->input->post('Customduty'.$i); $AfterCustomDuty = $this->input->post('AfterCustomduty'.$i); - - $ExciseDuty = $this->input->post('ExcisedutyTax'.$i); - $AfterExciseDuty = $this->input->post('AfterExcisedutyTax'.$i); - $ExciseDutyEd = $this->input->post('ExcisedutyED'.$i); - $AfterExciseDutyEd = $this->input->post('AfterExcisedutyED'.$i); - - $ExciseDutySH = $this->input->post('ExcisedutySH'.$i); - $AfterExciseDutySH = $this->input->post('AfterExcisedutySH'.$i); - $CustomEd= $this->input->post('CustomEDcess'.$i); $AfterCustomEd= $this->input->post('AfterCustomEDcess'.$i); - $CustomSH = $this->input->post('CustomSHcess'.$i); $AfterCustomSH = $this->input->post('AfterCustomSHcess'.$i); - - $AddAdtional = $this->input->post('AdditionalExciseduty'.$i); - $AfterAddAdtional = $this->input->post('AfterAdditionalExciseduty'.$i); - $Grossdutypayable = $this->input->post('Grossdutypayable'.$i); - $AvailableModvat = $this->input->post('AvilableModvat'.$i); - $Grossexpensesduetocustomduty = $this->input->post('Grossexpenses'.$i); - $purchaseratePerKG = $this->input->post('purchaserate'.$i); $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); - $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); + $QuantityKG = $this->input->post('PurQuantity'.$i); //$currencytypeID = $this->input->post('currencytype'); @@ -1671,6 +1632,14 @@ function addNewImportPurchaseOrder() //echo $BasicPriceinmton; $CostCenter = $this->input->post('costCode'.$i); + $AssessableValue=$this->input->post('AfterAssessable'.$i); + $Subtotal=$this->input->post('Subtotal'.$i); + $Igst=$this->input->post('Igst'.$i); + $AfterIgst=$this->input->post('AfterIgst'.$i); + $Dutyimpact=$this->input->post('Dutyimpact'.$i); + $Clearingcharge=$this->input->post('ClearingCharges'.$i); + $Nettvalue=$this->input->post('Nett'.$i); + $FreightType=$this->input->post('FreightType'.$i); @@ -1724,9 +1693,10 @@ function addNewImportPurchaseOrder() if(trim($POType) == IMPORT ) { // echo 'Success'; - $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); + $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'Grossdutypayable'=>$Grossdutypayable,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$nooftrip,'FreightValue'=>$Freightrate,'AfterFreightValue'=>$Freightamount,'AssessableValue'=>$AssessableValue,'SubTotal'=>$Subtotal,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'DutyImpact'=>$Dutyimpact,'ClearingCharge'=>$Clearingcharge,'NetValue'=>$Nettvalue); //print_r($ImportTaxList); - //die(); + //die();$Nettvalue + $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); @@ -1783,24 +1753,6 @@ function addNewImportPurchaseOrder() $DeliverySchedule = ''; } - - // if($DeliveryOption==1){ - // $Deliverydt = ''; - // $DeliverySchedule = $this->input->post('Scheduleby'); - // } - // else{ - // $Deliverydt = $this->getDateformat($dt); - // $DeliverySchedule = ''; - // } - // $PaymentDate=$this->input->post('Payment'); - // if($PaymentDate==1) - // { - // $PaymentDays='After'; - // } - // else - // { - // $PaymentDays='Before'; - // } $SpcialInstruction = $this->input->post('txtSpcialInstruction'); //$TotalOrder = $this->input->post('txtToatlOrder'); @@ -1903,7 +1855,7 @@ function addNewImportPurchaseOrder() $AfterExciseDutySH = $this->input->post('AfterExciseDutySHCess'.$i); $CustomEd= $this->input->post('CustomEdCess'.$i); - $AfterCustomEd= $this->input->post('AfterCustomEdCess'.$i); + $AfterCustomEd= $this->input->post('AfterCustomEdCess1'.$i); $CustomSH = $this->input->post('CustomSHCess'.$i); $AfterCustomSH = $this->input->post('AfterCustomSHCess'.$i); @@ -1942,6 +1894,18 @@ function addNewImportPurchaseOrder() $FreightRate=$this->input->post('FreightValue'.$i); $FreightAmount=$this->input->post('AfterFreightValue'.$i); + + + + + $AssessableValue=$this->input->post('AssessableValue'.$i); + $Subtotal=$this->input->post('SubTotal'.$i); + $Igst=$this->input->post('IGST'.$i); + $AfterIgst=$this->input->post('AfterIGST'.$i); + $Dutyimpact=$this->input->post('DutyImpact'.$i); + $Clearingcharge=$this->input->post('ClearingCharge'.$i); + $Nettvalue=$this->input->post('NetValue'.$i); + //echo $FreightAmount; @@ -2004,7 +1968,8 @@ function addNewImportPurchaseOrder() // 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,'FreightType'=>$FreightType,'NoOfTrip'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount); + $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'CreatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt,'Grossdutypayable'=>$Grossdutypayable,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount,'AssessableValue'=>$AssessableValue,'SubTotal'=>$Subtotal,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'DutyImpact'=>$Dutyimpact,'ClearingCharge'=>$Clearingcharge,'NetValue'=>$Nettvalue); + //print_r($ImportTaxList); diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index 3c46b61a..e0236cfd 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -100,6 +100,11 @@ $totordervalue=0; $totfreight=0; $ExchangeRate=0; $totorder=0; + +$totassesable=0; +$totSubtotal=0; +$totigst=0; + $Cur=''; $Currency_Type=''; $PayableAT=''; @@ -1118,10 +1123,10 @@ if($PONOStatus == PO_RELEASED)
- +
-
+
-
-
- - -
-
-
- 'ExcisedutyTax','value' => set_value('ExcisedutyTax',0),'id'=>'ExcisedutyTax', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'CalculateExciseDuty()'); - echo form_input($data); - ?> -
-
-
-
- 'AfterExcisedutyTax','value' => set_value('AfterExcisedutyTax'),'id'=>'AfterExcisedutyTax', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
-
- - -
-
-
- 'ExcisedutyEDcess','value' => set_value('ExcisedutyEDcess',0),'id'=>'ExcisedutyEDcess', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'CalculateExciseED1()'); - echo form_input($data); - ?> -
-
-
-
- 'AfterExcisedutyEDcess','value' => set_value('AfterExcisedutyEDcess'),'id'=>'AfterExcisedutyEDcess', 'class' => 'form-control num','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
-
-
- - - -
-
-
- 'ExcisedutySHcess','value' => set_value('ExcisedutySHcess',0),'id'=>'ExcisedutySHcess', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'CalculateexciseSHcess()'); - echo form_input($data); - ?> -
-
-
-
- 'AfterExcisedutySHcess','value' => set_value('AfterExcisedutySHcess'),'id'=>'AfterExcisedutySHcess', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> -
-
-
+ + +
@@ -1275,10 +1216,10 @@ if($PONOStatus == PO_RELEASED)
- +
-
+ + + + + +
+
+ + +
+
+
+ 'Igst ','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'CalculateIgst()'); + echo form_input($data); + ?> +
+
+
+
+ 'AfterIgst','value' => set_value('AfterIgst',0),'id'=>'AfterIgst', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+
+
+ + + + + + + +
- +
@@ -1308,36 +1283,8 @@ if($PONOStatus == PO_RELEASED)
-
-
- - -
-
-
- 'AvailableModvat','value' => set_value('AvailableModvat'),'id'=>'AvailableModvat', 'class' => 'form-control num' ,'readonly' => 'true'); - echo form_input($data); - ?> (b + c + d + g) -
-
- -
-
- -
- - -
-
-
- 'Grossexpenses','value' => set_value('Grossexpenses'),'id'=>'Grossexpenses', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);'); - echo form_input($data); - ?> -
-
-
+ +
@@ -1400,12 +1347,12 @@ if($PONOStatus == PO_RELEASED)
- +
'purchaserate','value' => set_value('purchaserate'),'id'=>'purchaserate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','readonly'=>'true'); + $data = array('name' => 'DutyImpact','value' => set_value('DutyImpact'),'id'=>'DutyImpact', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','readonly'=>'true'); echo form_input($data); ?>
@@ -1425,7 +1372,7 @@ if($PONOStatus == PO_RELEASED)
- +
@@ -1440,22 +1387,43 @@ if($PONOStatus == PO_RELEASED)
- +
'RMCIncludingCustomers','value' => set_value('RMCIncludingCustomers'),'id'=>'RMCIncludingCustomers', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','readonly'=>'true'); + $data = array('name' => 'ClearingCharges','value' => set_value('ClearingCharges'),'id'=>'ClearingCharges', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'CalculateCtable()'); echo form_input($data); ?>
-