diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index ab165e75..12515e5f 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1252,9 +1252,9 @@ function GetCurrencytype() function getCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, -Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, + $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, +Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount + ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance, ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem @@ -1316,9 +1316,9 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode function getDomesticCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, + $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, + Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount + ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance, POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem diff --git a/application/views/editCapitalAmendPO.php b/application/views/editCapitalAmendPO.php index 1c09468f..2d73a003 100644 --- a/application/views/editCapitalAmendPO.php +++ b/application/views/editCapitalAmendPO.php @@ -9,27 +9,33 @@ $SupName = ''; $Address = ''; $PODate = ''; - + $TotalCgst=''; + $TotalSgst=''; + $TotalIgst=''; $DeliveryAddress =''; $POStatus = ''; $PONO = ''; - $TotalServiceTax = 0; - $TotalEducessTax = 0.0; - $TotalSecHigherEducessTax = 0.0; - $TotalKrishiKalyantax = 0.0; - $TotalSwachhBharattax = 0.0; + + $TotalSGST = 0.0; + $TotalCGST = 0.0; + $TotalIGST = 0.0; + $Totalotherallowances = 0.0; + + $TotalSummary = 0.0; $TotalBasicAmount = 0.0; - $ServiceDescription = ''; + $scopeofwork = ''; + $Import_DispatchDetails=''; + $Import_PlaceofOrgin=''; + $CapitalRange=''; $Deliverydt=''; $DeliverSchedule=''; $MaxPoDate = ''; $AvlAmount = 0; $currentCurrencyType=''; - // if(!empty($ExchangeRate))//{ - //print_r($ExchangeRate); - $exchangeRate = $ExchangeRate;//} + $exchangeRate = $ExchangeRate; + $ConfigValue=''; $TotalLanding=0; $tothighseas=0; @@ -56,6 +62,19 @@ $CapitalRange=''; $PoStatusName=''; +$INR=''; +$INRSYM=''; +if(!empty($INRSYMBOL)) +{ + foreach ($INRSYMBOL as $INR) + { + $INRSYM=$INR->Currency_Code; + $INR=$INR->FontCode2000; + } +} + +//echo $INR; + if(!empty($MaxPODate)) { foreach ($MaxPODate as $date) @@ -64,6 +83,10 @@ if(!empty($MaxPODate)) } } +if(!empty($POItem)) +{ + //print_r($POItem); +} if(!empty($POMaster)) { @@ -87,7 +110,7 @@ if(!empty($POMaster)) $POStatus = $Req->StatusCode; $PoStatusName=$Req->StatusName; $PONO = $Req->PONO; - $ServiceDescription = $Req->ServiceDescription; + $scopeofwork = $Req->ServiceDescription; $PayableAT=$Req->PayableAT; $ExchangeRateOn=$Req->ExchangeRateCalculatedon; $PaymentDays=$Req->PaymentDays; @@ -95,10 +118,15 @@ if(!empty($POMaster)) $PaymentTerms=$Req->PaymentTerms; $UpdatedOn=$Req->UpdatedOn; $CapitalRange=$Req->CapitalRange; + $Import_DispatchDetails=$Req->Import_DispatchDetails; + $Import_PlaceofOrgin=$Req->Import_PlaceofOrgin; + $CapitalRange=$Req->CapitalRange; } } +//echo $CapitalRange; + if(!empty($AvlBudAmt)) { @@ -122,9 +150,16 @@ if(!empty($AvlBudAmt)) width:100% ! important; } + @@ -219,7 +256,11 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO'); + // $attributes = array('class' => 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO'); + + $attributes = array('class' => 'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'CapitalPO'); + + echo form_open($this->config->base_url().'/purchaseorder/addPO/',$attributes); ?> @@ -229,7 +270,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
-

Siddharth Industries - Edit Capital Purchase Order:- -For Amendment

+

Siddharth Industries - Amendment Capital Purchase Order -

+ + "DateRange", "id"=>"Date", "value"=>"0", 'checked'=>'checked')); ?>     @@ -373,15 +414,18 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; ?>
-

- +

+ + + 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true'); + // echo form_input($data); - 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control' ,'required' => 'true'); - echo form_input($data); - ?> - -
+ $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40'); + echo Form_textarea($data); + ?> + +
@@ -419,7 +463,19 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; echo form_input($data); ?>
- + + +
+ +
+ 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + // echo form_input($data); + $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin',$Import_PlaceofOrgin),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true'); + echo form_input($data); + ?> +
+
@@ -430,34 +486,32 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
Payable Terms - - ConfigValue){ - $options6[$rl->ConfigValue] = $rl->ConfigValue; - } + if($PaymentTerms==$rl->PaymentTerms) + { + $options6[$rl->PaymentTerms] = $rl->PaymentTerms; + } - - - endforeach; + endforeach; - if(!empty($Payment)) - { - foreach ($Payment as $rl2): + if(!empty($Payment)) + { + foreach ($Payment as $rl2): + if($PaymentTerms!=$rl2->PaymentTerms) + { + $options6[$rl2->PaymentTerms] = $rl2->PaymentTerms; + } - if($PaymentTerms!=$rl2->ConfigValue){ - $options6[$rl2->ConfigValue] = $rl2->ConfigValue; - } + endforeach; + } - endforeach; - } - - echo form_dropdown('PaymentMethod', $options6,set_value('PaymentMethod',$PaymentTerms),'id="PaymentMethod"' ,'required="true"' ,'class="form-control select2'); + echo form_dropdown('PaymentMethod', $options6,set_value('PaymentMethod',$PaymentTerms),'id="PaymentMethod"' ,'required="true"' ,'class="form-control select2'); ?> @@ -465,31 +519,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
-
- Payable AT - 'PayableAT','value' => set_value('PayableAT',$PayableAT),'id'=>'PayableAT', 'class' => 'form-control' ,'required' => 'true'); - echo form_input($data); - ?> - -
- -
- Payment Date
- - - - - - 'Before', 'value' => 'Before', 'checked' => ('Before' == $PaymentDays) ? TRUE : FALSE, 'id' => 'Before')); ?> - - - - 'After', 'value' => 'After', 'checked' => ('After' == $PaymentDays) ? TRUE : FALSE, 'id' => 'After')); ?> - - - -
+ @@ -497,7 +527,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- +

