capital and revenue po flow rate validations changes done

This commit is contained in:
gandhimathi 2017-09-01 17:26:54 +05:30
parent edc9a6077a
commit 796e4ea744
6 changed files with 180 additions and 65 deletions

View File

@ -1229,8 +1229,7 @@ public function importpoprint($PONO)
function DeletePODetails()
{
//echo "vffv";
//die();
$ReqList= $this->input->post('id');
$LineItemNo = '';
$ReqNo ='';
@ -1243,9 +1242,7 @@ public function importpoprint($PONO)
$MaterialCode = $ReqList[2];
$POType = $ReqList[3];
}
print_r($ReqList);
// die();
If($POType == REVENUE)
{
$this->purchaseorder_model->DeletePORevenueTax($LineItemNo);

View File

@ -713,7 +713,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'Ratechange();ChangeSgst();','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -741,7 +741,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'Ratechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -770,7 +770,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'Ratechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -795,7 +795,7 @@ function vaildateBeforeOpenModal()
<div class="col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'OtherAllowances','value' => set_value('OtherAllowances',0),'id'=>'OtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances');
$data = array('name' => 'OtherAllowances','value' => set_value('OtherAllowances',0),'id'=>'OtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1293,7 +1293,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'EditRatechange();ChangeEditSgst();','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1321,7 +1321,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1350,7 +1350,7 @@ function vaildateBeforeOpenModal()
<div class="form-group">
<?php
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1375,7 +1375,7 @@ function vaildateBeforeOpenModal()
<div class="col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances');
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -2308,6 +2308,14 @@ function vaildateBeforeOpenModal()
RequistQuantity = '';
}
function ChangeSgst(){
$('#Sgst').val($('#Cgst').val());
Ratechange();
}
function ChangeEditSgst(){
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
}
/*
This function is used to validate all field
@ -2370,9 +2378,9 @@ function vaildateBeforeOpenModal()
if(ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val())){
//Service Tax calculation
$('#AfterCgst').val(calculateCgstTax($('#AfterBasicPriceTax').val(),$('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax($('#AfterBasicPriceTax').val(),$('#Sgst').val()));
$('#AfterIgst').val(calculateIgstTax($('#AfterBasicPriceTax').val(),$('#Igst').val()));
$('#AfterCgst').val(calculateCgstTax($('#AfterBasicPriceTax').val(),$("#Cgst").val()== '' ? "0.00" : $('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax($('#AfterBasicPriceTax').val(),$("#Sgst").val()== '' ? "0.00" : $('#Sgst').val()));
$('#AfterIgst').val(calculateIgstTax($('#AfterBasicPriceTax').val(),$("#Igst").val()== '' ? "0.00" : $('#Igst').val()));
if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!=''){
$('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val(),$('#AfterBasicPriceTax').val()));
@ -2846,7 +2854,7 @@ function vaildateBeforeOpenModal()
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2);
var OtherAmt = parseFloat($('#OtherAllowances').val()).toFixed(2);
var OtherAmt = parseFloat($("#OtherAllowances").val()== '' ? "0.00" : $('#OtherAllowances').val()).toFixed(2);
var Cgst = $("#Cgst").val();
var AfterCgst = $("#AfterCgst").val();
var Sgst = $("#Sgst").val();
@ -2928,7 +2936,7 @@ var purchaseRate = $('#purchaserate').val();
addHidden(theForm,"echangeRate"+temp,exchangeRate );
addHidden(theForm,"uom"+temp,uom);
addHidden(theForm,"quantity"+temp,quantity);
addHidden(theForm,"rateInUs"+temp,convertRate);
addHidden(theForm,"rateInUs"+temp,itemRate);
addHidden(theForm,"itemRate"+temp,itemRate);
addHidden(theForm,"basicval"+temp,basicval);
addHidden(theForm,"basicvalInINR"+temp,basicvalInINR);
@ -3032,12 +3040,24 @@ var purchaseRate = $('#purchaserate').val();
alert('Please Enter the Quantity value');
$('#CPQuantity').focus();
return false;
}
else if($('#CPQuantity').val() == 0)
{
alert('Please Enter the Valid Quantity value');
$('#CPQuantity').focus();
return false;
}
else if($('#CPRate').val() == '')
{
alert('Please Enter the Rate of the Item');
$('#CPRate').focus();
return false;
}
else if($('#CPRate').val() == "0")
{
alert('Please Enter the Valid Rate of the Item');
$('#CPRate').focus();
return false;
}
else
{
@ -3803,9 +3823,9 @@ function clearAfterAddLineItemAdd(){
//Service Tax calculation
$('#EditAfterCgst').val(calculateCgstTax($('#EditAfterBasicPriceTax').val(),$('#EditCgst').val()));
$('#EditAfterSgst').val(calculateSgstTax($('#EditAfterBasicPriceTax').val(),$('#EditSgst').val()));
$('#EditAfterIgst').val(calculateIgstTax($('#EditAfterBasicPriceTax').val(),$('#EditIgst').val()));
$('#EditAfterCgst').val(calculateCgstTax($('#EditAfterBasicPriceTax').val(),$("#EditCgst").val()== '' ? "0.00" : $('#EditCgst').val()));
$('#EditAfterSgst').val(calculateSgstTax($('#EditAfterBasicPriceTax').val(),$("#EditSgst").val()== '' ? "0.00" : $('#EditSgst').val()));
$('#EditAfterIgst').val(calculateIgstTax($('#EditAfterBasicPriceTax').val(),$("#Editigst").val()== '' ? "0.00" : $('#EditIgst').val()));
// This is for import basic price
@ -3952,7 +3972,7 @@ function clearAfterAddLineItemAdd(){
var exchangeRate = $("#EditExchangeRtModal").val();
var quantity = $("#EditCPQuantity").val();
var convertRate = $("#EditCPRate").val();
var itemRate = convertRate;
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = $("#EditCPTotalAmount").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
@ -3960,7 +3980,7 @@ function clearAfterAddLineItemAdd(){
var AfterSgst = $("#EditAfterSgst").val();
var Igst = $("#EditIgst").val();
var AfterIgst = $("#EditAfterIgst").val();
var OtherAmt = $('#EditOtherAllowances').val();
var OtherAmt = parseFloat($("#EditOtherAllowances").val()== '' ? "0.00" : $('#EditOtherAllowances').val()).toFixed(2);
var Total = (parseFloat(basicval)+parseFloat(AfterCgst)+parseFloat(AfterSgst)+parseFloat(AfterIgst));
var TotalTaxValue = EditcalculateTaxValue();
@ -4009,7 +4029,7 @@ function clearAfterAddLineItemAdd(){
$('#materialName'+userid).val(materialName);
$('#uom'+userid).val(uom);
$('#quantity'+userid).val(quantity);
$('#rateInUs'+userid).val(convertRate);
$('#rateInUs'+userid).val(itemRate);
$('#basicval'+userid).val(basicval);
$('#basicvalInINR'+userid).val(basicvalInINR);
@ -4101,12 +4121,24 @@ function validateEditCapitalTax()
alert('Please Enter the Quantity value');
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPQuantity').val() == "0")
{
alert('Please Enter the Valid Quantity value');
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPRate').val() == '')
{
alert('Please Enter the Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else if($('#EditCPRate').val() == "0")
{
alert('Please Enter the Valid Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else
{
@ -4469,3 +4501,4 @@ location.reload();

View File

@ -662,7 +662,7 @@ document.getElementById('dispatchinternational').style.display = 'block';
<td style="text-align:right"><?php echo number_format($record->Rate * $record->Quantity,2,'.',''); ?></td>
<td style="text-align:right"><?php if($CapitalRange=='1'){echo $record->ServiceTaxamount;}else if($CapitalRange=='0'){echo "0.0"; }?></td>
<?php if($CapitalRange=='1'){?>
<td style="text-align:right"><?php echo (($record->Rate * $record->Quantity)+$record->ServiceTaxamount); ?></td>
<td style="text-align:right"><?php echo number_format(($record->Rate * $record->Quantity),2,'.',''); ?></td>
<?php }else if($CapitalRange=='0'){?>
<td style="text-align:right"><?php echo number_format(($record->Rate * $record->Quantity),2,'.',''); ?></td>
<?php }?>
@ -995,7 +995,7 @@ document.getElementById('dispatchinternational').style.display = 'block';
<div class="form-group">
<?php
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'ChangeEditSgst();EditRatechange();','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1023,7 +1023,7 @@ document.getElementById('dispatchinternational').style.display = 'block';
<div class="form-group">
<?php
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1052,7 +1052,7 @@ document.getElementById('dispatchinternational').style.display = 'block';
<div class="form-group">
<?php
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1078,7 +1078,7 @@ document.getElementById('dispatchinternational').style.display = 'block';
<div class="col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onchange'=>'EditRatechange()');
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -2962,7 +2962,11 @@ basicamt=$('#Totalservicesummary').val();
}
function ChangeEditSgst(){
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
}
/*
@ -3028,15 +3032,15 @@ basicamt=$('#Totalservicesummary').val();
//Service Tax calculation
$('#EditAfterCgst').val(calculateServiceCGST($('#EditCPTotalAmount').val(),$('#EditCgst').val()));
$('#EditAfterCgst').val(calculateServiceCGST($('#EditCPTotalAmount').val(),$("#EditCgst").val()== '' ? "0.00" : $('#EditCgst').val()));
$('#EditAfterSgst').val( calculateServiceSGST($('#EditCPTotalAmount').val(),$('#EditSgst').val()));
$('#EditAfterSgst').val( calculateServiceSGST($('#EditCPTotalAmount').val(),$("#EditSgst").val()== '' ? "0.00" : $('#EditSgst').val()));
$('#EditAfterIgst').val(calculateServiceIGST($('#EditCPTotalAmount').val(),$('#EditIgst').val()));
$('#EditAfterIgst').val(calculateServiceIGST($('#EditCPTotalAmount').val(),$("#EditIgst").val()== '' ? "0.00" : $('#EditIgst').val()));
var tempEditservicetotalordervaue=(parseFloat($('#EditCPTotalAmount').val())+parseFloat($('#EditAfterCgst').val())+parseFloat($('#EditAfterSgst').val())+parseFloat($('#EditAfterIgst').val())+parseFloat($('#EditOtherAllowances').val()));
var tempEditservicetotalordervaue=(parseFloat($('#EditCPTotalAmount').val())+parseFloat($('#EditAfterCgst').val())+parseFloat($('#EditAfterSgst').val())+parseFloat($('#EditAfterIgst').val())+parseFloat($('#EditOtherAllowances').val()=='' ? "0.00" : $('#EditOtherAllowances').val()));
$('#Editservicetotalordervaue').val(parseFloat(tempEditservicetotalordervaue).toFixed(2));
@ -3187,7 +3191,7 @@ basicamt=$('#Totalservicesummary').val();
var exchangeRate = $("#EditExchangeRtModal").val();
var quantity = $("#EditCPQuantity").val();
var convertRate = $("#EditCPRate").val();
var itemRate = convertRate;
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = $("#EditCPTotalAmount").val();
var CGST=$("#EditCgst").val();
var SGST=$("#EditSgst").val();
@ -3248,7 +3252,7 @@ basicamt=$('#Totalservicesummary').val();
$('#materialName'+userid).val(materialName);
$('#uom'+userid).val(uom);
$('#quantity'+userid).val(quantity);
$('#rateInUs'+userid).val(convertRate);
$('#rateInUs'+userid).val(itemRate);
$('#basicval'+userid).val(basicval);
@ -3346,12 +3350,24 @@ function validateEditCapitalTax()
alert('Please Enter the Quantity value');
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPQuantity').val() == "0")
{
alert('Please Enter the Valid Quantity value');
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPRate').val() == '')
{
alert('Please Enter the Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else if($('#EditCPRate').val() == "0")
{
alert('Please Enter the Valid Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else
{
@ -3584,3 +3600,4 @@ $("#PaymentMethod").change(function() {
});
</script>

View File

@ -973,7 +973,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'Ratechange();ChangeSgst();','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1001,7 +1001,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'Ratechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1030,7 +1030,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'Ratechange()');
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'Ratechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1055,7 +1055,7 @@ $("#PaymentMethod").select2();
<div class="col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'OtherAllowances','value' => set_value('OtherAllowances',0),'id'=>'OtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances');
$data = array('name' => 'OtherAllowances','value' => set_value('OtherAllowances',0),'id'=>'OtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1561,7 +1561,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditCgst','value' => set_value('EditCgst'),'id'=>'EditCgst', 'class' => 'form-control num' ,'placeholder' => 'CGST TAX PERCENTAGE','onchange'=>'EditRatechange();ChangeEditSgst();','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1589,7 +1589,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditSgst','value' => set_value('EditSgst'),'id'=>'EditSgst', 'class' => 'form-control num' ,'placeholder' => 'SGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1618,7 +1618,7 @@ $("#PaymentMethod").select2();
<div class="form-group">
<?php
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()');
$data = array('name' => 'EditIgst','value' => set_value('EditIgst'),'id'=>'EditIgst', 'class' => 'form-control num' ,'placeholder' => 'IGST TAX PERCENTAGE','onchange'=>'EditRatechange()','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -1644,7 +1644,7 @@ $("#PaymentMethod").select2();
<div class="col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances');
$data = array('name' => 'EditOtherAllowances','value' => set_value('EditOtherAllowances'),'id'=>'EditOtherAllowances', 'class' => 'form-control num' ,'placeholder' => 'Other Allowances','onkeypress'=>'return isNumberKey(event);');
echo form_input($data);
?>
</div>
@ -3151,6 +3151,14 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
RequistQuantity = '';
}
function ChangeSgst(){
$('#Sgst').val($('#Cgst').val());
Ratechange();
}
function ChangeEditSgst(){
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
}
/*
This function is used to validate all field
@ -3213,9 +3221,9 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
//Service Tax calculation
$('#AfterCgst').val(calculateCgstTax($('#AfterBasicPriceTax').val(),$('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax($('#AfterBasicPriceTax').val(),$('#Sgst').val()));
$('#AfterIgst').val(calculateIgstTax($('#AfterBasicPriceTax').val(),$('#Igst').val()));
$('#AfterCgst').val(calculateCgstTax($('#AfterBasicPriceTax').val(),$("#Cgst").val()== '' ? "0.00" : $('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax($('#AfterBasicPriceTax').val(),$("#Sgst").val()== '' ? "0.00" : $('#Sgst').val()));
$('#AfterIgst').val(calculateIgstTax($('#AfterBasicPriceTax').val(),$("#Igst").val()== '' ? "0.00" : $('#Igst').val()));
// This is for import basic price
@ -3711,7 +3719,7 @@ if(isNaN(CustomDutyExpenses))
var convertRate = $("#CPRate").val();
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2);
var OtherAmt = parseFloat($('#OtherAllowances').val()).toFixed(2);
var OtherAmt = parseFloat($("#OtherAllowances").val()== '' ? "0.00" : $('#OtherAllowances').val()).toFixed(2);
var Cgst = $("#Cgst").val();
var AfterCgst = $("#AfterCgst").val();
var Sgst = $("#Sgst").val();
@ -3793,7 +3801,7 @@ var purchaseRate = $('#purchaserate').val();
addHidden(theForm,"echangeRate"+temp,exchangeRate );
addHidden(theForm,"uom"+temp,uom);
addHidden(theForm,"quantity"+temp,quantity);
addHidden(theForm,"rateInUs"+temp,convertRate);
addHidden(theForm,"rateInUs"+temp,itemRate);
addHidden(theForm,"itemRate"+temp,itemRate);
addHidden(theForm,"basicval"+temp,basicval);
@ -3893,12 +3901,24 @@ var purchaseRate = $('#purchaserate').val();
alert('Please Enter the Quantity value');
$('#CPQuantity').focus();
return false;
}
else if($('#CPQuantity').val() == "0")
{
alert('Please Enter the Valid Quantity value');
$('#CPQuantity').focus();
return false;
}
else if($('#CPRate').val() == '')
{
alert('Please Enter the Rate of the Item');
$('#CPRate').focus();
return false;
}
else if($('#CPRate').val() == "0")
{
alert('Please Enter the Valid Rate of the Item');
$('#CPRate').focus();
return false;
}
else
{
@ -4825,9 +4845,9 @@ function clearAfterAddLineItemAdd(){
$('#EditAfterCgst').val(calculateCgstTax($('#EditAfterBasicPriceTax').val(),$('#EditCgst').val()));
$('#EditAfterSgst').val(calculateSgstTax($('#EditAfterBasicPriceTax').val(),$('#EditSgst').val()));
$('#EditAfterIgst').val(calculateIgstTax($('#EditAfterBasicPriceTax').val(),$('#EditIgst').val()));
$('#EditAfterCgst').val(calculateCgstTax($('#EditAfterBasicPriceTax').val(),$("#EditCgst").val()== '' ? "0.00" : $('#EditCgst').val()));
$('#EditAfterSgst').val(calculateSgstTax($('#EditAfterBasicPriceTax').val(),$("#EditSgst").val()== '' ? "0.00" : $('#EditSgst').val()));
$('#EditAfterIgst').val(calculateIgstTax($('#EditAfterBasicPriceTax').val(),$("#EditIgst").val()== '' ? "0.00" : $('#EditIgst').val()));
// This is for import basic price
@ -4969,7 +4989,7 @@ function clearAfterAddLineItemAdd(){
var exchangeRate = $("#EditExchangeRtModal").val();
var quantity = $("#EditCPQuantity").val();
var convertRate = $("#EditCPRate").val();
var itemRate = convertRate;
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = $("#EditCPTotalAmount").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
@ -4977,7 +4997,7 @@ function clearAfterAddLineItemAdd(){
var AfterSgst = $("#EditAfterSgst").val();
var Igst = $("#EditIgst").val();
var AfterIgst = $("#EditAfterIgst").val();
var OtherAmt = $('#EditOtherAllowances').val();
var OtherAmt = parseFloat($("#EditOtherAllowances").val()== '' ? "0.00" : $('#EditOtherAllowances').val()).toFixed(2);
var Total = (parseFloat(basicval)+parseFloat(AfterCgst)+parseFloat(AfterSgst)+parseFloat(AfterIgst));
var TotalTaxValue = EditcalculateTaxValue();
@ -5026,11 +5046,13 @@ function clearAfterAddLineItemAdd(){
$('#materialName'+userid).val(materialName);
$('#uom'+userid).val(uom);
$('#quantity'+userid).val(quantity);
$('#rateInUs'+userid).val(convertRate);
$('#rateInUs'+userid).val(itemRate);
$('#basicval'+userid).val(basicval);
RequistQuantity = $('#quantity'+userid).val();
$('#Cgst'+userid).val(Cgst);
$('#AfterCgst'+userid).val(AfterCgst);
$('#Sgst'+userid).val(Sgst);
$('#AfterSgst'+userid).val(AfterSgst);
@ -5116,12 +5138,24 @@ function validateEditCapitalTax()
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPQuantity').val() == "0")
{
alert('Please Enter the Valid Quantity value');
$('#EditCPQuantity').focus();
return false;
}
else if($('#EditCPRate').val() == '')
{
alert('Please Enter the Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else if($('#EditCPRate').val() == "0")
{
alert('Please Enter the Valid Rate of the Item');
$('#EditCPRate').focus();
return false;
}
else
{
return true;
@ -5413,3 +5447,4 @@ $("#PaymentMethod").change(function() {
});
</script>

View File

@ -2340,7 +2340,7 @@ function calculateEditTaxValue()
<label>CGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'change();');
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'change();RevenueChangeSgst();');
echo form_input($data);
?>
</div>
@ -2698,7 +2698,7 @@ function calculateEditTaxValue()
<label>CGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCgst','value' => set_value('EditCgst',0),'id'=>'EditCgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();');
$data = array('name' => 'EditCgst','value' => set_value('EditCgst',0),'id'=>'EditCgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();RevenueChangeEditSgst();');
echo form_input($data);
?>
</div>
@ -3262,7 +3262,7 @@ function calculateEditTaxValue()
<input type="hidden" name="<?php echo 'LineItemNo'.$index ?>" id="<?php echo 'LineItemNo'.$index ?>" value="<?php echo $record->LineItemNo ; ?>" />
<input type="hidden" name="<?php echo 'costCode'.$index ?>" id="<?php echo 'costCode'.$index ?>" value="<?php echo $record->CostCenterCode ; ?>" />
<input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo $record->MaterialName ; ?>" />
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo htmlentities($record->MaterialName);?>" />
<input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" />
<input align="right" type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
@ -3963,7 +3963,7 @@ function DeleteRow(rowid)
var answer = confirm(" Do you want to delete the Item from the List?")
if (answer)
{
populateValueMainFormForDeleteItem(rowid);
tr.parentNode.removeChild(tr);
var removeItem = $('#materialCode'+rowid).val();
@ -3988,7 +3988,7 @@ function DeleteRow(rowid)
});
// alert(result);
if(result == '0')
{
var DelRows = $('#txtDeletedRow').val();
@ -4026,7 +4026,8 @@ function DeleteRow(rowid)
if(data)
{
$('#content').loader('hide');
alert(data);
alert(data);
}
else
{
@ -4036,7 +4037,7 @@ function DeleteRow(rowid)
}});
}
populateValueMainFormForDeleteItem(rowid);
//populateValueMainFormForDeleteItem(rowid);
}
@ -4044,8 +4045,6 @@ function DeleteRow(rowid)
function populateValueMainFormForDeleteItem(rowid)
{
// alert(rows);
var totBasicAmt = $('#txtTotBasicAmount').val();
var totDiscountAmt = $('#txtTotalDiscount').val();
var totPackagingAmt = $('#txtTotalPackaing').val();
@ -4200,6 +4199,22 @@ $('#Scheduleby').change(function(){
});
});
function RevenueChangeSgst(){
var getTypeOfTax= $("input:radio[name='Range']:checked").val();
if(getTypeOfTax==0){
$('#Sgst').val($('#Cgst').val());
change();
}
}
function RevenueChangeEditSgst(){
var getEditTypeOfTax= $("input:radio[name='Range']:checked").val();
if(getEditTypeOfTax==0){
$('#EditSgst').val($('#EditCgst').val());
Editchange();
}
}
function change(){
ExceedQuantityCheck();
@ -4549,3 +4564,4 @@ $("#VIEWREVENUE").on("shown.bs.modal", function(e) {
});
</script>

View File

@ -2445,7 +2445,7 @@ function calculateEditTaxValue()
<label>CGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change()');
$data = array('name' => 'Cgst','value' => set_value('Cgst',0),'id'=>'Cgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();RevenueChangeSgst();');
echo form_input($data);
?>
</div>
@ -2800,7 +2800,7 @@ function calculateEditTaxValue()
<label>CGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCgst','value' => set_value('EditCgst',0),'id'=>'EditCgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();');
$data = array('name' => 'EditCgst','value' => set_value('EditCgst',0),'id'=>'EditCgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();RevenueChangeEditSgst();');
echo form_input($data);
?>
</div>
@ -3847,6 +3847,22 @@ $('#Scheduleby').change(function(){
$('#Scheduleby').val('');
});
function RevenueChangeSgst(){
var getTypeOfTax= $("input:radio[name='Range']:checked").val();
if(getTypeOfTax==0){
$('#Sgst').val($('#Cgst').val());
change();
}
}
function RevenueChangeEditSgst(){
var getEditTypeOfTax= $("input:radio[name='Range']:checked").val();
if(getEditTypeOfTax==0){
$('#EditSgst').val($('#EditCgst').val());
Editchange();
}
}
function change(){
ExceedQuantityCheck();
@ -4010,3 +4026,4 @@ location.reload();
</script>