revenuopo

This commit is contained in:
gayathri1990 2017-10-27 19:49:45 +05:30
parent c6c3cf5fd3
commit 75931fa3a8
3 changed files with 127 additions and 116 deletions

View File

@ -202,12 +202,7 @@ class employeedetails extends BaseController
function AddNewEmployee()
{
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$this->load->library('form_validation');
$this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]');
@ -347,7 +342,7 @@ echo "<script>alert('New Employee Created successfully!');</script>";redirect('e
echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','refresh');
}
}
}
}
@ -378,12 +373,7 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
* This function is used to load the add new Employee form with dropdown values */
function addemployee()
{
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$this->load->model('employeedetails_model');
$GenderConfigID = 'C013';
$MartialConfigID = 'C012';
@ -401,7 +391,7 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
$data['Department'] = $this->employeedetails_model->getDepartment();
$this->global['pageTitle'] = 'Siddharth : Add New Employee';
$this->loadViews("addemployee", $this->global, $data, NULL);
}
}
/**
* This function is used to check whether the Employee is existing in the database or not */
@ -577,12 +567,7 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
/* To Update the employee details*/
function UpdateEmployee()
{
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$EmpId = $this->input->post('employeeid');
$this->load->library('form_validation');
//$mail = $this->this->.post('emailid');
@ -760,7 +745,7 @@ echo "<script>alert('Record Not Updated!');</script>"; redirect('employeeListin
// redirect('employeeListing');
}
}
}
/** this function can be use for excel report **/

View File

