6657 lines
291 KiB
PHP
Executable File
6657 lines
291 KiB
PHP
Executable File
<script>
|
||
$(document).ready(function() {
|
||
// When the second modal is about to be shown
|
||
$('#packagingcalmodel').on('show.bs.modal', function() {
|
||
// Set a higher z-index for the second modal to appear on top
|
||
$('#packagingcalmodel').css('z-index', 1060); // Set the z-index for the second modal
|
||
// Ensure the second modal backdrop appears above the first one
|
||
setTimeout(function() {
|
||
$('.modal-backdrop').last().css('z-index', 1055);
|
||
}, 0);
|
||
});
|
||
|
||
// Reset z-index when the second modal is hidden (optional)
|
||
$('#packagingcalmodel').on('hidden.bs.modal', function() {
|
||
$('#packagingcalmodel').css('z-index', ''); // Reset to default
|
||
});
|
||
|
||
$('#editpackagingcalmodel').on('show.bs.modal', function() {
|
||
// Set a higher z-index for the second modal to appear on top
|
||
$('#editpackagingcalmodel').css('z-index', 1060); // Set the z-index for the second modal
|
||
// Ensure the second modal backdrop appears above the first one
|
||
setTimeout(function() {
|
||
$('.modal-backdrop').last().css('z-index', 1055);
|
||
}, 0);
|
||
});
|
||
|
||
// Reset z-index when the second modal is hidden (optional)
|
||
$('#editpackagingcalmodel').on('hidden.bs.modal', function() {
|
||
$('#editpackagingcalmodel').css('z-index', ''); // Reset to default
|
||
});
|
||
});
|
||
</script>
|
||
<?php
|
||
|
||
$t = '';
|
||
if (!empty($staticspecialinstruction)) {
|
||
foreach ($staticspecialinstruction as $text)
|
||
$t = $text->ConfigValue;
|
||
}
|
||
|
||
$insuranceStatus = array(
|
||
array("name" => "NO", "value" => "0"),
|
||
array("name" => "YES", "value" => "1")
|
||
);
|
||
$ReqType = '';
|
||
$CompanyAddress = '';
|
||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||
$CurrentDate = $dt->format('d-m-Y');
|
||
$MaxPoDate = '';
|
||
$AvlAmount = 0;
|
||
$paymentDate = '';
|
||
$paymentCheckDays = 'Before';
|
||
$paymentCheckDays1 = 'After';
|
||
if (!empty($MaxPODate)) {
|
||
foreach ($MaxPODate as $date) {
|
||
|
||
$MaxPoDate = $date->PODate;
|
||
}
|
||
}
|
||
if (!empty($CompanyDetails)) {
|
||
foreach ($CompanyDetails as $Req) {
|
||
$CompanyAddress = $Req->Address;
|
||
}
|
||
}
|
||
if (!empty($AvlBudAmt)) {
|
||
|
||
$AvlAmount = number_format($AvlCapitalBudAmt, 2, '.', '');
|
||
}
|
||
|
||
// if(!empty($AvlimportBudAmt))
|
||
// {
|
||
|
||
// $AvlAmount = $AvlimportBudAmt;
|
||
|
||
// }
|
||
|
||
|
||
|
||
$INR = '';
|
||
$INRSYM = '';
|
||
if (!empty($INRSYMBOL)) {
|
||
foreach ($INRSYMBOL as $INR) {
|
||
$INRSYM = $INR->Currency_Code;
|
||
$INR = $INR->FontCode2000;
|
||
}
|
||
}
|
||
|
||
// echo $INRSYM;
|
||
// echo $INR;
|
||
|
||
?>
|
||
<style>
|
||
#mceu_1 {
|
||
border-width: 0px 0px 0px !important;
|
||
}
|
||
|
||
#mceu_0 {
|
||
padding: 1px !important;
|
||
}
|
||
|
||
.modal {
|
||
overflow: auto !important;
|
||
}
|
||
|
||
.dataTables_paginate {
|
||
margin-top: -5%;
|
||
}
|
||
|
||
.dataTables_wrapper {
|
||
padding-bottom: 0px;
|
||
}
|
||
|
||
|
||
|
||
.num {
|
||
text-align: right;
|
||
}
|
||
|
||
|
||
.centered {
|
||
display: flex;
|
||
/* justify-content: center; */
|
||
align-items: center;
|
||
height: 10vh;
|
||
}
|
||
|
||
|
||
.centered label,
|
||
.centered input {
|
||
margin: 0 5px;
|
||
}
|
||
</style>
|
||
|
||
<script src="<?php echo base_url() ?>public/assets/tinymce/js/tinymce/tinymce.min.js"></script>
|
||
|
||
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||
|
||
<script type="text/javascript">
|
||
tinymce.init({
|
||
selector: "textarea#txtSpcialInstruction",
|
||
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false,
|
||
setup: function(ed) {
|
||
ed.on('init', function(evt) {
|
||
|
||
ed.setContent('<?php echo $t; ?>');
|
||
});
|
||
}
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#ItemDescription",
|
||
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#EditItemDescription",
|
||
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
</script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
|
||
$("#PaymentMethod").select2();
|
||
|
||
clearTotalItemValues();
|
||
$('#CapitalToatlOrder').val(0);
|
||
//Initialize Select2 Elements
|
||
$("#drpSupplier").select2();
|
||
$("#Reqnumber").select2();
|
||
$('#DomesticNOT').modal('show');
|
||
$("#CapitalCostCenter").select2();
|
||
$("#MaterialCode").select2();
|
||
$("#currencytype").select2();
|
||
|
||
// $("#PODate").datepicker({
|
||
// //minDate : d,
|
||
// maxDate: 'now',
|
||
// dateFormat: 'dd-mm-yy',
|
||
// changeMonth: true,
|
||
// changeYear: true,
|
||
// yearRange: '-100:+0'
|
||
// });
|
||
// $("#Deliverydt").datepicker({
|
||
// minDate: 'now',
|
||
// dateFormat: 'dd-mm-yy',
|
||
// changeMonth: true,
|
||
// changeYear: true,
|
||
// yearRange: '0:+10'
|
||
// });
|
||
$("#Exchangerateon").datepicker({
|
||
format: 'dd-mm-yyyy',
|
||
startDate: new Date(),
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
clearBtn: true
|
||
});
|
||
$('#Date').click(function() {
|
||
|
||
//for Dispatch range selection
|
||
$('#Schedulediv').hide();
|
||
$('#Deliverydtdiv').show();
|
||
$('#deliverydateby').hide();
|
||
});
|
||
$('#Schedule').click(function() {
|
||
|
||
//for schedule range selection
|
||
$('#Deliverydtdiv').hide();
|
||
$('#Schedulediv').show();
|
||
$('#deliverydateby').hide();
|
||
});
|
||
|
||
$('#DeliverycheckDate').click(function() {
|
||
|
||
//for Delivery Date selection
|
||
$('#Schedulediv').hide();
|
||
$('#deliverydateby').show();
|
||
$('#Deliverydtdiv').hide();
|
||
});
|
||
|
||
});
|
||
|
||
//document.getElementById("Date").checked = true;
|
||
|
||
function openModal() {
|
||
|
||
if (vaildateBeforeOpenModal()) {
|
||
$('#CAPITAL').modal('show');
|
||
}
|
||
}
|
||
|
||
function vaildateBeforeOpenModal() {
|
||
|
||
var radioValue = $("input[name='DateRange']:checked").val();
|
||
|
||
if ($('#PODate').val() == '') {
|
||
alert('Please Enter the Purchase Order date');
|
||
$('#PODate').focus();
|
||
return false;
|
||
} else if ($('#drpSupplier').val() == "0") {
|
||
alert('Please Select the Supplier details');
|
||
$('#drpSupplier').focus();
|
||
return false;
|
||
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
|
||
alert('Please Select the Delivery Date');
|
||
$('#Deliverydate').focus();
|
||
return false;
|
||
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
|
||
alert('Please Enter the Schedule By');
|
||
$('#Deliverydate').focus();
|
||
return false;
|
||
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
|
||
alert('Please Enter the Dispatch Instruction');
|
||
$('#Deliverydate').focus();
|
||
return false;
|
||
} else if ($('#DeliveryAddr').val() == '') {
|
||
alert('Please Enter the Delivery Address');
|
||
$('#DeliveryAddr').focus();
|
||
return false;
|
||
} else if ($('#PoTypeOptions').val() == "0") {
|
||
alert('Please Select POType');
|
||
$('#PoTypeOptions').focus();
|
||
return false;
|
||
|
||
} else if ($('#BudgetType').val() == "0") {
|
||
alert('Please Select Budget Type');
|
||
$('#BudgetType').focus();
|
||
return false;
|
||
|
||
} else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') {
|
||
alert('Please Enter the Dispatch Instruction');
|
||
$('#Deliverydt').focus();
|
||
return false;
|
||
} else if ($('#currencytype').val() == '0') {
|
||
alert('Please Select the Currency Type');
|
||
$('#currencytype').focus();
|
||
return false;
|
||
} else if (capitalType == 'International') {
|
||
if ($('#ExchangeRt').val() == '') {
|
||
alert('Please Enter the Exchange Rate');
|
||
$('#ExchangeRt').focus();
|
||
return false;
|
||
} else if ($('#PlaceOforigin').val().trim() == '') {
|
||
alert('Please Enter the Place Of Origin');
|
||
$('#PlaceOforigin').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
</script>
|
||
<div class="content-page">
|
||
<div class="content">
|
||
<!-- Start Content-->
|
||
<div class="container-fluid">
|
||
<!-- start page title -->
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="page-title-box page-title-box-alt">
|
||
<h4><?= "Capital Purchase Order"; ?></h4>
|
||
<a href="<?php echo base_url() ?>CreatePO" class="btn btn-secondary" id="back" value="Back">Back</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- end page title -->
|
||
<!-- Form row -->
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="card">
|
||
<div class="card-body">
|
||
<?php
|
||
$attributes = array('class' => 'form-label-left CapitalPO ', 'name' => 'CapitalPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data');
|
||
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
|
||
|
||
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Requistion No</label>
|
||
<?php
|
||
|
||
$options = array("0" => 'Selected Requisition Numbers');
|
||
if (!empty($ReqList)) {
|
||
foreach ($ReqList as $SID) :
|
||
|
||
// print_r($SID->ReqNo);
|
||
$options[$SID->ReqNo] = $SID->ReqNo . "-" . $SID->ReqBy;
|
||
$ReqType = $SID->ReqType;
|
||
endforeach;
|
||
}
|
||
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Purchase Order Type</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'POType', 'value' => set_value('POType', CAPITAL), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Select Supplier<span class="text-danger">*</span></label>
|
||
<?php
|
||
$options = array("0" => 'Select Supplier');
|
||
//print_r( $options);
|
||
|
||
if (!empty($Suplist)) {
|
||
foreach ($Suplist as $SID) :
|
||
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier" required="true" class="form-control select2"');
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Supplier Address</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'SupAddress', 'value' => set_value('SupAddress'), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40');
|
||
echo Form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3" id="currencyOpt">
|
||
<label>Currency Type<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Currency Type ');
|
||
//print_r( $options);
|
||
if (!empty($Currency)) {
|
||
foreach ($Currency as $Cur) :
|
||
|
||
$options[$Cur->Currency_Code] = $Cur->Currency_Code . ' ' . ' - ' . ' ' . $Cur->Country_and_Currency;
|
||
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('currencytype', $options, set_value('currencytype'), 'id="currencytype" class="form-control select2" required="true"');
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<b><u>Select Delivery By<span class="text-danger">*</span></u></b> <br />
|
||
<div style="display:inline-flex;">
|
||
<div class="centered">
|
||
<div id="dispatchinternational">
|
||
<!-- <?php echo form_label('Date', 'Date') . " " . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "0", 'checked' => 'checked')); ?> </td> -->
|
||
<?php echo form_label('Dispatch instruction', 'Dispatch instruction') . " " . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "2", 'checked' => set_radio('DateRange', '2', FALSE))); ?>
|
||
</div>
|
||
<div id="datedomestic">
|
||
<?php echo form_label('Deilvery Date', 'Deilvery Date') . " " . form_radio(array("name" => "DateRange", "id" => "DeliverycheckDate", "value" => "0", 'checked' => set_radio('DateRange', '0', FALSE))); ?>
|
||
</div>
|
||
<div>
|
||
<?php echo form_label('Schedule', 'Schedule') . " " . form_radio(array("name" => "DateRange", "id" => "Schedule", "value" => "1", 'checked' => 'checked')); ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" id="Schedulediv">
|
||
<label>Schedule By <span class="text-danger">*</span></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
|
||
echo Form_textarea($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="Deliverydtdiv" style="display:none;">
|
||
<label>Dispatch Instruction<span class="text-danger">*</span></label>
|
||
|
||
<?php
|
||
// $data = array('name' => 'Dispatch','value' => set_value('Dispatch'),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true');
|
||
// echo form_input($data);
|
||
$data = array('name' => 'Dispatch', 'value' => set_value('Dispatch'), 'id' => 'Dispatch', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
|
||
echo Form_textarea($data);
|
||
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="deliverydateby" style="display:none;">
|
||
<label>Delivery Date<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$formattedDate = $dt->format('d-m-Y');
|
||
$data = array('type' => 'text', 'name' => 'Deliverydate', 'value' => set_value('Deliverydate', $formattedDate), 'id' => 'Deliverydate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Delivery Address</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'DeliveryAddr', 'value' => set_value('DeliveryAddr', $CompanyAddress), 'id' => 'DeliveryAddr', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40');
|
||
echo Form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3" id="FromOnlineRate">
|
||
Check Today's Foreign Exchange value <a href="http://www.xe.com/" target="_blank"><u>(Click here)</u></a>
|
||
</div>
|
||
<div class="form-group col-md-3" id="hideExchangeRateOn">
|
||
<label>Exchange Rate On</label>
|
||
<div>
|
||
<?php
|
||
$formattedDate = $dt->format('d-m-Y');
|
||
$data = array('type' => 'text', 'name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $formattedDate), 'id' => 'Exchangerateon', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" id="hideExchangeRate">
|
||
<label id="CurrencySymbol">Exchange Rate</label><span class="text-danger">*</span>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt'), 'id' => 'ExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="PlaceOforigindiv">
|
||
<label>Place of Origin<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
// $data = array('name' => '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'), 'id' => 'PlaceOforigin', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Purchase Order Date</label>
|
||
<div>
|
||
<?php
|
||
$formattedDate = $dt->format('d-m-Y');
|
||
$data = array('type' => "text", 'name' => 'PODate', 'value' => set_value('PODate', $formattedDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Mode Of Shipment</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'addmodeofshipment', 'value' => set_value('addmodeofshipment'), 'id' => 'addmodeofshipment', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Contact Reference</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'addsupplierreference', 'value' => set_value('addsupplierreference'), 'id' => 'addsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Supplier's Offer No</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'addsupplierofferno', 'value' => set_value('addsupplierofferno'), 'id' => 'addsupplierofferno', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Our Reference(S)</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'addotherreference', 'value' => set_value('addotherreference'), 'id' => 'addotherreference', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Capital Type Options<span class="text-danger">*</span></label>
|
||
<div>
|
||
|
||
<?php
|
||
|
||
$optionsPO = array("0" => 'Select');
|
||
if (!empty($PoTypeOptions)) {
|
||
foreach ($PoTypeOptions as $POpt) :
|
||
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions" required="true" class="form-control select2"');
|
||
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="payablefrom">Payable Terms </label>
|
||
<?php
|
||
|
||
$options1 = array("0" => 'Select Payment method');
|
||
//print_r( $options);
|
||
|
||
if (!empty($Payment)) {
|
||
foreach ($Payment as $payment) :
|
||
|
||
$options1[$payment->PaymentID] = $payment->PaymentTerms;
|
||
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('PaymentMethod', $options1, set_value('PaymentMethod'), 'id="PaymentMethod" class="form-control" required="true"');
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
|
||
<label>Description of Payable Terms</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Insurance Options<span class="text-danger">*</span></label>
|
||
<div>
|
||
|
||
<?php
|
||
if (!empty($insuranceStatus)) {
|
||
foreach ($insuranceStatus as $INS) :
|
||
$optionsInsurance[$INS['value']] = $INS['name'];
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" id="insuranceTxtDiv" style="display:block;">
|
||
<label>Insurance No / Insurance Details <span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'InsuranceNumber', 'value' => set_value('InsuranceNumber'), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
|
||
<?php
|
||
|
||
|
||
$optionsnew = array('0' => 'Select', '1' => 'REVENUE', '2' => 'CAPITAL');
|
||
echo form_dropdown('BudgetType', $optionsnew, set_value('BudgetType'), 'id="BudgetType" required="true" class="form-control select2"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div>
|
||
|
||
<!-- <a data-toggle="modal" ><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd" >Select Line Item</button> </a> -->
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12 text-right">
|
||
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
|
||
<a data-toggle="modal" class="btn btn-success" data-dismiss="modal" onclick="openModal();">Add Line Item </a>
|
||
</div>
|
||
</div>
|
||
<br>
|
||
</div>
|
||
<div class="form-row">
|
||
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||
<thead>
|
||
<tr>
|
||
<th>SNo</th>
|
||
<th>Requisition No</th>
|
||
<th>Item Code</th>
|
||
<th>Item Description</th>
|
||
<th>Quantity</th>
|
||
<th>UOM</th>
|
||
<th>Rate</th>
|
||
<th>Basic Amount</th>
|
||
<th>Tax Amount</th>
|
||
<th>Total Order Amount</th>
|
||
<th>Action</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody id='capitalAppend'>
|
||
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="form-row" id="DOMdiv">
|
||
<div class="form-group col-md-3">
|
||
<label>Total Basic Amount <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'CapitalBasicOrder', 'value' => set_value('CapitalBasicOrder'), 'id' => 'CapitalBasicOrder', 'class' => 'form-control num', 'readonly' => 'true',);
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<label>Total Discount Amount <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalDiscount', 'value' => set_value('txtTotalDiscount'), 'id' => 'txtTotalDiscount', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total CGST <?php echo "($INR)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotCgst', 'value' => set_value('txtTotCgst'), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total SGST <?php echo "($INR)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtTotSgst', 'value' => set_value('txtTotSgst'), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total IGST <?php echo "($INR)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtTotIgst', 'value' => set_value('txtTotIgst'), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Other Allowances <?php echo "($INR)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'TotalOtherAllowances', 'value' => set_value('TotalOtherAllowances'), 'id' => 'TotalOtherAllowances', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Freight <?php echo "($INR)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'TotalFreight', 'value' => set_value('TotalFreight'), 'id' => 'TotalFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="HideImportTaxTotal">
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Landing Charge <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotallanding', 'value' => set_value('txttotallanding'), 'id' => 'txttotallanding', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Assessable Value <?php echo "($INR)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalAssessable', 'value' => set_value('txttotalAssessable'), 'id' => 'txttotalAssessable', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Custom Duty Charge <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalcustom', 'value' => set_value('txttotalcustom'), 'id' => 'txttotalcustom', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Subtotal Charge <?php echo "($INR)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalSubtotal', 'value' => set_value('txttotalSubtotal'), 'id' => 'txttotalSubtotal', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total IGST <?php echo "($INR)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalIgst', 'value' => set_value('txttotalIgst'), 'id' => 'txttotalIgst', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Custom ED_cess Charge <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalcustomED', 'value' => set_value('txttotalcustomED'), 'id' => 'txttotalcustomED', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Custom S & H cess Charge <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalcustomSH', 'value' => set_value('txttotalcustomSH'), 'id' => 'txttotalcustomSH', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Gross duty payable Charge <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txttotalgrossduty', 'value' => set_value('txttotalgrossduty'), 'id' => 'txttotalgrossduty', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Total Freight Amount <?php echo "($INR)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight'), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label id="lbl_international">Total Order Value <?php echo "($INR)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'CapitalToatlOrder', 'value' => set_value('CapitalToatlOrder'), 'id' => 'CapitalToatlOrder', 'class' => 'form-control num', 'readonly' => 'true',);
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
|
||
<label>Special Instructions </label> <?php
|
||
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
|
||
echo form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label>Select Purchase Order File</label><br>
|
||
<input type="file" name="POFile" id="POFile"><br>
|
||
</div>
|
||
</div>
|
||
|
||
<div align="right" style="padding:1% 0%;">
|
||
|
||
|
||
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
||
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||
<input type="hidden" name="Budget" id="Budget" />
|
||
<!--<input type="hidden" name="CapitalToatlOrder" id="CapitalToatlOrder" /> -->
|
||
|
||
|
||
<a class="btn btn-success Save" ID="Cancel" onclick="Reset();"> <span class="bold">Reset</span></a>
|
||
<a class="btn btn-success Save" ID="Save" onclick="Save(0)"> <span class="bold">Save as Draft</span></a>
|
||
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)"> <span class="bold">Submit</span></a>
|
||
|
||
</div>
|
||
<br />
|
||
</div> <!-- end card body-->
|
||
</div> <!-- end card -->
|
||
</div><!-- end col-->
|
||
</div>
|
||
</div> <!-- container -->
|
||
</div> <!-- content -->
|
||
</div>
|
||
<div id="packagingcalmodel" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-lg">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Freight Calculation On</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body p-4">
|
||
<form>
|
||
|
||
<div>
|
||
<label><input type="radio" name="optPackaging" checked="checked" value='0' id="optPackaging"> Basic Amount</label>
|
||
</div>
|
||
<div>
|
||
<label><input type="radio" name="optPackaging" id="optPackaging" value='1'> After Discount Amount</label>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer" style="border:none;">
|
||
<a class="btn btn-success" data-dismiss="modal" style="margin: 10px;" value="Cancel">Cancel</a>
|
||
<a class="btn btn-success" ID="PackagingOption" onclick="calculateFreightlocaddper();"> <span class="bold">Ok</span></a>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<div id="editpackagingcalmodel" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-lg">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Freight Calculation On
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body p-4">
|
||
<form>
|
||
|
||
<div>
|
||
<label><input type="radio" name="editoptPackaging" checked="checked" value='0' id="editoptPackaging"> Basic Amount</label>
|
||
</div>
|
||
<div>
|
||
<label><input type="radio" name="editoptPackaging" id="editoptPackaging" value='1'> After Discount Amount</label>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer" style="border:none;">
|
||
<a class="btn btn-success" data-dismiss="modal" style="margin: 10px;" value="Cancel">Cancel</a>
|
||
<a class="btn btn-success" ID="editPackagingOption" onclick="calculateFreightloceditper();"> <span class="bold">Ok</span></a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<div align="center">
|
||
<div id="CAPITAL" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; overflow-y:scroll !important">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content" style="width: 1060px;">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Add Capital Purchase Order Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4 " align="left">
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<?php
|
||
$RL = array("0" => 'Select Req No');
|
||
if (!empty($RequistionDetails)) {
|
||
foreach ($RequistionDetails as $SID) :
|
||
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('Reqnumber', $RL, set_value('Reqnumber'), 'id="Reqnumber" class="form-control select2 required"');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'CapitalDepartmentName', 'value' => set_value('CapitalDepartmentName'), 'id' => 'CapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div>
|
||
<?php
|
||
|
||
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Avail Bud Amount <?php echo "($INR)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'CapitalbudAmt', 'value' => set_value('CapitalbudAmt'), 'id' => 'CapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-3"></div>
|
||
|
||
<div class="form-group col-md-3" id="hideModalExchange">
|
||
<label> Exchange Rate</label>
|
||
<?php
|
||
$data = array('name' => 'ExchangeRtModal', 'value' => set_value('ExchangeRtModal'), 'id' => 'ExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row" style="padding: 0px;">
|
||
<div class="form-group col-md-3">
|
||
<label>Item Code<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Item Code');
|
||
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode" class="form-control num select2"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'CapitalItemName', 'value' => set_value('ICapitalItemName'), 'id' => 'CapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'CPUOM', 'value' => set_value('CPUOM'), 'id' => 'CPUOM', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'CPQuantity', 'value' => set_value('CPQuantity'), 'id' => 'CPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();calculateFreight(3);calculateFreightlocaddper()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-3"></div>
|
||
|
||
<div class="form-group col-md-3" style="padding-right: 0px;">
|
||
<label id="RateIn">Rate(INR /UOM)</label><span class="text-danger">*</span>
|
||
<?php
|
||
$data = array('name' => 'CPRate', 'value' => set_value('CPRate'), 'id' => 'CPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();calculateFreight(3);calculateFreightlocaddper()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label> <?php
|
||
$data = array('name' => 'AddPer', 'value' => set_value('AddPer'), 'id' => 'AddPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label id="TotalAmount">Basic value <?php echo "($INR)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'CPTotalAmount', 'value' => set_value('CPTotalAmount'), 'id' => 'CPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<span id="CAPdiv" style="padding: 5px;">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Type </label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Discount Type');
|
||
//print_r( $options);
|
||
|
||
if (!empty($TaxType)) {
|
||
foreach ($TaxType as $SID) :
|
||
|
||
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Rate </label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtDiscount', 'value' => set_value('txtDiscount'), 'id' => 'txtDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateDiscount(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discounted Amt <?php echo "($INR)" ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtAfterDiscount', 'value' => set_value('txtAfterDiscount', 0.00), 'id' => 'txtAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Type </label>
|
||
<?php
|
||
$options = array("0" => 'Select Freight Type');
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID) :
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpFreightloc', $options, set_value('drpFreightloc'), 'id="drpFreightloc" class="form-control "');
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Rate </label>
|
||
<?php
|
||
$data = array('name' => 'txtFreightloc', 'value' => set_value('txtFreightloc'), 'id' => 'txtFreightloc', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightlocaddper();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3" >
|
||
<label>Freight Amt <?php echo "($INR)"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtAfterFreightloc', 'value' => set_value('txtAfterFreightloc'), 'id' => 'txtAfterFreightloc', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3" id="TripsValueloc" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<?php
|
||
$data = array('name' => 'NOOfTripsloc', 'value' => set_value('NOOfTripsloc'), 'id' => 'NOOfTripsloc', 'class' => 'form-control num', 'onchange' => 'calculateFreightlocaddper(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> CGST In % </label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$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>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'AfterCgst', 'value' => set_value('AfterCgst', 0), 'id' => 'AfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> SGST In %</label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$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>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst', 0), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> IGST In %</label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$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>
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst', 0), 'id' => 'AfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label>Other Allowances <?php echo "($INR)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'OtherAllowances', 'value' => set_value('OtherAllowances', 0), 'id' => 'OtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label>Total Amount <?php echo "($INR)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue', 0), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total Order Amount', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</span>
|
||
|
||
<div class="form-row" style="padding:1%;"></div>
|
||
<div class="form-row p-2" id="ModalImportTaxHide" style="border:1px solid #000;padding:0px;">
|
||
<br />
|
||
<div class="form-group col-md-6" style="padding:10px;">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Basic Price <?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4" style="display:none;">
|
||
<?php
|
||
$data = array('name' => 'BasicPriceTax', 'value' => set_value('BasicPriceTax'), 'id' => 'BasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterBasicPriceTax', 'value' => set_value('AfterBasicPriceTax'), 'id' => 'AfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Landing charge<?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'LandingCharge', 'value' => set_value('LandingCharge'), 'id' => 'LandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterLandingCharge', 'value' => set_value('AfterLandingCharge'), 'id' => 'AfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Assessable Value (A)<?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4" style="display: none;">
|
||
<?php
|
||
$data = array('name' => 'Highseas ', 'value' => set_value('Highseas'), 'id' => 'Highseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterAssessable', 'value' => set_value('AfterAssessable'), 'id' => 'AfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom duty (B)<?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'Customduty', 'value' => set_value('Customduty'), 'id' => 'Customduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterCustomduty', 'value' => set_value('AfterCustomduty'), 'id' => 'AfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom ED_cess (C) </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'CustomEDcess', 'value' => set_value('CustomEDcess'), 'id' => 'CustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterCustomEDcess', 'value' => set_value('AfterCustomEDcess'), 'id' => 'AfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom S & H cess (D) </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'CustomSHcess', 'value' => set_value('CustomSHcess'), 'id' => 'CustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterCustomSHcess', 'value' => set_value('AfterCustomSHcess'), 'id' => 'AfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6" style="padding:10px;">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Subtotal (E) <?php echo "($INR) (A+B+C+D)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div style="display: none;">
|
||
<?php
|
||
$data = array('name' => 'AdditionalExciseduty ', 'value' => set_value('AdditionalExciseduty'), 'id' => 'AdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'Subtotal', 'value' => set_value('Subtotal'), 'id' => 'Subtotal', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
|
||
<!-- Additional Excise duty : (g) -->
|
||
<label><?php echo "IGST on (F) ($INR)"; ?></label>
|
||
|
||
<!-- IGST on (E) (F)<?php echo "($INR)"; ?> -->
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
|
||
<?php
|
||
$data = array('name' => 'Igst ', 'value' => set_value('Igst', 0), 'id' => 'IgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'AfterIgstInt', 'value' => set_value('AfterIgstInt', 0), 'id' => 'AfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Total Duty (G) <?php echo "($INR) (B+C+D+F)" ?> </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<?php
|
||
$data = array('name' => 'Grossdutypayable ', 'value' => set_value('Grossdutypayable'), 'id' => 'Grossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row" style="padding:0px;">
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Freight Type </label>
|
||
<?php
|
||
$options = array("0" => 'Select Freight Type');
|
||
//print_r( $options);
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID) :
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight" class="form-control "');
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>Freight Rate </label>
|
||
<?php
|
||
$data = array('name' => 'txtFreight', 'value' => set_value('txtFreight'), 'id' => 'txtFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-4" style="padding-left: 0px;">
|
||
<label>Freight Amt <?php echo "($INR)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtAfterFreight', 'value' => set_value('txtAfterFreight'), 'id' => 'txtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3" id="TripsValue" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<?php
|
||
$data = array('name' => 'NOOfTrips', 'value' => set_value('NOOfTrips'), 'id' => 'NOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<center> <label><h4>Cost of the product Per UOM<h4></label></center>
|
||
<hr />
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label>Duty Impact</label>
|
||
<?php
|
||
$data = array('name' => 'DutyImpact', 'value' => set_value('DutyImpact'), 'id' => 'DutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-6">
|
||
<label>Quantity</label>
|
||
<?php
|
||
$data = array('name' => 'PurQuantity', 'value' => set_value('PurQuantity'), 'id' => 'PurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label> Custom Duty<?php echo " ($INR)/UOM" ?></label>
|
||
<?php
|
||
$data = array('name' => 'CustomDutyExpenses ', 'value' => set_value('CustomDutyExpenses'), 'id' => 'CustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-6">
|
||
<label> Clearing Charges <?php echo "($INR)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'ClearingCharges', 'value' => set_value('ClearingCharges'), 'id' => 'ClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-6">
|
||
<!-- RMC Including Customers -->
|
||
<label><?php echo "Nett per UOM($INR)"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'Nett', 'value' => set_value('Nett', 0), 'id' => 'Nett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</span>
|
||
|
||
|
||
<br>
|
||
|
||
<div class="form-row" >
|
||
<div class="form-group col-md-12">
|
||
<label>Capital Description </label>
|
||
<?php
|
||
$data = array('name' => 'ItemDescription', 'value' => set_value('ItemDescription'), 'id' => 'ItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||
echo form_textarea($data); ?>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
||
<a class="btn btn-success font AddCapital" ID="AddCapital"></i> <span class="bold">Add Capital</span></a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
</div>
|
||
|
||
<div align="center">
|
||
<div id="EDITCAPITAL" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content" style="width: 1060px;">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Edit Capital Purchase Order Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4" align="left">
|
||
|
||
<div class="form-row" style="padding:0px;">
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<div>
|
||
|
||
<?php
|
||
$RL = array("0" => 'Select Req No');
|
||
if (!empty($RequistionDetails)) {
|
||
foreach ($RequistionDetails as $SID) :
|
||
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
|
||
endforeach;
|
||
}
|
||
|
||
|
||
$data = array('name' => 'EditReqnumber', 'value' => set_value('EditReqnumber'), 'id' => 'EditReqnumber', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCapitalDepartmentName', 'value' => set_value('EditCapitalDepartmentName'), 'id' => 'EditCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div>
|
||
<?php
|
||
|
||
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3"> <label>Avail Bud Amount</label>
|
||
<div> <?php $data = array('name' => 'EditCapitalbudAmt', 'value' => set_value('EditCapitalbudAmt'), 'id' => 'EditCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data); ?> </div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
|
||
<div class="form-group col-md-3" id="hideModalExchangeEdit">
|
||
<label> Exchange Rate</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditExchangeRtModal', 'value' => set_value('EditExchangeRtModal'), 'id' => 'EditExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row" style="padding:0px;">
|
||
<div class="form-group col-md-3">
|
||
<label>Item Code<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Item Code');
|
||
echo form_dropdown('MaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control select2"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" style="padding-right:0px;">
|
||
<label>Item Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCapitalItemName', 'value' => set_value('EditCapitalItemName'), 'id' => 'EditCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCPUOM', 'value' => set_value('EditCPUOM'), 'id' => 'EditCPUOM', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3" style="padding-right: 0px;">
|
||
<label id="EditRateIn">Rate (In INR/UOM)</label><span class="text-danger">*</span>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCPRate', 'value' => set_value('EditCPRate'), 'id' => 'EditCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label> <?php
|
||
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label id="EditTotalAmount">Basic value <?php echo "($INR)" ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCPTotalAmount', 'value' => set_value('EditCPTotalAmount'), 'id' => 'EditCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div id="EDITCAPdiv">
|
||
|
||
<div class="form-row"> <!--<div class="form-group col-md-4">
|
||
</div>-->
|
||
<div class="form-group col-md-3">
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Type </label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Discount Type');
|
||
//print_r( $options);
|
||
|
||
if (!empty($TaxType)) {
|
||
foreach ($TaxType as $SID) :
|
||
|
||
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Rate </label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtEditDiscount', 'value' => set_value('txtEditDiscount'), 'id' => 'txtEditDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateDiscount(1);', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discounted Amt <?php echo "($INR)" ?> </label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtEditAfterDiscount', 'value' => set_value('txtEditAfterDiscount'), 'id' => 'txtEditAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-3" ></div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Type </label>
|
||
<?php
|
||
$options = array("0" => 'Select Freight Type');
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID) :
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpFreighteditloc', $options, set_value('drpFreighteditloc'), 'id="drpFreighteditloc" class="form-control "');
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Rate </label>
|
||
<?php
|
||
$data = array('name' => 'txtFreightlocedit', 'value' => set_value('txtFreightlocedit'), 'id' => 'txtFreightlocedit', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightloceditper();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3" style="padding-left: -2px;">
|
||
<label>Freight Amt <?php echo "($INR)"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtAfterFreightlocedit', 'value' => set_value('txtAfterFreightlocedit'), 'id' => 'txtAfterFreightlocedit', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3" id="TripsValuelocedit" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<?php
|
||
$data = array('name' => 'NOOfTripslocedit', 'value' => set_value('NOOfTripslocedit'), 'id' => 'NOOfTripslocedit', 'class' => 'form-control num', 'onchange' => 'calculateFreightlocaddper(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> CGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$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>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterCgst', 'value' => set_value('EditAfterCgst'), 'id' => 'EditAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> SGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$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>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterSgst', 'value' => set_value('EditAfterSgst'), 'id' => 'EditAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> IGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$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>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst'), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="col-md-9 col-md-offset-4" align="right">
|
||
<label>Other Allowances <?php echo "($INR)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditOtherAllowances', 'value' => set_value('EditOtherAllowances'), 'id' => 'EditOtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-9 col-md-offset-4" align="right">
|
||
<label>Total Amount <?php echo "($INR)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EdittxtTotalOrderValue', 'value' => set_value('EdittxtTotalOrderValue'), 'id' => 'EdittxtTotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total Order Amount', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row" style="padding:1%;"></div>
|
||
<div class="form-row p-2" style="padding:0px;border:1px solid" id="EditModalImportTaxHide">
|
||
<br />
|
||
<div class="form-group col-md-6" style="padding:10px;text-align:left;">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Basic Price <?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4" style="display:none;">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditBasicPriceTax', 'value' => set_value('EditBasicPriceTax'), 'id' => 'EditBasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterBasicPriceTax', 'value' => set_value('EditAfterBasicPriceTax'), 'id' => 'EditAfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Landing charge <?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterLandingCharge', 'value' => set_value('EditAfterLandingCharge'), 'id' => 'EditAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Assessable Value (A)<?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div class="form-group" style="display: none">
|
||
<?php
|
||
$data = array('name' => 'EditHighseas ', 'value' => set_value('EditHighseas'), 'id' => 'EditHighseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterAssessable', 'value' => set_value('EditAfterAssessable'), 'id' => 'EditAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom duty (B)<?php echo "($INR)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCustomduty', 'value' => set_value('EditCustomduty'), 'id' => 'EditCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterCustomduty', 'value' => set_value('EditAfterCustomduty'), 'id' => 'EditAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom ED_cess (C) </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCustomEDcess', 'value' => set_value('EditCustomEDcess'), 'id' => 'EditCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterCustomEDcess', 'value' => set_value('EditAfterCustomEDcess'), 'id' => 'EditAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Custom S & H cess (D) </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCustomSHcess', 'value' => set_value('EditCustomSHcess'), 'id' => 'EditCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterCustomSHcess', 'value' => set_value('EditAfterCustomSHcess'), 'id' => 'EditAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6" style="padding:10px;">
|
||
<div class="form-row" style="text-align:left;">
|
||
<div class="form-group col-md-4">
|
||
<label> Subtotal (E) <?php echo "($INR) (A+B+C+D)" ?></label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div class="form-group" style="display: none;">
|
||
<?php
|
||
$data = array('name' => 'EditAdditionalExciseduty ', 'value' => set_value('EditAdditionalExciseduty'), 'id' => 'EditAdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditSubtotal', 'value' => set_value('EditSubtotal'), 'id' => 'EditSubtotal', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-row" style="text-align:left;">
|
||
<div class="form-group col-md-4">
|
||
<!-- Additional Excise duty : (g) -->
|
||
<label><?php echo "IGST on (E): (F) ($INR)"; ?></label>
|
||
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditIgstInt ', 'value' => set_value('EditIgstInt', 0), 'id' => 'EditIgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateIgst()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAfterIgstInt', 'value' => set_value('EditAfterIgstInt', 0), 'id' => 'EditAfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" style="text-align:left;">
|
||
<div class="form-group col-md-8">
|
||
<label> Total Duty (G)<?php echo "($INR) (B+C+D+F)" ?> </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditGrossdutypayable ', 'value' => set_value('EditGrossdutypayable'), 'id' => 'EditGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<!--Start of Adding of Frieght model-->
|
||
<div class="form-row" style="padding:0px;">
|
||
|
||
<div class="form-group col-md-4">
|
||
<span>Freight Type </span>
|
||
<?php
|
||
$options = array("0" => 'Select Freight Type');
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID) :
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight" class="form-control"');
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<span>Freight Rate </span>
|
||
<?php
|
||
$data = array('name' => 'txtEditFreight', 'value' => set_value('txtEditFreight'), 'id' => 'txtEditFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(1);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4" style="padding-left: 0px;">
|
||
<span>Freight Amt <?php echo "($INR)" ?></span>
|
||
<?php
|
||
$data = array('name' => 'txtEditAfterFreight', 'value' => set_value('txtEditAfterFreight'), 'id' => 'txtEditAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<!--End of Adding of freight in edit model -->
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3" id="EditTripsValue" style="display:none;">
|
||
<span>NO Of Trips</span>
|
||
<?php
|
||
$data = array('name' => 'EditNOOfTrips', 'value' => set_value('EditNOOfTrips'), 'id' => 'EditNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(1);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<center> <label>Cost of the product Per UOM</label></center>
|
||
<hr />
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label> Duty Impact </label>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditDutyImpact', 'value' => set_value('EditDutyImpact'), 'id' => 'EditDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-4" style="margin-top: -3.1%">
|
||
<label>Quantity</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditPurQuantity', 'value' => set_value('EditPurQuantity'), 'id' => 'EditPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-4">
|
||
<label>
|
||
Custom Duty <?php echo "($INR)/UOM" ?>
|
||
</label>
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
</div>
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-4">
|
||
<label>
|
||
Clearing Charges<?php echo "($INR)" ?>
|
||
</label>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-md-4">
|
||
<!-- RMC Including Customers -->
|
||
<label><?php echo "Nett per UOM($INR)"; ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditNett', 'value' => set_value('EditNett'), 'id' => 'EditNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row" >
|
||
<div class="form-group col-md-12">
|
||
<label>Capital Description </label>
|
||
|
||
|
||
<?php
|
||
$data = array('name' => 'EditItemDescription', 'value' => set_value('EditItemDescription'), 'id' => 'EditItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||
echo form_textarea($data); ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-success" data-dismiss="modal" value="Cancel" style="margin: 10px;">Cancel</a>
|
||
<a class="btn btn-success font EditCapital" ID="UpdateCapital"> <span class="bold">Update Capital</span></a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
</div>
|
||
|
||
|
||
<div class="modal fade" id="DomesticNOT" role="dialog">
|
||
<div class="modal-dialog">
|
||
<!-- Modal content-->
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<center>
|
||
<h4>Do You want to create Capital PO for International?</h4>
|
||
</center>
|
||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="row text-center">
|
||
<div class="form-group col-md-3">
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div class="form-check form-check-inline">
|
||
<input class="form-check-input" type="radio" name="optcapital" id="optcapital" checked="checked" value="0">
|
||
<label class="form-check-label" for="optcapitalYes">YES</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div class="form-check form-check-inline">
|
||
<input class="form-check-input" type="radio" name="optcapital" id="optcapital" value="1" checked>
|
||
<label class="form-check-label" for="optcapitalNo">NO</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<div class="col-md-12 text-center">
|
||
<a class="btn btn-dark waves-effect waves-light" data-dismiss="modal" style="background-color: gray;border-color: gray;margin-right: 10px;">Cancel</a>
|
||
<input type="button" class="btn btn-success" id="CapitalForCheck" onclick="SetCapitalPo();" value="OK" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- <script type="text/html" id="CapitalList">
|
||
<tr id="<%=index%>">
|
||
<td align="left"><%=index%></td>
|
||
<td align="left"><%=ReqNo%></td>
|
||
<td align="left"><%=MaterialCode%></td>
|
||
<td align="left"><%=MaterialName%></td>
|
||
<td align="left"><%=Quantity%></td>
|
||
<td align="left"><%=UOM%></td>
|
||
<td align="left"><%=Rate%></td>
|
||
<td align="left"><%=BasicAmount%></td>
|
||
<td align="left"><%=Taxvalue%></td>
|
||
<td align="left"><%=TotalValue%></td>
|
||
|
||
<td>
|
||
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||
|
||
|
||
</td>
|
||
</tr>
|
||
</script> -->
|
||
<script>
|
||
var tempUserId = 0;
|
||
var RequistQuantity = '';
|
||
var AvilBudAmt = '';
|
||
var POMaxDate = '<?php echo $MaxPoDate; ?>';
|
||
var d = new Date(POMaxDate);
|
||
var SelectedMaterialCode = [];
|
||
var CollIndex = 0;
|
||
var SelectedMaterialList = {
|
||
Mat: []
|
||
};
|
||
|
||
|
||
|
||
$("#BudgetType").change(function() {
|
||
|
||
var aa = $("#BudgetType option:selected").text();
|
||
|
||
$('#Budget').val(aa);
|
||
|
||
|
||
});
|
||
|
||
|
||
$(function() {
|
||
|
||
$("#PODate").datepicker({
|
||
format: 'dd-mm-yyyy',
|
||
startDate: new Date(),
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
clearBtn: true
|
||
});
|
||
$("#Deliverydate").datepicker({
|
||
format: 'dd-mm-yyyy',
|
||
startDate: new Date(),
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
clearBtn: true
|
||
});
|
||
|
||
|
||
var a = parseFloat($('#optcapital').val());
|
||
// console.log(a);
|
||
|
||
// if(a==0)
|
||
// {
|
||
// $('#CAPdiv').hide();
|
||
|
||
// }
|
||
|
||
|
||
$('#PoTypeOptions').change(function() {
|
||
|
||
var potypeval = $('#PoTypeOptions').val();
|
||
var poopt = <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>;
|
||
var config = poopt[0].ConfigValue;
|
||
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||
var default1 = Payment[4].PaymentTerms;
|
||
|
||
|
||
if (potypeval == config) {
|
||
$('#PaymentMethod').empty();
|
||
$.each(Payment, function(idx, obj) {
|
||
if (obj.PaymentID == 'PT05') {
|
||
// console.log(obj.PaymentID);
|
||
// console.log(obj.PaymentTerms)
|
||
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
||
|
||
}
|
||
|
||
});
|
||
|
||
|
||
|
||
$.each(Payment, function(idx, obj) {
|
||
if (obj.PaymentID == 'PT05') {
|
||
|
||
|
||
|
||
} else {
|
||
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
||
}
|
||
|
||
});
|
||
|
||
}
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
$('#drpSupplier').change(function() {
|
||
|
||
var supPaymentTerms = '';
|
||
|
||
var id = $('#drpSupplier').val();
|
||
|
||
$("#SupAddress").val('');
|
||
|
||
if (id != '0') {
|
||
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
||
|
||
|
||
$.each(y, function(idx, obj) {
|
||
if (obj.SupplierID === id) {
|
||
|
||
if (obj.MSME) {
|
||
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
|
||
} else {
|
||
$("#SupAddress").val(obj.Address);
|
||
}
|
||
supPaymentTerms = obj.PaymentID;
|
||
|
||
//$("#PaymentMethod").val(obj.PaymentID);
|
||
|
||
|
||
|
||
}
|
||
|
||
});
|
||
|
||
if (supPaymentTerms != 'PT08') {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
} else if (supPaymentTerms == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
}
|
||
$('#PaymentMethod').empty();
|
||
var paymentList = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||
|
||
$.each(paymentList, function(idx1, obj1) {
|
||
|
||
|
||
if (obj1.PaymentID == supPaymentTerms) {
|
||
$("#PaymentMethod").append($('<option></option>').val(obj1.PaymentID).html(obj1.PaymentTerms));
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
$.each(paymentList, function(idx, obj) {
|
||
|
||
|
||
if (obj.PaymentID != supPaymentTerms) {
|
||
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
||
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} else {
|
||
alert('Please select the SupplierID');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
$('#Reqnumber').change(function() {
|
||
var ExchangeRate = '';
|
||
var ExchangeRate = $('#ExchangeRt').val();
|
||
var id = $('#Reqnumber').val();
|
||
|
||
$("#CapitalbudAmt").val('');
|
||
$("#ExchangeRtModal").val(parseFloat(ExchangeRate).toFixed(2));
|
||
|
||
$("#MaterialCode").empty();
|
||
$("#CapitalDepartmentName").val('');
|
||
$("#CPUOM").val('');
|
||
$("#CPQuantity").val('');
|
||
$("#CapitalItemName").val('');
|
||
$("#CPTotalAmount").val('');
|
||
$("#txtBasicValue").val('');
|
||
$("#CostCenter").val('');
|
||
clearTaxField();
|
||
if (id != '0') {
|
||
|
||
var y = <?php echo json_encode($RequistionDetails, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
// For Binding DepartmentName
|
||
$.each(y, function(idx, obj) {
|
||
if (obj.ReqNo === id) {
|
||
$("#CapitalDepartmentName").val(obj.DepartmentName);
|
||
$("#CostCenter").val(obj.CostCenterCode);
|
||
|
||
}
|
||
});
|
||
$("#CapitalbudAmt").val(parseFloat(AvlBudAmt).toFixed(2));
|
||
|
||
|
||
// For Binding Material list center for the selected Requistion Number
|
||
$("#MaterialCode").append($('<option></option>').val("0").html("Select Material Code"));
|
||
var isAdded = "0";
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
|
||
if (obj.ReqNo === id) {
|
||
|
||
$.each(SelectedMaterialList.Mat, function(idx1, el) {
|
||
if (id == el.ReqNo) {
|
||
|
||
if (el.materialCode == obj.MaterialCode) {
|
||
isAdded = "1";
|
||
return false;
|
||
} else {
|
||
isAdded = "0";
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
|
||
if (isAdded == "0") {
|
||
|
||
$("#MaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
}
|
||
} else {
|
||
alert('Please select the Requisition Number');
|
||
return false;
|
||
}
|
||
id = '';
|
||
|
||
});
|
||
$('#MaterialCode').change(function() {
|
||
|
||
var id = $('#MaterialCode').val();
|
||
$("#CapitalItemName").val('');
|
||
$("#CPUOM").val('');
|
||
$("#CPQuantity").val('');
|
||
$("#CPTotalAmount").val('');
|
||
RequistQuantity = '';
|
||
clearTaxField();
|
||
if (id != '0') {
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
if (obj.MaterialCode === id) {
|
||
$("#CapitalItemName").val(obj.MaterialName);
|
||
$("#CPUOM").val(obj.UOM);
|
||
var CPUOMDisplay = obj.UOM;
|
||
$("#CPQuantity").val(obj.Quantity);
|
||
RequistQuantity = obj.Quantity;
|
||
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
|
||
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)');
|
||
|
||
|
||
}
|
||
});
|
||
}
|
||
var d = $('#drpSupplier').val();
|
||
$('#loader').show();
|
||
$.ajax({
|
||
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
||
type: 'POST',
|
||
data: {
|
||
supplierid: d,
|
||
materialcode: id
|
||
},
|
||
success: function(response) {
|
||
$('#loader').hide();
|
||
if (response) alert(response);
|
||
}
|
||
});
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
|
||
$('#EditMaterialCode').change(function() {
|
||
|
||
|
||
var id = $('#EditMaterialCode').val();
|
||
$("#EditItemName").val('');
|
||
$("#EditUOM").val('');
|
||
$("#EditQuantity").val('');
|
||
$("#EditRate").val('');
|
||
$("#txtEditBasicValue").val('');
|
||
RequistQuantity = '';
|
||
clearEditTaxField();
|
||
if (id != '0') {
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
if (obj.MaterialCode === id) {
|
||
$("#EditItemName").val(obj.MaterialName);
|
||
$("#EditUOM").val(obj.UOM);
|
||
var EDITUOMDisplay = obj.UOM;
|
||
$("#EditQuantity").val(obj.Quantity);
|
||
RequistQuantity = obj.Quantity;
|
||
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EDITUOMDisplay + ')');
|
||
$('#CPTotalAmount').html('Basic value in' + " " + obj.FontCode2000);
|
||
|
||
}
|
||
});
|
||
}
|
||
var d = $('#drpSupplier').val();
|
||
$('#loader').show();
|
||
$.ajax({
|
||
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
||
type: 'POST',
|
||
data: {
|
||
supplierid: d,
|
||
materialcode: id
|
||
},
|
||
success: function(response) {
|
||
$('#loader').hide();
|
||
if (response) alert(response);
|
||
}
|
||
});
|
||
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
function clearTaxField() {
|
||
$('#CPTotalAmount').val('');
|
||
$('#AfterServiceTax').val('');
|
||
$('#AfterEduCess').val('');
|
||
$('#AfterSecHighTax').val('');
|
||
$('#AfterKrishiTax').val('');
|
||
$('#AfterSwachhTax').val('');
|
||
$('#BasicPriceTax ').val('');
|
||
$('#AfterBasicPriceTax').val('');
|
||
|
||
$("#LandingCharge").val('');
|
||
$("#AfterLandingCharge").val('');
|
||
$("#Highseas").val('');
|
||
$("#AfterHighseas").val('');
|
||
$("#Customduty").val('');
|
||
$("#AfterCustomduty").val('');
|
||
$("#ExcisedutyTax").val('');
|
||
$("#AfterExcisedutyTax").val('');
|
||
$("#ExcisedutyEDcess").val('');
|
||
$("#AfterExcisedutyEDcess").val('');
|
||
$("#ExcisedutySHcess").val('');
|
||
$("#AfterExcisedutySHcess").val('');
|
||
$("#CustomEDcess").val('');
|
||
$("#AfterCustomEDcess").val('');
|
||
$("#CustomSHcess").val('');
|
||
$("#AfterCustomSHcess").val('');
|
||
$("#AdditionalExciseduty").val('');
|
||
$("#AfterAdditionalExciseduty").val('');
|
||
$("#Grossdutypayable").val('');
|
||
$("#AvailableModvat").val('');
|
||
$("#Grossexpenses").val('');
|
||
$("#purchaserate").val('');
|
||
$("#CustomDutyExpenses").val('');
|
||
$("#RMCIncludingCustomers").val('');
|
||
$("#PurQuantity").val('');
|
||
|
||
RequistQuantity = '';
|
||
|
||
}
|
||
|
||
function ChangeSgst() {
|
||
$('#Sgst').val($('#Cgst').val());
|
||
Ratechange();
|
||
}
|
||
|
||
function ChangeEditSgst() {
|
||
$('#EditSgst').val($('#EditCgst').val());
|
||
EditRatechange();
|
||
}
|
||
/*
|
||
|
||
This function is used to validate all field
|
||
|
||
*/
|
||
function Ratechange() {
|
||
//alert();
|
||
|
||
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 = '';
|
||
var BasicInINR = '';
|
||
var RatePerTon = parseFloat($('#CPRate').val());
|
||
//var txtUnitPrice = parseFloat($('#Rate').val());
|
||
if (capitalType == 'International')
|
||
|
||
{
|
||
txtExchangeRate = parseFloat($('#ExchangeRtModal').val());
|
||
var Tot = txtQuantity * RatePerTon;
|
||
BasicInINR = Tot * txtExchangeRate;
|
||
|
||
|
||
|
||
} else
|
||
|
||
|
||
{
|
||
var Tot = txtQuantity * RatePerTon;
|
||
if ($('#txtDiscount').val() != '' && $('#txtDiscount').val() != '0') {
|
||
$('#txtAfterDiscount').val(updateDiscountValuesChange(parseFloat(Tot).toFixed(2), $("#DiscountType").val(), $('#txtDiscount').val()));
|
||
}
|
||
|
||
|
||
var discountedValue = parseFloat($('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val()).toFixed(2);
|
||
|
||
|
||
|
||
var Freight = parseFloat($('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val()).toFixed(2);
|
||
|
||
txtExchangeRate = 1;
|
||
BasicInINR = (Tot * txtExchangeRate - discountedValue);
|
||
}
|
||
|
||
var CPtotal = parseFloat(BasicInINR) + parseFloat(Freight);
|
||
|
||
//console.log(CPtotal);
|
||
|
||
|
||
$('#CPTotalAmount').val(parseFloat(Tot).toFixed(2));
|
||
$('#AfterBasicPriceTax').val(parseFloat(BasicInINR).toFixed(2));
|
||
// var a=$('#AfterBasicPriceTax').val();
|
||
// console.log(a);
|
||
|
||
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
|
||
|
||
if (ExceedBudget($('#CPTotalAmount').val(), $('#CapitalbudAmt').val())) {
|
||
//Service Tax calculation
|
||
|
||
$('#AfterCgst').val(calculateCgstTax(CPtotal, $("#Cgst").val() == '' ? "0.00" : $('#Cgst').val()));
|
||
$('#AfterSgst').val(calculateSgstTax(CPtotal, $("#Sgst").val() == '' ? "0.00" : $('#Sgst').val()));
|
||
$('#AfterIgst').val(calculateIgstTax(CPtotal, $("#Igst").val() == '' ? "0.00" : $('#Igst').val()));
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!='')
|
||
// {
|
||
// $('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val()==''?"0.00":$('#LandingCharge').val(),$('#AfterBasicPriceTax').val()==''?"0.00":$('#AfterBasicPriceTax').val()));
|
||
// }
|
||
|
||
// if($('#Customduty').val()!='' && $('#AfterAssessable').val()!='')
|
||
|
||
// {
|
||
// $('#AfterCustomduty').val(calculateCustomdutyCharge($('#AfterLandingCharge').val()==''?"0.00":$('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#Customduty').val()==''?"0.00":$('#Customduty').val()));
|
||
|
||
// }
|
||
|
||
|
||
// if($('#AfterCustomduty').val()!='' && $('#CustomEDcess').val()!='')
|
||
|
||
// {
|
||
// $('#AfterCustomEDcess').val(calculateCustomEDcessCharge($('#AfterCustomduty').val()==''?"0.00":$('#AfterCustomduty').val(),$('#CustomEDcess').val()==''?"0.00":$('#CustomEDcess').val()));
|
||
|
||
// }
|
||
|
||
|
||
|
||
// if($('#AfterCustomduty').val()!='' && $('#CustomSHcess').val()!='')
|
||
// {
|
||
// $('#AfterCustomSHcess').val(calculateCustomSHcessCharge($('#AfterCustomduty').val(),$('#CustomSHcess').val()));
|
||
|
||
// }
|
||
|
||
|
||
|
||
// if($('#Subtotal').val()!='' && $('#IgstInt').val()!='')
|
||
// {
|
||
// $('#AfterIgstInt').val(CalculateIgst($('#Subtotal').val(),$('#IgstInt').val()));
|
||
|
||
// }
|
||
|
||
|
||
//$('#DutyImpact').val(CalculateCtable());
|
||
Calculateloadingcharge();
|
||
|
||
|
||
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.');
|
||
|
||
$('#CPQuantity').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
/*
|
||
This function is used to calculate tax
|
||
*/
|
||
function calculateServiceTax(varBasicValue) {
|
||
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SERVICETAX_14PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateEduess(varAfterServiceTax) {
|
||
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_EDUCESS_2PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterEduCess').val(TAXval);
|
||
}
|
||
|
||
function calculateHigherEdu(varAfterServiceTax) {
|
||
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_HIGHEREDUCESS_1PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterSecHighTax').val(TAXval);
|
||
}
|
||
|
||
function calculateKrishiKalyantax(varBasicValue) {
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_KRISHIKALYAN; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterKrishiTax').val(TAXval);
|
||
}
|
||
|
||
function calculateSwachhBharattax(varBasicValue) {
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SWACHHBHARAT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterSwachhTax').val(TAXval);
|
||
}
|
||
|
||
/*
|
||
Calculate Landing charge
|
||
*/
|
||
|
||
function calculateLandingCharge(landingCharge, basicValue) {
|
||
var landCharge = landingCharge;
|
||
var basicPrice = parseFloat(basicValue);
|
||
afterLandingCharge = <?php echo Capital_Landing_Charge; ?>;
|
||
var Assessable = parseFloat(afterLandingCharge) + parseFloat(basicPrice);
|
||
// console.log(Assessable);
|
||
|
||
$('#AfterAssessable').val(Assessable.toFixed(2));
|
||
|
||
|
||
|
||
return parseFloat(afterLandingCharge).toFixed(2);
|
||
|
||
|
||
}
|
||
/*Calculate Highseas Charge*/
|
||
|
||
/*Calculate calculate Customduty Charge */
|
||
function calculateCustomdutyCharge(AfterLanding, basicPrices, afterHighseass, Customduty) { //salert();
|
||
|
||
var Customduty = Customduty;
|
||
// console.log(Customduty);
|
||
var accessible = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val());
|
||
|
||
afterCustomdutyCharge = <?php echo Capital_Customduty_Charge1; ?>;
|
||
|
||
return parseFloat(afterCustomdutyCharge).toFixed(2);
|
||
|
||
}
|
||
|
||
/*
|
||
calculate Excise Charge
|
||
*/
|
||
|
||
/* calculateExciseEDcessCharge*/
|
||
|
||
|
||
/* calculate Excise duty S & H cess :(d) */
|
||
|
||
/*
|
||
calculate CustomEDcess Charge
|
||
*/
|
||
function calculateCustomEDcessCharge(AfterCustomduty, CustomEDcess) { //alert();
|
||
|
||
var AfterCustomduty = parseFloat(AfterCustomduty);
|
||
var CustomEDcess = CustomEDcess;
|
||
afterCustomEDcessCharge = <?php echo Capital_CustomEDcess_Charge1; ?>;
|
||
|
||
return parseFloat(afterCustomEDcessCharge).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculate custom S & H cess
|
||
*/
|
||
function calculateCustomSHcessCharge(AfterCustomduty, CustomSHcess) {
|
||
|
||
var AfterCustomduty = parseFloat(AfterCustomduty);
|
||
|
||
var CustomSHcess = CustomSHcess;
|
||
|
||
|
||
afterCustomCustomSHcessCharge = <?php echo Capital_CustomSHcess_Charge1; ?>;
|
||
|
||
var assessble = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val());
|
||
var custom = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
|
||
var customsh = parseFloat(afterCustomCustomSHcessCharge);
|
||
var customed = parseFloat($('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val());
|
||
var tot = <?php echo SUBTOTAL; ?>;
|
||
|
||
|
||
if (isNaN(tot)) {
|
||
$('#Subtotal').val('');
|
||
} else {
|
||
$('#Subtotal').val(parseFloat(tot).toFixed(2));
|
||
}
|
||
|
||
return parseFloat(afterCustomCustomSHcessCharge).toFixed(2);
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
function CalculateIgst(Subtotal, Igst) {
|
||
var tot = parseFloat(Subtotal);
|
||
var igstpercentage = parseFloat(Igst);
|
||
var AfterIgst1 = <?php echo IGST; ?>;
|
||
|
||
var custom = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
|
||
var customsh = parseFloat($('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val());
|
||
var customed = parseFloat($('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val());
|
||
var afterigst = parseFloat(AfterIgst1);
|
||
var txtgrossduty = <?php echo GROSS_DUTY1; ?>;
|
||
|
||
if (isNaN(txtgrossduty)) {
|
||
$('#Grossdutypayable').val('');
|
||
} else {
|
||
$('#Grossdutypayable').val(parseFloat(txtgrossduty).toFixed(2));
|
||
}
|
||
//CalculateCtable();
|
||
|
||
|
||
var grossduty = parseFloat(txtgrossduty);
|
||
|
||
var total = parseFloat(grossduty) - parseFloat(afterigst);
|
||
|
||
//console.log(total);
|
||
|
||
$('#DutyImpact').val(parseFloat(total).toFixed(2));
|
||
|
||
|
||
CalculateCtable()
|
||
|
||
return parseFloat(AfterIgst1).toFixed(2);
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
/*
|
||
calculate Additional ExciseDuty Charge
|
||
*/
|
||
function calculateAdditionalExciseDutyCharge(basicPrices, AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterCustomEDcess, AfterCustomSHcess, AdditionalExciseduty) {
|
||
var basicPrices = parseFloat(basicPrices);
|
||
var afterLandingCharge = parseFloat(AfterLanding);
|
||
var AfterHighseas = parseFloat(AfterHighseas);
|
||
var AfterCustomduty = parseFloat(AfterCustomduty);
|
||
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
|
||
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
|
||
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
|
||
|
||
var AfterCustomEDcess = parseFloat(AfterCustomEDcess);
|
||
var AfterCustomSHcess = parseFloat(AfterCustomSHcess);
|
||
var AdditionalExciseduty = AdditionalExciseduty;
|
||
|
||
|
||
afterAdditionalExcisedutyCharge = <?php echo Capital_AdditionalExciseduty_Charge; ?>;
|
||
|
||
return parseFloat(afterAdditionalExcisedutyCharge).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculate Additional Grossdutypayable Charge
|
||
*/
|
||
function calculateGrossdutypayableCharge(AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterCustomEDcess, AfterCustomSHcess, AfterAdditionalExciseduty) {
|
||
var AfterAdditionalExciseduty = parseFloat(AfterAdditionalExciseduty);
|
||
var afterLandingCharge = parseFloat(AfterLanding);
|
||
var AfterHighseas = parseFloat(AfterHighseas);
|
||
var AfterCustomduty = parseFloat(AfterCustomduty);
|
||
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
|
||
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
|
||
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
|
||
|
||
var AfterCustomEDcess = parseFloat(AfterCustomEDcess);
|
||
var AfterCustomSHcess = parseFloat(AfterCustomSHcess);
|
||
|
||
|
||
GrossdutypayableCharge = <?php echo Capital_Grossdutypayable_Charge; ?>;
|
||
|
||
return parseFloat(GrossdutypayableCharge).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculate ModvatCharge Charge
|
||
*/
|
||
function calculateAvailableModvatCharge(AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterAdditionalExciseduty) {
|
||
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
|
||
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
|
||
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
|
||
var AfterAdditionalExciseduty = parseFloat(AfterAdditionalExciseduty);
|
||
|
||
|
||
|
||
ModvatCharge = <?php echo Capital_ModvatCharge_Charge; ?>;
|
||
|
||
return parseFloat(ModvatCharge).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculate Grossexpenses Charge
|
||
*/
|
||
function calculateGrossexpensesCharge(Grossdutypayable, AvailableModvat) {
|
||
var Grossdutypayable = parseFloat(Grossdutypayable);
|
||
var AvailableModvat = parseFloat(AvailableModvat);
|
||
|
||
|
||
|
||
|
||
Grossexpenses = <?php echo Capital_Grossexpenses_Charge; ?>;
|
||
|
||
return parseFloat(Grossexpenses).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculate purchaserate
|
||
*/
|
||
function calculatepurchaserate(AfterBasicPriceTax, PurQuantity) {
|
||
var AfterBasicPriceTax = parseFloat(AfterBasicPriceTax);
|
||
var PurQuantity = parseFloat(PurQuantity);
|
||
|
||
|
||
|
||
|
||
purchaserate = <?php echo Capital_purchaserate_Charge; ?>;
|
||
|
||
return parseFloat(purchaserate).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculateCustomDutyExpenses
|
||
*/
|
||
function calculateCustomDutyExpenses(Grossexpenses, PurQuantity) {
|
||
var Grossexpenses = parseFloat(Grossexpenses);
|
||
var PurQuantity = parseFloat(PurQuantity);
|
||
|
||
|
||
|
||
|
||
CustomDutyExpenses = <?php echo Capital_CustomDutyExpenses_Charge; ?>;
|
||
|
||
return parseFloat(CustomDutyExpenses).toFixed(2);
|
||
|
||
}
|
||
/*
|
||
calculateRMCIncludingCustomers
|
||
*/
|
||
function calculateRMCIncludingCustomers(purchaserate, CustomDutyExpenses) {
|
||
var purchaserate = parseFloat(purchaserate);
|
||
var CustomDutyExpenses = parseFloat(CustomDutyExpenses);
|
||
|
||
|
||
|
||
|
||
RMCIncludingCustomers = <?php echo Capital_RMCIncludingCustomers_Charge; ?>;
|
||
|
||
return parseFloat(RMCIncludingCustomers).toFixed(2);
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
/*
|
||
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
|
||
*/
|
||
function ExceedBudget(ValuetoCheck, budgetAmount) {
|
||
var ReqAmount = parseFloat(ValuetoCheck);
|
||
var BudAmount = parseFloat(budgetAmount);
|
||
|
||
// if(ReqAmount > BudAmount )
|
||
// {
|
||
// alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.');
|
||
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
}
|
||
var index = 1;
|
||
/* This is used add capital po line item */
|
||
$('.AddCapital').click(function() {
|
||
|
||
tinyMCE.triggerSave();
|
||
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 addPer = '';
|
||
if ($("#AddPer").val().trim() == '') {
|
||
addPer = $("#CPUOM").val();
|
||
} else {
|
||
addPer = $("#AddPer").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 OtherAmt = parseFloat($("#OtherAllowances").val() == '' ? "0.00" : $('#OtherAllowances').val()).toFixed(2);
|
||
var Cgst = $("#Cgst").val();
|
||
var AfterCgst = $("#AfterCgst").val();
|
||
var Sgst = $("#Sgst").val();
|
||
var AfterSgst = $("#AfterSgst").val();
|
||
var Igst = $("#Igst").val();
|
||
var AfterIgst = $("#AfterIgst").val();
|
||
|
||
var DisType = $("#DiscountType").val();
|
||
var DisVal = $("#txtDiscount").val();
|
||
var AfterDisVal = parseFloat($("#txtAfterDiscount").val() == '' ? "0.00" : $('#txtAfterDiscount').val()).toFixed(2);
|
||
|
||
|
||
|
||
|
||
var landingCharge = $('#AfterLandingCharge').val();
|
||
|
||
var CustomDuty = $('#AfterCustomduty').val();
|
||
|
||
var CustomEDCess = $('#AfterCustomEDcess').val();
|
||
|
||
var CustomSHCess = $('#AfterCustomSHcess').val();
|
||
|
||
var GrossDutyPayable = $('#Grossdutypayable').val();
|
||
|
||
var PurQuantity = $('#PurQuantity').val();
|
||
|
||
var CustomDutyExpenses = $('#CustomDutyExpenses').val();
|
||
|
||
var Accessible = $('#AfterAssessable').val();
|
||
|
||
var Subtotal = $('#Subtotal').val();
|
||
|
||
// var AfterIgst = $('#AfterIgstInt').val();
|
||
var Dutyimpact = $('#DutyImpact').val();
|
||
var ClearingCharges = $('#ClearingCharges').val();
|
||
var Nett = $('#Nett').val();
|
||
|
||
/*get % values */
|
||
var beforeLanding = $('#LandingCharge').val();
|
||
|
||
var beforeCustomDuty = $('#Customduty').val();
|
||
|
||
var beforeCustomEDCess = $('#CustomEDcess').val();
|
||
var beforeCustomSHCess = $('#CustomSHcess').val();
|
||
// var Igst = $('#IgstInt').val();
|
||
var PurQuantity = $('#PurQuantity').val();
|
||
|
||
var FreightType = $("#drpFreight").val();
|
||
var FreightVal = $("#txtFreight").val();
|
||
var AfterFreightVal = $("#txtAfterFreight").val();
|
||
var NoOfTrip = $("#NOOfTrips").val();
|
||
|
||
|
||
var FreightTypeloc = $('#drpFreightloc').val();
|
||
var Nooftriploc = $('#NOOfTripsloc').val();
|
||
|
||
|
||
var Freightrateloc = $('#txtFreightloc').val();
|
||
var AfterFreightAmountloc = $('#txtAfterFreightloc').val();
|
||
|
||
|
||
|
||
// console.log(FreightTypeloc);
|
||
// console.log(Nooftriploc);
|
||
// console.log(Freightrateloc);
|
||
// console.log(AfterFreightAmountloc);
|
||
|
||
|
||
var Total = (parseFloat(basicval) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) - parseFloat(AfterDisVal) + parseFloat(AfterFreightAmountloc)).toFixed(2);
|
||
|
||
|
||
var TotalOrderValuePerkg = $("#txtTotalOrderValue").val();
|
||
|
||
var TotalTaxValue = calculateTaxValue();
|
||
var basicvalInINR = $('#AfterBasicPriceTax').val();
|
||
var CapitalDescription = $('#ItemDescription').val();
|
||
|
||
|
||
if (capitalType == 'International') {
|
||
|
||
TotalTaxValue = 0.00;
|
||
Total = parseFloat(basicval);
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
$('#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,
|
||
// MaterialCode: materialCode,
|
||
// MaterialName: materialName,
|
||
// Quantity: quantity,
|
||
// UOM: uom,
|
||
// Rate: itemRate,
|
||
// BasicAmount: basicval,
|
||
// Taxvalue: TotalTaxValue,
|
||
// TotalValue: Total
|
||
// }));
|
||
|
||
var rowHtml = `
|
||
<tr id="${temp}">
|
||
<td align="left">${temp}</td>
|
||
<td align="left">${Reqnumber}</td>
|
||
<td align="left">${materialCode}</td>
|
||
<td align="left">${materialName}</td>
|
||
<td align="left">${quantity}</td>
|
||
<td align="left">${uom}</td>
|
||
<td align="left">${itemRate}</td>
|
||
<td align="left">${basicval}</td>
|
||
<td align="left">${TotalTaxValue}</td>
|
||
<td align="left">${Total}</td>
|
||
<td>
|
||
<a data-target='#EDITCAPITAL' id="edit${temp}" data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
|
||
</a>
|
||
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||
<span class="ri-delete-bin-7-fill"></span>
|
||
</a>
|
||
</td>
|
||
</tr>`;
|
||
|
||
$('#capitalAppend').append(rowHtml);
|
||
|
||
//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, "per" + temp, addPer);
|
||
addHidden(theForm, "quantity" + temp, quantity);
|
||
addHidden(theForm, "rateInUs" + temp, itemRate);
|
||
addHidden(theForm, "itemRate" + temp, itemRate);
|
||
addHidden(theForm, "basicval" + temp, basicval);
|
||
addHidden(theForm, "basicvalInINR" + temp, basicvalInINR);
|
||
|
||
addHidden(theForm, "landingCharge" + temp, landingCharge);
|
||
|
||
addHidden(theForm, "CustomDuty" + temp, CustomDuty);
|
||
|
||
addHidden(theForm, "CustomEDCess" + temp, CustomEDCess);
|
||
addHidden(theForm, "CustomSHCess" + temp, CustomSHCess);
|
||
|
||
addHidden(theForm, "GrossDutyPayable" + temp, GrossDutyPayable);
|
||
|
||
|
||
|
||
addHidden(theForm, "CustomDutyExpenses" + temp, CustomDutyExpenses);
|
||
|
||
addHidden(theForm, "ServiceTotalOrderValue" + temp, TotalTaxValue);
|
||
|
||
addHidden(theForm, "beforeLanding" + temp, beforeLanding);
|
||
addHidden(theForm, "beforeCustomDuty" + temp, beforeCustomDuty);
|
||
addHidden(theForm, "beforeCustomEDCess" + temp, beforeCustomEDCess);
|
||
addHidden(theForm, "beforeCustomSHCess" + temp, beforeCustomSHCess);
|
||
|
||
addHidden(theForm, "PurQuantity" + temp, PurQuantity);
|
||
|
||
addHidden(theForm, "AfterAssessable" + temp, Accessible);
|
||
addHidden(theForm, "Subtotal" + temp, Subtotal);
|
||
|
||
addHidden(theForm, "IgstInt" + temp, Igst);
|
||
addHidden(theForm, "AfterIgstInt" + temp, AfterIgst);
|
||
addHidden(theForm, "Dutyimpact" + temp, Dutyimpact);
|
||
addHidden(theForm, "ClearingCharges" + temp, ClearingCharges);
|
||
addHidden(theForm, "Nett" + temp, Nett);
|
||
|
||
//var a=$('#Dutyimpact'+temp).val();
|
||
|
||
//console.log(a);
|
||
|
||
|
||
|
||
addHidden(theForm, "capitalType", capitalType);
|
||
addHidden(theForm, "Cgst" + temp, Cgst);
|
||
addHidden(theForm, "AfterCgst" + temp, AfterCgst);
|
||
addHidden(theForm, "Sgst" + temp, Sgst);
|
||
addHidden(theForm, "AfterSgst" + temp, AfterSgst);
|
||
addHidden(theForm, "Igst" + temp, Igst);
|
||
addHidden(theForm, "AfterIgst" + temp, AfterIgst);
|
||
addHidden(theForm, "OtherAmt" + temp, OtherAmt);
|
||
|
||
|
||
addHidden(theForm, "FreightType" + temp, FreightType);
|
||
addHidden(theForm, "FreightVal" + temp, FreightVal);
|
||
addHidden(theForm, "AfterFreightVal" + temp, AfterFreightVal);
|
||
addHidden(theForm, "NoOfTrip" + temp, NoOfTrip);
|
||
addHidden(theForm, "CapitalItemDescrition" + temp, CapitalDescription);
|
||
|
||
addHidden(theForm, "DisType" + temp, DisType);
|
||
addHidden(theForm, "DisVal" + temp, DisVal);
|
||
addHidden(theForm, "AfterDisVal" + temp, AfterDisVal);
|
||
$('#txtRowCount').val(temp);
|
||
|
||
addHidden(theForm, "FreightTypeloc" + temp, FreightTypeloc);
|
||
addHidden(theForm, "NoofTriploc" + temp, Nooftriploc);
|
||
addHidden(theForm, "FreightRateloc" + temp, Freightrateloc);
|
||
addHidden(theForm, "AfterFreightRateloc" + temp, AfterFreightAmountloc);
|
||
|
||
// var a=parseFloat($('#NoofTriploc'+temp).val());
|
||
// console.log(Nooftriploc);
|
||
|
||
$('#CAPITAL').modal('hide');
|
||
clearCapitalModalFields();
|
||
}
|
||
|
||
});
|
||
|
||
/* used to validateExceedLimit */
|
||
function validateExceedLimit() {
|
||
|
||
var avalbudAmt = parseFloat($('#CapitalbudAmt').val());
|
||
var basicAmountRate = parseFloat($('#CPTotalAmount').val());
|
||
var discountRate = parseFloat($('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val());
|
||
var totalAmount = parseFloat($('#txtTotalOrderValue').val());
|
||
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
|
||
if (capitalType != 'Domestic') {
|
||
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
|
||
} else {
|
||
basicAmountRate = parseFloat(basicAmountRate) - parseFloat(discountRate);
|
||
}
|
||
// if(basicAmountRate > avalbudAmt)
|
||
// {
|
||
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
// $('#CPRate').focus();
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
|
||
}
|
||
|
||
function validateCapitalTax() {
|
||
if ($('#Reqnumber').val() == "0") {
|
||
alert('Please select the Requisition Number');
|
||
$('#Reqnumber').focus();
|
||
return false;
|
||
} else if ($('#CostCenter').val() == "0") {
|
||
alert('Please select the Cost center');
|
||
$('#CostCenter').focus();
|
||
return false;
|
||
} else if ($('#MaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#CPQuantity').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 if($('#ItemDescription').val() == '')
|
||
{
|
||
alert('Please Enter the Capital Description');
|
||
$('#ItemDescription').focus();
|
||
return false;
|
||
} */
|
||
else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function calculateTotalValue() {
|
||
var BasicVal = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
|
||
var disRate = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
BasicVal = BasicVal - disRate;
|
||
|
||
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
||
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
||
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
||
|
||
var Freight = parseFloat($('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val()).toFixed(2);
|
||
|
||
|
||
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').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(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(Freight)).toFixed(2);
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
|
||
$('#txtTotalOrderValue').val(tot);
|
||
|
||
validateExceedLimit();
|
||
ExceedQuantityCheck();
|
||
}
|
||
/* calculate tax value*/
|
||
function calculateTaxValue() {
|
||
var Cgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
||
var Sgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
||
var Igst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').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(Sgst) + parseFloat(Cgst) + parseFloat(Igst));
|
||
//+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 disRate = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
BasicVal = BasicVal - disRate;
|
||
|
||
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
||
|
||
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
||
|
||
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
||
|
||
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
|
||
|
||
|
||
var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
|
||
|
||
var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
|
||
|
||
var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
|
||
|
||
var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
|
||
|
||
var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val();
|
||
|
||
|
||
var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
|
||
|
||
var AfterFreight = $('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val();
|
||
// var totvalue = $('#txtTotalOrderValue').val() == '' ? '0.00' : $('#txtTotalOrderValue').val();
|
||
var totvalue = (parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(AfterFreight)).toFixed(2);
|
||
|
||
|
||
|
||
var Assessable = $('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val();
|
||
|
||
var Subtotal = $('#Subtotal').val() == '' ? '0.00' : $('#Subtotal').val();
|
||
|
||
var Igst = $('#AfterIgstInt').val() == '' ? '0.00' : $('#AfterIgstInt').val();
|
||
|
||
//console.log(Igst);
|
||
|
||
|
||
|
||
var TotalOrderValueSummary = $('#txtToatlOrder').val() == '' ? '0.00' : $('#txtToatlOrder').val();
|
||
|
||
|
||
|
||
var TotalCgst = $('#txtTotCgst').val() == '' ? '0.00' : $('#txtTotCgst').val();
|
||
|
||
var TotSgst = $('#txtTotSgst').val() == '' ? '0.00' : $('#txtTotSgst').val();
|
||
|
||
var TotalIgst = $('#txtTotIgst').val() == '' ? '0.00' : $('#txtTotIgst').val();
|
||
|
||
var TotalAllowance = $('#TotalOtherAllowances').val() == '' ? '0.00' : $('#TotalOtherAllowances').val();
|
||
|
||
|
||
|
||
|
||
var totfreight = $('#TotalFreight').val() == '' ? '0.00' : $('#TotalFreight').val();
|
||
|
||
var TotLanding = $('#txttotallanding').val() == '' ? '0.00' : $('#txttotallanding').val();
|
||
|
||
|
||
var TotCustom = $('#txttotalcustom').val() == '' ? '0.00' : $('#txttotalcustom').val();
|
||
|
||
var TotCustomED = $('#txttotalcustomED').val() == '' ? '0.00' : $('#txttotalcustomED').val();
|
||
|
||
var TotCustomSH = $('#txttotalcustomSH').val() == '' ? '0.00' : $('#txttotalcustomSH').val();
|
||
|
||
var TotGrossduty = $('#txttotalgrossduty').val() == '' ? '0.00' : $('#txttotalgrossduty').val();
|
||
|
||
var TotGrossexpense = $('#txttotalgrossexpense').val() == '' ? '0.00' : $('#txttotalgrossexpense').val();
|
||
|
||
var TotalCapitalOrder = $('#CapitalToatlOrder').val() == '' ? '0.00' : $('#CapitalToatlOrder').val();
|
||
|
||
var TotalBasicOrder = $('#CapitalBasicOrder').val() == '' ? '0.00' : $('#CapitalBasicOrder').val();
|
||
|
||
|
||
var TotalAssable = $('#txttotalAssessable').val() == '' ? '0.00' : $('#txttotalAssessable').val();
|
||
|
||
var TotalSubtotal = $('#txttotalSubtotal').val() == '' ? '0.00' : $('#txttotalSubtotal').val();
|
||
|
||
var TotalIgst = $('#txttotalIgst').val() == '' ? '0.00' : $('#txttotalIgst').val();
|
||
|
||
//console.log(TotalIgst);
|
||
|
||
|
||
|
||
$('#txtTotCgst').val((parseFloat(TotalCgst) + parseFloat(AfterCgst)).toFixed(2));
|
||
$('#txtTotSgst').val((parseFloat(TotSgst) + parseFloat(AfterSgst)).toFixed(2));
|
||
$('#txtTotIgst').val((parseFloat(TotalIgst) + parseFloat(AfterIgst)).toFixed(2));
|
||
$('#TotalOtherAllowances').val((parseFloat(TotalAllowance) + parseFloat(OtherAmt)).toFixed(2));
|
||
|
||
|
||
|
||
|
||
$('#TotalFreight').val((parseFloat(totfreight) + parseFloat(AfterFreight)).toFixed(2));
|
||
|
||
$('#txttotallanding').val((parseFloat(TotLanding) + parseFloat(landingCharge)).toFixed(2));
|
||
|
||
$('#txttotalcustom').val((parseFloat(TotCustom) + parseFloat(CustomDuty)).toFixed(2));
|
||
|
||
$('#txttotalcustomED').val((parseFloat(TotCustomED) + parseFloat(CustomEDCess)).toFixed(2));
|
||
|
||
$('#txttotalcustomSH').val((parseFloat(TotCustomSH) + parseFloat(CustomSHCess)).toFixed(2));
|
||
|
||
$('#txttotalgrossduty').val((parseFloat(TotGrossduty) + parseFloat(GrossDutyPayable)).toFixed(2));
|
||
|
||
|
||
$('#txttotalAssessable').val((parseFloat(TotalAssable) + parseFloat(Assessable)).toFixed(2));
|
||
|
||
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal) + parseFloat(Subtotal)).toFixed(2));
|
||
|
||
$('#txttotalIgst').val((parseFloat(TotalIgst) + parseFloat(Igst)).toFixed(2));
|
||
|
||
// $('#txttotalgrossexpense').val((parseFloat(TotGrossexpense) + parseFloat(GrossExpensesDuetoCustom)).toFixed(2) );
|
||
|
||
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
||
|
||
|
||
var totDiscountAmt = $('#txtTotalDiscount').val() == '' ? '0.00' : $('#txtTotalDiscount').val();
|
||
|
||
var totFreightAmt = $('#txtTotalFreight').val() == '' ? '0.00' : $('#txtTotalFreight').val();
|
||
|
||
|
||
$('#txtTotalDiscount').val((parseFloat(totDiscountAmt) + parseFloat(disRate)).toFixed(2));
|
||
|
||
$('#txtTotalFreight').val((parseFloat(totFreightAmt) + parseFloat(Freight)).toFixed(2));
|
||
|
||
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary) + parseFloat(totvalue)).toFixed(2));
|
||
|
||
if (capitalType == 'International') {
|
||
|
||
$('#CapitalToatlOrder').val((parseFloat(TotalCapitalOrder) + parseFloat(BasicVal)).toFixed(2));
|
||
|
||
} else {
|
||
|
||
$('#CapitalToatlOrder').val((parseFloat(TotalCapitalOrder) + parseFloat(BasicVal) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(AfterFreight)).toFixed(2));
|
||
|
||
}
|
||
$('#CapitalBasicOrder').val((parseFloat(TotalBasicOrder) + parseFloat(BasicVal) + parseFloat(disRate)).toFixed(2));
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
function clearCapitalModalFields() {
|
||
|
||
|
||
$('#Reqnumber').val('0');
|
||
$('#CapitalDepartmentName').val('');
|
||
$('#CapitalbudAmt').val('');
|
||
$('#CostCenter').val('0');
|
||
$('#MaterialCode').val('0');
|
||
$("#CapitalItemName").val('');
|
||
$("#CPUOM").val('');
|
||
//var exchangeRate = $("#ExchangeRtModal").val();
|
||
$("#CPQuantity").val('');
|
||
$("#CPRate").val('');
|
||
|
||
$("#CPTotalAmount").val('');
|
||
$("#AfterCgst").val(0);
|
||
$("#AfterSgst").val(0);
|
||
$("#AfterIgst").val(0);
|
||
$("#Cgst").val(0);
|
||
$("#Sgst").val(0);
|
||
$("#Igst").val(0);
|
||
$("#OtherAllowances").val(0);
|
||
$('#AfterBasicPriceTax').val('');
|
||
$('#LandingCharge').val('');
|
||
$('#AfterLandingCharge').val('');
|
||
|
||
$('#Customduty').val('');
|
||
$('#AfterCustomduty').val('');
|
||
|
||
$('#CustomEDcess').val('');
|
||
$('#AfterCustomEDcess').val('');
|
||
$('#CustomSHcess').val('');
|
||
$('#AfterCustomSHcess').val('');
|
||
$('#Grossdutypayable').val('');
|
||
$('#PurQuantity').val('');
|
||
$('#CustomDutyExpenses').val('');
|
||
|
||
|
||
$('#AfterAssessable').val('');
|
||
$('#Subtotal').val('');
|
||
$('#IgstInt').val(0);
|
||
$('#AfterIgstInt').val('');
|
||
$('#DutyImpact').val('');
|
||
$('#ClearingCharges').val('');
|
||
$('#Nett').val('');
|
||
|
||
$("#txtTotalOrderValue").val('');
|
||
$("#AddPer").val('');
|
||
$("#drpFreight").val('0');
|
||
$("#txtFreight").val('');
|
||
$("#txtAfterFreight").val('');
|
||
$("#NOOfTrips").val('');
|
||
tinyMCE.get('ItemDescription').setContent('');
|
||
$("#DiscountType").val('0');
|
||
$("#txtDiscount").val('');
|
||
$("#txtAfterDiscount").val('');
|
||
|
||
$("#drpFreightloc").val('0');
|
||
$("#NOOfTripsloc").val('');
|
||
$("#txtFreightloc").val('');
|
||
$("#txtAfterFreightloc").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 DelRows = $('#txtDeletedRow').val();
|
||
//alertMaterialListrowid);
|
||
|
||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||
if (answer) {
|
||
var td = document.getElementById(rowid);
|
||
td.parentNode.removeChild(td);
|
||
var materialCode = $('#materialCode' + rowid).val();
|
||
var removeItem = $('#materialCode' + rowid).val();
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(index, value) {
|
||
|
||
|
||
if (value.MaterialCode == materialCode) {
|
||
|
||
$("#MaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
||
}
|
||
|
||
|
||
|
||
});
|
||
}
|
||
|
||
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
|
||
$.each(SelectedMaterialList.Mat, function(i, el) {
|
||
|
||
if (this.materialCode == removeItem) { //Type = '';
|
||
SelectedMaterialList.Mat.splice(i, 1);
|
||
}
|
||
});
|
||
// alert(SelectedMaterialCode);
|
||
if (DelRows != '') {
|
||
DelRows = DelRows + ":" + rowid;
|
||
} else {
|
||
DelRows = "0" + ":" + rowid;
|
||
}
|
||
$('#txtDeletedRow').val(DelRows);
|
||
populateValueMainFormForDeleteServiceTax(rowid);
|
||
}
|
||
|
||
}
|
||
|
||
|
||
/**
|
||
* This function is used to calculate the total amounts after delete the row
|
||
*/
|
||
function populateValueMainFormForDeleteServiceTax(deletedRow) {
|
||
|
||
var rows = document.getElementById('serviceTax').rows.length;
|
||
|
||
var TotalOrderValueSummary = 0;
|
||
|
||
var TotCgst = 0;
|
||
var TotSgst = 0;
|
||
var TotIgst = 0;
|
||
var TotOther = 0;
|
||
|
||
var TotLanding = 0;
|
||
|
||
var TotCustom = 0;
|
||
|
||
var TotCustomED = 0;
|
||
var TotCustomSH = 0;
|
||
|
||
var TotGrossduty = 0;
|
||
|
||
var TotalAssable = 0;
|
||
|
||
var TotalSubtotal = 0;
|
||
var TotalIgstInt = 0;
|
||
var Capinttotal = 0;
|
||
|
||
var CapitalToatlOrder = 0;
|
||
var TotFreight = 0;
|
||
var TotDiscount = 0;
|
||
var TotBasicAmt = 0;
|
||
for (var i = 1; i < rows; i++) {
|
||
|
||
|
||
if (deletedRow == i) {
|
||
|
||
|
||
$('#AfterCgst' + i).val('');
|
||
$('#AfterSgst' + i).val('');
|
||
$('#AfterIgst' + i).val('');
|
||
|
||
$('#OtherAmt' + i).val('');
|
||
|
||
|
||
$('#landingCharge' + i).val('');
|
||
|
||
$('#CustomDuty' + i).val('');
|
||
|
||
$('#CustomEDCess' + i).val('');
|
||
$('#CustomSHCess' + i).val('');
|
||
|
||
$('#GrossDutyPayable' + i).val('');
|
||
|
||
|
||
$('#basicval' + i).val('');
|
||
$('#AfterFreightVal' + i).val('');
|
||
$('#AfterDisVal' + i).val('');
|
||
$('#ServiceTotalOrderValue' + i).val('');
|
||
|
||
|
||
|
||
$('#AfterAssessable' + i).val('');
|
||
$('#Subtotal' + i).val('');
|
||
$('#AfterIgstInt' + i).val('');
|
||
|
||
|
||
|
||
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
|
||
|
||
var TotCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
||
var TotSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
||
var TotIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
||
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
||
|
||
|
||
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
|
||
|
||
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
|
||
|
||
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
|
||
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
|
||
|
||
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
|
||
|
||
|
||
var Assessable = $('#AfterAssessable' + i).val() == '' ? '0.00' : $('#AfterAssessable' + i).val();
|
||
|
||
var Subtotal = $('#Subtotal' + i).val() == '' ? '0.00' : $('#Subtotal' + i).val();
|
||
|
||
var IgstInt = $('#AfterIgstInt' + i).val() == '' ? '0.00' : $('#AfterIgstInt' + i).val();
|
||
|
||
|
||
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
|
||
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
|
||
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
|
||
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
|
||
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
|
||
} else if (deletedRow != i)
|
||
|
||
{
|
||
|
||
|
||
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
|
||
|
||
var TotCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
||
var TotSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
||
var TotIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
||
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
||
|
||
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
|
||
|
||
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
|
||
|
||
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
|
||
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
|
||
|
||
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
|
||
|
||
|
||
var TotGrossexpenseI = $('#GrossExpensesDuetoCustom' + i).val() == '' ? '0.00' : $('#GrossExpensesDuetoCustom' + i).val();
|
||
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
|
||
|
||
|
||
var Assessable = $('#AfterAssessable' + i).val() == '' ? '0.00' : $('#AfterAssessable' + i).val();
|
||
|
||
var Subtotal = $('#Subtotal' + i).val() == '' ? '0.00' : $('#Subtotal' + i).val();
|
||
|
||
var IgstInt = $('#AfterIgstInt' + i).val() == '' ? '0.00' : $('#AfterIgstInt' + i).val();
|
||
|
||
|
||
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
|
||
|
||
//console.log(CapitalToatlOrderI);
|
||
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
|
||
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
|
||
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
|
||
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
|
||
} else {
|
||
|
||
}
|
||
TotFreight = parseFloat(TotFreight) + parseFloat(TotFreightI);
|
||
TotDiscount = parseFloat(TotDiscount) + parseFloat(TotDiscountI);
|
||
TotCgst = parseFloat(TotCgst) + parseFloat(TotCgstI);
|
||
TotSgst = parseFloat(TotSgst) + parseFloat(TotSgstI);
|
||
TotIgst = parseFloat(TotIgst) + parseFloat(TotIgstI);
|
||
TotOther = parseFloat(TotOther) + parseFloat(TotOtherI);
|
||
|
||
|
||
TotLanding = parseFloat(TotLanding) + parseFloat(TotLandingI);
|
||
|
||
TotCustom = parseFloat(TotCustom) + parseFloat(TotCustomI);
|
||
|
||
TotCustomED = parseFloat(TotCustomED) + parseFloat(TotCustomEDI);
|
||
TotCustomSH = parseFloat(TotCustomSH) + parseFloat(TotCustomSHI);
|
||
|
||
TotGrossduty = parseFloat(TotGrossduty) + parseFloat(TotGrossdutyI);
|
||
|
||
// TotGrossexpense = parseFloat(TotGrossexpense) + parseFloat(TotGrossexpenseI);
|
||
TotalOrderValueSummary = parseFloat(TotalOrderValueSummary) + parseFloat(TotalOrderValueSummaryI);
|
||
|
||
|
||
CapitalToatlOrder = parseFloat(CapitalToatlOrder) + parseFloat(CapitalToatlOrderI) + parseFloat(TotCgstI) + parseFloat(TotSgstI) + parseFloat(TotIgstI) + parseFloat(TotOtherI);
|
||
|
||
Capinttotal = parseFloat(Capinttotal) + parseFloat(CapitalToatlOrderI);
|
||
|
||
// console.log(Capinttotal);
|
||
TotBasicAmt = parseFloat(TotBasicAmt) + parseFloat(TotBasicAmtI);
|
||
|
||
|
||
TotalAssable = parseFloat(TotalAssable) + parseFloat(Assessable);
|
||
|
||
TotalSubtotal = parseFloat(TotalSubtotal) + parseFloat(Subtotal);
|
||
TotalIgstInt = parseFloat(TotalIgstInt) + parseFloat(IgstInt);
|
||
}
|
||
$('#txtTotalDiscount').val(parseFloat(TotDiscount).toFixed(2));
|
||
$('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2));
|
||
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
||
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
||
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
||
$('#TotalOtherAllowances').val(parseFloat(TotOther).toFixed(2));
|
||
|
||
$('#txttotallanding').val((parseFloat(TotLanding)).toFixed(2));
|
||
|
||
$('#txttotalcustom').val((parseFloat(TotCustom)).toFixed(2));
|
||
|
||
$('#txttotalcustomED').val((parseFloat(TotCustomED)).toFixed(2));
|
||
$('#txttotalcustomSH').val((parseFloat(TotCustomSH)).toFixed(2));
|
||
|
||
$('#txttotalgrossduty').val((parseFloat(TotGrossduty)).toFixed(2));
|
||
|
||
if (capitalType == 'International') {
|
||
$('#CapitalToatlOrder').val((parseFloat(Capinttotal)).toFixed(2));
|
||
} else {
|
||
$('#CapitalToatlOrder').val((parseFloat(CapitalToatlOrder)).toFixed(2));
|
||
}
|
||
$('#CapitalBasicOrder').val((parseFloat(TotBasicAmt)).toFixed(2));
|
||
|
||
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary)).toFixed(2));
|
||
|
||
$('#txttotalAssessable').val((parseFloat(TotalAssable)).toFixed(2));
|
||
|
||
|
||
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal)).toFixed(2));
|
||
|
||
|
||
$('#txttotalIgst').val((parseFloat(TotalIgstInt)).toFixed(2));
|
||
|
||
|
||
}
|
||
/* get Edit Capital Po Modal*/
|
||
$(document).ready(function() {
|
||
$("#EDITCAPITAL").on("shown.bs.modal", function(e) {
|
||
|
||
|
||
|
||
userid = $(e.relatedTarget).data('userid');
|
||
|
||
|
||
|
||
$('#isEdit').val(1);
|
||
if (userid) {
|
||
tempUserId = userid;
|
||
} else {
|
||
userid = tempUserId;
|
||
}
|
||
// alert(userid);
|
||
var tr = document.getElementById(userid);
|
||
|
||
var cellval = tr.cells;
|
||
|
||
var id = $('#Reqnumber' + userid).val();
|
||
|
||
$('#EditReqnumber').val($('#Reqnumber' + userid).val());
|
||
$('#EditCapitalDepartmentName').val($('#departmentName' + userid).val());
|
||
$("#EditCostCenter").val($('#CPCostCode' + userid).val());
|
||
$('#EditCapitalbudAmt').val($('#AvilBudget' + userid).val());
|
||
$('#EditExchangeRtModal').val($('#echangeRate' + userid).val());
|
||
|
||
$('#EditCapitalItemName').val($('#materialName' + userid).val());
|
||
$('#EditCPUOM').val($('#uom' + userid).val());
|
||
$('#EditPer').val($('#per' + userid).val());
|
||
var EditUOM = $('#uom' + userid).val();
|
||
$('#EditCPQuantity').val($('#quantity' + userid).val());
|
||
$('#EditCPRate').val($('#rateInUs' + userid).val());
|
||
|
||
$('#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());
|
||
|
||
|
||
$('#EditAfterBasicPriceTax').val($('#basicvalInINR' + userid).val());
|
||
$('#EditAfterLandingCharge').val($('#landingCharge' + userid).val());
|
||
|
||
$('#EditAfterCustomduty').val($('#CustomDuty' + userid).val());
|
||
|
||
$('#EditAfterCustomEDcess').val($('#CustomEDCess' + userid).val());
|
||
$('#EditAfterCustomSHcess').val($('#CustomSHCess' + userid).val());
|
||
|
||
$('#EditGrossdutypayable').val($('#GrossDutyPayable' + userid).val());
|
||
$('#EditCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
|
||
//$('#txtEditInsurance').val($('#RMCIncludingCustomers'+userid).val());
|
||
|
||
console.log($('#Igst' + userid).val());
|
||
|
||
$('#EdittxtTotalOrderValue').val(cellval[9].innerHTML);
|
||
$('#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($('#OtherAmt' + userid).val());
|
||
/* get % value */
|
||
|
||
$('#EditLandingCharge').val($('#beforeLanding' + userid).val());
|
||
|
||
$('#EditCustomduty').val($('#beforeCustomDuty' + userid).val());
|
||
|
||
$('#EditCustomEDcess').val($('#beforeCustomEDCess' + userid).val());
|
||
$('#EditCustomSHcess').val($('#beforeCustomSHCess' + userid).val());
|
||
|
||
$('#EditPurQuantity').val($('#PurQuantity' + userid).val());
|
||
$('#txtEditFreight').val($('#FreightVal' + userid).val());
|
||
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
|
||
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
|
||
$("#drpEditFreight").val($('#FreightType' + userid).val());
|
||
|
||
|
||
$("#drpFreighteditloc").val($('#FreightTypeloc' + userid).val());
|
||
$("#NOOfTripslocedit").val($('#NoofTriploc' + userid).val());
|
||
$("#txtFreightlocedit").val($('#FreightRateloc' + userid).val());
|
||
$("#txtAfterFreightlocedit").val($('#AfterFreightRateloc' + userid).val());
|
||
|
||
|
||
$('#EditAfterAssessable').val($("#AfterAssessable" + userid).val());
|
||
$('#EditSubtotal').val($("#Subtotal" + userid).val());
|
||
$('#EditIgstInt').val($("#IgstInt" + userid).val());
|
||
$('#EditAfterIgstInt').val($("#AfterIgstInt" + userid).val());
|
||
$('#EditDutyImpact').val($("#Dutyimpact" + userid).val());
|
||
$('#EditClearingCharges').val($("#ClearingCharges" + userid).val());
|
||
$('#EditNett').val($("#Nett" + userid).val());
|
||
|
||
|
||
var a = parseFloat($('#EditDutyImpact').val());
|
||
//var b =parseFloat($('#Dutyimpact'+userid).val());
|
||
|
||
// console.log(a);
|
||
//console.log(b);
|
||
|
||
|
||
var FreightTypeloc = $('#FreightTypeloc' + userid).val();
|
||
|
||
if (FreightTypeloc == '<?php echo PERTRIP; ?>') {
|
||
$('#TripsValuelocedit').show();
|
||
|
||
} else {
|
||
$('#TripsValuelocedit').hide();
|
||
|
||
}
|
||
|
||
|
||
|
||
var FreightType = $('#FreightType' + userid).val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#EditTripsValue').show();
|
||
} else {
|
||
$('#EditTripsValue').hide();
|
||
}
|
||
$("#EditDiscountType").val($('#DisType' + userid).val());
|
||
$('#txtEditDiscount').val($('#DisVal' + userid).val());
|
||
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
|
||
|
||
tinyMCE.get('EditItemDescription').setContent($('#CapitalItemDescrition' + userid).val());
|
||
|
||
|
||
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
$("#EditMaterialCode").empty();
|
||
|
||
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EditUOM + ')');
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
if (obj.MaterialCode != $('#materialCode' + userid).val()) {
|
||
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
|
||
}
|
||
});
|
||
}
|
||
});
|
||
});
|
||
/*get edit material list*/
|
||
$('#EditMaterialCode').change(function() {
|
||
|
||
var id = $('#EditMaterialCode').val();
|
||
$("#EditCapitalItemName").val('');
|
||
$("#EditCPUOM").val('');
|
||
$("#EditCPQuantity").val('');
|
||
$("#EditCPTotalAmount").val('');
|
||
RequistQuantity = '';
|
||
clearTaxField();
|
||
if (id != '0') {
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
if (obj.MaterialCode === id) {
|
||
$("#EditCapitalItemName").val(obj.MaterialName);
|
||
$("#EditCPUOM").val(obj.UOM);
|
||
$("#EditCPQuantity").val(obj.Quantity);
|
||
RequistQuantity = obj.Quantity;
|
||
}
|
||
});
|
||
}
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
function clearEditTaxField() {
|
||
$('#EditCPRate').val('');
|
||
|
||
$('#EditCPTotalAmount').val('');
|
||
$('#EditAfterServiceTax').val('');
|
||
$('#EditAfterEduCess').val('');
|
||
$('#EditAfterSecHighTax').val('');
|
||
$('#EditAfterKrishiTax').val('');
|
||
$('#EditAfterSwachhTax').val('');
|
||
$('#EditBasicPriceTax ').val('');
|
||
$('#EditAfterBasicPriceTax').val('');
|
||
|
||
$("#EditLandingCharge").val('');
|
||
$("#EditAfterLandingCharge").val('');
|
||
$("#EditHighseas").val('');
|
||
$("#EditAfterHighseas").val('');
|
||
$("#EditCustomduty").val('');
|
||
$("#EditAfterCustomduty").val('');
|
||
$("#EditExcisedutyTax").val('');
|
||
$("#EditAfterExcisedutyTax").val('');
|
||
$("#EditExcisedutyEDcess").val('');
|
||
$("#EditAfterExcisedutyEDcess").val('');
|
||
$("#EditExcisedutySHcess").val('');
|
||
$("#EditAfterExcisedutySHcess").val('');
|
||
$("#EditCustomEDcess").val('');
|
||
$("#EditAfterCustomEDcess").val('');
|
||
$("#EditCustomSHcess").val('');
|
||
$("#EditAfterCustomSHcess").val('');
|
||
$("#EditAdditionalExciseduty").val('');
|
||
$("#EditAfterAdditionalExciseduty").val('');
|
||
$("#EditGrossdutypayable").val('');
|
||
$("#EditAvailableModvat").val('');
|
||
$("#EditGrossexpenses").val('');
|
||
$("#Editpurchaserate").val('');
|
||
$("#EditCustomDutyExpenses").val('');
|
||
$("#EditRMCIncludingCustomers").val('');
|
||
$("#EditPurQuantity").val('');
|
||
$("#EdittxtTotalOrderValue").val('');
|
||
|
||
RequistQuantity = '';
|
||
|
||
}
|
||
|
||
|
||
function Save(status) {
|
||
|
||
if (status == '0') {
|
||
stat = '<?php echo PO_DRAFT; ?>';
|
||
} else {
|
||
stat = '<?php echo PO_CREATED; ?>';
|
||
// stat = '<?php echo PO_RELEASED; ?>';
|
||
}
|
||
tinyMCE.triggerSave();
|
||
var splinstr = $('#txtSpcialInstruction').val();
|
||
var deladd = $('#DeliveryAddr').val();
|
||
var ExchangeRateOn = $('#Exchangerateon').val();
|
||
var PaymentMethod = $('#PaymentMethod').val();
|
||
$('#SpcialInstruction').val(splinstr);
|
||
$('#txtDeliveryAddress').val(deladd);
|
||
$('#txtStatus').val(stat);
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
var basicAmountRate = parseFloat($('#CapitalToatlOrder').val());
|
||
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
|
||
if (capitalType != 'Domestic') {
|
||
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
|
||
} else {
|
||
basicAmountRate = parseFloat($('#CapitalBasicOrder').val()) - parseFloat($('#txtTotalDiscount').val());
|
||
}
|
||
if (validate()) {
|
||
if (document.getElementById('serviceTax').rows.length < 2) {
|
||
alert('Please Select Line item to Create PO');
|
||
$('#Deliverydt').focus();
|
||
return false;
|
||
} else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
|
||
alert('Please Enter Other Payable Terms Description');
|
||
$('#Otherpayment').focus();
|
||
return false;
|
||
}
|
||
// else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) {
|
||
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
|
||
// return false;
|
||
// }
|
||
else if ($('#PoTypeOptions').val() == "0") {
|
||
alert('Please Select POType');
|
||
$('#PoTypeOptions').focus();
|
||
return false;
|
||
|
||
} else {
|
||
// $('#content').loader('show');
|
||
var formData = new FormData($('.CapitalPO')[0]);
|
||
formData.append('ExchangeRateOn', ExchangeRateOn);
|
||
formData.append('PaymentMethod', PaymentMethod);
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
processData: false,
|
||
contentType: false,
|
||
// data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod,
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>purchaseorder/addNewCapitalPurchaseOrder",
|
||
success: function(data) {
|
||
alert(data);
|
||
$('#loader').hide();
|
||
if (data) {
|
||
// $('#content').loader('hide');
|
||
|
||
$('#txtRowCount').val('');
|
||
$('#txtDeletedRow').val('');
|
||
$('#SpcialInstruction').val('');
|
||
$('#txtDeliveryAddress').val('');
|
||
$('#CapitalToatlOrder').val('');
|
||
|
||
clearAfterAddLineItemAdd();
|
||
window.location = "purchaseorderListing";
|
||
|
||
} else {
|
||
// $('#content').loader('hide');
|
||
alert("Error");
|
||
}
|
||
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
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('');
|
||
|
||
}
|
||
|
||
|
||
/*
|
||
|
||
This function is used to validate all field and caluclate all field while edit capital po
|
||
|
||
*/
|
||
function EditRatechange() {
|
||
|
||
|
||
if ($('#EditReqnumber').val() == "0") {
|
||
alert('Please select the Requisition Number');
|
||
$('#EditReqnumber').focus();
|
||
return false;
|
||
} else if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditCostCenter').val() == "0") {
|
||
alert('Please select the CostCenterCode');
|
||
$('#EditCostCenter').focus();
|
||
return false;
|
||
}
|
||
// EditExceedQuantityCheck();
|
||
|
||
if (EditExceedQuantityCheck()) {
|
||
|
||
|
||
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
|
||
|
||
var txtQuantity = parseFloat($('#EditCPQuantity').val());
|
||
var txtExchangeRate = 1;
|
||
var RatePerTon = parseFloat($('#EditCPRate').val()).toFixed(2);
|
||
//var txtUnitPrice = parseFloat($('#Rate').val()).toFixed(2);
|
||
var BasicInINR = '';
|
||
if (capitalType == 'International') {
|
||
txtExchangeRate = parseFloat($('#EditExchangeRtModal').val());
|
||
var Tot = txtQuantity * RatePerTon;
|
||
var BasicInINR = Tot * txtExchangeRate;
|
||
|
||
} else {
|
||
var Tot = txtQuantity * RatePerTon;
|
||
if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') {
|
||
$('#txtEditAfterDiscount').val(updateDiscountValuesChange(parseFloat(Tot).toFixed(2), $("#EditDiscountType").val(), $('#txtEditDiscount').val()));
|
||
}
|
||
var discountedValue = parseFloat($('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val()).toFixed(2);
|
||
|
||
var Freight = parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#txtAfterFreightlocedit').val()).toFixed(2);
|
||
|
||
txtExchangeRate = 1;
|
||
var BasicInINR = Tot * txtExchangeRate - discountedValue;
|
||
}
|
||
var editCPtotal = parseFloat(BasicInINR) + parseFloat(Freight);
|
||
|
||
$('#EditCPTotalAmount').val(parseFloat(Tot).toFixed(2));
|
||
$('#EditAfterBasicPriceTax').val(Math.round(BasicInINR));
|
||
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
|
||
|
||
if (ExceedBudget($('#EditCPTotalAmount').val(), $('#EditCapitalbudAmt').val())) {
|
||
//Service Tax calculation
|
||
|
||
|
||
$('#EditAfterCgst').val(calculateCgstTax(editCPtotal, $("#EditCgst").val() == '' ? "0.00" : $('#EditCgst').val()));
|
||
$('#EditAfterSgst').val(calculateSgstTax(editCPtotal, $("#EditSgst").val() == '' ? "0.00" : $('#EditSgst').val()));
|
||
$('#EditAfterIgst').val(calculateIgstTax(editCPtotal, $("#Editigst").val() == '' ? "0.00" : $('#EditIgst').val()));
|
||
|
||
// This is for import basic price
|
||
|
||
//$('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
|
||
|
||
// if($('#EditLandingCharge').val()!='' && $('#EditAfterBasicPriceTax').val()!='')
|
||
// {
|
||
// $('#EditAfterLandingCharge').val(calculateLandingCharge($('#EditLandingCharge').val()==''?"0.00":$('#EditLandingCharge').val(),$('#EditAfterBasicPriceTax').val()==''?"0.00":$('#EditAfterBasicPriceTax').val()));
|
||
|
||
// var result=$('#EditAfterLandingCharge').val()==''?'0.00':$('#EditAfterLandingCharge').val();
|
||
|
||
// var txtbasicprice=$('#EditAfterBasicPriceTax').val()==''?'0.00':$('#EditAfterBasicPriceTax').val();
|
||
|
||
// var Assessable=<?php echo ASSESSBLE; ?>;
|
||
|
||
// $('#EditAfterAssessable').val(Assessable.toFixed(2));
|
||
|
||
|
||
// }
|
||
|
||
// if($('#Customduty').val()!='' && $('#AfterAssessable').val()!='')
|
||
|
||
// {
|
||
// $('#AfterCustomduty').val(calculateCustomdutyCharge($('#AfterLandingCharge').val()==''?"0.00":$('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#Customduty').val()==''?"0.00":$('#Customduty').val()));
|
||
|
||
// }
|
||
|
||
|
||
// if($('#AfterCustomduty').val()!='' && $('#CustomEDcess').val()!='')
|
||
|
||
// {
|
||
// $('#AfterCustomEDcess').val(calculateCustomEDcessCharge($('#AfterCustomduty').val()==''?"0.00":$('#AfterCustomduty').val(),$('#CustomEDcess').val()==''?"0.00":$('#CustomEDcess').val()));
|
||
|
||
// }
|
||
|
||
|
||
|
||
// if($('#AfterCustomduty').val()!='' && $('#CustomSHcess').val()!='')
|
||
// {
|
||
// $('#AfterCustomSHcess').val(calculateCustomSHcessCharge($('#AfterCustomduty').val(),$('#CustomSHcess').val()));
|
||
|
||
// }
|
||
|
||
|
||
|
||
// if($('#Subtotal').val()!='' && $('#IgstInt').val()!='')
|
||
// {
|
||
// $('#AfterIgstInt').val(CalculateIgst($('#Subtotal').val(),$('#IgstInt').val()));
|
||
|
||
// }
|
||
|
||
if (capitalType == 'International') {
|
||
EditCalculateloadingcharge();
|
||
}
|
||
|
||
EditcalculateTotalValue();
|
||
|
||
// 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 while Editing*/
|
||
|
||
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.');
|
||
|
||
$('#EditCPQuantity').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
/**
|
||
* This function is used for Edit Capital
|
||
*/
|
||
$('.EditCapital').click(function() {
|
||
tinyMCE.triggerSave();
|
||
if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) {
|
||
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
|
||
var Reqnumber = $('#EditReqnumber').val();
|
||
var departmentName = $('#EditCapitalDepartmentName').val();
|
||
var AvilBudget = $('#EditCapitalbudAmt').val();
|
||
var costCode = $('#EditCostCenter').val();
|
||
|
||
var materialCode = $('#EditMaterialCode').val();
|
||
var materialName = $("#EditCapitalItemName").val();
|
||
var uom = $("#EditCPUOM").val();
|
||
var editPer = '';
|
||
if ($("#EditPer").val().trim() == '') {
|
||
editPer = $("#EditCPUOM").val();
|
||
} else {
|
||
editPer = $("#EditPer").val();
|
||
}
|
||
|
||
var exchangeRate = $("#EditExchangeRtModal").val();
|
||
var quantity = $("#EditCPQuantity").val();
|
||
var convertRate = $("#EditCPRate").val();
|
||
var itemRate = parseFloat(convertRate).toFixed(2);
|
||
var basicval = $("#EditCPTotalAmount").val();
|
||
var Cgst = $("#EditCgst").val();
|
||
var AfterCgst = $("#EditAfterCgst").val();
|
||
var Sgst = $("#EditSgst").val();
|
||
var AfterSgst = $("#EditAfterSgst").val();
|
||
var Igst = $("#EditIgst").val();
|
||
var AfterIgst = $("#EditAfterIgst").val();
|
||
var OtherAmt = parseFloat($("#EditOtherAllowances").val() == '' ? "0.00" : $('#EditOtherAllowances').val()).toFixed(2);
|
||
|
||
var TotalTaxValue = EditcalculateTaxValue();
|
||
|
||
var landingCharge = $('#EditAfterLandingCharge').val();
|
||
var HighSeasSalesCharge = $('#EditAfterHighseas').val();
|
||
var CustomDuty = $('#EditAfterCustomduty').val();
|
||
|
||
var CustomEDCess = $('#EditAfterCustomEDcess').val();
|
||
var CustomSHCess = $('#EditAfterCustomSHcess').val();
|
||
|
||
var GrossDutyPayable = $('#EditGrossdutypayable').val();
|
||
|
||
var PurQuantity = $('#EditPurQuantity').val();
|
||
|
||
var CustomDutyExpenses = $('#EditCustomDutyExpenses').val();
|
||
|
||
var TotalOrderValuePerkg = $("#EdittxtTotalOrderValue").val();
|
||
|
||
|
||
|
||
|
||
var Igst = $('#EditIgstInt').val();
|
||
var AfterIgst = $('#EditAfterIgstInt').val();
|
||
var Dutyimpact = $('#EditDutyImpact').val();
|
||
var Clearing = $('#EditClearingCharges').val();
|
||
var Nett = $('#EditNett').val();
|
||
var assessble = $('#EditAfterAssessable').val();
|
||
//console.log(assessble);
|
||
var Subtotal = $('#EditSubtotal').val();
|
||
|
||
/*get % values */
|
||
var beforeLanding = $('#EditLandingCharge').val();
|
||
var beforeHighSeasSalesCharge = $('#EditHighseas').val();
|
||
var beforeCustomDuty = $('#EditCustomduty').val();
|
||
var beforeExciseDuty = $('#EditExcisedutyTax').val();
|
||
var beforeExciseDutyEDCess = $('#EditExcisedutyEDcess').val();
|
||
var beforeExciseDutySHCess = $('#EditExcisedutySHcess').val();
|
||
var beforeCustomEDCess = $('#EditCustomEDcess').val();
|
||
var beforeCustomSHCess = $('#EditCustomSHcess').val();
|
||
var beforeAdditionalExciseDuty = $('#EditAdditionalExciseduty').val();
|
||
var PurQuantity = $('#EditPurQuantity').val();
|
||
var FreightType = $("#drpEditFreight").val();
|
||
var FreightVal = $("#txtEditFreight").val();
|
||
var AfterFreightVal = $("#txtEditAfterFreight").val();
|
||
var NoOfTrip = $("#EditNOOfTrips").val();
|
||
|
||
var basicvalInINR = $('#EditAfterBasicPriceTax').val();
|
||
var EditCapitalDescription = $("#EditItemDescription").val();
|
||
|
||
var FreightTypeloc = $('#drpFreighteditloc').val();
|
||
var FreightRateloc = $('#txtFreightlocedit').val();
|
||
var FreightRateAmountloc = $('#txtAfterFreightlocedit').val();
|
||
var Nooftriploc = $('#NOOfTripslocedit').val();
|
||
|
||
|
||
|
||
|
||
|
||
var DisType = $("#EditDiscountType").val();
|
||
var DisVal = $("#txtEditDiscount").val();
|
||
var AfterDisVal = $("#txtEditAfterDiscount").val();
|
||
|
||
var Total = (parseFloat(basicval) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) - parseFloat(AfterDisVal) + parseFloat(FreightRateAmountloc)).toFixed(2);
|
||
|
||
|
||
|
||
$('#Reqnumber' + userid).val(Reqnumber);
|
||
$('#departmentName' + userid).val(departmentName);
|
||
$('#CPCostCode' + userid).val(costCode);
|
||
$('#AvilBudget' + userid).val(AvilBudget);
|
||
$('#echangeRate' + userid).val(exchangeRate);
|
||
$('#materialCode' + userid).val(materialCode);
|
||
$('#materialName' + userid).val(materialName);
|
||
$('#uom' + userid).val(uom);
|
||
$('#per' + userid).val(editPer);
|
||
$('#quantity' + userid).val(quantity);
|
||
$('#rateInUs' + userid).val(itemRate);
|
||
$('#itemRate' + userid).val(itemRate);
|
||
$('#basicval' + userid).val(basicval);
|
||
$('#basicvalInINR' + userid).val(basicvalInINR);
|
||
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
|
||
$('#ServiceTotalOrderValue' + userid).val(TotalTaxValue);
|
||
|
||
$('#landingCharge' + userid).val(landingCharge);
|
||
|
||
$('#CustomDuty' + userid).val(CustomDuty);
|
||
|
||
$('#CustomEDCess' + userid).val(CustomEDCess);
|
||
$('#CustomSHCess' + userid).val(CustomSHCess);
|
||
|
||
$('#GrossDutyPayable' + userid).val(GrossDutyPayable);
|
||
|
||
|
||
$('#CustomDutyExpenses' + userid).val(CustomDutyExpenses);
|
||
|
||
$('#CapitalToatlOrder' + userid).val(basicval);
|
||
|
||
$('#Cgst' + userid).val(Cgst);
|
||
$('#AfterCgst' + userid).val(AfterCgst);
|
||
$('#Sgst' + userid).val(Sgst);
|
||
$('#AfterSgst' + userid).val(AfterSgst);
|
||
$('#Igst' + userid).val(Igst);
|
||
$('#AfterIgst' + userid).val(AfterIgst);
|
||
|
||
$('#OtherAmt' + userid).val(OtherAmt);
|
||
$('#DisType' + userid).val(DisType);
|
||
$('#DisVal' + userid).val(DisVal);
|
||
$('#AfterDisVal' + userid).val(AfterDisVal);
|
||
|
||
/* get % value */
|
||
|
||
$('#beforeLanding' + userid).val(beforeLanding);
|
||
|
||
$('#beforeCustomDuty' + userid).val(beforeCustomDuty);
|
||
|
||
$('#beforeCustomEDCess' + userid).val(beforeCustomEDCess);
|
||
$('#beforeCustomSHCess' + userid).val(beforeCustomSHCess);
|
||
|
||
$('#PurQuantity' + userid).val(PurQuantity);
|
||
|
||
$('#FreightType' + userid).val(FreightType);
|
||
$('#FreightVal' + userid).val(FreightVal);
|
||
$('#NoOfTrip' + userid).val(NoOfTrip);
|
||
|
||
|
||
$('#AfterFreightVal' + userid).val(AfterFreightVal);
|
||
$('#CapitalItemDescrition' + userid).val(EditCapitalDescription);
|
||
|
||
|
||
$('#FreightTypeloc' + userid).val(FreightTypeloc);
|
||
$('#NoofTriploc' + userid).val(Nooftriploc);
|
||
$('#FreightRateloc' + userid).val(FreightRateloc);
|
||
$('#AfterFreightRateloc' + userid).val(FreightRateAmountloc);
|
||
|
||
|
||
|
||
|
||
$('#IgstInt' + userid).val(Igst);
|
||
$('#AfterIgstInt' + userid).val(AfterIgst);
|
||
$('#Dutyimpact' + userid).val(Dutyimpact);
|
||
$('#AfterAssessable' + userid).val(assessble);
|
||
$('#Nett' + userid).val(Nett);
|
||
$('#ClearingCharges' + userid).val(Clearing);
|
||
$('#Subtotal' + userid).val(Subtotal);
|
||
|
||
if (capitalType == 'International') {
|
||
TotalTaxValue = 0.00;
|
||
Total = basicval;
|
||
}
|
||
|
||
cellval[2].innerHTML = materialCode;
|
||
cellval[3].innerHTML = materialName;
|
||
|
||
cellval[4].innerHTML = quantity;
|
||
cellval[5].innerHTML = uom;
|
||
cellval[6].innerHTML = itemRate;
|
||
cellval[7].innerHTML = basicval;
|
||
cellval[8].innerHTML = TotalTaxValue;
|
||
cellval[9].innerHTML = Total;
|
||
|
||
|
||
$('#EDITCAPITAL').modal('hide');
|
||
|
||
populateValueMainFormForEditCapitalTax();
|
||
|
||
}
|
||
|
||
});
|
||
|
||
function validateEditCapitalTax() {
|
||
|
||
if ($('#EditReqnumber').val() == "0") {
|
||
alert('Please select the Requisition Number');
|
||
$('#EditReqnumber').focus();
|
||
return false;
|
||
} else if ($('#EditCostCenter').val() == "0") {
|
||
alert('Please select the Cost center');
|
||
$('#EditCostCenter').focus();
|
||
return false;
|
||
} else if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditCPQuantity').val() == '') {
|
||
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 if($('#EditItemDescription').val() == '')
|
||
{
|
||
alert('Please Enter the Capital Description');
|
||
$('#EditItemDescription').focus();
|
||
return false;
|
||
} */
|
||
else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function EditcalculateTotalValue() {
|
||
var BasicVal = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
|
||
var disRate = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
||
BasicVal = BasicVal - disRate;
|
||
|
||
var AfterCgst = $('#EditAfterCgst').val() == '' ? '0.00' : $('#EditAfterCgst').val();
|
||
var AfterSgst = $('#EditAfterSgst').val() == '' ? '0.00' : $('#EditAfterSgst').val();
|
||
var AfterIgst = $('#EditAfterIgst').val() == '' ? '0.00' : $('#EditAfterIgst').val();
|
||
var OtherAmt = $('#EditOtherAllowances').val() == '' ? '0.00' : $('#EditOtherAllowances').val();
|
||
|
||
var Freight = parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#txtAfterFreightlocedit').val()).toFixed(2);
|
||
|
||
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(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(Freight)).toFixed(2);
|
||
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
|
||
$('#EdittxtTotalOrderValue').val(tot);
|
||
|
||
validateEditExceedLimit();
|
||
EditExceedQuantityCheck();
|
||
}
|
||
/* calculate tax value*/
|
||
function EditcalculateTaxValue() {
|
||
var Cgst = $('#EditAfterCgst').val() == '' ? '0.00' : $('#EditAfterCgst').val();
|
||
var Sgst = $('#EditAfterSgst').val() == '' ? '0.00' : $('#EditAfterSgst').val();
|
||
var Igst = $('#EditAfterIgst').val() == '' ? '0.00' : $('#EditAfterIgst').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 totTaxvalue = (parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst));
|
||
//+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;
|
||
}
|
||
/* used to validateExceedLimit for edit*/
|
||
function validateEditExceedLimit() {
|
||
|
||
|
||
var avalbudAmt = parseFloat($('#EditCapitalbudAmt').val());
|
||
var basicAmountRate = parseFloat($('#EditCPTotalAmount').val());
|
||
|
||
var discountRate = parseFloat($('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val());
|
||
var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val());
|
||
|
||
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
|
||
if (capitalType != 'Domestic') {
|
||
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
|
||
} else {
|
||
basicAmountRate = parseFloat(basicAmountRate) - parseFloat(discountRate);
|
||
}
|
||
// if(basicAmountRate > avalbudAmt)
|
||
// {
|
||
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
// $('#EditCPRate').focus();
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
|
||
}
|
||
|
||
|
||
/**
|
||
* This function is used to calculate the total amounts after Edit row
|
||
*/
|
||
function populateValueMainFormForEditCapitalTax() {
|
||
|
||
var rows = document.getElementById('serviceTax').rows.length;
|
||
var TotalOrderValueSummary = 0;
|
||
|
||
var TotCgst = 0;
|
||
var TotSgst = 0;
|
||
var TotIgst = 0;
|
||
var TotOther = 0;
|
||
|
||
var TotLanding = 0;
|
||
|
||
var TotCustom = 0;
|
||
|
||
var TotCustomED = 0;
|
||
var TotCustomSH = 0;
|
||
|
||
var TotGrossduty = 0;
|
||
|
||
var CapitalToatlOrder = 0;
|
||
var TotFreight = 0;
|
||
var TotDiscount = 0;
|
||
var TotBasicAmt = 0;
|
||
var TotaFreight = 0;
|
||
|
||
var TotalAssable = 0;
|
||
var TotalSubtotal = 0;
|
||
var Totaligstint = 0;
|
||
var Totint = 0;
|
||
for (var i = 1; i < rows; i++) {
|
||
|
||
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
|
||
|
||
var TotalCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
||
var TotalSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
||
var TotalIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
||
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
||
|
||
var TotalFreight = $('#AfterFreightRateloc' + i).val() == '' ? '0.00' : $('#AfterFreightRateloc' + i).val();
|
||
//console.log(TotalFreight);
|
||
|
||
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
|
||
|
||
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
|
||
|
||
|
||
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
|
||
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
|
||
|
||
|
||
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
|
||
|
||
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
|
||
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
|
||
|
||
|
||
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
|
||
|
||
|
||
var totalinter = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
|
||
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
|
||
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
|
||
|
||
var Assessable = $('#AfterAssessable' + i).val() == '' ? '0.00' : $('#AfterAssessable' + i).val();
|
||
var Subtotal = $('#Subtotal' + i).val() == '' ? '0.00' : $('#Subtotal' + i).val();
|
||
var igstInt = $('#AfterIgstInt' + i).val() == '' ? '0.00' : $('#AfterIgstInt' + i).val();
|
||
|
||
|
||
|
||
TotCgst = parseFloat(TotCgst) + parseFloat(TotalCgstI);
|
||
TotSgst = parseFloat(TotSgst) + parseFloat(TotalSgstI);
|
||
TotIgst = parseFloat(TotIgst) + parseFloat(TotalIgstI);
|
||
TotOther = parseFloat(TotOther) + parseFloat(TotOtherI);
|
||
TotaFreight = parseFloat(TotaFreight) + parseFloat(TotalFreight);
|
||
|
||
// console.log(TotaFreight);
|
||
Totint = parseFloat(Totint) + parseFloat(totalinter);
|
||
|
||
TotLanding = parseFloat(TotLanding) + parseFloat(TotLandingI);
|
||
|
||
TotCustom = parseFloat(TotCustom) + parseFloat(TotCustomI);
|
||
|
||
TotCustomED = parseFloat(TotCustomED) + parseFloat(TotCustomEDI);
|
||
TotCustomSH = parseFloat(TotCustomSH) + parseFloat(TotCustomSHI);
|
||
|
||
TotGrossduty = parseFloat(TotGrossduty) + parseFloat(TotGrossdutyI);
|
||
|
||
var TotalAssable = parseFloat(TotalAssable) + parseFloat(Assessable);
|
||
var TotalSubtotal = parseFloat(TotalSubtotal) + parseFloat(Subtotal);
|
||
var Totaligstint = parseFloat(Totaligstint) + parseFloat(igstInt);
|
||
|
||
|
||
|
||
TotalOrderValueSummary = parseFloat(TotalOrderValueSummary) + parseFloat(TotalOrderValueSummaryI);
|
||
CapitalToatlOrder = parseFloat(CapitalToatlOrder) + parseFloat(CapitalToatlOrderI) + parseFloat(TotalCgstI) + parseFloat(TotalSgstI) + parseFloat(TotalIgstI) + parseFloat(TotOtherI) + parseFloat(TotalFreight);
|
||
TotBasicAmt = parseFloat(TotBasicAmt) + parseFloat(TotBasicAmtI);
|
||
|
||
TotFreight = parseFloat(TotFreight) + parseFloat(TotFreightI);
|
||
TotDiscount = parseFloat(TotDiscount) + parseFloat(TotDiscountI);
|
||
}
|
||
|
||
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
||
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
||
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
||
$('#TotalOtherAllowances').val(parseFloat(TotOther).toFixed(2));
|
||
$('#TotalFreight').val(parseFloat(TotaFreight).toFixed(2));
|
||
|
||
$('#txttotallanding').val((parseFloat(TotLanding)).toFixed(2));
|
||
|
||
$('#txttotalcustom').val((parseFloat(TotCustom)).toFixed(2));
|
||
|
||
$('#txttotalcustomED').val((parseFloat(TotCustomED)).toFixed(2));
|
||
$('#txttotalcustomSH').val((parseFloat(TotCustomSH)).toFixed(2));
|
||
|
||
$('#txttotalgrossduty').val((parseFloat(TotGrossduty)).toFixed(2));
|
||
|
||
$('#txttotalAssessable').val((parseFloat(TotalAssable)).toFixed(2));
|
||
|
||
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal)).toFixed(2));
|
||
|
||
$('#txttotalIgst').val((parseFloat(Totaligstint)).toFixed(2));
|
||
|
||
if (capitalType == 'International') {
|
||
$('#CapitalToatlOrder').val((parseFloat(Totint)).toFixed(2));
|
||
} else {
|
||
$('#CapitalToatlOrder').val((parseFloat(CapitalToatlOrder)).toFixed(2));
|
||
|
||
}
|
||
$('#CapitalBasicOrder').val((parseFloat(TotBasicAmt)).toFixed(2));
|
||
|
||
|
||
|
||
|
||
$('#txtTotalDiscount').val(parseFloat(TotDiscount).toFixed(2));
|
||
$('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2));
|
||
}
|
||
|
||
$("#CurrencySymbol").val('');
|
||
var DisplayCurrencySymbol = '';
|
||
$('#currencytype').change(function() {
|
||
var SelectCurrency = $('#currencytype').val();
|
||
var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
|
||
|
||
$.each(currency, function(idx, obj) {
|
||
if (obj.Currency_Code === SelectCurrency) {
|
||
|
||
$("#CurrencySymbol").val(obj.FontCode2000);
|
||
$('#CurrencySymbol').html('Exchange Rate In' + " " + obj.FontCode2000);
|
||
$('#RateIn').html('Rate in' + " " + obj.FontCode2000);
|
||
$('#EditRateIn').html('Rate in' + " " + obj.FontCode2000);
|
||
$('#TotalAmount').html('Basic value in' + " " + obj.FontCode2000);
|
||
$('#EditTotalAmount').html('Basic value in' + " " + obj.FontCode2000);
|
||
DisplayCurrencySymbol = obj.FontCode2000;
|
||
$("p").html(obj.FontCode2000);
|
||
$('#lbl_international').html('Total Order Value (' + "" + obj.FontCode2000 + ')');
|
||
|
||
|
||
}
|
||
|
||
});
|
||
});
|
||
|
||
var PaymentDate = 'After';
|
||
$('#Before').change(function() {
|
||
PaymentDate = $('#Before').val();
|
||
});
|
||
$('#After').change(function() {
|
||
PaymentDate = $('#After').val();
|
||
|
||
});
|
||
|
||
var capitalType = '';
|
||
|
||
function SetCapitalPo() {
|
||
|
||
capitalType1 = $("input:radio[name='optcapital']:checked").val();
|
||
|
||
console.log(capitalType1);
|
||
console.log(capitalType1 == 0);
|
||
|
||
if (capitalType1 == 0) {
|
||
capitalType = 'International';
|
||
$('#DomesticNOT').modal('hide');
|
||
$('#CAPdiv').hide();
|
||
$('#DOMdiv').hide();
|
||
$('#EDITCAPdiv').hide();
|
||
$('#datedomestic').hide();
|
||
$('#dispatchinternational').show();
|
||
|
||
|
||
|
||
} else {
|
||
capitalType = 'Domestic';
|
||
$('#DomesticNOT').modal('hide');
|
||
$('#currencyOpt').hide();
|
||
$('#FromOnlineRate').hide();
|
||
$('#hideExchangeRateOn').hide();
|
||
$('#hideExchangeRate').hide();
|
||
$('#dispatchinternational').hide();
|
||
$('#PlaceOforigindiv').hide();
|
||
$('#datedomestic').show();
|
||
|
||
|
||
$('#currencytype').val('');
|
||
$('#hideModalExchange').hide();
|
||
$('#hideModalExchangeEdit').hide();
|
||
$('#ExchangeRtModal').val('1');
|
||
$('#HideImportTaxTotal').hide();
|
||
$('#ModalImportTaxHide').hide();
|
||
$('#EditModalImportTaxHide').hide();
|
||
tinyMCE.get('txtSpcialInstruction').setContent('');
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
function calculateCgstTax(varBasicValue, Cgst) {
|
||
|
||
var basicValue1 = parseFloat(varBasicValue);
|
||
|
||
var Freight = parseFloat($('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val()).toFixed(2);
|
||
|
||
var basicValue = basicValue1;
|
||
|
||
|
||
|
||
var Cgst = parseFloat(Cgst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateSgstTax(varBasicValue, Sgst) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
var Sgst = parseFloat(Sgst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateIgstTax(varBasicValue, Igst) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
var Igst = parseFloat(Igst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
//If others is the payment terms to display mandatory field
|
||
$("#PaymentMethod").change(function() {
|
||
if ($('#PaymentMethod').val().trim() == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
} else {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
}
|
||
});
|
||
|
||
function clearTotalItemValues() {
|
||
$('#txtTotCgst').val('');
|
||
$('#txtTotSgst').val('');
|
||
$('#txtTotIgst').val('');
|
||
$('#TotalOtherAllowances').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(0);
|
||
|
||
$('#CapitalToatlOrder').val(0);
|
||
|
||
$('#txtTotalDiscount').val('');
|
||
$('#txtTotalFreight').val('');
|
||
$('#CapitalBasicOrder').val('');
|
||
}
|
||
|
||
|
||
function Reset() {
|
||
location.reload();
|
||
|
||
}
|
||
|
||
$('#insuranceTxtDiv').hide();
|
||
$("#insuranceStatus").change(function() {
|
||
|
||
if ($("#insuranceStatus").val() == "1") {
|
||
$('#insuranceTxtDiv').show();
|
||
$('#InsuranceNumber').val('Yes');
|
||
|
||
} else {
|
||
$('#insuranceTxtDiv').hide();
|
||
$('#InsuranceNumber').val('');
|
||
}
|
||
});
|
||
$('#drpFreight').change(function() {
|
||
|
||
var FreightType = $("#drpFreight").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#TripsValue').show();
|
||
$('#TripsValueafterHide').hide();
|
||
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#NOOfTrips').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#txtFreight').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#txtAfterFreight').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
} else {
|
||
$('#TripsValue').hide();
|
||
$('#TripsValueafterHide').show();
|
||
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#NOOfTrips').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#txtFreight').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#txtAfterFreight').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
}
|
||
|
||
if ($('#AfterBasicPriceTax').val() != '') {
|
||
selValue = $("#drpFreight").val();
|
||
$('#txtFreight').val('');
|
||
$('#txtAfterFreight').val('');
|
||
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtFreight').attr('readonly', 'true');
|
||
$('#txtFreight').val('0.00');
|
||
|
||
} else {
|
||
$('#txtFreight').removeAttr('readonly', 'true');
|
||
$('#txtFreight').val('');
|
||
|
||
|
||
}
|
||
} else {
|
||
alert('Please Enter the Rate value');
|
||
$('#drpFreight').val("0");
|
||
$('#CPRate').focus();
|
||
}
|
||
calculateFreight(0);
|
||
|
||
});
|
||
$('#drpEditFreight').change(function() {
|
||
var FreightType = $("#drpEditFreight").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#EditTripsValue').show();
|
||
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#EditNOOfTrips').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#txtEditFreight').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
$('#txtEditAfterFreight').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
} else {
|
||
$('#EditTripsValue').hide();
|
||
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#EditNOOfTrips').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#txtEditFreight').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
$('#txtEditAfterFreight').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
}
|
||
|
||
if ($('#EditAfterBasicPriceTax').val() != '') {
|
||
selValue = $("#drpEditFreight").val();
|
||
$('#txtEditFreight').val('');
|
||
$('#txtEditAfterFreight').val('');
|
||
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtEditFreight').attr('readonly', 'true');
|
||
$('#txtEditFreight').val('0.00');
|
||
|
||
} else {
|
||
$('#txtEditFreight').removeAttr('readonly', 'true');
|
||
$('#txtEditFreight').val('');
|
||
}
|
||
} else {
|
||
alert('Please Enter the Rate value');
|
||
$('#drpEditFreight').val("0");
|
||
$('#EditCPRate').focus();
|
||
}
|
||
calculateFreight(1);
|
||
});
|
||
|
||
function calculateFreight(isEdit) {
|
||
|
||
if (isEdit == '0') {
|
||
|
||
if ($('#AfterBasicPriceTax').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#CPRate').focus();
|
||
$('#txtFreight').val('');
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#AfterBasicPriceTax').val());
|
||
|
||
var FreightType = $("#drpFreight").val();
|
||
if (FreightType == "0") {
|
||
alert('Please select Freight Type');
|
||
$('#txtFreight').val('');
|
||
$("#drpFreight").focus();
|
||
} else if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
|
||
|
||
var FreightValue = parseFloat($('#txtFreight').val());
|
||
|
||
var Quantity = parseFloat($('#CPQuantity').val());
|
||
|
||
var AfterFreight = 0.0;
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#NOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#NOOfTrips").focus();
|
||
$('#txtFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#txtAfterFreight').val("0.00");
|
||
return false;
|
||
} else {
|
||
var noOftrip = $("#NOOfTrips").val();
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
}
|
||
|
||
|
||
} else {
|
||
AfterFreight = $("#txtFreight").val();
|
||
}
|
||
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
||
|
||
$('#txtAfterFreight').val(AfterFreightval);
|
||
} else {
|
||
$('#txtAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
|
||
} else if (isEdit == '3') {
|
||
|
||
|
||
if ($('#AfterBasicPriceTax').val() != '') {
|
||
var basicValue = parseFloat($('#AfterBasicPriceTax').val());
|
||
|
||
var FreightType = $("#drpFreight").val();
|
||
|
||
if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
|
||
|
||
var FreightValue = parseFloat($('#txtFreight').val());
|
||
|
||
var Quantity = parseFloat($('#CPQuantity').val());
|
||
|
||
var AfterFreight = 0.0;
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#NOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#NOOfTrips").focus();
|
||
$('#txtFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#txtAfterFreight').val("0.00");
|
||
return false;
|
||
} else {
|
||
var noOftrip = $("#NOOfTrips").val();
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
}
|
||
|
||
|
||
} else {
|
||
AfterFreight = $("#txtFreight").val();
|
||
}
|
||
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
||
|
||
$('#txtAfterFreight').val(AfterFreightval);
|
||
} else {
|
||
$('#txtAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
|
||
} else if (isEdit == '4') {
|
||
|
||
|
||
if ($('#EditAfterBasicPriceTax').val() != '') {
|
||
var basicValue = parseFloat($('#EditAfterBasicPriceTax').val());
|
||
var FreightType = $("#drpEditFreight").val();
|
||
|
||
if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
|
||
var FreightValue = parseFloat($('#txtEditFreight').val());
|
||
|
||
var Quantity = parseFloat($('#EditCPQuantity').val());
|
||
//alert(FreightType);
|
||
var AfterFreight = 0.0;
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#EditNOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#EditNOOfTrips").focus();
|
||
$('#txtEditFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#txtEditAfterFreight').val("0.00");
|
||
return false;
|
||
} else {
|
||
var noOftrip = $("#EditNOOfTrips").val();
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
}
|
||
} else {
|
||
AfterFreight = $("#txtEditFreight").val();
|
||
}
|
||
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
||
|
||
$('#txtEditAfterFreight').val(AfterFreightval);
|
||
} else {
|
||
$('#txtEditAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
|
||
} else {
|
||
if ($('#EditAfterBasicPriceTax').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditCPRate').focus();
|
||
$('#txtEditFreight').val('');
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#EditAfterBasicPriceTax').val());
|
||
var FreightType = $("#drpEditFreight").val();
|
||
if (FreightType == "0") {
|
||
alert('Please select Freight Type');
|
||
$('#txtEditFreight').val('');
|
||
$("#drpEditFreight").focus();
|
||
} else if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
|
||
var FreightValue = parseFloat($('#txtEditFreight').val());
|
||
|
||
var Quantity = parseFloat($('#EditCPQuantity').val());
|
||
//alert(FreightType);
|
||
var AfterFreight = 0.0;
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#EditNOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#EditNOOfTrips").focus();
|
||
$('#txtEditFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#txtEditAfterFreight').val("0.00");
|
||
return false;
|
||
} else {
|
||
var noOftrip = $("#EditNOOfTrips").val();
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
}
|
||
} else {
|
||
AfterFreight = $("#txtEditFreight").val();
|
||
}
|
||
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
||
|
||
$('#txtEditAfterFreight').val(AfterFreightval);
|
||
} else {
|
||
$('#txtEditAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
|
||
/* Capital Discount calcualation */
|
||
|
||
$('#DiscountType').change(function() {
|
||
if ($('#CPRate').val() != '') {
|
||
selValue = $("#DiscountType").val();
|
||
$('#txtDiscount').val('');
|
||
$('#txtAfterDiscount').val('');
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtDiscount').attr('readonly', 'true');
|
||
$('#txtDiscount').val('0.00');
|
||
$('#txtAfterDiscount').val('0.00');
|
||
|
||
} else {
|
||
$('#txtDiscount').removeAttr('readonly', 'true');
|
||
$('#txtDiscount').val('');
|
||
$('#txtAfterDiscount').val('');
|
||
}
|
||
} else {
|
||
alert('Please Rate Field Value');
|
||
|
||
$('#CPRate').focus();
|
||
}
|
||
Ratechange();
|
||
|
||
});
|
||
$('#EditDiscountType').change(function() {
|
||
if ($('#EditCPRate').val() != '') {
|
||
selValue = $("#EditDiscountType").val();
|
||
$('#txtEditDiscount').val('');
|
||
$('#txtEditAfterDiscount').val('');
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtEditDiscount').attr('readonly', 'true');
|
||
$('#txtEditDiscount').val('0.00');
|
||
$('#txtEditAfterDiscount').val('0.00');
|
||
|
||
} else {
|
||
$('#txtEditDiscount').removeAttr('readonly', 'true');
|
||
$('#txtEditDiscount').val('');
|
||
$('#txtEditAfterDiscount').val('');
|
||
}
|
||
} else {
|
||
alert('Please Select MaterialCode and Rate Field Value');
|
||
$('#EditDiscountType').val("0");
|
||
$('#EditCPRate').focus();
|
||
}
|
||
EditRatechange();
|
||
|
||
});
|
||
/*
|
||
* To calcuate the Discount */
|
||
function calculateDiscount(isEdit) {
|
||
|
||
if (isEdit == '0') {
|
||
|
||
if ($('#CPRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#CPRate').focus();
|
||
$('#txtDiscount').val('');
|
||
return false;
|
||
}
|
||
if ($('#CPRate').val() != '') {
|
||
|
||
var basicValue = parseFloat($('#CPTotalAmount').val());
|
||
var DiscountType = $("#DiscountType").val();
|
||
|
||
if (DiscountType == "0") {
|
||
alert('Please Select the discount Type');
|
||
$('#txtDiscount').val('');
|
||
$("#DiscountType").focus();
|
||
} else if ($('#txtDiscount').val() != '' && $('#txtDiscount').val() != '0') {
|
||
var AfterDiscount = 0.0;
|
||
var Discountval = parseFloat($('#txtDiscount').val());
|
||
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
||
|
||
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
|
||
AfterDiscount = "0.00";
|
||
} else {
|
||
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
||
}
|
||
var discount = parseFloat(AfterDiscount).toFixed(2);
|
||
$('#txtAfterDiscount').val(discount);
|
||
} else {
|
||
$('#txtAfterDiscount').val("0.00");
|
||
}
|
||
Ratechange();
|
||
}
|
||
|
||
|
||
} else {
|
||
|
||
|
||
if ($('#EditCPRate').val() != '') {
|
||
|
||
var basicValue = parseFloat($('#EditCPTotalAmount').val());
|
||
var DiscountType = $("#EditDiscountType").val();
|
||
|
||
if (DiscountType == "0") {
|
||
alert('Please Select the discount Type');
|
||
$('#txtEditDiscount').val('');
|
||
$("#EditDiscountType").focus();
|
||
} else if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') {
|
||
var AfterDiscount = 0.0;
|
||
var Discountval = parseFloat($('#txtEditDiscount').val());
|
||
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
||
|
||
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
|
||
AfterDiscount = "0.00";
|
||
} else {
|
||
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
||
}
|
||
var discount = parseFloat(AfterDiscount).toFixed(2);
|
||
$('#txtEditAfterDiscount').val(discount);
|
||
} else {
|
||
$('#txtEditAfterDiscount').val("0.00");
|
||
}
|
||
EditRatechange();
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
function updateDiscountValuesChange(totAmt, disType, disAmt) {
|
||
|
||
var basicValue = totAmt;
|
||
var DiscountType = disType;
|
||
|
||
|
||
var AfterDiscount = 0.0;
|
||
var Discountval = parseFloat(disAmt);
|
||
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
||
|
||
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
|
||
AfterDiscount = "0.00";
|
||
} else {
|
||
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
||
}
|
||
var discount = parseFloat(AfterDiscount).toFixed(2);
|
||
return discount;
|
||
}
|
||
|
||
|
||
|
||
|
||
var edit = '';
|
||
|
||
$('#drpFreightloc').change(function() {
|
||
var FreightType = $("#drpFreightloc").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#TripsValueloc').show();
|
||
// $(this).parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#NOOfTripsloc').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#txtFreightloc').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#txtAfterFreightloc').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
} else {
|
||
$('#TripsValueloc').hide();
|
||
// $(this).parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#NOOfTripsloc').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#txtFreightloc').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#txtAfterFreightloc').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
}
|
||
|
||
|
||
if ($('#Rate').val() != '' && $('#MaterialCode').val() != "0") {
|
||
selValue = $("#drpFreightloc").val();
|
||
|
||
|
||
$('#txtFreightloc').val('');
|
||
$('#txtAfterFreight').val('');
|
||
var PackagingCalculation = '';
|
||
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtFreightloc').attr('readonly', 'true');
|
||
$('#txtFreightloc').val('0.00');
|
||
|
||
}
|
||
|
||
|
||
|
||
if (selValue == '<?php echo PERCENTAGE; ?>') {
|
||
var PackagingCalculation = '';
|
||
edit = 'FreightCalculationOn';
|
||
$('#packagingcalmodel').modal('show');
|
||
//PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
|
||
|
||
} else {
|
||
$('#txtFreightloc').removeAttr('readonly', 'true');
|
||
$('#txtFreightloc').val('');
|
||
|
||
calculateFreightlocaddper()
|
||
|
||
}
|
||
|
||
} else {
|
||
alert('Please Select MaterialCode and Rate Field Value');
|
||
$('#drpFreightloc').val("0");
|
||
$('#Rate').focus();
|
||
}
|
||
|
||
});
|
||
$('#editpackagingcalmodel').on('hidden.bs.modal', function() {
|
||
|
||
$('#EDITCAPITAL').modal('show');
|
||
// $('.modal-backdrop').remove();
|
||
|
||
// console.log($('#edit'+tempUserId));
|
||
|
||
// $('#edit'+tempUserId).click();
|
||
});
|
||
$('#packagingcalmodel').on('hidden.bs.modal', function() {
|
||
console.log("add form ");
|
||
|
||
$('#CAPITAL').modal('show');
|
||
});
|
||
|
||
function calculateFreightlocaddper() {
|
||
|
||
var Calculation = document.querySelector('input[name = "optPackaging"]:checked').value;
|
||
var FreightType = $("#drpFreightloc").val();
|
||
$('#packagingcalmodel').modal('hide');
|
||
$('#CAPITAL').modal('show');
|
||
|
||
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
$('#txtAfterFreightloc').val('');
|
||
if (Calculation == 0) {
|
||
var basicValue = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
|
||
} else if (Calculation == 1) {
|
||
|
||
var basicinrValue = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
|
||
var discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
var basicValue = basicinrValue - discount;
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
|
||
}
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
$('#txtAfterFreightloc').val('');
|
||
AfterFreight = 0.00;
|
||
$('#txtFreightloc').val('');
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
document.getElementById("txtAfterFreightloc").readOnly = true;
|
||
document.getElementById("txtFreightloc").readOnly = true;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
$('#txtAfterFreightloc').val('');
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
document.getElementById("txtAfterFreightloc").readOnly = true;
|
||
|
||
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
$('#txtAfterFreightloc').val('');
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
var Quantity = $('#CPQuantity').val() == '' ? '0.00' : $('#CPQuantity').val();
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
$('#txtAfterFreightloc').val('');
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
var noOftrip = $('#NOOfTripsloc').val() == '' ? '0.00' : $('#NOOfTripsloc').val();
|
||
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
|
||
} else {
|
||
|
||
$('#txtAfterFreightloc').val('');
|
||
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
|
||
var txtAfterFreightloc = parseFloat(FreightValue).toFixed(2);
|
||
$('#txtAfterFreightloc').val(txtAfterFreightloc);
|
||
|
||
}
|
||
Ratechange();
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
$('#drpFreighteditloc').change(function() {
|
||
var FreightType = $("#drpFreighteditloc").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#TripsValuelocedit').show();
|
||
|
||
// $(this).parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#NOOfTripslocedit').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#txtFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
// $('#txtAfterFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
|
||
} else {
|
||
$('#TripsValuelocedit').hide();
|
||
|
||
// $(this).parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#NOOfTripslocedit').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#txtFreightlocedit').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
// $('#txtAfterFreightlocedit').parent().removeClass('col-md-2').addClass('col-md-3');
|
||
}
|
||
|
||
if ($('#EditCPRate').val() != '' && $('#EditMaterialCode').val() != "0") {
|
||
selValue = $("#drpFreighteditloc").val();
|
||
|
||
|
||
$('#txtFreightlocedit').val('');
|
||
$('#txtAfterFreightlocedit').val('');
|
||
var PackagingCalculation = '';
|
||
|
||
if (selValue == '<?php echo NILTYPE; ?>') {
|
||
|
||
$('#txtFreightlocedit').attr('readonly', 'true');
|
||
$('#txtFreightlocedit').val('0.00');
|
||
|
||
}
|
||
|
||
|
||
|
||
if (selValue == '<?php echo PERCENTAGE; ?>') {
|
||
var PackagingCalculation = '';
|
||
$('#editpackagingcalmodel').modal('show');
|
||
//PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
|
||
|
||
} else {
|
||
// $('#txtFreightlocedit').removeAttr( 'readonly','true' );
|
||
$('#txtFreightlocedit').val('');
|
||
|
||
calculateFreightloceditper()
|
||
|
||
}
|
||
|
||
} else {
|
||
alert('Please Select MaterialCode and Rate Field Value');
|
||
$('#drpFreighteditloc').val("0");
|
||
$('#Rate').focus();
|
||
}
|
||
|
||
});
|
||
|
||
|
||
|
||
function calculateFreightloceditper() {
|
||
|
||
var Calculation = document.querySelector('input[name = "editoptPackaging"]:checked').value;
|
||
var FreightType = $("#drpFreighteditloc").val();
|
||
$('#editpackagingcalmodel').modal('hide');
|
||
// $('.modal-backdrop').remove();
|
||
$('#EDITCAPITAL').modal('show');
|
||
$('#EDITCAPITAL').modal({
|
||
backdrop: 'static',
|
||
keyboard: false
|
||
});
|
||
|
||
// if (!document.getElementById('modalScrollCSS')) {
|
||
// var style = document.createElement('style');
|
||
// style.id = 'modalScrollCSS'; // Assign an ID to the style tag to avoid duplicates
|
||
// style.innerHTML = `
|
||
// /* Force scroll by setting a max height */
|
||
// .modal-body {
|
||
// max-height: 540px;
|
||
// overflow-y: auto;
|
||
// }
|
||
// `;
|
||
// document.head.appendChild(style); // Append the CSS to the head
|
||
// }
|
||
if (FreightType == '<?php echo PERCENTAGE; ?>') {
|
||
|
||
$('#txtAfterFreightlocedit').val('');
|
||
if (Calculation == 0) {
|
||
var basicValue = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
|
||
} else if (Calculation == 1) {
|
||
|
||
var basicinrValue = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
|
||
var discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
||
var basicValue = basicinrValue - discount;
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
|
||
}
|
||
} else if (FreightType == '<?php echo NILTYPE; ?>') {
|
||
$('#txtAfterFreightlocedit').val('');
|
||
AfterFreight = 0.00;
|
||
$('#txtFreightlocedit').val('');
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
document.getElementById("txtAfterFreightlocedit").readOnly = true;
|
||
document.getElementById("txtFreightlocedit").readOnly = true;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
$('#txtAfterFreightlocedit').val('');
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
document.getElementById("txtAfterFreightlocedit").readOnly = true;
|
||
|
||
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
$('#txtAfterFreightlocedit').val('');
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
var Quantity = $('#EditCPQuantity').val() == '' ? '0.00' : $('#EditCPQuantity').val();
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
$('#txtAfterFreightlocedit').val('');
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
var noOftrip = $('#NOOfTripslocedit').val() == '' ? '0.00' : $('#NOOfTripslocedit').val();
|
||
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
|
||
} else {
|
||
|
||
$('#txtAfterFreightlocedit').val('');
|
||
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
|
||
var txtAfterFreightloc = parseFloat(FreightValue).toFixed(2);
|
||
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
|
||
|
||
}
|
||
|
||
EditRatechange();
|
||
|
||
}
|
||
|
||
|
||
function CalculateCtable() {
|
||
|
||
var quantity = 0;
|
||
var txtbasicinrprice = 0;
|
||
var txtpurchaserate = 0;
|
||
var txtgrossexp = 0;
|
||
var txtcustomdutyexp = 0;
|
||
var txtrmc = 0;
|
||
var total = 0;
|
||
var basicamt = 0;
|
||
var qty = parseFloat($('#CPQuantity').val());
|
||
|
||
|
||
var igst = parseFloat($('#AfterIgstInt').val());
|
||
var totduty = parseFloat($('#Grossdutypayable').val());
|
||
|
||
var txtdutyimpact = <?php echo DUTYIMPACT; ?>;
|
||
|
||
//console.log(txtdutyimpact);
|
||
|
||
// if(isNaN(txtdutyimpact))
|
||
// {
|
||
// $('#DutyImpact').val('');
|
||
// }
|
||
// else
|
||
// {
|
||
// $('#DutyImpact').val(parseFloat(txtdutyimpact).toFixed(2));
|
||
// }
|
||
|
||
quantity = parseFloat($('#PurQuantity').val());
|
||
|
||
var dutyimpact = parseFloat($('#DutyImpact').val());
|
||
|
||
|
||
var peruom = <?php echo PURCHASE_RATE1; ?>;
|
||
|
||
|
||
if (isNaN(peruom)) {
|
||
$('#CustomDutyExpenses').val('');
|
||
} else {
|
||
$('#CustomDutyExpenses').val((peruom).toFixed(2));
|
||
}
|
||
|
||
|
||
var customdutyexp = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
|
||
var basicqtyval = $('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val();
|
||
var qty = parseFloat($('#CPQuantity').val());
|
||
var clearing = $('#ClearingCharges').val() == '' ? '0.00' : $('#ClearingCharges').val();
|
||
var basicres = <?php echo MATBYQTY; ?>;
|
||
var clear = <?php echo CLEARINGQTY; ?>;
|
||
|
||
|
||
var basicnett = parseFloat(basicres) + parseFloat(clear) + parseFloat(customdutyexp);
|
||
|
||
|
||
if (isNaN(basicnett)) {
|
||
$('#Nett').val('');
|
||
} else {
|
||
$('#Nett').val((basicnett).toFixed(2));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
function EditCalculateloadingcharge() {
|
||
//alert();
|
||
var txtlanding = 0;
|
||
var txtbasicprice = 0;
|
||
// txtlanding=parseFloat($('#EditLandingCharge').val());
|
||
// txtbasicprice=parseFloat($('#EditAfterBasicPriceTax').val());
|
||
|
||
|
||
|
||
txtlanding = parseFloat($('#EditLandingCharge').val() == '' ? '0.00' : $('#EditLandingCharge').val());
|
||
txtbasicprice = parseFloat($('#EditAfterBasicPriceTax').val() == '' ? '0.00' : $('#EditAfterBasicPriceTax').val());
|
||
|
||
|
||
var result = <?php echo LOADING_CHARGE; ?>;
|
||
var assessble = <?php echo ASSESSBLE; ?>;
|
||
// console.log(assessble);
|
||
|
||
if (isNaN(result)) {
|
||
$('#EditAfterLandingCharge').val('');
|
||
$('#EditAfterAssessable').val(assessble.toFixed(2));
|
||
} else {
|
||
$('#EditAfterLandingCharge').val(parseFloat(result).toFixed(2));
|
||
$('#EditAfterAssessable').val(assessble.toFixed(2));
|
||
}
|
||
// $('#EditAfterLandingCharge').val(result.toFixed(2));
|
||
EditCalculateCustomduty();
|
||
//alert();
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function EditCalculateCustomduty() {
|
||
var txtbasic = 0;
|
||
var txtcustompercentage = 0;
|
||
var txthighse = 0;
|
||
var txtlandingch = 0;
|
||
var sumcustom = 0;
|
||
var txtcustomduty = 0;
|
||
|
||
// var accessible=parseFloat($('#EditAfterAssessable').val());
|
||
// var txtcustompercentage=parseFloat($('#EditCustomduty').val());
|
||
//sumcustom=txthighse+txtlandingch+txtbasic;
|
||
var accessible = parseFloat($('#EditAfterAssessable').val() == '' ? '0.00' : $('#EditAfterAssessable').val());
|
||
var txtcustompercentage = parseFloat($('#EditCustomduty').val() == '' ? '0.00' : $('#EditCustomduty').val());
|
||
|
||
txtcustomduty = <?php echo CUSTOM_DUTY1; ?>;
|
||
if (isNaN(txtcustomduty)) {
|
||
$('#EditAfterCustomduty').val('');
|
||
} else {
|
||
$('#EditAfterCustomduty').val(parseFloat(txtcustomduty).toFixed(2));
|
||
}
|
||
EditCalculateCustomEdcess();
|
||
|
||
}
|
||
|
||
function EditCalculateCustomEdcess() {
|
||
var txtloading = 0;
|
||
var txthighses = 0;
|
||
var txtcustomduty1 = 0;
|
||
var txtexciseduty = 0;
|
||
var txtedexciseduty = 0;
|
||
var txtshexcisesess = 0;
|
||
var totalval = 0;
|
||
var txtedcesspercentage = 0;
|
||
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
|
||
var txtcustomedsess = 0;
|
||
|
||
// txtcustomduty1=parseFloat($('#EditAfterCustomduty').val());
|
||
|
||
// txtedcesspercentage=parseFloat($('#EditCustomEDcess').val());
|
||
|
||
|
||
txtcustomduty1 = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
|
||
|
||
txtedcesspercentage = parseFloat($('#EditCustomEDcess').val() == '' ? '0.00' : $('#EditCustomEDcess').val());
|
||
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
|
||
txtcustomedsess = <?php echo CUSTOM_ED1; ?>;
|
||
if (isNaN(txtcustomedsess)) {
|
||
$('#EditAfterCustomEDcess').val('');
|
||
} else {
|
||
$('#EditAfterCustomEDcess').val(parseFloat(txtcustomedsess).toFixed(2));
|
||
}
|
||
EditCalculateCustomSHcess();
|
||
|
||
}
|
||
|
||
|
||
function EditCalculateCustomSHcess() { //alert();
|
||
|
||
var landingch = 0;
|
||
var highsesssalles = 0;
|
||
var customch = 0;
|
||
var excisech = 0;
|
||
var exciseedch = 0;
|
||
var exciseshch = 0;
|
||
var totcustomsh = 0;
|
||
|
||
var txtshpercentage = 0;
|
||
//var totresult=(totcustomsh*txtshpercentage)/100;
|
||
var totresult = 0;
|
||
|
||
landingch = parseFloat($('#EditAfterLandingCharge').val());
|
||
highsesssalles = parseFloat($('#EditAfterHighseas').val());
|
||
//customch=parseFloat($('#EditAfterCustomduty').val());
|
||
excisech = parseFloat($('#EditAfterExcisedutyTax').val());
|
||
exciseedch = parseFloat($('#EditAfterExcisedutyEDcess').val());
|
||
exciseshch = parseFloat($('#EditAfterExcisedutySHcess').val());
|
||
totcustomsh = landingch + highsesssalles + customch + excisech + exciseedch + exciseshch;
|
||
|
||
|
||
customch = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
|
||
//txtshpercentage=parseFloat($('#EditCustomSHcess').val());
|
||
txtshpercentage = parseFloat($('#EditCustomSHcess').val() == '' ? '0.00' : $('#EditCustomSHcess').val());
|
||
//var totresult=(totcustomsh*txtshpercentage)/100;
|
||
var totresult = <?php echo CUSTOM_SH1; ?>;
|
||
if (isNaN(totresult)) {
|
||
$('#EditAfterCustomSHcess').val('');
|
||
} else {
|
||
$('#EditAfterCustomSHcess').val(parseFloat(totresult).toFixed(2));
|
||
}
|
||
//EditCalculateaddlExciseDuty();
|
||
|
||
EditCalculateIgst()
|
||
|
||
}
|
||
|
||
|
||
function EditCalculateIgst() {
|
||
|
||
// var custom=parseFloat($('#EditAfterCustomduty').val());
|
||
// var customsh=parseFloat($('#EditAfterCustomSHcess').val());
|
||
// var customed=parseFloat($('#EditAfterCustomEDcess').val());
|
||
|
||
// var assessble=parseFloat($('#EditAfterAssessable').val());
|
||
|
||
|
||
var custom = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
|
||
var customsh = parseFloat($('#EditAfterCustomSHcess').val() == '' ? '0.00' : $('#EditAfterCustomSHcess').val());
|
||
var customed = parseFloat($('#EditAfterCustomEDcess').val() == '' ? '0.00' : $('#EditAfterCustomEDcess').val());
|
||
|
||
var assessble = parseFloat($('#EditAfterAssessable').val() == '' ? '0.00' : $('#EditAfterAssessable').val());
|
||
|
||
|
||
|
||
var tot = <?php echo SUBTOTAL; ?>;
|
||
//var igstpercentage=parseFloat($('#EditIgst').val());
|
||
|
||
var igstpercentage = parseFloat($('#EditIgstInt').val() == '' ? '0.00' : $('#EditIgstInt').val());
|
||
var afterigst = <?php echo IGST; ?>;
|
||
|
||
$('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val()
|
||
if (isNaN(tot)) {
|
||
$('#EditSubtotal').val('');
|
||
} else {
|
||
$('#EditSubtotal').val(parseFloat(tot).toFixed(2));
|
||
}
|
||
|
||
|
||
|
||
if (isNaN(afterigst)) {
|
||
$('#EditAfterIgstInt').val('');
|
||
} else {
|
||
$('#EditAfterIgstInt').val(parseFloat(afterigst).toFixed(2));
|
||
}
|
||
|
||
|
||
var grossexp = custom + customsh + customed + afterigst;
|
||
|
||
var txtgrossduty = <?php echo GROSS_DUTY1; ?>;
|
||
|
||
;
|
||
if (isNaN(txtgrossduty)) {
|
||
$('#EditGrossdutypayable').val('');
|
||
} else {
|
||
$('#EditGrossdutypayable').val(parseFloat(txtgrossduty).toFixed(2));
|
||
}
|
||
|
||
EditCalculateCtable()
|
||
}
|
||
|
||
|
||
|
||
|
||
function EditCalculateCtable() {
|
||
|
||
var quantity = 0;
|
||
var txtbasicinrprice = 0;
|
||
var txtpurchaserate = 0;
|
||
var txtgrossexp = 0;
|
||
var txtcustomdutyexp = 0;
|
||
var txtrmc = 0;
|
||
var total = 0;
|
||
var basicamt = 0;
|
||
var qty = parseFloat($('#EditCPQuantity').val());
|
||
|
||
|
||
var igst = parseFloat($('#EditAfterIgstInt').val());
|
||
var totduty = parseFloat($('#EditGrossdutypayable').val());
|
||
// console.log(igst);
|
||
// console.log(totduty);
|
||
|
||
|
||
var txtdutyimpact = <?php echo DUTYIMPACT; ?>;
|
||
|
||
// console.log(txtdutyimpact);
|
||
|
||
if (isNaN(txtdutyimpact)) {
|
||
$('#EditDutyImpact').val('');
|
||
} else {
|
||
$('#EditDutyImpact').val(parseFloat(txtdutyimpact).toFixed(2));
|
||
}
|
||
|
||
quantity = parseFloat($('#EditPurQuantity').val());
|
||
|
||
var dutyimpact = parseFloat($('#EditDutyImpact').val());
|
||
|
||
|
||
var peruom = <?php echo PURCHASE_RATE1; ?>;
|
||
|
||
|
||
if (isNaN(peruom)) {
|
||
$('#EditCustomDutyExpenses').val('');
|
||
} else {
|
||
$('#EditCustomDutyExpenses').val((peruom).toFixed(2));
|
||
}
|
||
|
||
|
||
var customdutyexp = $('#EditCustomDutyExpenses').val() == '' ? '0.00' : $('#EditCustomDutyExpenses').val();
|
||
var basicqtyval = $('#EditAfterBasicPriceTax').val() == '' ? '0.00' : $('#EditAfterBasicPriceTax').val();
|
||
var qty = parseFloat($('#EditCPQuantity').val());
|
||
var clearing = $('#EditClearingCharges').val() == '' ? '0.00' : $('#EditClearingCharges').val();
|
||
var basicres = <?php echo MATBYQTY; ?>;
|
||
var clear = <?php echo CLEARINGQTY; ?>;
|
||
|
||
|
||
var basicnett = parseFloat(basicres) + parseFloat(clear) + parseFloat(customdutyexp);
|
||
|
||
|
||
if (isNaN(basicnett)) {
|
||
$('#EditNett').val('');
|
||
} else {
|
||
$('#EditNett').val((basicnett).toFixed(2));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function Calculateloadingcharge() {
|
||
//alert();
|
||
$('#AfterHighseas').val('');
|
||
$('#AfterCustomduty').val('');
|
||
$('#AfterExcisedutyTax').val('');
|
||
$('#AfterExcisedutyEDcess').val('');
|
||
$('#AfterExcisedutySHcess').val('');
|
||
$('#AfterCustomEDcess').val('');
|
||
$('#AfterCustomSHcess').val('');
|
||
$('#AfterAdditionalExciseduty').val('');
|
||
$('#Grossdutypayable').val('');
|
||
$('#AvailableModvat').val('');
|
||
$('#Grossexpenses').val('');
|
||
$('#purchaserate').val('');
|
||
$('#CustomDutyExpenses').val('');
|
||
$('#RMCIncludingCustomers').val('');
|
||
|
||
|
||
var txtlanding = 0;
|
||
var txtbasicprice = 0;
|
||
|
||
//txtlanding=$('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val()
|
||
txtlanding = parseFloat($('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val());
|
||
//$('#Rate').val() == '' ? '0.00' : $('#Rate').val()
|
||
//txtbasicprice=parseFloat($('#AfterBasicPriceTax').val());
|
||
txtbasicprice = parseFloat($('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val());
|
||
//var result=(txtlanding*txtbasicprice/100);
|
||
var result = <?php echo LOADING_CHARGE; ?>;
|
||
var assessble = parseFloat(result) + parseFloat(txtbasicprice);
|
||
|
||
|
||
var assessble = <?php echo ASSESSBLE; ?>;
|
||
//$('#AfterLandingCharge').val(parseFloat(Math.round(result)));
|
||
if (isNaN(result)) {
|
||
$('#AfterLandingCharge').val('');
|
||
$('#AfterAssessable').val(txtbasicprice.toFixed(2));
|
||
|
||
|
||
} else {
|
||
$('#AfterLandingCharge').val(result.toFixed(2));
|
||
//$('#AfterAssessable').val(assessble.toFixed(2));
|
||
}
|
||
|
||
if (isNaN(assessble)) {
|
||
$('#AfterAssessable').val(txtbasicprice);
|
||
|
||
|
||
|
||
} else {
|
||
$('#AfterAssessable').val(assessble.toFixed(2));
|
||
|
||
}
|
||
|
||
CalculateCustomduty()
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function CalculateCustomduty() {
|
||
|
||
var txtbasic = 0;
|
||
var txtcustompercentage = 0;
|
||
var txthighse = 0;
|
||
var txtlandingch = 0;
|
||
var sumcustom = 0;
|
||
var txtcustomduty = 0;
|
||
|
||
//var accessible=parseFloat($('#AfterAssessable').val());
|
||
var accessible = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val());
|
||
|
||
//var txtcustompercentage=parseFloat($('#Customduty').val());
|
||
var txtcustompercentage = parseFloat($('#Customduty').val() == '' ? '0.00' : $('#Customduty').val());
|
||
txtcustomduty = <?php echo CUSTOM_DUTY1; ?>;
|
||
if (isNaN(txtcustomduty)) {
|
||
$('#AfterCustomduty').val('');
|
||
} else {
|
||
$('#AfterCustomduty').val(parseFloat(txtcustomduty).toFixed(2));
|
||
}
|
||
|
||
CalculateCustomEdcess()
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
function CalculateCustomEdcess() {
|
||
|
||
var txtloading = 0;
|
||
var txthighses = 0;
|
||
var txtcustomduty1 = 0;
|
||
var txtexciseduty = 0;
|
||
var txtedexciseduty = 0;
|
||
var txtshexcisesess = 0;
|
||
var totalval = 0;
|
||
var txtedcesspercentage = 0;
|
||
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
|
||
var txtcustomedsess = 0;
|
||
|
||
|
||
//txtcustomduty1=parseFloat($('#AfterCustomduty').val());
|
||
|
||
txtcustomduty1 = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
|
||
|
||
// txtedcesspercentage=parseFloat($('#CustomEDcess').val());
|
||
txtedcesspercentage = parseFloat($('#CustomEDcess').val() == '' ? '0.00' : $('#CustomEDcess').val());
|
||
|
||
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
|
||
|
||
txtcustomedsess = <?php echo CUSTOM_ED1; ?>;
|
||
if (isNaN(txtcustomedsess)) {
|
||
|
||
$('#AfterCustomEDcess').val('');
|
||
} else {
|
||
$('#AfterCustomEDcess').val(parseFloat(txtcustomedsess).toFixed(2));
|
||
}
|
||
CalculateCustomSHcess();
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
function CalculateCustomSHcess() { //alert();
|
||
|
||
var landingch = 0;
|
||
|
||
var customch = 0;
|
||
|
||
var totcustomsh = 0;
|
||
|
||
var txtshpercentage = 0;
|
||
|
||
var totresult = 0;
|
||
|
||
|
||
//customch=parseFloat($('#AfterCustomduty').val());
|
||
//console.log(customch);
|
||
customch = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
|
||
|
||
//txtshpercentage=parseFloat($('#CustomSHcess').val());
|
||
txtshpercentage = parseFloat($('#CustomSHcess').val() == '' ? '0.00' : $('#CustomSHcess').val());
|
||
//var totresult=(totcustomsh*txtshpercentage)/100;
|
||
totresult = <?php echo CUSTOM_SH1; ?>;
|
||
if (isNaN(totresult)) {
|
||
$('#AfterCustomSHcess').val('');
|
||
} else {
|
||
$('#AfterCustomSHcess').val(parseFloat(totresult).toFixed(2));
|
||
}
|
||
//CalculateaddlExciseDuty();
|
||
CalculateIgst();
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function CalculateIgst() {
|
||
var basucprice = parseFloat($('#AfterBasicPriceTax').val());
|
||
//var basucprice=$('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val();
|
||
|
||
var landing = parseFloat($('#AfterLandingCharge').val());
|
||
//var landing=$('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
|
||
|
||
var custom = parseFloat($('#AfterCustomduty').val());
|
||
//var custom=$('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
|
||
|
||
var customsh = parseFloat($('#AfterCustomSHcess').val());
|
||
//var customsh=$('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
|
||
|
||
var customed = parseFloat($('#AfterCustomEDcess').val());
|
||
//var customed=$('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
|
||
|
||
var assessble = parseFloat($('#AfterAssessable').val());
|
||
//var assessble=$('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val();
|
||
|
||
// var tot=parseFloat(assessble)+parseFloat(custom)+parseFloat(customsh)+
|
||
// parseFloat(customed);
|
||
|
||
var tot = <?php echo SUBTOTAL; ?>;
|
||
var igstpercentage = parseFloat($('#IgstInt').val());
|
||
var afterigst = <?php echo IGST; ?>;
|
||
|
||
|
||
if (isNaN(tot)) {
|
||
$('#Subtotal').val('');
|
||
} else {
|
||
$('#Subtotal').val(parseFloat(tot).toFixed(2));
|
||
}
|
||
|
||
|
||
|
||
if (isNaN(afterigst)) {
|
||
$('#AfterIgstInt').val('');
|
||
} else {
|
||
$('#AfterIgstInt').val(parseFloat(afterigst).toFixed(2));
|
||
}
|
||
|
||
|
||
var grossexp = custom + customsh + customed + afterigst;
|
||
|
||
//$('#Grossdutypayable').val(parseFloat(grossexp).toFixed(2));
|
||
|
||
var txtgrossduty = <?php echo GROSS_DUTY1; ?>;
|
||
|
||
//console.log(grossexp);
|
||
if (isNaN(txtgrossduty)) {
|
||
$('#Grossdutypayable').val('');
|
||
} else {
|
||
$('#Grossdutypayable').val(parseFloat(txtgrossduty).toFixed(2));
|
||
}
|
||
|
||
CalculateCtable();
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function CalculateCtable() {
|
||
|
||
var quantity = 0;
|
||
var txtbasicinrprice = 0;
|
||
var txtpurchaserate = 0;
|
||
var txtgrossexp = 0;
|
||
var txtcustomdutyexp = 0;
|
||
var txtrmc = 0;
|
||
var total = 0;
|
||
var basicamt = 0;
|
||
var qty = parseFloat($('#Quantity').val());
|
||
|
||
|
||
var igst = parseFloat($('#AfterIgstInt').val());
|
||
var totduty = parseFloat($('#Grossdutypayable').val());
|
||
|
||
var txtdutyimpact = <?php echo DUTYIMPACT; ?>;
|
||
|
||
// console.log(txtdutyimpact);
|
||
|
||
if (isNaN(txtdutyimpact)) {
|
||
$('#DutyImpact').val('');
|
||
} else {
|
||
$('#DutyImpact').val(parseFloat(txtdutyimpact).toFixed(2));
|
||
}
|
||
|
||
quantity = parseFloat($('#PurQuantity').val());
|
||
|
||
var dutyimpact = parseFloat($('#DutyImpact').val());
|
||
|
||
|
||
var peruom = <?php echo PURCHASE_RATE1; ?>;
|
||
|
||
|
||
if (isNaN(peruom)) {
|
||
$('#CustomDutyExpenses').val('');
|
||
} else {
|
||
$('#CustomDutyExpenses').val((peruom).toFixed(2));
|
||
}
|
||
|
||
|
||
var customdutyexp = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
|
||
var basicqtyval = $('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val();
|
||
var qty = parseFloat($('#CPQuantity').val());
|
||
var clearing = $('#ClearingCharges').val() == '' ? '0.00' : $('#ClearingCharges').val();
|
||
var basicres = <?php echo MATBYQTY; ?>;
|
||
var clear = <?php echo CLEARINGQTY; ?>;
|
||
|
||
|
||
var basicnett = parseFloat(basicres) + parseFloat(clear) + parseFloat(customdutyexp);
|
||
|
||
|
||
if (isNaN(basicnett)) {
|
||
$('#Nett').val('');
|
||
} else {
|
||
$('#Nett').val((basicnett).toFixed(2));
|
||
}
|
||
|
||
}
|
||
</script>
|