@@ -512,7 +542,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; UOM Rate Basic Amount - Tax Amount + Tax Amount Total Order Amount Action @@ -536,12 +566,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; Quantity ?> UOM ?> Rate ?> - Quantity * $record->Rate; - echo $Basicamt; ?> + Rate * $record->Quantity ?> ServiceTaxamount?> - BasicValue?> + Rate * $record->Quantity ?> $record->MaterialCode,"ReqNo"=>$record->ReqNo); array_push($res_arr_values, $row); @@ -556,7 +583,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; + + @@ -609,17 +638,16 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; - + - - - - - - - - - + + + + + + + + @@ -628,26 +656,23 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; - PONO.'&ReqType='.$record->ReqType.'&CapitalRange='.$record->CapitalRange; ?>" - -     - - - + +     + + + ServiceTax; - $TotalEducessTax = $TotalEducessTax+$record->EducessTax; - $TotalSecHigherEducessTax = $TotalSecHigherEducessTax+$record->SecHigherEducessTax; - $TotalKrishiKalyantax = $TotalKrishiKalyantax+$record->KrishiKalyantax; - $TotalSwachhBharattax = $TotalSwachhBharattax+$record->SwachhBharattax; + $TotalSGST =$TotalSGST+$record->After_SGST; + $TotalCGST = $TotalCGST+$record->After_CGST; + $TotalIGST = $TotalIGST+$record->After_IGST; + $Totalotherallowances = $Totalotherallowances+$record->otherallowance; + $TotalSummary = $TotalSummary+$record->ServiceTaxamount; $TotalBasicAmount = $TotalBasicAmount+$record->BasicValue; - $ServiceDescription = $ServiceDescription; + //$ServiceDescription = $ServiceDescription; if($CapitalRange=='0'){ $TotalLanding = $TotalLanding + $record->AfterLandingCharge; $tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge; @@ -691,543 +716,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
-
- -
+ +
-
-
- Service Tax @14% : -
- 'TotalAfterServiceTax','value' => set_value('TotalAfterServiceTax',$TotalServiceTax),'id'=>'TotalAfterServiceTax', 'class' => 'form-control' ,'placeholder' => 'After Service Tax','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- Education cess @2% on service Tax : -
- 'TotalAfterEduCess','value' => set_value('TotalAfterEduCess',$TotalEducessTax),'id'=>'TotalAfterEduCess', 'class' => 'form-control' ,'placeholder' => 'After Edu. cess','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- Sec. & Higher Edu. cess @1 % on service Tax : -
- 'TotalAfterSecHighTax','value' => set_value('TotalAfterSecHighTax',$TotalSecHigherEducessTax),'id'=>'TotalAfterSecHighTax', 'class' => 'form-control' ,'placeholder' => 'After High Edu. cess','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- Krishi Kalyan tax @.5 % on Basic Amount: -
- 'TotalAfterKrishiTax','value' => set_value('TotalAfterKrishiTax',$TotalKrishiKalyantax),'id'=>'TotalAfterKrishiTax', 'class' => 'form-control' ,'placeholder' => 'After Krishi Kalyan tax.','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- Swachh Bharat tax @.5 % on Basic Amount: -
- 'TotalAfterSwachhTax','value' => set_value('TotalAfterSwachhTax',$TotalSwachhBharattax),'id'=>'TotalAfterSwachhTax', 'class' => 'form-control' ,'placeholder' => 'After Swatchh Bhart Tax.','readonly' => 'true'); - echo form_input($data); - ?> -
-
-
- Total Tax Amount: -
- 'txtToatlOrder','value' => set_value('txtToatlOrder',$TotalSummary),'id'=>'txtToatlOrder', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true'); - echo form_input($data); - ?> -
-
+
+
+ + 'txtTotCgst','value' => set_value('txtTotCgst',$TotalCGST ),'id'=>'txtTotCgst', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+ + +
+ + 'txtTotSgst','value' => set_value('txtTotSgst' ,$TotalSGST),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+
+ + 'txtTotIgst','value' => set_value('txtTotIgst' ,$TotalIGST),'id'=>'txtTotIgst', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+ +
+ + 'TotalOtherAllowances','value' => set_value('TotalOtherAllowances',$Totalotherallowances),'id'=>'TotalOtherAllowances', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> + +
+ + + 'Totalservicesummary','value' => set_value('Totalservicesummary',$TotalSummary),'id'=>'Totalservicesummary', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> + +
@@ -1830,7 +1386,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotallanding','value' => set_value('txttotallanding',$TotalLanding),'id'=>'txttotallanding', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1839,7 +1395,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalhighseas','value' => set_value('txttotalhighseas',$tothighseas),'id'=>'txttotalhighseas', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1848,7 +1404,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalcustom','value' => set_value('txttotalcustom',$totcustom),'id'=>'txttotalcustom', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1857,7 +1413,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalexcise','value' => set_value('txttotalexcise',$totexciseduty),'id'=>'txttotalexcise', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1866,7 +1422,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalexciseED','value' => set_value('txttotalexciseED',$totexcisedutyED),'id'=>'txttotalexciseED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1876,7 +1432,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalexciseSH','value' => set_value('txttotalexciseSH',$totexciseSH),'id'=>'txttotalexciseSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1885,7 +1441,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalcustomED','value' => set_value('txttotalcustomED',$totcustomED),'id'=>'txttotalcustomED', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1894,7 +1450,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalcustomSH','value' => set_value('txttotalcustomSH',$totcustomSH),'id'=>'txttotalcustomSH', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1903,7 +1459,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalAdditionalExciseduty','value' => set_value('txttotalAdditionalExciseduty',$totaddtnlexcise),'id'=>'txttotalAdditionalExciseduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1913,7 +1469,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalgrossduty','value' => set_value('txttotalgrossduty',$totgrossduty),'id'=>'txttotalgrossduty', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1922,7 +1478,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalavlmodvat','value' => set_value('txttotalavlmodvat',$totavlmodvat),'id'=>'txttotalavlmodvat', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1932,7 +1488,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
- + 'txttotalgrossexpense','value' => set_value('txttotalgrossexpense',$totgrossexpense),'id'=>'txttotalgrossexpense', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;'); @@ -1947,7 +1503,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$ServiceDescription),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '10', 'cols' => '40' ); + $data = array('name' => 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$scopeofwork),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '10', 'cols' => '40' ); echo form_textarea($data); ?>
@@ -2002,12 +1558,12 @@ document.getElementById('currencyTypeDiv').style.display = 'block'; - - + +   Submit - - + +