@ -489,6 +489,7 @@ $('#PackagingType').change(function() {
$('#txtPackaging').attr('readonly', 'true');
$('#txtPackaging').val('0.00');
change();
}
else
{
@ -516,6 +517,7 @@ $('#EditPackagingType').change(function() {
$('#txtEditPackaging').attr('readonly', 'true');
$('#txtEditPackaging').val('0.00');
Editchange();
}
else
{
@ -592,7 +594,7 @@ $('#drpFreight').change(function() {
$('#txtFreight').attr('readonly', 'true');
$('#txtFreight').val('0.00');
change();
}
else
{
@ -644,6 +646,7 @@ $('#drpEditFreight').change(function() {
$('#txtEditFreight').attr('readonly', 'true');
$('#txtEditFreight').val('0.00');
Editchange();
}
else
@ -877,7 +880,7 @@ function calculatePackaging(isEdit)
var Packaging = parseFloat(AfterPackaging).toFixed(2);
$('#txtAfterPackaging').val(Packaging);
RevenueChangeSgst();
//RevenueChangeSgst();
}
else
{
@ -949,7 +952,7 @@ function calculatePackaging(isEdit)
var Packaging = parseFloat(AfterPackaging).toFixed(2);
$('#txtEditAfterPackaging').val(Packaging);
RevenueChangeEditSgst();
//RevenueChangeEditSgst();
}
else
{
@ -1640,7 +1643,7 @@ function calculatePackaging(isEdit)
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreight').val(AfterFreightval);
RevenueChangeSgst();
//RevenueChangeSgst();
}
else
{
@ -1737,7 +1740,7 @@ function calculatePackaging(isEdit)
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtEditAfterFreight').val(AfterFreightval);
RevenueChangeEditSgst();
//RevenueChangeEditSgst();
}
else
{
@ -1848,10 +1851,13 @@ function calculatePackaging(isEdit)
cgst= $('#ViewCGST').val();
sgst= $('#ViewSGST').val();
igst= $('#ViewIGST').val();
//alert(sgst);
//alert(igst);
afterdiscount= $('#txtViewAfterDiscount').val();
//alert(afterdiscount);
packaging12= $('#txtViewAfterPackaging').val();
//alert( packaging12);
freight12= $('#txtViewAfterFreight').val();//ViewAfterCGST
//alert(freight12);
calculateCgstTax(basicvalue,cgst,afterdiscount,packaging12,freight12);
calculateSgstTax(basicvalue,sgst,afterdiscount,packaging12,freight12);
calculateIgstTax(basicvalue,igst,afterdiscount,packaging12,freight12)
@ -2027,7 +2033,16 @@ SetVatorCST();
if ($("#EditDiscountType").val()!=0) {
calculateDiscount(1);
}
if($("#EditCgst").val()!=''){
if ($("#EditPackagingType").val()!=0) {
calculatePackaging(1);
}
if($("#drpEditFreight").val()!=0){
calculateFreight(1);
}
if($("#EditCgst").val()!=''){
$('#EditAfterCgst').val(calculateSgstTax($('#txtEditBasicValue').val(),$('#EditCgst').val(),$('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(),$('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(),$('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
@ -2041,14 +2056,6 @@ SetVatorCST();
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(),$('#EditIgst').val(),$('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(),$('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(),$('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
}
if ($("#EditPackagingType").val()!=0) {
calculatePackaging(1);
}
if($("#drpEditFreight").val()!=0){
calculateFreight(1);
}
calculateEditTotalValue($('#isEdit').val());
}
@ -2669,25 +2676,25 @@ function calculateEditTaxValue()
<div align="right">
<div align="right">
<?php
<?php
if($PONOStatus == PO_RELEASED)
{?>
<?php }
else if($PONOStatus==PO_DRAFT ||$PONOStatus==PO_CREATED || $PONOStatus==PO_APPROVED)
else if($PONOStatus==PO_DRAFT ||$PONOStatus==PO_CREATED || $PONOStatus==PO_APPROVED)
{?>
<a data-toggle="modal" ><button type="submit" onclick="myFunction();" class="btn btn-primary" id="abcd" >Select Line Item</button> </a>
<a data-toggle="modal" ><button type="submit" onclick="myFunction();" class="btn btn-primary" id="abcd" >Select Line Item</button> </a>
<?}?>
<?php
}?>
</div>
</div>
<!-- Model for revenue po -->
<div id="REVENUE" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="overflow-y:scroll !important">
@ -2908,7 +2915,7 @@ function calculateEditTaxValue()
<label>Packaging Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtPackaging','value' => set_value('txtPackaging'),'id'=>'txtPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculatePackaging(0);');
$data = array('name' => 'txtPackaging','value' => set_value('txtPackaging'),'id'=>'txtPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -3000,7 +3007,7 @@ function calculateEditTaxValue()
<label>Freight Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(0);');
$data = array('name' => 'txtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -3291,7 +3298,7 @@ function calculateEditTaxValue()
<label>Packaging Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditPackaging','value' => set_value('txtEditPackaging'),'id'=>'txtEditPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculatePackaging(1);RevenueChangeEditSgst();','style'=>'text-align:right;');
$data = array('name' => 'txtEditPackaging','value' => set_value('txtEditPackaging'),'id'=>'txtEditPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -3382,7 +3389,7 @@ function calculateEditTaxValue()
<label>Freight Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditFreight','value' => set_value('txtEditFreight'),'id'=>'txtEditFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(1);','style'=>'text-align:right;');
$data = array('name' => 'txtEditFreight','value' => set_value('txtEditFreight'),'id'=>'txtEditFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -3884,7 +3891,7 @@ function calculateEditTaxValue()
<input align="right" type="hidden" name="<?php echo 'TotalOrderValue'.$index ?>" id="<?php echo 'TotalOrderValue'.$index ?>" value="<?php echo $record->TotalValue ; ?>" />
<?php
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus==PO_APPROVED)
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED)
{?>
<td> <a data-target='#EDITREVENUE' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo ; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
<?php
@ -4111,7 +4118,7 @@ $('.AddRevenue').click(function(){
var PackVal = $("#txtPackaging").val();
var AfterPackVal = $("#txtAfterPackaging").val();
var Cgst = $("#Cgst").val();
var Cgst = $("#Cgst").val();
var AfterCgst = $("#AfterCgst").val();
var Sgst = $("#Sgst").val();
var AfterSgst = $("#AfterSgst").val();
@ -4299,8 +4306,10 @@ clearRevenueModalFields();
var AfterFreightVal = $("#txtViewAfterFreight").val();
var NoOfTrip = $("#ViewNOOfTrips").val();
var Cgst = $("#ViewAfterCGST").val();
//alert(Cgst);
var Sgst = $("#ViewAfterSGST").val();
var Igst = $("#ViewAfterIGST").val();
// alert(Igst);
if(FreightType != 'PER TRIP'){
NoOfTrip=0;
}
@ -4326,6 +4335,7 @@ clearRevenueModalFields();
$('#NoOfTrip'+userid).val(NoOfTrip);
$('#RevenueAfterCgst'+userid).val(Cgst);
$('#RevenueAfterSgst'+userid).val(Sgst);
$('#RevenueAfterIgst'+userid).val(Igst);
$('#TotalOrderValue'+userid).val(TotalOrderValue);
@ -4475,7 +4485,7 @@ function clearRevenueModalFields()
$("input:radio[name='optVat'][value='0']").prop('checked', 'checked');
$("input:radio[name='optCST'][value='0']").prop('checked', 'checked');
$("#Cgst").val('0');
$("#Cgst").val('0');
$("#Sgst").val('0');
$("#Igst").val('0');
$("#AfterCgst").val('0');
@ -4485,7 +4495,7 @@ function clearRevenueModalFields()
$("#drpFreight").val('0');
$("#txtFreight").val('');
$("#txtAfterFreight").val('');
$("#NOOfTrips").val('');
$("#NOOfTrips").val('');
$("#txtBasicValue").val('');
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
@ -4579,14 +4589,15 @@ function calculateCgstTax(varBasicValue,Cgst,discount,pack,freight)
var packfreight=parseFloat(packaging)+parseFloat(freight);
var basicValue1 = parseFloat(varBasicValue-discount);
var basicValue =parseFloat(basicValue1+packfreight)
var Igst = parseFloat(Igst);
//alert(basicValue);
var Igst = parseFloat(Igst);
//alert(Igst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
$('#ViewAfterIGST').val(TAXval);
return TAXval;// $('#AfterServiceTax').val(TAXval);
}
@ -4938,7 +4949,16 @@ function change(){
if ($("#DiscountType").val()!=0) {
calculateDiscount(0);
}
if($("#Cgst").val()!=''){
if ($("#PackagingType").val()!=0) {
calculatePackaging(0);
}
if($("#drpFreight").val()!=0){
calculateFreight(0);
}
if($("#Cgst").val()!=''){
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$('#Cgst').val(),$('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(),$("#txtAfterPackaging").val()== '' ? "0.00" : $('#txtAfterPackaging').val(),$("#txtAfterFreight").val()== '' ? "0.00" : $('#txtAfterFreight').val()));
}
if($("#Sgst").val()!=''){
@ -4951,14 +4971,6 @@ function change(){
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(),$('#Igst').val(),$('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(),$("#txtAfterPackaging").val()== '' ? "0.00" : $('#txtAfterPackaging').val(),$("#txtAfterFreight").val()== '' ? "0.00" : $('#txtAfterFreight').val()));
}
if ($("#PackagingType").val()!=0) {
calculatePackaging(0);
}
if($("#drpFreight").val()!=0){
calculateFreight(0);
}
calculateTotalValue();
}
@ -5255,7 +5267,7 @@ $("#VIEWREVENUE").on("shown.bs.modal", function(e) {
$('#ViewTripsValue').hide();
}
$('#txtViewTotalOrderValue').val($('#TotalOrderValue'+userid).val());
$('#ViewAfterCGST').val($('#RevenueAfterCgst'+userid).val());
$('#ViewAfterCGST').val($('#RevenueAfterCgst'+userid).val());
$('#ViewAfterSGST').val($('#RevenueAfterSgst'+userid).val());
$('#ViewAfterIGST').val($('#RevenueAfterIgst'+userid).val());
$('#ViewCGST').val($('#RevenueCgst'+userid).val());

View File

@ -110,11 +110,6 @@ if(!empty($INRSYMBOL))
$(document).ready(function(){
$("#PaymentTerms").select2();
clearTotalItemValues();
if($("#insurance").val() == 1)
{
$("#insurancenodiv").show();
$("#insuranceno").val('Yes');
}
});
@ -512,6 +507,8 @@ $('#PackagingType').change(function() {
$('#txtPackaging').attr('readonly', 'true');
$('#txtPackaging').val('0.00');
$('#txtAfterPackaging').val("0.00");
change();
}
else
{
@ -546,6 +543,8 @@ $('#EditPackagingType').change(function() {
$('#txtEditPackaging').attr('readonly', 'true');
$('#txtEditPackaging').val('0.00');
Editchange();
}
else
{
@ -702,14 +701,13 @@ $('#drpFreight').change(function() {
$('#txtFreight').attr('readonly', 'true');
$('#txtFreight').val('0.00');
$('#txtAfterFreight').val('0.00');
change();
}
else
{
$('#txtFreight').removeAttr( 'readonly','true' );
$('#txtFreight').val('');
}
}
else
@ -740,17 +738,18 @@ $('#drpEditFreight').change(function() {
$('#txtEditAfterFreight').val('');
if(selValue == PercentageType)
{
var PackagingCalculation = '';
var FreightCalculation = '';
// $('#freight').modal('show');
$('#freightcalmodel').modal('show');
$('#txtEditFreight').removeAttr( 'readonly','true' );
//Editchange();
}
else if (selValue == NilType)
{
$('#txtEditFreight').attr('readonly', 'true');
$('#txtEditFreight').val('0.00');
Editchange();
}
else
@ -765,7 +764,7 @@ $('#drpEditFreight').change(function() {
$('#drpEditFreight').val("0");
$('#EditRate').focus();
}
calculateFreight(1);
calculateFreight(1);
});
});
@ -960,7 +959,8 @@ function calculatePackaging(isEdit)
var Packaging = parseFloat(AfterPackaging).toFixed(2);
$('#txtAfterPackaging').val(Packaging);
RevenueChangeSgst();
//RevenueChangeSgst();
//calculateCgstTax();
}
else
@ -1035,7 +1035,7 @@ function calculatePackaging(isEdit)
}
var Packaging = parseFloat(AfterPackaging).toFixed(2);
$('#txtEditAfterPackaging').val(Packaging);
RevenueChangeEditSgst();
//RevenueChangeEditSgst();
}
else
{
@ -1691,6 +1691,7 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
alert('Please select Freight Type');
$('#txtFreight').val('');
$("#drpFreight").focus();
// calculateCgstTax();
}
else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '')
{
@ -1702,8 +1703,8 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
if(FreightType == PercentageType)
{
//AfterFreight = <?php echo FREIGHT_PERCENTAGE;?>;
if($(freightCalculation != 0 && '#txtAfterDiscount').val() == '')
{
if($(freightCalculation != 0 && '#txtAfterDiscount').val() == '')
{
//alert(freightCalculation);
alert('Please Enter the Discount value');
$('#txtFreight').val('');
@ -1763,7 +1764,7 @@ AfterFreight = <?php echo FREIGHT_PERCENTAGE_AFTER;?>;}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreight').val(AfterFreightval);
RevenueChangeSgst();
}
else
{
@ -1794,6 +1795,7 @@ AfterFreight = <?php echo FREIGHT_PERCENTAGE_AFTER;?>;}
{
var basicValue = parseFloat($('#txtEditBasicValue').val());
var FreightType =$("#drpEditFreight").val();
//alert(FreightType);
if(FreightType == "0")
{
alert('Please select Freight Type');
@ -1802,6 +1804,7 @@ AfterFreight = <?php echo FREIGHT_PERCENTAGE_AFTER;?>;}
}
else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '')
{
var FreightValue = parseFloat($('#txtEditFreight').val());
var UOM = parseFloat($('#EditUOM').val());
var Quantity = parseFloat($('#EditQuantity').val());
@ -1871,7 +1874,7 @@ AfterFreight = <?php echo FREIGHT_PERCENTAGE_AFTER;?>;}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtEditAfterFreight').val(AfterFreightval);
RevenueChangeEditSgst();
//RevenueChangeEditSgst();
}
else
@ -2029,7 +2032,16 @@ return true;
{
calculateDiscount(1);
}
if($("#EditCgst").val()!='')
if ($("#EditPackagingType").val()!=0) {
calculatePackaging(1);
}
if($("#drpEditFreight").val()!=0){
calculateFreight(1);
}
if($("#EditCgst").val()!='')
{
$('#EditAfterCgst').val(calculateCgstTax($('#txtEditBasicValue').val(),$('#EditCgst').val(),$('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(),$('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(),$('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
@ -2043,14 +2055,6 @@ return true;
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(),$('#EditIgst').val(),$('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(),$('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(),$('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
}
if ($("#EditPackagingType").val()!=0) {
calculatePackaging(1);
}
if($("#drpEditFreight").val()!=0){
calculateFreight(1);
}
calculateEditTotalValue($('#isEdit').val());
}
@ -2726,7 +2730,7 @@ function calculateEditTaxValue()
<!-- <label>Rate</label> -->
<div class="form-group">
<?php
$data = array('name' => 'Rate','value' => set_value('Rate'),'id'=>'Rate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change()' );
$data = array('name' => 'Rate','value' => set_value('Rate'),'id'=>'Rate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change()');
echo form_input($data);
?>
</div>
@ -2841,7 +2845,7 @@ function calculateEditTaxValue()
<label>Packaging Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtPackaging','value' => set_value('txtPackaging'),'id'=>'txtPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculatePackaging(0);');
$data = array('name' => 'txtPackaging','value' => set_value('txtPackaging'),'id'=>'txtPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -2860,7 +2864,7 @@ function calculateEditTaxValue()
<label>SGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' change();');
$data = array('name' => 'Sgst','value' => set_value('Sgst',0),'id'=>'Sgst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -2880,7 +2884,7 @@ function calculateEditTaxValue()
<label>IGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' change();');
$data = array('name' => 'Igst','value' => set_value('Igst',0),'id'=>'Igst', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -2933,7 +2937,7 @@ function calculateEditTaxValue()
<label>Freight Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(0);');
$data = array('name' => 'txtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'change();');
echo form_input($data);
?>
</div>
@ -3153,7 +3157,7 @@ function calculateEditTaxValue()
<label>Discount Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditDiscount','value' => set_value('txtEditDiscount'),'id'=>'txtEditDiscount', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Editchange();calculateDiscount(1);','style'=>'text-align:right;');
$data = array('name' => 'txtEditDiscount','value' => set_value('txtEditDiscount'),'id'=>'txtEditDiscount', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Editchange();','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -3216,7 +3220,7 @@ function calculateEditTaxValue()
<label>Packaging Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditPackaging','value' => set_value('txtEditPackaging'),'id'=>'txtEditPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculatePackaging(1);','style'=>'text-align:right;');
$data = array('name' => 'txtEditPackaging','value' => set_value('txtEditPackaging'),'id'=>'txtEditPackaging', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -3307,7 +3311,7 @@ function calculateEditTaxValue()
<label>Freight Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditFreight','value' => set_value('txtEditFreight'),'id'=>'txtEditFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(1);','style'=>'text-align:right;');
$data = array('name' => 'txtEditFreight','value' => set_value('txtEditFreight'),'id'=>'txtEditFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Editchange();','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -3533,9 +3537,9 @@ function calculateEditTaxValue()
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
<td align="left"><%=MaterialCode%></td>
<td align="left"><%=MaterialName%></td>
<td align="right"><%=Quantity%></td>
<td align="left"><%=UOM%></td>
<td align="left"><%=MaterialName%></td>
<td align="right"><%=Quantity%></td>
<td align="left"><%=UOM%></td>
<td align="right"><%=Rate%></td>
<td align="right"><%=BasicAmount%></td>
<td align="right"><%=Taxvalue%></td>
@ -3565,8 +3569,7 @@ $("#insurance").change(function(){
$("#insuranceno").val("");
}
else {
$("#insurancenodiv").show();
$("#insuranceno").val('Yes');}
$("#insurancenodiv").show();}
});
$("#EDITREVENUE").on("shown.bs.modal", function(e) {
@ -4307,7 +4310,20 @@ function change(){
if ($("#DiscountType").val()!=0) {
calculateDiscount(0);
}
if($("#Cgst").val()!=''){
if ($("#PackagingType").val()!=0) {
calculatePackaging(0);
}
if($("#drpFreight").val()!=0){
calculateFreight(0);
}
if($("#Cgst").val()!=''){
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$('#Cgst').val(),$('#txtAfterDiscount').val ()== '' ? '0.00' : $('#txtAfterDiscount').val(),$('#txtAfterPackaging').val() == '' ? '0.00' :$('#txtAfterPackaging').val(),$('#txtAfterFreight').val() == '' ? '0.00' :$('#txtAfterFreight').val()));
}
@ -4322,16 +4338,6 @@ function change(){
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(),$('#Igst').val(),$('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(),$('#txtAfterPackaging').val() == '' ? '0.00' :$('#txtAfterPackaging').val(),$('#txtAfterFreight').val() == '' ? '0.00' :$('#txtAfterFreight').val()));
}
if ($("#PackagingType").val()!=0) {
calculatePackaging(0);
}
if($("#drpFreight").val()!=0){
calculateFreight(0);
}
calculateTotalValue();
@ -4362,6 +4368,7 @@ function calculateTotalValue()
function calculateCgstTax(varBasicValue,Cgst,discount,pack,freight)
{
//alert('hai');
var discount = discount;
var packaging = pack;
var freight = freight;
@ -4405,12 +4412,19 @@ function calculateTotalValue()
function calculateIgstTax(varBasicValue,Igst,discount,pack1,freight1)
{
var discount = discount;
// alert(discount);
var packaging=parseFloat(pack1);
//alert(packaging);
var freight=parseFloat(freight1);
//alert(freight);
var packfreight=parseFloat(packaging)+parseFloat(freight);
//alert(packfreight);
var basicValue1 = parseFloat(varBasicValue-discount);
// alert(basicValue1);
var basicValue =parseFloat(basicValue1+packfreight)
var Igst = parseFloat(Igst);
// alert(basicValue);
var Igst = parseFloat(Igst);
//alert(Igst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;