@@ -2075,7 +1631,27 @@ var myArray = ; $("#Deliverydt").datepicker({ minDate : 'now', dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' - }); + }); + + var capital=; + //alert(capital); + if(capital==0) + { + $('#CAPdiv').hide(); + $('#ADDCAPdiv').hide(); + $('#ADDCAPdiv1').hide(); + $('#ADDCAPdiv2').hide(); + $('#ADDCAPdiv3').hide(); + $('#EDITCAPdiv').hide(); + $('#EDITCAPdiv1').hide(); + $('#EDITCAPdiv2').hide(); + $('#EDITCAPdiv3').hide(); + $('#VIEWCAPdiv').hide(); + $('#VIEWCAPdiv1').hide(); + $('#VIEWCAPdiv2').hide(); + $('#VIEWCAPdiv3').hide(); + //$('#DOMdiv').hide(); + } $('#drpSupplier').change(function() { @@ -2362,267 +1938,71 @@ var myArray = ; This function is used to validate all field */ - function Ratechange(){ - - - if($('#Reqnumber').val() == "0") - { - alert('Please select the Requisition Number'); - $('#Reqnumber').focus(); - return false; - } - else if($('#MaterialCode').val() == "0") - { - alert('Please select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#CostCenter').val() == "0") - { - alert('Please select the CostCenterCode'); - $('#CostCenter').focus(); - return false; - } - //ExceedQuantityCheck(); - - if(ExceedQuantityCheck()){ - - - if($('#CPQuantity').val() != '' && $('#CPRate').val() != '') - { - - var txtQuantity = parseFloat( $('#CPQuantity').val()); - //var txtExchangeRate = parseFloat( $('#ExchangeRtModal').val()); - var RatePerTon = parseFloat( $('#CPRate').val()); - //var txtUnitPrice = parseFloat($('#Rate').val()); - - var txtExchangeRate=''; - if(capitalType=='International'){ - txtExchangeRate = parseFloat( $('#ExchangeRtModal').val()); - var Tot = txtQuantity * RatePerTon; - } - - else{ - var Tot = txtQuantity * RatePerTon; - txtExchangeRate = 1; - } - - - var BasicInINR=Tot * txtExchangeRate; - - - $('#CPTotalAmount').val(parseFloat(Tot).toFixed(2)); - $('#AfterBasicPriceTax').val(Math.round(BasicInINR)); - //ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val()); - - if(ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val())){ - //Service Tax calculation - - - $('#AfterServiceTax').val(calculateServiceTax($('#AfterBasicPriceTax').val())); - - //Edu. cess @2% on service Tax - $('#AfterEduCess').val( calculateEduess($('#AfterServiceTax').val())); - - //Sec. & Higher Edu. cess @1 % on service Tax - - $('#AfterSecHighTax').val(calculateHigherEdu($('#AfterServiceTax').val())); - //Krishi Kalyan tax - - $('#AfterKrishiTax').val(calculateKrishiKalyantax($('#AfterBasicPriceTax').val())); - //Swachh Bharat tax - - $('#AfterSwachhTax').val(calculateSwachhBharattax($('#AfterBasicPriceTax').val())); - - // This is for import basic price - - //$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val())); - - if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!=''){ - $('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val(),$('#AfterBasicPriceTax').val())); - - - if($('#Highseas').val()!='' && $('#AfterLandingCharge').val()!=''){ - $('#AfterHighseas').val(calculateHighseasCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#Highseas').val())); - - if($('#Customduty').val()!='' && $('#AfterHighseas').val()!=''){ - $('#AfterCustomduty').val(calculateCustomdutyCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#Customduty').val())); - if($('#AfterCustomduty').val()!='' && $('#ExcisedutyTax').val()!=''){ - $('#AfterExcisedutyTax').val(calculateExciseCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#ExcisedutyTax').val())); - - if($('#AfterExcisedutyTax').val()!='' && $('#ExcisedutyEDcess').val()!=''){ - $('#AfterExcisedutyEDcess').val(calculateExciseEDcessCharge($('#AfterExcisedutyTax').val(),$('#ExcisedutyEDcess').val())); - - if($('#AfterExcisedutyTax').val()!='' && $('#ExcisedutySHcess').val()!=''){ - $('#AfterExcisedutySHcess').val(calculateExciseSHcessCharge($('#AfterExcisedutyTax').val(),$('#ExcisedutySHcess').val())); - if($('#AfterExcisedutySHcess').val()!='' && $('#CustomEDcess').val()!=''){ - $('#AfterCustomEDcess').val(calculateCustomEDcessCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#CustomEDcess').val())); - - } - if($('#AfterExcisedutySHcess').val()!='' && $('#CustomSHcess').val()!=''){ - $('#AfterCustomSHcess').val(calculateCustomSHcessCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#CustomSHcess').val())); - - if($('#AfterCustomSHcess').val()!='' && $('#AdditionalExciseduty').val()!=''){ - $('#AfterAdditionalExciseduty').val(calculateAdditionalExciseDutyCharge($('#AfterBasicPriceTax').val(),$('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterCustomEDcess').val(),$('#AfterCustomSHcess').val(),$('#AdditionalExciseduty').val())); - - - $('#Grossdutypayable').val(calculateGrossdutypayableCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterCustomEDcess').val(),$('#AfterCustomSHcess').val(),$('#AfterAdditionalExciseduty').val())); - - $('#AvailableModvat').val(calculateAvailableModvatCharge($('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterAdditionalExciseduty').val())); - $('#Grossexpenses').val(calculateGrossexpensesCharge($('#Grossdutypayable').val(),$('#AvailableModvat').val())); - if($('#PurQuantity').val()!=''){ - $('#purchaserate').val(calculatepurchaserate($('#AfterBasicPriceTax').val(),$('#PurQuantity').val())); - $('#CustomDutyExpenses').val(calculateCustomDutyExpenses($('#Grossexpenses').val(),$('#PurQuantity').val())); - $('#RMCIncludingCustomers').val(calculateRMCIncludingCustomers($('#purchaserate').val(),$('#CustomDutyExpenses').val())); - var Rmc = $('#RMCIncludingCustomers').val(); - var Quanty =$('#CPQuantity').val(); - var BasicAmt = $('#CPTotalAmount').val(); - var perKg = Rmc * Quanty * BasicAmt; - - - $('#txtTotalOrderValue').val(perKg); - } - } - - } - } - else{ - //alert('Please Enter Excise duty S & H cess'); - } - } - else{ - //alert('Please Enter Excise Duty ED_cess'); - - } - } - else{ - //alert('Please Enter Excise Duty'); - } - } - else{ - //alert('Please Enter Custom Duty'); - } - - } - - - } - else{ - //alert('Please Enter Landing Charge ') - } - - - - - - calculateTotalValue(); - - // var res = ExceedBudget($('#TotalOrderValue').val(), $('#CapitalbudAmt').val()); - //if(!res) - // { - // $('#CPRate').focus(); - // return false; - // } - } - } - - - else{ - $('CPRate').focus(); - } - - } - else{ - clearTaxField(); - } - - } + /* This function used to check quantity exceeding or not */ - function ExceedQuantityCheck() - { - var EnterQuantity = $("#CPQuantity").val()== '' ? "0.00" : parseFloat($("#CPQuantity").val()); - var ReqQuantity = parseFloat(RequistQuantity); - //alert(ReqQuantity); - if(EnterQuantity > ReqQuantity) - { - alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // function ExceedQuantityCheck() + // { + // var EnterQuantity = $("#CPQuantity").val()== '' ? "0.00" : parseFloat($("#CPQuantity").val()); + // var ReqQuantity = parseFloat(RequistQuantity); + // //alert(ReqQuantity); + // if(EnterQuantity > ReqQuantity) + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - $('#CPQuantity').focus(); - return false; - } - else { - return true; - } - } + // $('#CPQuantity').focus(); + // return false; + // } + // else { + // return true; + // } + // } /* This function is used to calculate tax */ - function calculateServiceTax(varBasicValue) + function calculateServiceCGST(varBasicValue,varCGST) { var basicValue = parseFloat(varBasicValue); + var Cgst = parseFloat(varCGST); + var ServiceCGSTvalue = 0.0; - var ServiceTaxValue = 0.0; + ServiceCGSTvalue = ; - ServiceTaxValue = ; - - var TAXval = parseFloat(ServiceTaxValue).toFixed(2); + var TAXval = parseFloat(ServiceCGSTvalue).toFixed(2); return TAXval;// $('#AfterServiceTax').val(TAXval); } - function calculateEduess(varAfterServiceTax) + function calculateServiceSGST(varBasicValue,varSGST) { - var ServiceTaxAmount = parseFloat(varAfterServiceTax); + // alert(varBasicValue+"-"+varSGST); + var basicValue = parseFloat(varBasicValue); + var Sgst = parseFloat(varSGST); + var ServiceSGSTvalue = 0.0; - var ServiceTaxValue = 0.0; + ServiceSGSTvalue = ; - ServiceTaxValue = ; + var TAXval = parseFloat(ServiceSGSTvalue).toFixed(2); - var TAXval = parseFloat(ServiceTaxValue).toFixed(2); - - return TAXval;// $('#AfterEduCess').val(TAXval); + return TAXval;// $('#AfterEduCess').val(TAXval); } - function calculateHigherEdu(varAfterServiceTax) - { - var ServiceTaxAmount = parseFloat(varAfterServiceTax); - - var ServiceTaxValue = 0.0; - - ServiceTaxValue = ; - - var TAXval = parseFloat(ServiceTaxValue).toFixed(2); - - return TAXval;//$('#AfterSecHighTax').val(TAXval); - } - function calculateKrishiKalyantax(varBasicValue) + function calculateServiceIGST(varBasicValue,varIGST) { var basicValue = parseFloat(varBasicValue); + var Igst = parseFloat(varIGST); + var ServiceCGSTvalue = 0.0; - var ServiceTaxValue = 0.0; + ServiceCGSTvalue = ; - ServiceTaxValue = ; + var TAXval = parseFloat(ServiceCGSTvalue).toFixed(2); - var TAXval = parseFloat(ServiceTaxValue).toFixed(2); - - return TAXval;//$('#AfterKrishiTax').val(TAXval); - } - function calculateSwachhBharattax(varBasicValue) - { - var basicValue = parseFloat(varBasicValue); - - var ServiceTaxValue = 0.0; - - ServiceTaxValue = ; - - var TAXval = parseFloat(ServiceTaxValue).toFixed(2); - - return TAXval; //$('#AfterSwachhTax').val(TAXval); + return TAXval;//$('#AfterSecHighTax').val(TAXval); } + /* Calculate Landing charge @@ -2858,20 +2238,7 @@ var myArray = ; /* This is used to calculate Total order value */ - function calculateTotalOrdervalue() - { - var basicValue = parseFloat($('#CPTotalAmount').val()); - var ServiceTaxAmount = parseFloat($('#AfterServiceTax').val()); - var EduCessTaxAmount = parseFloat($('#AfterEduCess').val()); - var SecHighTaxAmount = parseFloat($('#AfterSecHighTax').val()); - var KrishiTaxAmount = parseFloat($('#AfterKrishiTax').val()); - var SwachhTaxAmount = parseFloat($('#AfterSwachhTax').val()); - - var TotAmt = basicValue + ServiceTaxAmount+ EduCessTaxAmount + SecHighTaxAmount+ KrishiTaxAmount + SwachhTaxAmount; - - // $('#TotalOrderValue').val( parseFloat(TotAmt).toFixed(2)); - - } + /* Used to check the exceed budget */ @@ -2894,152 +2261,7 @@ var myArray = ; /* This is used add capital po line item */ - $('.AddCapital').click(function(){ - - - if(validateCapitalTax() && validateExceedLimit() && ExceedQuantityCheck()) - { - var temp = index; - var Reqnumber = $('#Reqnumber').val(); - var departmentName = $('#CapitalDepartmentName').val(); - var AvilBudget = $('#CapitalbudAmt').val(); - var costCode = $('#CostCenter').val(); - - var materialCode =$('#MaterialCode').val(); - var materialName = $("#CapitalItemName").val(); - var uom = $("#CPUOM").val(); - var exchangeRate = $("#ExchangeRtModal").val(); - var quantity = $("#CPQuantity").val(); - var convertRate = $("#CPRate").val(); - var itemRate = parseFloat(convertRate).toFixed(2); - var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2); - var AfterServiceTax = $("#AfterServiceTax").val(); - var AfterEduCess = $("#AfterEduCess").val(); - var AfterSecHighTax = $("#AfterSecHighTax").val(); - - var AfterKrishiTax = $("#AfterKrishiTax").val(); - var AfterSwachhTax = $("#AfterSwachhTax").val(); - - - var landingCharge = $('#AfterLandingCharge').val(); - var HighSeasSalesCharge = $('#AfterHighseas').val(); - var CustomDuty = $('#AfterCustomduty').val(); - var ExciseDuty = $('#AfterExcisedutyTax').val(); - var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val(); - var ExciseDutySHCess = $('#AfterExcisedutySHcess').val(); - var CustomEDCess = $('#AfterCustomEDcess').val(); - var CustomSHCess = $('#AfterCustomSHcess').val(); - var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val(); - var GrossDutyPayable = $('#Grossdutypayable').val(); - var AvailableModvat = $('#AvailableModvat').val(); - var GrossExpensesDuetoCustom = $('#Grossexpenses').val(); - var PurQuantity = $('#PurQuantity').val(); -var purchaseRate = $('#purchaserate').val(); - var CustomDutyExpenses = $('#CustomDutyExpenses').val(); - var RMCIncludingCustomers = $('#RMCIncludingCustomers').val(); - var basicvalInINR=$('#AfterBasicPriceTax').val(); - /*get % values */ - var beforeLanding = $('#LandingCharge').val(); - - var beforeHighSeasSalesCharge = $('#Highseas').val(); - var beforeCustomDuty = $('#Customduty').val(); - var beforeExciseDuty = $('#ExcisedutyTax').val(); - var beforeExciseDutyEDCess = $('#ExcisedutyEDcess').val(); - var beforeExciseDutySHCess = $('#ExcisedutySHcess').val(); - var beforeCustomEDCess = $('#CustomEDcess').val(); - var beforeCustomSHCess = $('#CustomSHcess').val(); - var beforeAdditionalExciseDuty =$('#AdditionalExciseduty').val(); - var PurQuantity = $('#PurQuantity').val(); - - var Total = (parseFloat(basicval)+parseFloat(AfterServiceTax)+parseFloat(AfterEduCess)+parseFloat(AfterSecHighTax)+parseFloat(AfterKrishiTax)+parseFloat(AfterSwachhTax)).toFixed(2); - - - var TotalOrderValuePerkg = $("#txtTotalOrderValue").val(); - - var TotalTaxValue = calculateTaxValue(); - - - - $('#MaterialCode option[value='+materialCode+']').remove(); - - SelectedMaterialCode[CollIndex] = materialCode; - CollIndex = CollIndex + 1; - - SelectedMaterialList.Mat.push({ - "materialCode" : materialCode, - "ReqNo" : Reqnumber, - - }); - - populateValueMainFormForCapital(); - - - - index = parseInt(index)+1; - - var template = jQuery("#CapitalList").html(); - - - $('#capitalAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,MaterialName:materialName,Quantity:quantity,UOM:uom,Rate:itemRate,BasicAmount:basicval,Taxvalue:TotalTaxValue,TotalValue:basicval})); - - //clearCapitalModalFields(); - var theForm = $(".CapitalPO"); - - addHidden(theForm,"Reqnumber"+temp,Reqnumber); - addHidden(theForm,"departmentName"+temp,departmentName ); - addHidden(theForm,"AvilBudget"+temp,AvilBudget ); - addHidden(theForm,"CPCostCode"+temp,costCode ); - addHidden(theForm,"materialCode"+temp,materialCode ); - addHidden(theForm,"materialName"+temp,materialName ); - addHidden(theForm,"echangeRate"+temp,exchangeRate ); - addHidden(theForm,"uom"+temp,uom); - addHidden(theForm,"quantity"+temp,quantity); - addHidden(theForm,"rateInUs"+temp,convertRate); - addHidden(theForm,"itemRate"+temp,itemRate); - addHidden(theForm,"basicval"+temp,basicval); - addHidden(theForm,"AfterServiceTax"+temp,AfterServiceTax); - addHidden(theForm,"AfterEduCess"+temp,AfterEduCess); - addHidden(theForm,"AfterSecHighTax"+temp,AfterSecHighTax); - addHidden(theForm,"AfterKrishiTax"+temp,AfterKrishiTax); - addHidden(theForm,"AfterSwachhTax"+temp,AfterSwachhTax); - addHidden(theForm,"landingCharge"+temp,landingCharge); - addHidden(theForm,"HighSeasSalesCharge"+temp,HighSeasSalesCharge); - addHidden(theForm,"CustomDuty"+temp,CustomDuty); - addHidden(theForm,"ExciseDuty"+temp,ExciseDuty); - addHidden(theForm,"ExciseDutyEDCess"+temp,ExciseDutyEDCess); - addHidden(theForm,"ExciseDutySHCess"+temp,ExciseDutySHCess); - addHidden(theForm,"CustomEDCess"+temp,CustomEDCess); - addHidden(theForm,"CustomSHCess"+temp,CustomSHCess); - addHidden(theForm,"AdditionalExciseDuty"+temp,AdditionalExciseDuty); - addHidden(theForm,"GrossDutyPayable"+temp,GrossDutyPayable); - addHidden(theForm,"AvailableModvat"+temp,AvailableModvat); - addHidden(theForm,"GrossExpensesDuetoCustom"+temp,GrossExpensesDuetoCustom); - addHidden(theForm,"purchaseRate"+temp,purchaseRate); - addHidden(theForm,"CustomDutyExpenses"+temp,CustomDutyExpenses); - addHidden(theForm,"RMCIncludingCustomers"+temp,RMCIncludingCustomers); - addHidden(theForm,"ServiceTotalOrderValue"+temp,TotalTaxValue); - - addHidden(theForm,"beforeLanding"+temp,beforeLanding); - addHidden(theForm,"beforeHighSeasSalesCharge"+temp,beforeHighSeasSalesCharge ); - addHidden(theForm,"beforeCustomDuty"+temp,beforeCustomDuty ); - addHidden(theForm,"beforeExciseDuty"+temp,beforeExciseDuty ); - addHidden(theForm,"beforeExciseDutyEDCess"+temp,beforeExciseDutyEDCess ); - addHidden(theForm,"beforeExciseDutySHCess"+temp,beforeExciseDutySHCess ); - addHidden(theForm,"beforeCustomEDCess"+temp,beforeCustomEDCess ); - addHidden(theForm,"beforeCustomSHCess"+temp,beforeCustomSHCess); - addHidden(theForm,"beforeAdditionalExciseDuty"+temp,beforeAdditionalExciseDuty); - addHidden(theForm,"PurQuantity"+temp,PurQuantity); - addHidden(theForm,"PerKgExpense"+temp,TotalOrderValuePerkg); - addHidden(theForm,"LineItemNo"+temp,""); - addHidden(theForm,"basicvalInINR"+temp,basicvalInINR); - - $('#txtRowCount').val(temp); - - - clearCapitalModalFields(); - } - - }); + /* used to validateExceedLimit */ function validateExceedLimit() @@ -3098,148 +2320,7 @@ var purchaseRate = $('#purchaserate').val(); return true; } } - function calculateTotalValue() - { - var BasicVal = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val(); - var ServiceTaxAmount = $('#AfterServiceTax').val() == '' ? '0.00' : $('#AfterServiceTax').val(); - var EduCessTaxAmount = $('#AfterEduCess').val() == '' ? '0.00' : $('#AfterEduCess').val(); - var SecHighTaxAmount = $('#AfterSecHighTax').val() == '' ? '0.00' : $('#AfterSecHighTax').val(); - var KrishiTaxAmount = $('#AfterKrishiTax').val() == '' ? '0.00' : $('#AfterKrishiTax').val(); - var SwachhTaxAmount = $('#AfterSwachhTax').val() == '' ? '0.00' : $('#AfterSwachhTax').val(); - var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val(); - var HighSeasSalesCharge = $('#AfterHighseas').val() == '' ? '0.00' : $('#AfterHighseas').val(); - var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val(); - var ExciseDuty = $('#AfterExcisedutyTax').val() == '' ? '0.00' : $('#AfterExcisedutyTax').val(); - var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val() == '' ? '0.00' : $('#AfterExcisedutyEDcess').val(); - var ExciseDutySHCess = $('#AfterExcisedutySHcess').val() == '' ? '0.00' : $('#AfterExcisedutySHcess').val(); - var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val(); - var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val(); - var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val() == '' ? '0.00' : $('#AfterAdditionalExciseduty').val(); - var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val(); - var AvailableModvat = $('#AvailableModvat').val() == '' ? '0.00' : $('#AvailableModvat').val(); - var GrossExpensesDuetoCustom = $('#Grossexpenses').val() == '' ? '0.00' : $('#Grossexpenses').val(); - var purchaseRate = $('#purchaserate').val() == '' ? '0.00' : $('#purchaserate').val(); - var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val(); - var RMCIncludingCustomers = $('#RMCIncludingCustomers').val() == '' ? '0.00' : $('#RMCIncludingCustomers').val(); - var totvalue = (parseFloat(BasicVal) + parseFloat(ServiceTaxAmount)+ parseFloat(EduCessTaxAmount)+ parseFloat(SecHighTaxAmount) + parseFloat(KrishiTaxAmount)+ parseFloat(SwachhTaxAmount)); -//+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers) - var tot = parseFloat(totvalue).toFixed(2); - - //$('#txtTotalOrderValue').val(tot); - - validateExceedLimit(); - ExceedQuantityCheck(); - } - /* calculate tax value*/ - function calculateTaxValue(){ - var ServiceTaxAmount = $('#AfterServiceTax').val() == '' ? '0.00' : $('#AfterServiceTax').val(); - var EduCessTaxAmount = $('#AfterEduCess').val() == '' ? '0.00' : $('#AfterEduCess').val(); - var SecHighTaxAmount = $('#AfterSecHighTax').val() == '' ? '0.00' : $('#AfterSecHighTax').val(); - var KrishiTaxAmount = $('#AfterKrishiTax').val() == '' ? '0.00' : $('#AfterKrishiTax').val(); - var SwachhTaxAmount = $('#AfterSwachhTax').val() == '' ? '0.00' : $('#AfterSwachhTax').val(); - var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val(); - var HighSeasSalesCharge = $('#AfterHighseas').val() == '' ? '0.00' : $('#AfterHighseas').val(); - var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val(); - var ExciseDuty = $('#AfterExcisedutyTax').val() == '' ? '0.00' : $('#AfterExcisedutyTax').val(); - var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val() == '' ? '0.00' : $('#AfterExcisedutyEDcess').val(); - var ExciseDutySHCess = $('#AfterExcisedutySHcess').val() == '' ? '0.00' : $('#AfterExcisedutySHcess').val(); - var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val(); - var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val(); - var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val() == '' ? '0.00' : $('#AfterAdditionalExciseduty').val(); - var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val(); - var AvailableModvat = $('#AvailableModvat').val() == '' ? '0.00' : $('#AvailableModvat').val(); - var GrossExpensesDuetoCustom = $('#Grossexpenses').val() == '' ? '0.00' : $('#Grossexpenses').val(); - var purchaseRate = $('#purchaserate').val() == '' ? '0.00' : $('#purchaserate').val(); - var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val(); - var RMCIncludingCustomers = $('#RMCIncludingCustomers').val() == '' ? '0.00' : $('#RMCIncludingCustomers').val(); - var totTaxvalue = (parseFloat(ServiceTaxAmount)+ parseFloat(EduCessTaxAmount)+ parseFloat(SecHighTaxAmount) + parseFloat(KrishiTaxAmount)+ parseFloat(SwachhTaxAmount)); -//+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers) - - var totTax = parseFloat(totTaxvalue).toFixed(2); - return totTax; - } - - function populateValueMainFormForCapital() - { - var BasicVal = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val(); - var ServiceTaxAmount = $('#AfterServiceTax').val() == '' ? '0.00' : $('#AfterServiceTax').val(); - - var EduCessTaxAmount = $('#AfterEduCess').val() == '' ? '0.00' : $('#AfterEduCess').val(); - var SecHighTaxAmount = $('#AfterSecHighTax').val() == '' ? '0.00' : $('#AfterSecHighTax').val(); - var KrishiTaxAmount = $('#AfterKrishiTax').val() == '' ? '0.00' : $('#AfterKrishiTax').val(); - var SwachhTaxAmount = $('#AfterSwachhTax').val() == '' ? '0.00' : $('#AfterSwachhTax').val(); - var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val(); - var HighSeasSalesCharge = $('#AfterHighseas').val() == '' ? '0.00' : $('#AfterHighseas').val(); - var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val(); - var ExciseDuty = $('#AfterExcisedutyTax').val() == '' ? '0.00' : $('#AfterExcisedutyTax').val(); - var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val() == '' ? '0.00' : $('#AfterExcisedutyEDcess').val(); - var ExciseDutySHCess = $('#AfterExcisedutySHcess').val() == '' ? '0.00' : $('#AfterExcisedutySHcess').val(); - var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val(); - var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val(); - var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val() == '' ? '0.00' : $('#AfterAdditionalExciseduty').val(); - var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val(); - var AvailableModvat = $('#AvailableModvat').val() == '' ? '0.00' : $('#AvailableModvat').val(); - var GrossExpensesDuetoCustom = $('#Grossexpenses').val() == '' ? '0.00' : $('#Grossexpenses').val(); - var purchaseRate = $('#purchaserate').val() == '' ? '0.00' : $('#purchaserate').val(); - var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val(); - var RMCIncludingCustomers = $('#RMCIncludingCustomers').val() == '' ? '0.00' : $('#RMCIncludingCustomers').val(); - // var totvalue = $('#txtTotalOrderValue').val() == '' ? '0.00' : $('#txtTotalOrderValue').val(); - var totvalue = (parseFloat(ServiceTaxAmount)+parseFloat(EduCessTaxAmount)+parseFloat(SecHighTaxAmount)+parseFloat(KrishiTaxAmount)+parseFloat(SwachhTaxAmount)).toFixed(2); - - - var TotalOrderValueSummary = $('#txtToatlOrder').val() == '' ? '0.00' : $('#txtToatlOrder').val(); - - var TotalServiceTax = $('#TotalAfterServiceTax').val() == '' ? '0.00' : $('#TotalAfterServiceTax').val(); - - var TotalEducess = $('#TotalAfterEduCess').val() == '' ? '0.00' : $('#TotalAfterEduCess').val(); - var TotHigherEdu = $('#TotalAfterSecHighTax').val() == '' ? '0.00' : $('#TotalAfterSecHighTax').val(); - - var TotalKrishiKalyan = $('#TotalAfterKrishiTax').val() == '' ? '0.00' : $('#TotalAfterKrishiTax').val(); - var TotSwachhBharat = $('#TotalAfterSwachhTax').val() == '' ? '0.00' : $('#TotalAfterSwachhTax').val(); - - var TotLanding = $('#txttotallanding').val() == '' ? '0.00' : $('#txttotallanding').val(); - var TotHighseas = $('#txttotalhighseas').val() == '' ? '0.00' : $('#txttotalhighseas').val(); - var TotCustom = $('#txttotalcustom').val() == '' ? '0.00' : $('#txttotalcustom').val(); - var TotExcise = $('#txttotalexcise').val() == '' ? '0.00' : $('#txttotalexcise').val(); - var TotExciseED = $('#txttotalexciseED').val() == '' ? '0.00' : $('#txttotalexciseED').val(); - var TotExciseSH = $('#txttotalexciseSH').val() == '' ? '0.00' : $('#txttotalexciseSH').val(); - var TotCustomED = $('#txttotalcustomED').val() == '' ? '0.00' : $('#txttotalcustomED').val(); - var TotCustomSH = $('#txttotalcustomSH').val() == '' ? '0.00' : $('#txttotalcustomSH').val(); - var TotAdditionalExciseduty = $('#txttotalAdditionalExciseduty').val() == '' ? '0.00' : $('#txttotalAdditionalExciseduty').val(); - var TotGrossduty = $('#txttotalgrossduty').val() == '' ? '0.00' : $('#txttotalgrossduty').val(); - var TotAvlmodvat = $('#txttotalavlmodvat').val() == '' ? '0.00' : $('#txttotalavlmodvat').val(); - - var TotGrossexpense = $('#txttotalgrossexpense').val() == '' ? '0.00' : $('#txttotalgrossexpense').val(); - var TotalCapitalOrder = $('#CapitalToatlOrder').val() == '' ? '0.00' : $('#CapitalToatlOrder').val(); - - $('#TotalAfterServiceTax').val((parseFloat(TotalServiceTax) + parseFloat(ServiceTaxAmount)).toFixed(2) ); - $('#TotalAfterEduCess').val((parseFloat(TotalEducess) + parseFloat(EduCessTaxAmount)).toFixed(2) ); - $('#TotalAfterSecHighTax').val((parseFloat(TotHigherEdu) + parseFloat(SecHighTaxAmount)).toFixed(2) ); - - $('#TotalAfterKrishiTax').val((parseFloat(TotalKrishiKalyan) + parseFloat(KrishiTaxAmount)).toFixed(2) ); - $('#TotalAfterSwachhTax').val((parseFloat(TotSwachhBharat) + parseFloat(SwachhTaxAmount)).toFixed(2) ); - - $('#txttotallanding').val((parseFloat(TotLanding) + parseFloat(landingCharge)).toFixed(2) ); - $('#txttotalhighseas').val((parseFloat(TotHighseas) + parseFloat(HighSeasSalesCharge)).toFixed(2) ); - $('#txttotalcustom').val((parseFloat(TotCustom) + parseFloat(CustomDuty)).toFixed(2) ); - $('#txttotalexcise').val((parseFloat(TotExcise) + parseFloat(ExciseDuty)).toFixed(2) ); - $('#txttotalexciseED').val((parseFloat(TotExciseED) + parseFloat(ExciseDutyEDCess)).toFixed(2) ); - $('#txttotalexciseSH').val((parseFloat(TotExciseSH) + parseFloat(ExciseDutySHCess)).toFixed(2) ); - $('#txttotalcustomED').val((parseFloat(TotCustomED) + parseFloat(CustomEDCess)).toFixed(2) ); - $('#txttotalcustomSH').val((parseFloat(TotCustomSH) + parseFloat(CustomSHCess)).toFixed(2) ); - $('#txttotalAdditionalExciseduty').val((parseFloat(TotAdditionalExciseduty) + parseFloat(AdditionalExciseDuty)).toFixed(2) ); - $('#txttotalgrossduty').val((parseFloat(TotGrossduty) + parseFloat(GrossDutyPayable)).toFixed(2) ); - $('#txttotalavlmodvat').val((parseFloat(TotAvlmodvat) + parseFloat(AvailableModvat)).toFixed(2) ); - $('#txttotalgrossexpense').val((parseFloat(TotGrossexpense) + parseFloat(GrossExpensesDuetoCustom)).toFixed(2) ); - - $('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary) + parseFloat(totvalue)).toFixed(2) ); - - $('#CapitalToatlOrder').val((parseFloat(TotalCapitalOrder) + parseFloat(BasicVal)).toFixed(2) ); - - - - - } + function clearCapitalModalFields() { @@ -3293,136 +2374,9 @@ $('#PurQuantity').val(''); } - function addHidden(theForm, key, value) { - // Create a hidden input element, and append it to the form: - var input = document.createElement('input'); - input.type = 'hidden'; - input.name = key;'name-as-seen-at-the-server'; - input.id = key;'name-as-seen-at-the-server'; - input.value = value; - theForm.append(input); -} - -function DeleteRow(rowid) -{ - var id = []; - var DelRows = $('#txtDeletedRow').val(); - - - var answer = confirm(" Do you want to delete the Item from the List?") - if (answer) - { - - - var materialCode = $('#materialCode'+rowid).val(); - var LineItemNo =$('#LineItemNo'+rowid).val(); - var ReqNo =$('#Reqnumber'+rowid).val(); - var POType =''; - id[0]= LineItemNo; - id[1]= ReqNo; - id[2]= materialCode; - id[3]= POType; - var removeItem = $('#materialCode'+rowid).val(); - - var td = document.getElementById(rowid); - - td.parentNode.removeChild(td); - - - var Material = ; - - for(i=0;i').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName) ); - } - - - - }); -} - - SelectedMaterialCode.splice( SelectedMaterialCode.indexOf('removeItem'), 1 ); - $.each(SelectedMaterialList.Mat, function(i, el){ - - if (this.materialCode == removeItem){ - SelectedMaterialList.Mat.splice(i, 1); - } - }); - - - var x = ; - - var result = '0'; - $.each(x, function(idx, obj) { - - if(obj.LineItemNo === LineItemNo) - { - result = '1'; - return false; - } - - }); - - // alert(result); - if(result == '0') - { - var DelRows = $('#txtDeletedRow').val(); - //tr.parentNode.removeChild(tr); - if(DelRows != '') - { - DelRows = DelRows + ":" + rowid; - } - else - { - DelRows= "0" + ":" + rowid; - } - $('#txtDeletedRow').val(DelRows); - - } - // To delete the value from Tables - else if(result == '1') - { - var DelRows = $('#txtDeletedRow').val(); - //tr.parentNode.removeChild(tr); - if(DelRows != '') - { - DelRows = DelRows + ":" + rowid; - } - else - { - DelRows= "0" + ":" + rowid; - } - $('#txtDeletedRow').val(DelRows); - - - $.ajax({ - data:{id:id}, - type:"POST", - url:"purchaseorder/DeletePODetails", - success:function(data) { - if(data) - { - $('#content').loader('hide'); - alert(data); - } - else - { - alert("Error"); - } - - }}); - } - populateValueMainFormForDeleteServiceTax(rowid); - - } - -} /** @@ -3615,6 +2569,8 @@ function DeleteRow(rowid) $('#EditExchangeRtModal').val($('#echangeRate'+userid).val()); $('#EditCapitalItemName').val($('#materialName'+userid).val()); + $('#Edittxtservicedescription').val($('#ServiceMaterialDescription'+userid).val()); + $('#EditFrequency').val($('#frequency'+userid).val()); $('#EditCPUOM').val($('#uom'+userid).val()); @@ -3624,12 +2580,14 @@ function DeleteRow(rowid) $('#EditCPTotalAmount').val($('#basicval'+userid).val()); RequistQuantity = $('#quantity'+userid).val(); - $('#EditAfterServiceTax').val($('#AfterServiceTax'+userid).val()); - $('#EditAfterEduCess').val($('#AfterEduCess'+userid).val()); - $('#EditAfterSecHighTax').val($('#AfterSecHighTax'+userid).val()); - $('#EditAfterKrishiTax').val($('#AfterKrishiTax'+userid).val()); - $('#EditAfterSwachhTax').val($('#AfterSwachhTax'+userid).val()); - + $('#EditCgst').val($('#CGST'+userid).val()); + $('#EditAfterCgst').val($('#afterCGST'+userid).val()); + $('#EditSgst').val($('#SGST'+userid).val()); + $('#EditAfterSgst').val($('#afterSGST'+userid).val()); + $('#EditIgst').val($('#IGST'+userid).val()); + $('#EditAfterIgst').val($('#afterIGST'+userid).val()); + $('#EditOtherAllowances').val($('#otherallowance'+userid).val()); + $('#Editservicetotalordervaue').val($('#totalservicevalue'+userid).val()); $('#EditAfterBasicPriceTax').val($('#basicvalInINR'+userid).val()); $('#EditAfterLandingCharge').val($('#landingCharge'+userid).val()); @@ -3688,6 +2646,9 @@ $('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')'); } }); + + + /*get edit material list*/ $('#EditMaterialCode').change(function() { @@ -3768,7 +2729,8 @@ $("#EdittxtTotalOrderValue").val(''); } function Save(status) -{ +{ //alert('save function'); + if(status == '0') { @@ -3794,6 +2756,8 @@ $('#txtStatus').val(stat); if(validate()) { + + if(document.getElementById('serviceTax').rows.length < 2) { alert('Please Select Line item to Create PO'); @@ -3801,25 +2765,31 @@ $('#txtStatus').val(stat); return false; } else - { + { + + //alert('else'); + $('#content').loader('show'); - $.ajax({ + //salert('ss'); + + $.ajax({ + data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate, type:"POST", - url:"amendmentpurchaseorder/EditAmendCapitalPurchaseOrder", + url:"purchaseorder/EditCapitalPurchaseOrder", + success:function(data) { if(data) { $('#content').loader('hide'); - alert(data); + $('#txtRowCount').val(''); $('#txtDeletedRow').val(''); $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); - - window.location="amendmentpurchaseorder"; - - + + clearAfterAddLineItemAdd(); + //window.location ="purchaseorderListing"; } else @@ -3836,31 +2806,7 @@ $('#txtStatus').val(stat); } } -function clearAfterAddLineItemAdd(){ - $('#TotalAfterServiceTax').val(''); - $('#TotalAfterEduCess').val(''); - $('#TotalAfterSecHighTax').val(''); - - $('#TotalAfterKrishiTax').val(''); - $('#TotalAfterSwachhTax').val(''); - - $('#txttotallanding').val(''); - $('#txttotalhighseas').val(''); - $('#txttotalcustom').val(''); - $('#txttotalexcise').val(''); - $('#txttotalexciseED').val(''); - $('#txttotalexciseSH').val(''); - $('#txttotalcustomED').val(''); - $('#txttotalcustomSH').val(''); - $('#txttotalAdditionalExciseduty').val(''); - $('#txttotalgrossduty').val(''); - $('#txttotalavlmodvat').val(''); - $('#txttotalgrossexpense').val(''); - - $('#txtToatlOrder').val(''); - -} /* @@ -3891,7 +2837,7 @@ function clearAfterAddLineItemAdd(){ } // EditExceedQuantityCheck(); - if(EditExceedQuantityCheck()){ + // if(EditExceedQuantityCheck()){ if($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') @@ -3924,22 +2870,20 @@ function clearAfterAddLineItemAdd(){ //Service Tax calculation - $('#EditAfterServiceTax').val(calculateServiceTax($('#EditAfterBasicPriceTax').val())); + $('#EditAfterCgst').val(calculateServiceCGST($('#EditCPTotalAmount').val(),$('#EditCgst').val())); + + $('#EditAfterSgst').val( calculateServiceSGST($('#EditCPTotalAmount').val(),$('#EditSgst').val())); - //Edu. cess @2% on service Tax - $('#EditAfterEduCess').val( calculateEduess($('#EditAfterServiceTax').val())); + - //Sec. & Higher Edu. cess @1 % on service Tax + $('#EditAfterIgst').val(calculateServiceIGST($('#EditCPTotalAmount').val(),$('#EditIgst').val())); + + var tempEditservicetotalordervaue=(parseFloat($('#EditCPTotalAmount').val())+parseFloat($('#EditAfterCgst').val())+parseFloat($('#EditAfterSgst').val())+parseFloat($('#EditAfterIgst').val())+parseFloat($('#EditOtherAllowances').val())); + $('#Editservicetotalordervaue').val(parseFloat(tempEditservicetotalordervaue).toFixed(2)); - $('#EditAfterSecHighTax').val(calculateHigherEdu($('#EditAfterServiceTax').val())); - //Krishi Kalyan tax + - $('#EditAfterKrishiTax').val(calculateKrishiKalyantax($('#EditAfterBasicPriceTax').val())); - //Swachh Bharat tax - - $('#EditAfterSwachhTax').val(calculateSwachhBharattax($('#EditAfterBasicPriceTax').val())); - - // This is for import basic price + // $('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val())); @@ -3982,7 +2926,7 @@ function clearAfterAddLineItemAdd(){ var Rmc = $('#EditRMCIncludingCustomers').val(); var Quanty =$('#EditCPQuantity').val(); var BasicAmt = $('#EditCPTotalAmount').val(); - var perKg = Rmc * Quanty * BasicAmt; + var perKg = parseFloat(BasicAmt).toFixed(2); $('#EdittxtTotalOrderValue').val(perKg); @@ -4036,39 +2980,40 @@ function clearAfterAddLineItemAdd(){ $('CPRate').focus(); } - } - else{ - clearTaxField(); - } + // } + // else{ + // clearTaxField(); + // } } /* This function used to check quantity exceeding or not while Editing*/ - function EditExceedQuantityCheck() - { - var EnterQuantity = $("#EditCPQuantity").val()== '' ? "0.00" : parseFloat($("#EditCPQuantity").val()); - var ReqQuantity = parseFloat(RequistQuantity); + // function EditExceedQuantityCheck() + // { + // var EnterQuantity = $("#EditCPQuantity").val()== '' ? "0.00" : parseFloat($("#EditCPQuantity").val()); + // var ReqQuantity = parseFloat(RequistQuantity); - //alert(ReqQuantity); - if(EnterQuantity > ReqQuantity) - { - // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); + // //alert(ReqQuantity); + // if(EnterQuantity > ReqQuantity) + // { + // alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); - // $('#EditCPQuantity').focus(); - return true; - } - else { - return true; - } - } + // $('#EditCPQuantity').focus(); + // return false; + // } + // else { + // return true; + // } + // } /** * This function is used for Edit Capital */ $('.EditCapital').click(function(){ - if( validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) + if( validateEditCapitalTax() && validateEditExceedLimit()) { + //alert('EDIT'); var tr= document.getElementById(userid); var cellval = tr.cells; @@ -4077,7 +3022,7 @@ function clearAfterAddLineItemAdd(){ var departmentName = $('#EditCapitalDepartmentName').val(); var AvilBudget = $('#EditCapitalbudAmt').val(); var costCode = $('#EditCostCenter').val(); - + var servicedescription=$('#Edittxtservicedescription').val(); var materialCode =$('#EditMaterialCode').val(); var materialName = $("#EditCapitalItemName").val(); var uom = $("#EditCPUOM").val(); @@ -4086,14 +3031,18 @@ function clearAfterAddLineItemAdd(){ var convertRate = $("#EditCPRate").val(); var itemRate = convertRate; var basicval = $("#EditCPTotalAmount").val(); - var AfterServiceTax = $("#EditAfterServiceTax").val(); - var AfterEduCess = $("#EditAfterEduCess").val(); - var AfterSecHighTax = $("#EditAfterSecHighTax").val(); - - var AfterKrishiTax = $("#EditAfterKrishiTax").val(); - var AfterSwachhTax = $("#EditAfterSwachhTax").val(); - var Total = (parseFloat(basicval)+parseFloat(AfterServiceTax)+parseFloat(AfterEduCess)+parseFloat(AfterSecHighTax)+parseFloat(AfterKrishiTax)+parseFloat(AfterSwachhTax)); - + var CGST=$("#EditCgst").val(); + var SGST=$("#EditSgst").val(); + var IGST=$("#EditIgst").val(); + + var AfterCGST = $("#EditAfterCgst").val(); + var AfterSGST = $("#EditAfterSgst").val(); + var AfterIGST = $("#EditAfterIgst").val(); + var otherallowance = $("#EditOtherAllowances").val(); + + var totalservicevalue = $("#Editservicetotalordervaue").val(); + var Total = (parseFloat(AfterCGST)+parseFloat(AfterSGST)+parseFloat(AfterIGST)+parseFloat(otherallowance)); + //alert(totalservicevalue+"-"+Total); var TotalTaxValue = EditcalculateTaxValue(); var landingCharge = $('#EditAfterLandingCharge').val(); @@ -4145,12 +3094,17 @@ function clearAfterAddLineItemAdd(){ $('#basicval'+userid).val(basicval); RequistQuantity = $('#quantity'+userid).val(); - $('#AfterServiceTax'+userid).val(AfterServiceTax); - $('#AfterEduCess'+userid).val(AfterEduCess); - $('#AfterSecHighTax'+userid).val(AfterSecHighTax); - $('#AfterKrishiTax'+userid).val(AfterKrishiTax); - $('#AfterSwachhTax'+userid).val(AfterSwachhTax); - $('#ServiceTotalOrderValue'+userid).val(TotalTaxValue); + $('#SGST'+userid).val(SGST); + $('#CGST'+userid).val(CGST); + $('#IGST'+userid).val(IGST); + + $('#afterSGST'+userid).val(AfterSGST); + $('#afterCGST'+userid).val(AfterCGST); + $('#afterIGST'+userid).val(AfterIGST); + + $('#otherallowance'+userid).val(otherallowance); + $('#totalservicevalue'+userid).val(totalservicevalue); + $('#ServiceMaterialDescription'+userid).val(servicedescription); $('#landingCharge'+userid).val(landingCharge); $('#HighSeasSalesCharge'+userid).val(HighSeasSalesCharge); @@ -4186,13 +3140,19 @@ function clearAfterAddLineItemAdd(){ $('#PerKgExpense'+userid).val(TotalOrderValuePerkg); cellval[2].innerHTML = materialName; - + //alert(materialName); cellval[3].innerHTML = quantity; + //alert(quantity); cellval[4].innerHTML =uom; + //alert(uom); cellval[5].innerHTML =itemRate; + //alert(itemRate); cellval[6].innerHTML =basicval; + //alert(basicval); cellval[7].innerHTML =TotalTaxValue; + //alert(TotalTaxValue); cellval[8].innerHTML =basicval; + //alert(basicval); @@ -4240,45 +3200,14 @@ function validateEditCapitalTax() } } - function EditcalculateTotalValue() - { - var BasicVal = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val(); - var ServiceTaxAmount = $('#EditAfterServiceTax').val() == '' ? '0.00' : $('#EditAfterServiceTax').val(); - var EduCessTaxAmount = $('#EditAfterEduCess').val() == '' ? '0.00' : $('#EditAfterEduCess').val(); - var SecHighTaxAmount = $('#EditAfterSecHighTax').val() == '' ? '0.00' : $('#EditAfterSecHighTax').val(); - var KrishiTaxAmount = $('#EditAfterKrishiTax').val() == '' ? '0.00' : $('#EditAfterKrishiTax').val(); - var SwachhTaxAmount = $('#EditAfterSwachhTax').val() == '' ? '0.00' : $('#EditAfterSwachhTax').val(); - var landingCharge = $('#EditAfterLandingCharge').val() == '' ? '0.00' : $('#EditAfterLandingCharge').val(); - var HighSeasSalesCharge = $('#EditAfterHighseas').val() == '' ? '0.00' : $('#EditAfterHighseas').val(); - var CustomDuty = $('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val(); - var ExciseDuty = $('#EditAfterExcisedutyTax').val() == '' ? '0.00' : $('#EditAfterExcisedutyTax').val(); - var ExciseDutyEDCess = $('#EditAfterExcisedutyEDcess').val() == '' ? '0.00' : $('#EditAfterExcisedutyEDcess').val(); - var ExciseDutySHCess = $('#EditAfterExcisedutySHcess').val() == '' ? '0.00' : $('#EditAfterExcisedutySHcess').val(); - var CustomEDCess = $('#EditAfterCustomEDcess').val() == '' ? '0.00' : $('#EditAfterCustomEDcess').val(); - var CustomSHCess = $('#EditAfterCustomSHcess').val() == '' ? '0.00' : $('#EditAfterCustomSHcess').val(); - var AdditionalExciseDuty = $('#EditAfterAdditionalExciseduty').val() == '' ? '0.00' : $('#EditAfterAdditionalExciseduty').val(); - var GrossDutyPayable = $('#EditGrossdutypayable').val() == '' ? '0.00' : $('#EditGrossdutypayable').val(); - var AvailableModvat = $('#EditAvailableModvat').val() == '' ? '0.00' : $('#EditAvailableModvat').val(); - var GrossExpensesDuetoCustom = $('#EditGrossexpenses').val() == '' ? '0.00' : $('#EditGrossexpenses').val(); - var purchaseRate = $('#Editpurchaserate').val() == '' ? '0.00' : $('#Editpurchaserate').val(); - var CustomDutyExpenses = $('#EditCustomDutyExpenses').val() == '' ? '0.00' : $('#EditCustomDutyExpenses').val(); - var RMCIncludingCustomers = $('#EditRMCIncludingCustomers').val() == '' ? '0.00' : $('#EditRMCIncludingCustomers').val(); - var totvalue = (parseFloat(BasicVal) + parseFloat(ServiceTaxAmount)+ parseFloat(EduCessTaxAmount)+ parseFloat(SecHighTaxAmount) + parseFloat(KrishiTaxAmount)+ parseFloat(SwachhTaxAmount)); -//+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers) - var tot = parseFloat(totvalue).toFixed(2); - - //$('#EdittxtTotalOrderValue').val(tot); - - validateEditExceedLimit(); - EditExceedQuantityCheck(); - } + /* calculate tax value*/ function EditcalculateTaxValue(){ - var ServiceTaxAmount = $('#EditAfterServiceTax').val() == '' ? '0.00' : $('#EditAfterServiceTax').val(); - var EduCessTaxAmount = $('#EditAfterEduCess').val() == '' ? '0.00' : $('#EditAfterEduCess').val(); - var SecHighTaxAmount = $('#EditAfterSecHighTax').val() == '' ? '0.00' : $('#EditAfterSecHighTax').val(); - var KrishiTaxAmount = $('#EditAfterKrishiTax').val() == '' ? '0.00' : $('#EditAfterKrishiTax').val(); - var SwachhTaxAmount = $('#EditAfterSwachhTax').val() == '' ? '0.00' : $('#EditAfterSwachhTax').val(); + var CGSTTaxAmount = $('#EditAfterCgst').val() == '' ? '0.00' : $('#EditAfterCgst').val(); + var SGSTTaxAmount = $('#EditAfterSgst').val() == '' ? '0.00' : $('#EditAfterSgst').val(); + var IGSTTaxAmount = $('#EditAfterIgst').val() == '' ? '0.00' : $('#EditAfterIgst').val(); + var otherallowanceAmount = $('#EditOtherAllowances').val() == '' ? '0.00' : $('#EditOtherAllowances').val(); + var landingCharge = $('#EditAfterLandingCharge').val() == '' ? '0.00' : $('#EditAfterLandingCharge').val(); var HighSeasSalesCharge = $('#EditAfterHighseas').val() == '' ? '0.00' : $('#EditAfterHighseas').val(); var CustomDuty = $('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val(); @@ -4294,10 +3223,11 @@ function validateEditCapitalTax() var purchaseRate = $('#Editpurchaserate').val() == '' ? '0.00' : $('#Editpurchaserate').val(); var CustomDutyExpenses = $('#EditCustomDutyExpenses').val() == '' ? '0.00' : $('#EditCustomDutyExpenses').val(); var RMCIncludingCustomers = $('#EditRMCIncludingCustomers').val() == '' ? '0.00' : $('#EditRMCIncludingCustomers').val(); - var totTaxvalue = (parseFloat(ServiceTaxAmount)+ parseFloat(EduCessTaxAmount)+ parseFloat(SecHighTaxAmount) + parseFloat(KrishiTaxAmount)+ parseFloat(SwachhTaxAmount)); + var totTaxvalue = (parseFloat(CGSTTaxAmount)+ parseFloat(SGSTTaxAmount)+ parseFloat(IGSTTaxAmount) + parseFloat(otherallowanceAmount)); //+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers) var totTax = parseFloat(totTaxvalue).toFixed(2); + // alert("TAx from EditcalculateTaxValue function "+totTax ); return totTax; } /* used to validateExceedLimit for edit*/ @@ -4332,12 +3262,12 @@ function validateEditCapitalTax() var rows = document.getElementById('serviceTax').rows.length; var TotalOrderValueSummary = 0; - var TotalServiceTax = 0; - var TotalEducess = 0; - var TotHigherEdu = 0; + var TotalCGSTTax = 0; + var TotalSGSTTax = 0; + var TotalIGSTTax = 0; - var TotalKrishiKalyan = 0; - var TotSwachhBharat = 0; + var Totalotherallowance = 0; + var TotLanding = 0; var TotHighseas = 0; @@ -4357,14 +3287,14 @@ function validateEditCapitalTax() for (var i = 1; i < rows; i++) { - var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue'+i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue'+i).val(); + var TotalOrderValueSummaryI = $('#totalservicevalue'+i).val() == '' ? '0.00' : $('#totalservicevalue'+i).val(); - var TotalServiceTaxI = $('#AfterServiceTax'+i).val() == '' ? '0.00' : $('#AfterServiceTax'+i).val(); - var TotalEducessI = $('#AfterEduCess'+i).val() == '' ? '0.00' : $('#AfterEduCess'+i).val(); - var TotHigherEduI = $('#AfterSecHighTax'+i).val() == '' ? '0.00' : $('#AfterSecHighTax'+i).val(); + var TotalCGSTTaxI = $('#afterCGST'+i).val() == '' ? '0.00' : $('#afterCGST'+i).val(); + var TotalSGSTTaxI = $('#afterSGST'+i).val() == '' ? '0.00' : $('#afterSGST'+i).val(); + var TotalIGSTTaxI = $('#afterIGST'+i).val() == '' ? '0.00' : $('#afterIGST'+i).val(); - var TotalKrishiKalyanI = $('#AfterKrishiTax'+i).val() == '' ? '0.00' : $('#AfterKrishiTax'+i).val(); - var TotSwachhBharatI = $('#AfterSwachhTax'+i).val() == '' ? '0.00' : $('#AfterSwachhTax'+i).val(); + var TotalotherallowanceI = $('#otherallowance'+i).val() == '' ? '0.00' : $('#otherallowance'+i).val(); + var TotLandingI = $('#landingCharge'+i).val() == '' ? '0.00' : $('#landingCharge'+i).val(); var TotHighseasI = $('#HighSeasSalesCharge'+i).val() == '' ? '0.00' : $('#HighSeasSalesCharge'+i).val(); @@ -4381,12 +3311,12 @@ function validateEditCapitalTax() var TotGrossexpenseI = $('#GrossExpensesDuetoCustom'+i).val() == '' ? '0.00' : $('#GrossExpensesDuetoCustom'+i).val(); var CapitalToatlOrderI = $('#basicval'+i).val() == '' ? '0.00' : $('#basicval'+i).val(); - TotalServiceTax = parseFloat(TotalServiceTax) + parseFloat(TotalServiceTaxI); - TotalEducess = parseFloat(TotalEducess) + parseFloat(TotalEducessI); - TotHigherEdu = parseFloat(TotHigherEdu) + parseFloat(TotHigherEduI); + TotalCGSTTax = parseFloat(TotalCGSTTax) + parseFloat(TotalCGSTTaxI); + TotalSGSTTax = parseFloat(TotalSGSTTax) + parseFloat(TotalSGSTTaxI); + TotalIGSTTax = parseFloat(TotalIGSTTax) + parseFloat(TotalIGSTTaxI); - TotalKrishiKalyan = parseFloat(TotalKrishiKalyan) + parseFloat(TotalKrishiKalyanI); - TotSwachhBharat = parseFloat(TotSwachhBharat) + parseFloat(TotSwachhBharatI); + Totalotherallowance = parseFloat(Totalotherallowance) + parseFloat(TotalotherallowanceI); + TotLanding = parseFloat(TotLanding) + parseFloat(TotLandingI); TotHighseas = parseFloat(TotHighseas) + parseFloat(TotHighseasI); @@ -4406,12 +3336,11 @@ function validateEditCapitalTax() } - $('#TotalAfterServiceTax').val((parseFloat(TotalServiceTax)).toFixed(2) ); - $('#TotalAfterEduCess').val((parseFloat(TotalEducess)).toFixed(2) ); - $('#TotalAfterSecHighTax').val((parseFloat(TotHigherEdu)).toFixed(2) ); - - $('#TotalAfterKrishiTax').val((parseFloat(TotalKrishiKalyan) ).toFixed(2) ); - $('#TotalAfterSwachhTax').val((parseFloat(TotSwachhBharat) ).toFixed(2) ); + $('#txtTotCgst').val((parseFloat(TotalCGSTTax)).toFixed(2) ); + $('#txtTotSgst').val((parseFloat(TotalSGSTTax)).toFixed(2) ); + $('#txtTotIgst').val((parseFloat(TotalIGSTTax)).toFixed(2) ); + $('#TotalOtherAllowances').val((parseFloat(Totalotherallowance) ).toFixed(2) ); + $('#txttotallanding').val((parseFloat(TotLanding) ).toFixed(2) ); $('#txttotalhighseas').val((parseFloat(TotHighseas) ).toFixed(2) ); @@ -4427,26 +3356,31 @@ function validateEditCapitalTax() $('#txttotalgrossexpense').val((parseFloat(TotGrossexpense)).toFixed(2) ); $('#CapitalToatlOrder').val((parseFloat(CapitalToatlOrder)).toFixed(2) ); - $('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary)).toFixed(2) ); + $('#Totalservicesummary').val((parseFloat(TotalOrderValueSummary)).toFixed(2) ); } var DisplayCurrencySymbol=''; +var ViewCurrencySymbol=''; var currency = ; $.each(currency, function(idx, obj) { if(obj.Currency_Code === $("#currencytype").val()) { $("#CurrencySymbol").val(obj.FontCode2000); DisplayCurrencySymbol=obj.FontCode2000; +ViewCurrencySymbol=obj.FontCode2000; + var DisplayUOM=$('#uom').val(); $('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000); $('#RateIn').html('Rate(in' + " "+obj.FontCode2000 + '/'+DisplayUOM+')'); $('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000 + '/'+DisplayUOM+')'); $('#TotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol); $('#EditTotalAmount').html('Basic Value in' + " "+DisplayCurrencySymbol); - + //$('#ViewTotalAmount').html('Basic Value in' + " "+ViewCurrencySymbol); + // $('#ViewRateIn').html('Rate(in' + " "+ViewCurrencySymbol + '/'+DisplayUOM+')'); } + }); $('#currencytype').change(function(){ var SelectCurrency = $('#currencytype').val(); diff --git a/application/views/editRevenueAmendPO.php b/application/views/editRevenueAmendPO.php index 88893772..f1e2c137 100755 --- a/application/views/editRevenueAmendPO.php +++ b/application/views/editRevenueAmendPO.php @@ -874,22 +874,39 @@ body {
Payable Terms - + PaymentTerms){ + echo "$Terms"; + echo "$pay2->PaymentTerms"; + + $optionsPay[$pay2->PaymentTerms] = $pay2->PaymentTerms; + + } + + foreach ($Payment as $pay1): + + if($Terms!=$pay1->PaymentTerms){ + + $optionsPay[$pay1->PaymentTerms] = $pay1->PaymentTerms; + + } + endforeach; + } + + echo form_dropdown('PaymentTerms', $optionsPay,set_value('PaymentTerms'),'id="PaymentTerms"' ,'required="true"' ,'class="form-control select2'); + + ?> +
@@ -2198,14 +2215,14 @@ $('#Scheduleby').change(function(){ }); }); - var Detail = ; -//console.log(Detail); + // var Detail = ; +// //console.log(Detail); - $.each(Detail, function (index, value) - { - $("#PaymentTerms").append( $('').val(value.ConfigValue).html(value.ConfigValue) ); + // $.each(Detail, function (index, value) + // { + // $("#PaymentTerms").append( $('').val(value.ConfigValue).html(value.ConfigValue) ); - } ); + // } ); \ No newline at end of file diff --git a/application/views/editServiceAmendPO.php b/application/views/editServiceAmendPO.php index 2cc22297..e054b2b5 100755 --- a/application/views/editServiceAmendPO.php +++ b/application/views/editServiceAmendPO.php @@ -116,8 +116,16 @@ foreach ($PaymentTerms as $TER) ?> + + + \ No newline at end of file