4383 lines
220 KiB
PHP
4383 lines
220 KiB
PHP
<?php
|
|
$AvlAmount = 0;
|
|
$ReqType = '';
|
|
$CompanyAddress = '';
|
|
$Value = '';
|
|
$Value = "៛";
|
|
$UOM = '';
|
|
$Terms = '';
|
|
|
|
|
|
|
|
|
|
$t = '';
|
|
if (!empty($staticspecialinstruction)) {
|
|
foreach ($staticspecialinstruction as $text)
|
|
$t = $text->ConfigValue;
|
|
}
|
|
|
|
|
|
date_default_timezone_set('Asia/Kolkata');
|
|
$date = date('d/m/Y h:i:s a', time());
|
|
|
|
|
|
if (!empty($CompanyDetails)) {
|
|
foreach ($CompanyDetails as $Req) {
|
|
$CompanyAddress = $Req->Address;
|
|
}
|
|
}
|
|
//echo "$CompanyAddress";
|
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
$CurrentDate = $dt->format('d-m-Y');
|
|
//echo $CurrentDate;
|
|
$MaxPoDate = '';
|
|
if (!empty($MaxPODate)) {
|
|
foreach ($MaxPODate as $date) {
|
|
$MaxPoDate = $date->PODate;
|
|
}
|
|
}
|
|
|
|
$INR = '';
|
|
$INRSYM = '';
|
|
if (!empty($INRSYMBOL)) {
|
|
foreach ($INRSYMBOL as $INR) {
|
|
$INRSYM = $INR->Currency_Code;
|
|
$INR = $INR->FontCode2000;
|
|
}
|
|
}
|
|
|
|
//echo $INRSYM;
|
|
|
|
if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|
$AvlAmount = number_format($AvlimportBudAmt, 2, '.', '');
|
|
} else {
|
|
$AvlAmount = 0;
|
|
}
|
|
|
|
//echo $AvlAmount;
|
|
|
|
// if(!empty($AvlBudAmt))
|
|
// {
|
|
|
|
// $AvlAmount = $AvlBudAmt;
|
|
|
|
// }
|
|
|
|
//echo "view $AvlAmount";
|
|
?>
|
|
|
|
<style>
|
|
.modal {
|
|
padding-right: 25% ! important;
|
|
}
|
|
|
|
.dataTables_paginate {
|
|
margin-top: -5%;
|
|
}
|
|
|
|
.dataTables_wrapper {
|
|
padding-bottom: 0px;
|
|
}
|
|
</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>
|
|
$(document).ready(function() {
|
|
$("#PaymentTerms").select2();
|
|
|
|
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#addtxtInstruction",
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
|
|
|
|
|
|
tinymce.init({
|
|
selector: "textarea#edittxtInstruction",
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
//Initialize Select2 Elements for currency type
|
|
$("#currencytype").select2();
|
|
|
|
var POMaxDate = '<?php echo $MaxPoDate; ?>';
|
|
var d = new Date(POMaxDate);
|
|
var t = '<?php echo $CurrentDate; ?>';
|
|
var m = new Date(t);
|
|
|
|
$("#PODate").datepicker({
|
|
minDate: d,
|
|
maxDate: 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
});
|
|
|
|
|
|
$("#Exchangerateon").datepicker({
|
|
minDate: m,
|
|
//maxDate : 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
});
|
|
// $("#Deliverydt").datepicker({
|
|
// minDate : 'now',
|
|
// dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
|
// });
|
|
|
|
});
|
|
|
|
function openModal() {
|
|
if (vaildateBeforeOpenModal()) {
|
|
$('#IMPORT').modal('show');
|
|
}
|
|
}
|
|
|
|
function vaildateBeforeOpenModal() {
|
|
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 ($('#DeliveryAddr').val() == '') {
|
|
alert('Please Enter the Delivery Address');
|
|
$('#DeliveryAddr').focus();
|
|
return false;
|
|
} else if ($('#Dispatch').val() == '' && $('#Scheduleby').val() == '') {
|
|
if (document.getElementById("Schedule").checked) {
|
|
alert('Please Enter Schedule By');
|
|
return false;
|
|
} else if (document.getElementById("Date").checked) {
|
|
alert('Please Enter Dispatch Instruction');
|
|
return false;
|
|
}
|
|
|
|
} else if ($('#currencytype').val() == '0') {
|
|
alert('Please Select the Currency Type');
|
|
$('#currencytype').focus();
|
|
return false;
|
|
} else if ($('#ExchangeRate').val() == '') {
|
|
alert('Please Enter the Exchange Rate');
|
|
$('#ExchangeRate').focus();
|
|
return false;
|
|
} else if ($('#ExchangeRate').val() == 0) {
|
|
alert('Please Enter the Exchange Rate');
|
|
$('#ExchangeRate').focus();
|
|
return false;
|
|
} else if ($('#PlaceOforigin').val() == '') {
|
|
alert('Please Enter Place Of Origin');
|
|
$('#PlaceOforigin').focus();
|
|
return false;
|
|
} else if ($('#PaymentTerms').val() == '') {
|
|
alert('Please Select Payment Terms');
|
|
$('#PaymentTerms').focus();
|
|
return false;
|
|
|
|
} else if ($('#BudgetType').val() == "0") {
|
|
alert('Please Select Budget Type');
|
|
$('#BudgetType').focus();
|
|
return false;
|
|
|
|
} else if ($('#Importoption').val() == "0") {
|
|
alert('Please Select POType');
|
|
$('#Importoption').focus();
|
|
return false;
|
|
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.pagination {
|
|
margin: 0px ! important;
|
|
}
|
|
|
|
.box-body {
|
|
padding: 0px ! important;
|
|
}
|
|
|
|
.num {
|
|
text-align: right;
|
|
}
|
|
|
|
.header-container {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 25px;
|
|
}
|
|
|
|
.header-container h2 {
|
|
flex: 1;
|
|
text-align: center;
|
|
margin: 0;
|
|
}
|
|
|
|
.centered {
|
|
display: flex;
|
|
/* justify-content: center; */
|
|
align-items: center;
|
|
height: 10vh;
|
|
}
|
|
|
|
.centered label,
|
|
.centered input {
|
|
margin: 0 5px;
|
|
}
|
|
|
|
.mandatory {
|
|
color: red;
|
|
text-align: right;
|
|
background-color: white;
|
|
}
|
|
</style>
|
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
<section class="content">
|
|
<div id="content"></div>
|
|
<?php
|
|
$attributes = array('class' => 'form-label-left ImportPO ', 'name' => 'ImportPO', 'id' => 'ImportPO');
|
|
|
|
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
|
|
|
|
|
|
<div class="box">
|
|
<div class="header-container">
|
|
<h2>Import Purchase Order</h2>
|
|
<a href="<?php echo base_url() ?>CreatePO" class="btn btn-cancel" id="back" value="Back">Back</a>
|
|
</div>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="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="col-md-3">
|
|
<label>Purchase Order Type</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'POType', 'value' => set_value('POType', IMPORT), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Select Supplier<span class="badge mandatory">*</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="col-md-3">
|
|
<label>Supplier Address</label>
|
|
<div class="form-group">
|
|
<?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>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Currency Type<span class="badge mandatory">*</span></label>
|
|
<?php
|
|
$options = array("0" => 'Select Currency Type');
|
|
//print_r($Currency);
|
|
if (!empty($Currency)) { //print_r($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"', 'required="true"', 'class="form-control select2');
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
|
|
<b><u>Select Delivery By<span class="badge mandatory">*</span></u></b><br />
|
|
<div class="centered">
|
|
<?php echo form_label('Dispatch instruction', 'Dispatch instruction') . " " . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "2", 'checked' => 'checked')); ?>
|
|
<?php echo form_label('Schedule', 'Schedule') . " " . form_radio(array("name" => "DateRange", "id" => "Schedule", "value" => "1")); ?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3" id="Schedulediv" style="display:none;">
|
|
<label>Schedule By<span class="badge mandatory">*</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="col-md-3" id="Deliverydtdiv">
|
|
<label>Dispatch Instruction<span class="badge mandatory">*</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="col-md-3">
|
|
<label>Delivery Address</label>
|
|
<div class="form-group">
|
|
<?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>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
Check Today's Foreign Exchange value <a href="http://www.xe.com/" target="_blank"><u>(Click here)</u></a>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Exchange Rate On</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $CurrentDate), 'id' => 'Exchangerateon', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label id=label1>Exchange Rate <span class="badge mandatory">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExchangeRate', 'value' => set_value('ExchangeRate'), 'id' => 'ExchangeRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'USRate()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Place of Origin<span class="badge mandatory">*</span></label>
|
|
<div class="form-group">
|
|
<?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>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Purchase Order Date</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control', 'required' => 'true', 'onkeypress' => 'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Mode Of Shipment</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'addmodeofshipment', 'value' => set_value('addmodeofshipment'), 'id' => 'addmodeofshipment', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Contact Reference</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'addsupplierreference', 'value' => set_value('addsupplierreference'), 'id' => 'addsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Supplier's Offer No</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'addsupplierofferno', 'value' => set_value('addsupplierofferno'), 'id' => 'addsupplierofferno', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Our Reference(S)</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'addotherreference', 'value' => set_value('addotherreference'), 'id' => 'addotherreference', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="payablefrom">Import Type Options<span class="badge mandatory">*</span></label>
|
|
<?php
|
|
|
|
$options3 = array("0" => 'Select');
|
|
|
|
if (!empty($PoTypeOptions)) {
|
|
foreach ($PoTypeOptions as $payment) :
|
|
|
|
$options3[$payment->ConfigValue] = $payment->ConfigValue;
|
|
//$options6[$pay->PaymentID] = $pay->PaymentTerms;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('Importoption', $options3, set_value('Importoption'), 'id="Importoption"', 'class="form-control"'); ?>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="payablefrom">Payable Terms<span class="badge mandatory">*</span></label>
|
|
<input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>">
|
|
|
|
|
|
<?php
|
|
|
|
$options1 = array("0" => 'Select Payment method');
|
|
|
|
|
|
|
|
if (!empty($Payment)) {
|
|
foreach ($Payment as $payment) :
|
|
|
|
$options1[$payment->PaymentID] = $payment->PaymentTerms;
|
|
//$options6[$pay->PaymentID] = $pay->PaymentTerms;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('PaymentTerms', $options1, set_value('PaymentTerms'), 'id="PaymentTerms"', 'class="form-control"'); ?>
|
|
|
|
</div>
|
|
<div class="col-md-3" id="otheroptiondiv" style="display:none;">
|
|
<label>Description of Payable Terms<span class="badge mandatory">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
<label for="payablefrom">Insurance Options<span class="badge mandatory">*</span></label>
|
|
<?php
|
|
$options1 = array("0" => 'NO', "1" => 'YES');
|
|
|
|
// if(!empty($PoTypeOptions))
|
|
// {
|
|
// foreach ($PoTypeOptions as $payment):
|
|
|
|
// $options1[$payment->ConfigValue] = $payment->ConfigValue;
|
|
// //$options6[$pay->PaymentID] = $pay->PaymentTerms;
|
|
|
|
// endforeach;
|
|
// }
|
|
|
|
echo form_dropdown('Insurance', $options1, set_value('Insurance'), 'id="Insurance"', 'class="form-control"'); ?>
|
|
</div>
|
|
<div class="col-md-3" id="insurancenum" style="display:none;">
|
|
<label>Insurance No / Insurance Details<span class="badge mandatory">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$data = array('name' => 'InsuranceNumber', 'InsuranceNumber' => set_value('InsuranceNumber'), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="BudgetType">Budget Type<span class="badge mandatory">*</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 class="col-md-3">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="">
|
|
<table class="table table-bordered" style="border:1px solid #333">
|
|
<div align="right" style="padding-right:10px">
|
|
<div align="right">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3 col-md-offset-7" align="right" style="padding:10px">
|
|
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
|
|
</div>
|
|
<div class="col-md-1" align="right">
|
|
<a data-toggle="modal" class="btn btn-success" data-dismiss="modal" onclick="openModal();">Add Line Item </a>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- <a data-toggle="modal" class="btn btn-success" data-dismiss="modal" onclick="openModal();">Add Line Item </a> -->
|
|
|
|
|
|
|
|
|
|
<!--<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd" >Select Line Item</button> </a>-->
|
|
|
|
|
|
<!-- <div class="modal fade" id="IMPORT" role="dialog">-->
|
|
|
|
<div id="IMPORT" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1030px;font-size:12px;">
|
|
<div class="modal-header">
|
|
|
|
<center>
|
|
<h4>Add Import Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Req No<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Req No');
|
|
//echo form_dropdown('ImportMaterialCode', $options,set_value('ImportMaterialCode'),'id="ImportMaterialCode"' ,'class="form-control required"');
|
|
$RL = array("0" => 'Select Req No');
|
|
if (!empty($RequistionDetails)) {
|
|
foreach ($RequistionDetails as $SID) :
|
|
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('ReqNo', $RL, set_value('ReqNo'), 'id="ReqNo"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Department Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
//$data = array('name' => 'ImportDepartmentName','value' => set_value('ImportDepartmentName'),'id'=>'ImportDepartmentName', 'class' => 'form-control' ,'readonly' => 'true');
|
|
$data = array('name' => 'deptName', 'value' => set_value('deptName'), 'id' => 'deptName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Code</label>
|
|
<div class="form-group">
|
|
<?php
|
|
//$options = array("0"=>'Select Cost Center');
|
|
|
|
//echo form_dropdown('CostCenter', $options,set_value('CostCenter'),'id="CostCenter"' ,'class="form-control"');
|
|
|
|
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="padding-right: 0px;">
|
|
<label>Available Budget Amount(<?php echo $INR ?>)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AvlBudAmt', 'value' => set_value('AvlBudAmt'), 'id' => 'AvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
|
|
<!--In this item code the value should come from DB , so it getting error , so i am disabling this div , once get the data from DB uncommand this div-->
|
|
<div>
|
|
<?php
|
|
|
|
$options = array("0" => 'Item Code');
|
|
//print_r( $options);
|
|
|
|
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ItemName', 'value' => set_value('ItemName'), 'id' => 'ItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-3">
|
|
<label>Quantity<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange(),ExceedQuantityCheck(),calculateFreight(0)');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<!-- <P id=labelRate> --> <label id=labelRate><?php echo "Rate in"; ?> <span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label><!-- </P> -->
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange(),validateExceedLimit(),calculateFreight(0)');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="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="col-md-3" style="padding: 0px;">
|
|
<!--<label>Basic Amount </label>-->
|
|
<!-- <p id=label2> --> <label id=label2><?php echo "Basic Value In"; ?></label><!-- </p> -->
|
|
<div class="form-group">
|
|
<?php
|
|
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
|
|
|
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
<!-- <p id=labelBasicpriceus> --> <label id=labelBasicpriceus><?php echo "Basic Price In"; ?></label><!-- </p> -->
|
|
|
|
<!-- Basic Price in US $ per Ton : -->
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imBasicPrice', 'value' => set_value('imBasicPrice'), 'id' => 'imBasicPrice', 'class' => 'form-control num', 'placeholder ' => 'basic price', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'USRate()', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<!-- Exchange Rate : -->
|
|
<label id=labeladdexc>Exchange Rate :</label>
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt'), 'id' => 'ExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<!-- <P id=labelBasicINR> --> <!-- <label id=labelBasicINR><?php echo "Basic value in INR"; ?> </label>< --><!-- !-- </P> -->
|
|
|
|
<!-- Basic value in INR : -->
|
|
|
|
<label>Basic value in <?php echo $INR; ?> :</label>
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'INRBasicvalue', 'value' => set_value('INRBasicvalue'), 'id' => 'INRBasicvalue', 'class' => 'form-control num changetodecimal', 'readonly' => 'true',);
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!--<div class="col-md-3">
|
|
<a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a>
|
|
</div>-->
|
|
|
|
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
|
<br />
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Basic Price: -->
|
|
<label>Basic Price (<?php echo $INR ?>)</label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group" 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>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterBasicPriceTax', 'value' => set_value('AfterBasicPriceTax'), 'id' => 'AfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Landing charge -->
|
|
<label><?php echo "Landing Charge ($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'LandingCharge', 'value' => set_value('LandingCharge', 0), 'id' => 'LandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Calculateloadingcharge()');
|
|
echo form_input($data);
|
|
|
|
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterLandingCharge', 'value' => set_value('AfterLandingCharge', 0), 'id' => 'AfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- High seas sales charge -->
|
|
<label><?php echo "Assessable Value (A)($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group" style="display: none">
|
|
<?php
|
|
$data = array('name' => 'Assessable ', 'value' => set_value('Assessable', 0), 'id' => 'Assessable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateHighseassalescharge()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterAssessable', 'value' => set_value('AfterAssessable', 0), 'id' => 'AfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom duty : (a) -->
|
|
<label><?php echo "Custom duty (B)($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Customduty', 'value' => set_value('Customduty', 0), 'id' => 'Customduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateCustomduty()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomduty', 'value' => set_value('AfterCustomduty', 0), 'id' => 'AfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom ED_cess : (e) -->
|
|
<label><?php echo "Custom ED_cess (C) ($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomEDcess', 'value' => set_value('CustomEDcess', 0), 'id' => 'CustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateCustomEdcess()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomEDcess', 'value' => set_value('AfterCustomEDcess', 0), 'id' => 'AfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom S & H cess : (f) -->
|
|
<label><?php echo "Custom S & H cess (D)($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomSHcess', 'value' => set_value('CustomSHcess', 0), 'id' => 'CustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateCustomSHcess()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomSHcess', 'value' => set_value('AfterCustomSHcess', 0), 'id' => 'AfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Additional Excise duty : (g) -->
|
|
<label><?php echo "Subtotal (E)($INR) (A+B+C+D)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group" style="display: none;">
|
|
<?php
|
|
$data = array('name' => 'AdditionalExciseduty ', 'value' => set_value('AdditionalExciseduty', 0), 'id' => 'AdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateaddlExciseDuty(),CalculateAvlModvat(),CalculateGrossExpense()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Subtotal', 'value' => set_value('Subtotal', 0), 'id' => 'Subtotal', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Additional Excise duty : (g) -->
|
|
<label><?php echo "IGST on (E): (F) ($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Igst ', 'value' => set_value('Igst', 0), 'id' => 'Igst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateIgst()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst', 0), 'id' => 'AfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
<!-- Gross duty payable -->
|
|
<label><?php echo "Total Duty (G)($INR) (B+C+D+F)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Grossdutypayable ', 'value' => set_value('Grossdutypayable', 0), 'id' => 'Grossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true', 'onchange' => 'CalculateAvlModvat()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12" style="padding:0px;">
|
|
<div class="col-md-3">
|
|
<label>Freight Type </label>
|
|
<div>
|
|
<?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>
|
|
<div class="col-md-3" id="TripsValue" style="display:none;">
|
|
<label>NO Of Trips</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'NOOfTrips', 'value' => set_value('NOOfTrips'), 'id' => 'NOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(0);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Freight Rate </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtFreight', 'value' => set_value('txtFreight'), 'id' => 'txtFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(0);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3" style="padding-left: 0px;">
|
|
<label>Freight Amt In <?php echo $INR; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtAfterFreight', 'value' => set_value('txtAfterFreight'), 'id' => 'txtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<center><label>Cost of the product Per UOM</label></center>
|
|
<hr />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>Duty Impact</label>
|
|
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'DutyImpact', 'value' => set_value('DutyImpact', 0), 'id' => 'DutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="margin-top: -4.8%">
|
|
<label>Quantity</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'PurQuantity', 'value' => set_value('PurQuantity'), 'id' => 'PurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateCtable()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4">
|
|
<!-- Custom Duty Expenses -->
|
|
<label><?php echo "Custom Duty($INR)/UOM"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomDutyExpenses ', 'value' => set_value('CustomDutyExpenses', 0), 'id' => 'CustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- RMC Including Customers -->
|
|
<label><?php echo "Clearing Charges($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ClearingCharges', 'value' => set_value('ClearingCharges', 0), 'id' => 'ClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateCtable()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-4">
|
|
<!-- RMC Including Customers -->
|
|
<label><?php echo "Nett per UOM($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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 class="col-md-4" style="display:none;">
|
|
<!-- Total Amount: -->
|
|
|
|
<label id=labelTotalAmount>Total Amount</label>
|
|
</div>
|
|
<div class="col-md-4" style="display: none;">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'TotalExp', 'value' => set_value('TotalExp', 0), 'id' => 'TotalExp', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-12">
|
|
<label style="text-align: left;">Import Description :</label>
|
|
<?php
|
|
$data = array('name' => 'addtxtInstruction', 'value' => set_value('addtxtInstruction'), 'id' => 'addtxtInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
<a class="btn btn-success font AddImport" ID="AddImport"> <span class="bold">Add Import</span></a>
|
|
<!--<a class="btn btn-success font AddService" ID="AddService" ><i class="fa fa-plus"></i> <span class="bold">Add Service</span></a>-->
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!--Edit modal body-->
|
|
|
|
<div id="editimportpomodel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1000px;font-size:12px;">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center>
|
|
<h4>Edit Import Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Req No<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
|
|
$data = array('name' => 'EditReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Department Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditdeptName', 'value' => set_value('EditdeptName'), 'id' => 'EditdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Code</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$options = array("0" => 'Select Cost Center');
|
|
|
|
//echo form_dropdown('EditCostCenter', $options,set_value('EditCostCenter'),'id="EditCostCenter"' ,'class="form-control"');
|
|
|
|
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="padding-right: 0px;">
|
|
<label>Available Budget Amount (<?php echo $INR ?>)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditAvlBudAmt', 'value' => set_value('EditAvlBudAmt'), 'id' => 'EditAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
|
|
<!--In this item code the value should come from DB , so it getting error , so i am disabling this div , once get the data from DB uncommand this div-->
|
|
<div>
|
|
<?php
|
|
// $options = array("0"=>'Item Code');
|
|
|
|
//if(!empty($MaterialList))
|
|
//{
|
|
// foreach ($MaterialList as $SID):
|
|
|
|
|
|
// $options[$SID->MaterialCode] = $SID->MaterialCode.' '.' - '.' '.$SID->MaterialName;
|
|
|
|
//endforeach;
|
|
//}
|
|
|
|
//echo form_dropdown('ImportMaterialCode', $options,set_value('ImportMaterialCode'),'id="ImportMaterialCode"' ,'class="form-control"');
|
|
|
|
$options = array("0" => 'Item Code');
|
|
//print_r( $options);
|
|
|
|
|
|
|
|
echo form_dropdown('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditItemName', 'value' => set_value('EditItemName'), 'id' => 'EditItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding: 0px;">
|
|
<div class="col-md-3">
|
|
<label>Quantity<span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck(),calculateFreight(1)');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<!-- <P id=labelEditRate> --> <label id=labelEditRate><?php echo "Rate in"; ?> <span class="badge mandatory" style="color:red;text-align:right;background-color: #fff;">*</span></label><!-- </P> -->
|
|
<!-- <label>Rate </label> -->
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),calculateFreight(1)');
|
|
echo form_input($data);
|
|
|
|
|
|
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="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="col-md-3" style="padding: 0px;">
|
|
<!-- <p id=label3> --><label id=label3><?php echo "Basic Value In"; ?></label><!-- </p> -->
|
|
<div class="form-group">
|
|
<?php
|
|
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
|
|
|
|
$data = array('name' => 'EdittxtBasicValue', 'value' => set_value('EdittxtBasicValue'), 'id' => 'EdittxtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
<!-- <p id=labelEditBasicPriceUs> --><label id=labelEditBasicPriceUs><?php echo "Basic Value In"; ?></label><!-- </p> -->
|
|
<!-- Basic Price in US $ per Ton : -->
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditimBasicPrice', 'value' => set_value('EditimBasicPrice'), 'id' => 'EditimBasicPrice', 'class' => 'form-control num', 'placeholder ' => 'basic price', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<label id=labeleditexc>Exchange Rate :</label>
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditExchangeRt', 'value' => set_value('EditExchangeRt'), 'id' => 'EditExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<!-- <p id=labelEditBasicINR> --><label id=labelEditBasicINR><?php echo "Basic value in ($INR)"; ?></label><!-- </p> -->
|
|
<!-- Basic value in INR : -->
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditINRBasicvalue', 'value' => set_value('EditINRBasicvalue'), 'id' => 'EditINRBasicvalue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!--<div class="col-md-3">
|
|
<a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a>
|
|
</div>-->
|
|
|
|
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
|
<br />
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Basic Price: -->
|
|
<label><?php echo "Basic Price($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group" style="display:none;">
|
|
<?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="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Landing charge -->
|
|
<label><?php echo "Landing Charge($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateloadingcharge()');
|
|
echo form_input($data);
|
|
|
|
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- High seas sales charge -->
|
|
<label><?php echo "Assessable Value (A) ($INR)"; ?></label>
|
|
</div>
|
|
<div class="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' => 'EditCalculateHighseassalescharge()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom duty : (a) -->
|
|
<label><?php echo "Custom duty (B) ($INR)" ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCustomduty', 'value' => set_value('EditCustomduty'), 'id' => 'EditCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomduty()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom ED_cess : (e) -->
|
|
<label><?php echo "Custom ED_cess (C)($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCustomEDcess', 'value' => set_value('EditCustomEDcess'), 'id' => 'EditCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomEdcess()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Custom S & H cess : (f) -->
|
|
<label><?php echo "Custom S & H cess (D)($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCustomSHcess', 'value' => set_value('EditCustomSHcess'), 'id' => 'EditCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomSHcess()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Additional Excise duty : (g) -->
|
|
<label><?php echo "Subtotal (E)($INR) (A+B+C+D)"; ?></label>
|
|
</div>
|
|
<div class="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' => 'EditCalculateaddlExciseDuty(),EditCalculateAvlModvat(),EditCalculateGrossExpense()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- Additional Excise duty : (g) -->
|
|
<label><?php echo "IGST on (E): (F) ($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditIgst ', 'value' => set_value('EditIgst', 0), 'id' => 'EditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateIgst()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst', 0), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
<!-- Gross duty payable -->
|
|
<label><?php echo "Total Duty (G)($INR) (B+C+D+E)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditGrossdutypayable ', 'value' => set_value('EditGrossdutypayable'), 'id' => 'EditGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!--Start of Adding of Frieght model-->
|
|
<div class="col-md-12" style="padding:0px;">
|
|
<div class="col-md-3">
|
|
<label>Freight Type </label>
|
|
<div>
|
|
<?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('drpeditFreight', $options, set_value('drpeditFreight'), 'id="drpeditFreight"', 'class="form-control "');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" id="editTripsValue" style="display:block;">
|
|
<label>NO Of Trips</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'editNOOfTrips', 'value' => set_value('editNOOfTrips'), 'id' => 'editNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(1);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Freight Rate </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditFreight', 'value' => set_value('txtEditFreight'), 'id' => 'txtEditFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(1);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3" style="padding-left: 0px;">
|
|
<label>Freight Amt In <?php echo $INR; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'edittxtAfterFreight', 'value' => set_value('edittxtAfterFreight'), 'id' => 'edittxtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<!--End of Adding of freight in edit model -->
|
|
|
|
<div class="col-md-12">
|
|
<center> <label>Cost of the product Per UOM</label></center>
|
|
<hr />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>Duty Impact </label>
|
|
<!-- <p id=labelEditPurchaseRate><label><?php echo "purchase rate [Basic]/" ?></label> -->
|
|
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditDutyImpact', 'value' => set_value('EditDutyImpact'), 'id' => 'EditDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="margin-top: -4.8%">
|
|
<label>Quantity</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditPurQuantity', 'value' => set_value('EditPurQuantity'), 'id' => 'EditPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCtable()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4">
|
|
<!-- Custom Duty Expenses -->
|
|
<label><?php echo "Custom Duty($INR) /UOM" ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<!-- RMC Including Customers -->
|
|
<label><?php echo "Clearing Charges ($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCtable()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-4">
|
|
<!-- RMC Including Customers -->
|
|
<label><?php echo "Nett per UOM($INR)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?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 class="col-md-4" style="display:none;">
|
|
<!-- Total Amount: -->
|
|
<label id=labelEditTotalAmount>Total Amount</label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group" style="display: none;">
|
|
<?php
|
|
$data = array('name' => 'EditTotalExp', 'value' => set_value('EditTotalExp'), 'id' => 'EditTotalExp', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-12">
|
|
<label>Import Description :</label>
|
|
<?php
|
|
$data = array('name' => 'edittxtInstruction', 'value' => set_value('edittxtInstruction'), 'id' => 'edittxtInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
<a class="btn btn-success font EditImport" ID="EditImport"> <span class="bold">Edit Import</span></a>
|
|
<!--<a class="btn btn-success font AddService" ID="AddService" ><i class="fa fa-plus"></i> <span class="bold">Add Service</span></a>-->
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br />
|
|
<div class="box-body" style="margin-top: -3%;">
|
|
<table id="ImportTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
|
<thead>
|
|
<tr>
|
|
<th>SNo</th>
|
|
<th>Requisition No</th>
|
|
<th>Material Code</th>
|
|
<th>Description</th>
|
|
<th>Quantity</th>
|
|
<th>UOM</th>
|
|
<th>Rate<?php echo $INR ?></th>
|
|
<th>Basic Amount<?php echo $INR ?></th>
|
|
<th>Received Qty</th>
|
|
<th>Rejected Qty</th>
|
|
<th>Pending Qty</th>
|
|
<!-- <th>Tax Amount</th>
|
|
<th>Total Order Amount</th> -->
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody id='ImportAppend'>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="col-md-12" style="border: 1px solid;">
|
|
|
|
<div class="col-md-12">
|
|
<div class="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="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="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="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="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="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="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="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="col-md-4">
|
|
<label>Total Freight Value </label> <?php
|
|
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight'), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-4">
|
|
<label id=labeltotal>Total Order Value </label> <?php
|
|
$data = array('name' => 'txtToatlOrder', 'value' => set_value('txtToatlOrder'), 'id' => 'txtToatlOrder', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="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>
|
|
<div align="right" style="padding-right:10px">
|
|
|
|
<div class="col-md-4 col-md-offset-8"><br />
|
|
<input type="file" name="POFile" id="POFile"><br>
|
|
<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="reset" class="btn btn-reset" value="Reset" onclick="window.location.reload()">
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script type="text/html" id="ImportList">
|
|
<tr id="<%=index%>">
|
|
<td align="left"><%=index%></td>
|
|
<td align="left"><%=ReqNo%></td>
|
|
<td align="left"><%=MaterialCode%></td>
|
|
|
|
<td align="left"><%=Description%></td>
|
|
<td align="left"><%=Quantity%></td>
|
|
<td align="left"><%=UOM%></td>
|
|
<td align="left"><%=Rate%></td>
|
|
<td align="left"><%=BasicAmount%></td>
|
|
<td align="left"><%=ReceivedQty%></td>
|
|
<td align="left"><%=RejectedQty%></td>
|
|
<td align="left"><%=PendingQty%></td>
|
|
<!-- <td align="left"><%=Taxvalue%></td>
|
|
<td align="left"><%=TotalValue%></td> -->
|
|
|
|
<td>
|
|
<a data-target='#editimportpomodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#editimportpomodel"><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="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
// for delivey date and scheduled
|
|
//alert();
|
|
$(document).ready(function() {
|
|
$('#Date').click(function() {
|
|
//for Date range selection
|
|
$('#Schedulediv').hide();
|
|
$('#Deliverydtdiv').show();
|
|
});
|
|
$('#Schedule').click(function() {
|
|
//for schedule range selection
|
|
$('#Deliverydtdiv').hide();
|
|
$('#Schedulediv').show();
|
|
});
|
|
});
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(document).on('change', ".changetodecimal", function() {
|
|
|
|
alert();
|
|
var inputvalues = $(this).val();
|
|
var resultvalues = parseFloat(inputvalues).toFixed(2);
|
|
$(this).val(resultvalues);
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#BudgetType").change(function() {
|
|
|
|
var aa = $("#BudgetType option:selected").text();
|
|
|
|
$('#Budget').val(aa);
|
|
|
|
|
|
});
|
|
|
|
|
|
var SelectedMaterialCode = [];
|
|
var RequistQuantity = '';
|
|
var AvilBudAmt = '';
|
|
var CollIndex = 0;
|
|
var index = '1';
|
|
var userid = '';
|
|
var NilType = '<?php echo NILTYPE; ?>';
|
|
var PercentageType = '<?php echo PERCENTAGE; ?>';
|
|
var IsEdit = '0';
|
|
var SelectedMaterialList = {
|
|
Mat: []
|
|
};
|
|
|
|
|
|
$('#Insurance').change(function() {
|
|
|
|
var insure = $('#Insurance').val();
|
|
if (insure == '1') {
|
|
$('#insurancenum').show();
|
|
$('#InsuranceNumber').val('Yes');
|
|
} else {
|
|
$('#insurancenum').hide();
|
|
('#InsuranceNumber').val('');
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#Importoption').change(function() {
|
|
|
|
|
|
var potypeval = $('#Importoption').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) {
|
|
$('#PaymentTerms').empty();
|
|
$.each(Payment, function(idx, obj) {
|
|
if (obj.PaymentID == 'PT05') {
|
|
|
|
$("#PaymentTerms").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
$.each(Payment, function(idx, obj) {
|
|
if (obj.PaymentID == 'PT05') {
|
|
|
|
|
|
|
|
} else {
|
|
$("#PaymentTerms").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
$('#drpSupplier').change(function() {
|
|
|
|
var id = $('#drpSupplier').val();
|
|
$("#SupAddress").val('');
|
|
|
|
|
|
if (id != '0') {
|
|
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
|
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
|
var PaymentID = '';
|
|
$('#PaymentTerms').empty();
|
|
|
|
$.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);
|
|
}
|
|
PaymentID = obj.PaymentID;
|
|
//PaymentID = obj.PaymentID;
|
|
$('#PaymentTerms').val(obj.PaymentTerms);
|
|
}
|
|
});
|
|
|
|
|
|
if (PaymentID == 'PT08') {
|
|
$('#otheroptiondiv').show();
|
|
$('#Otherpayment').val('');
|
|
} else {
|
|
$('#otheroptiondiv').hide();
|
|
$('#Otherpayment').show();
|
|
}
|
|
|
|
$('#PaymentTerms').empty();
|
|
var paymentList = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
|
|
|
|
|
$.each(paymentList, function(pay, payobj)
|
|
|
|
{
|
|
if (payobj.PaymentID == PaymentID) {
|
|
|
|
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
|
|
|
}
|
|
// else
|
|
// {
|
|
// // $("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
$.each(Payment, function(pay, payobj) {
|
|
if (payobj.PaymentID == PaymentID) {
|
|
|
|
} else {
|
|
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
alert('Please select the SupplierID');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('#currencytype').change(function() {
|
|
$('#ExchangeRate').val('');
|
|
});
|
|
|
|
|
|
$('#ReqNo').change(function() {
|
|
|
|
var id = $('#ReqNo').val();
|
|
$("#AvlBudAmt").val('');
|
|
$("#CostCenter").empty();
|
|
$("#MaterialCode").empty();
|
|
$("#deptName").val('');
|
|
$("#UOM").val('');
|
|
$("#Quantity").val('');
|
|
$("#ItemName").val('');
|
|
$("#Rate").val('');
|
|
$("#txtBasicValue").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 isset($AvlimportBudAmt) ? $AvlimportBudAmt : 0 ?>';
|
|
//alert(AvlBudAmt);
|
|
if (AvlBudAmt == '') {
|
|
$("#AvlBudAmt").val(parseFloat(0).toFixed(2));
|
|
} else {
|
|
$("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2));
|
|
}
|
|
//alert(Material);
|
|
|
|
// For Binding DepartmentName
|
|
$.each(y, function(idx, obj) {
|
|
if (obj.ReqNo === id) {
|
|
$("#deptName").val(obj.DepartmentName);
|
|
$("#CostCenter").val(obj.CostCenterCode);
|
|
|
|
}
|
|
});
|
|
|
|
//$("#AvlBudAmt").val(AvlBudAmt);
|
|
// $("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2));
|
|
// For Binding Cost center for the selected department
|
|
/* $("#CostCenter").append( $('<option></option>').val("0").html("Select Cost Center") );
|
|
$.each(cost, function(idx, obj) {
|
|
if(obj.ReqNo === id)
|
|
{
|
|
$("#CostCenter").append( $('<option></option>').val(obj.CostCenterCode).html(obj.CostCenterCode + "-" + obj.CostCenterName) );
|
|
|
|
}
|
|
|
|
});*/
|
|
// 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();
|
|
$("#ItemName").val('');
|
|
$("#UOM").val('');
|
|
$("#Quantity").val('');
|
|
$("#ItemName").val('');
|
|
$("#Rate").val('');
|
|
$("#txtBasicValue").val('');
|
|
RequistQuantity = '';
|
|
//clearTaxField();
|
|
if (id != '0') {
|
|
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
|
// alert(Material);
|
|
for (i = 0; i < Material.length; i++) {
|
|
$.each(Material[i], function(idx, obj) {
|
|
if (obj.MaterialCode === id) {
|
|
$("#ItemName").val(obj.MaterialName);
|
|
$("#UOM").val(obj.UOM);
|
|
$("#Quantity").val(obj.Quantity);
|
|
RequistQuantity = obj.Quantity;
|
|
unit = obj.UOM;
|
|
// document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
|
|
// document.getElementById("labelEditPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
|
|
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
alert('Please select the MaterialCode');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#currencytype').change(function() { //alert();
|
|
var id = $('#currencytype').val();
|
|
var symbol = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
|
|
$.each(symbol, function(idx, obj) {
|
|
if (obj.Currency_Code == id) {
|
|
var sign = obj.FontCode2000;
|
|
var code = obj.Currency_Code;
|
|
//console.log(code);
|
|
// alert(code);labeladdexc
|
|
//alert(sign);
|
|
document.getElementById("label1").innerHTML = 'Exchange Rate in ' + code + '(' + sign + ')';
|
|
document.getElementById("labeltotal").innerHTML = 'Total Order Value ' + code + '(' + sign + ')';
|
|
|
|
document.getElementById("labeladdexc").innerHTML = 'Exchange Rate ' + code + '(' + sign + ')';
|
|
|
|
document.getElementById("labeleditexc").innerHTML = 'Exchange Rate ' + code + '(' + sign + ')';
|
|
|
|
|
|
|
|
document.getElementById("label2").innerHTML = 'Basic Value in ' + code + '(' + sign + ')';
|
|
document.getElementById("label3").innerHTML = 'Basic Value in ' + code + '(' + sign + ')';
|
|
document.getElementById("labelRate").innerHTML = 'Rate in ' + code + '(' + sign + ')';
|
|
document.getElementById("labelBasicpriceus").innerHTML = 'Basic Value In ' + code + '(' + sign + ')';
|
|
//document.getElementById("labelBasicINR").innerHTML ='Basic Price INR';
|
|
document.getElementById("labelEditRate").innerHTML = 'Rate in ' + sign;
|
|
document.getElementById("labelEditBasicPriceUs").innerHTML = 'Basic Value In ' + code + '(' + sign + ')';
|
|
//document.getElementById("labelEditBasicINR").innerHTML ='Basic Price in INR';
|
|
|
|
document.getElementById("labelTotalAmount").innerHTML = 'Total Amount ' + code + '(' + sign + ')';
|
|
document.getElementById("labelEditTotalAmount").innerHTML = 'Total Amount ' + code + '(' + sign + ')';
|
|
|
|
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function USRate() {
|
|
|
|
if ($('#imBasicPrice').val() != '' && $('#ExchangeRate').val() != '') {
|
|
var txtbasics = parseFloat($('#imBasicPrice').val());
|
|
var txtexchangerate = parseFloat($('#ExchangeRate').val());
|
|
$('#ExchangeRt').val(txtexchangerate);
|
|
var txtINRvalue = txtbasics * txtexchangerate;
|
|
$('#INRBasicvalues').val(txtINRvalue)
|
|
$('#INRBasicvalue').val(Math.round(txtINRvalue));
|
|
$('#BasicPriceTax').val(txtINRvalue);
|
|
//txtINR = Math.ceil(txtINR*10)/10;
|
|
txtINR = Math.round(txtINRvalue);
|
|
//alert(txtINR);BasicPriceTax
|
|
|
|
$('#AfterBasicPriceTax').val(txtINR);
|
|
$('#imBasicPrice').val(txtbasics);
|
|
$('#ExchangeRt').val(txtexchangerate);
|
|
$('#EditAfterBasicPriceTax').val(txtINR);
|
|
$('#EditimBasicPrice').val(txtbasics);
|
|
$('#EditExchangeRt').val(txtexchangerate);
|
|
$('#EditINRBasicvalue').val(txtINRvalue);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
function QtyZerocheck() {
|
|
if (($('#Rate').val() == "0") || $('#Quantity').val() == "0" || ($('#Rate').val() == '') || $('#Quantity').val() == '') {
|
|
alert('Please Enter A Valid Number for Rate and Quantity');
|
|
$('#txtBasicValue').val(0);
|
|
$('#imBasicPrice').val(0);
|
|
$('#ExchangeRt').val(0);
|
|
$('#INRBasicvalues').val(0);
|
|
$('#AfterBasicPriceTax').val(0);
|
|
$('#INRBasicvalue').val(0);
|
|
return false;
|
|
|
|
} else
|
|
return true;
|
|
|
|
}
|
|
|
|
function Ratechange() {
|
|
//alert();
|
|
// if($('#ReqNo').val() == "0")
|
|
// {
|
|
// alert('Please select the Requisition Number');
|
|
// $('#ReqNo').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($('#Quantity').val() != '' && $('#Rate').val() != '')
|
|
// {
|
|
if (QtyZerocheck()) {
|
|
|
|
var txtQuantity = $('#Quantity').val() == '' ? '0.00' : $('#Quantity').val();
|
|
//console.log(txtQuantity);
|
|
// var txtQuantity = parseFloat( $('#Quantity').val());
|
|
var txtUnitPrice = $('#Rate').val() == '' ? '0.00' : $('#Rate').val();
|
|
//var txtUnitPrice = parseFloat($('#Rate').val());
|
|
|
|
var Tot = parseFloat(txtQuantity * txtUnitPrice).toFixed(2);
|
|
//console.log(Tot);
|
|
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
|
$('#imBasicPrice').val(parseFloat(Tot).toFixed(2));
|
|
|
|
|
|
var txtbasics = parseFloat($('#imBasicPrice').val());
|
|
var txtexchangerate = parseFloat($('#ExchangeRate').val());
|
|
$('#ExchangeRt').val(txtexchangerate.toFixed(2));
|
|
var txtINRvalue = txtbasics * txtexchangerate;
|
|
$('#INRBasicvalues').val(parseFloat(txtINRvalue).toFixed(2));
|
|
$('#INRBasicvalue').val(parseFloat(txtINRvalue).toFixed(2));
|
|
$('#BasicPriceTax').val(txtINRvalue);
|
|
|
|
|
|
$('#TotalExp').val(parseFloat(Tot).toFixed(2));
|
|
//txtINR = Math.ceil(txtINR*10)/10;
|
|
txtINR = Math.round(txtINRvalue);
|
|
//alert(txtINR);BasicPriceTax
|
|
var txtEditQuantity = parseFloat($('#EditQuantity').val());
|
|
var txtEditUnitPrice = parseFloat($('#EditRate').val());
|
|
var EditTot = txtEditQuantity * txtEditUnitPrice;
|
|
// console.log(EditTot);
|
|
$('#EdittxtBasicValue').val(parseFloat(EditTot).toFixed(2));
|
|
var EditBasicINR = EditTot * txtexchangerate;
|
|
$('#AfterBasicPriceTax').val(parseFloat(txtINRvalue).toFixed(2));
|
|
$('#imBasicPrice').val(parseFloat(txtbasics).toFixed(2));
|
|
$('#ExchangeRt').val(parseFloat(txtexchangerate).toFixed(2));
|
|
$('#EditAfterBasicPriceTax').val(parseFloat(EditBasicINR).toFixed(2));
|
|
$('#EditimBasicPrice').val(parseFloat(EditTot).toFixed(2));
|
|
$('#EditExchangeRt').val(parseFloat(txtexchangerate).toFixed(2));
|
|
$('#EditINRBasicvalue').val(parseFloat(EditBasicINR).toFixed(2));
|
|
//calculateFreight(0)
|
|
Calculateloadingcharge();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function EditQtyZerocheck() {
|
|
if (($('#EditRate').val() == "0") || $('#EditQuantity').val() == "0" || ($('#EditRate').val() == '') || $('#EditQuantity').val() == '') {
|
|
alert('Please Enter A Valid Number for Rate and Quantity');
|
|
$('#EdittxtBasicValue').val(0);
|
|
$('#EditimBasicPrice').val(0);
|
|
var txtexchangerate = parseFloat($('#ExchangeRate').val());
|
|
$('#EditExchangeRt').val(parseFloat(txtexchangerate).toFixed(2));
|
|
$('#EditINRBasicvalues').val(0);
|
|
$('#EditAfterBasicPriceTax').val(0);
|
|
$('#EditINRBasicvalue').val(0);
|
|
return false;
|
|
|
|
} else
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
function EditRatechange() {
|
|
|
|
|
|
|
|
if (EditQtyZerocheck()) {
|
|
var txteditQuantity = parseFloat($('#EditQuantity').val());
|
|
var txteditUnitPrice = parseFloat($('#EditRate').val());
|
|
var editTot = txteditQuantity * txteditUnitPrice
|
|
|
|
if (isNaN(editTot)) {
|
|
$('#EdittxtBasicValue').val('');
|
|
} else {
|
|
$('#EdittxtBasicValue').val(parseFloat(editTot).toFixed(2));
|
|
$('#EditTotalExp').val(parseFloat(editTot).toFixed(2));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isNaN(editTot)) {
|
|
$('#EditimBasicPrice').val('');
|
|
} else {
|
|
$('#EditimBasicPrice').val(parseFloat(editTot).toFixed(2));
|
|
|
|
}
|
|
|
|
|
|
//$('#EdittxtBasicValue').val(editTot);
|
|
//$('#EditimBasicPrice').val(editTot);
|
|
var exchangerate = parseFloat($('#EditExchangeRt').val());
|
|
var txtINR = editTot * exchangerate;
|
|
|
|
if (isNaN(txtINR)) {
|
|
$('#EditINRBasicvalue').val('');
|
|
} else {
|
|
$('#EditINRBasicvalue').val(parseFloat(txtINR).toFixed(2));
|
|
}
|
|
|
|
|
|
if (isNaN(txtINR)) {
|
|
$('#EditAfterBasicPriceTax').val('');
|
|
} else {
|
|
$('#EditAfterBasicPriceTax').val(parseFloat(txtINR).toFixed(2));
|
|
}
|
|
|
|
|
|
|
|
//$('#EditINRBasicvalue').val(txtINR);
|
|
$('#EditBasicPriceTax').val(txtINR);
|
|
//$('#EditAfterBasicPriceTax').val(txtINR);
|
|
calculateFreight(1);
|
|
EditCalculateloadingcharge();
|
|
}
|
|
}
|
|
|
|
|
|
var avalbudAmte = <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
|
|
//alert(avalbudAmte)
|
|
function validateEditExceedLimit() {
|
|
//var avalbudAmt = parseFloat($('#EditAvlBudAmt').val());
|
|
var basicAmountRate = parseFloat($('#EdittxtBasicValue').val());
|
|
var totalAmount = parseFloat($('#EditTotalExp').val());
|
|
var exchangerate = parseFloat($('#EditExchangeRt').val());
|
|
var exp = 0;
|
|
exp = basicAmountRate * exchangerate;
|
|
//console.log(exp);
|
|
|
|
// if(exp > avalbudAmte || totalAmount > avalbudAmte)
|
|
// {
|
|
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
|
// $('#EditRate').focus();
|
|
// return false;
|
|
// }
|
|
// else
|
|
// {
|
|
return true;
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
var avalbudAmt = <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
|
|
|
|
//alert(avalbudAmt);
|
|
|
|
function validateExceedLimit() {
|
|
|
|
//alert('ddf');
|
|
//avalbudAmt = parseFloat($('#AvlBudAmt').val());
|
|
|
|
var basicAmountRate = parseFloat($('#txtBasicValue').val());
|
|
var totalAmount = parseFloat($('#TotalExp').val());
|
|
var exchangerate = parseFloat($('#ExchangeRt').val());
|
|
var exp = 0;
|
|
exp = basicAmountRate * exchangerate;
|
|
//console.log(exp);
|
|
|
|
// if(exp > avalbudAmt || totalAmount > avalbudAmt)
|
|
// {
|
|
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
|
// $('#Rate').focus();
|
|
// return false;
|
|
// }
|
|
// else
|
|
// {
|
|
return true;
|
|
//}
|
|
|
|
}
|
|
|
|
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 = parseFloat($('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val());
|
|
|
|
//$('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').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));
|
|
}
|
|
|
|
CalculateCustomduty()
|
|
}
|
|
|
|
|
|
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 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 txtcustompercentage=parseFloat($('#Customduty').val());
|
|
|
|
|
|
|
|
var accessible = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').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 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 ExceedQuantityCheck() {
|
|
// RequistQuantity
|
|
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
|
var ReqQuantity = parseFloat(RequistQuantity);
|
|
if (EnterQuantity > ReqQuantity) {
|
|
alert('Your exceeding the Quantity from the Requisition Quantity:' + RequistQuantity + '.Please adjust the Quantity to proceed further.');
|
|
//$('#Quantity').val(RequistQuantity);
|
|
$('#Quantity').focus();
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
function ExceedEditQuantityCheck() {
|
|
// RequistQuantity
|
|
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
|
var ReqQuantity = parseFloat(RequistQuantity);
|
|
if (EnterQuantity > ReqQuantity) {
|
|
alert('Your exceeding the Quantity from the Requisition Quantity:' + RequistQuantity + '.Please adjust the Quantity to proceed further.');
|
|
//$('#Quantity').val(RequistQuantity);
|
|
$('#EditQuantity').focus();
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
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());
|
|
|
|
// txtedcesspercentage=parseFloat($('#CustomEDcess').val());
|
|
|
|
|
|
txtcustomduty1 = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').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 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 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 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 CalculateIgst() {
|
|
var basucprice = parseFloat($('#AfterBasicPriceTax').val());
|
|
var landing = parseFloat($('#AfterLandingCharge').val());
|
|
// var custom=parseFloat($('#AfterCustomduty').val());
|
|
// var customsh=parseFloat($('#AfterCustomSHcess').val());
|
|
// var customed=parseFloat($('#AfterCustomEDcess').val());
|
|
|
|
// var assessble=parseFloat($('#AfterAssessable').val());
|
|
|
|
var assessble = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val());
|
|
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 tot=parseFloat(assessble)+parseFloat(custom)+parseFloat(customsh)+
|
|
// parseFloat(customed);
|
|
|
|
var tot = <?php echo SUBTOTAL; ?>;
|
|
//var igstpercentage=parseFloat($('#Igst').val());
|
|
var igstpercentage = parseFloat($('#Igst').val() == '' ? '0.00' : $('#Igst').val());
|
|
|
|
|
|
var afterigst = <?php echo IGST; ?>;
|
|
|
|
|
|
if (isNaN(tot)) {
|
|
$('#Subtotal').val('');
|
|
} else {
|
|
$('#Subtotal').val(parseFloat(tot).toFixed(2));
|
|
}
|
|
|
|
|
|
|
|
if (isNaN(afterigst)) {
|
|
$('#AfterIgst').val('');
|
|
} else {
|
|
$('#AfterIgst').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 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($('#EditIgst').val() == '' ? '0.00' : $('#EditIgst').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)) {
|
|
$('#EditAfterIgst').val('');
|
|
} else {
|
|
$('#EditAfterIgst').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 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($('#AfterIgst').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($('#Quantity').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 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($('#EditQuantity').val());
|
|
|
|
|
|
var igst = parseFloat($('#EditAfterIgst').val());
|
|
var totduty = parseFloat($('#EditGrossdutypayable').val());
|
|
|
|
|
|
|
|
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($('#EditQuantity').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));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#drpFreight').change(function() {
|
|
|
|
var FreightType = $("#drpFreight").val();
|
|
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#TripsValue').show();
|
|
} else {
|
|
|
|
$('#TripsValue').hide();
|
|
}
|
|
if ($('#Rate').val() != '' && $('#MaterialCode').val() != "0") {
|
|
selValue = $("#drpFreight").val();
|
|
$('#txtFreight').val('');
|
|
$('#txtAfterFreight').val('');
|
|
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtFreight').attr('readonly', 'true');
|
|
$('#txtFreight').val('0.00');
|
|
|
|
} else {
|
|
$('#txtFreight').removeAttr('readonly', 'true');
|
|
$('#txtFreight').val('');
|
|
|
|
|
|
}
|
|
} else {
|
|
alert('Please Select MaterialCode and Rate Field Value');
|
|
$('#drpFreight').val("0");
|
|
$('#Rate').focus();
|
|
}
|
|
calculateFreight(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function calculateFreight(isEdit) {
|
|
|
|
|
|
//alert();
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtFreight').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtFreight').val('');
|
|
return false;
|
|
} else {
|
|
// var basicValue = parseFloat($('#txtBasicValue').val());
|
|
var basicValue = parseFloat($('#INRBasicvalue').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 UOM = parseFloat($('#UOM').val());
|
|
var Quantity = parseFloat($('#Quantity').val());
|
|
//alert(FreightType);
|
|
var AfterFreight = 0.0;
|
|
if (FreightType == PercentageType) {
|
|
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
|
} else if (FreightType == 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");
|
|
}
|
|
|
|
}
|
|
// calculateTotalValue();
|
|
} else {
|
|
|
|
//alert();
|
|
if ($('#EditMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditMaterialCode').focus();
|
|
$('#txtEditFreight').val('');
|
|
return false;
|
|
} else if ($('#EditRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRate').focus();
|
|
$('#txtEditFreight').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#EditINRBasicvalue').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 UOM = parseFloat($('#EditUOM').val());
|
|
var Quantity = parseFloat($('#EditQuantity').val());
|
|
//alert(FreightType);
|
|
var AfterFreight = 0.0;
|
|
if (FreightType == PercentageType) {
|
|
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
|
} else if (FreightType == 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;
|
|
$('#edittxtAfterFreight').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);
|
|
|
|
$('#edittxtAfterFreight').val(AfterFreightval);
|
|
} else {
|
|
$('#edittxtAfterFreight').val("0.00");
|
|
}
|
|
|
|
}
|
|
// calculateEditTotalValue();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$('.AddImport').click(function() {
|
|
|
|
//alert('out');
|
|
if (validateImport() && ExceedQuantityCheck() && validateExceedLimit() && QtyZerocheck()) {
|
|
//alert('in');
|
|
|
|
var temp = index;
|
|
//alert('in');
|
|
var Reqnumber = $('#ReqNo').val();
|
|
//alert(JSON.strigify(Reqnumber));
|
|
var departmentName = $('#deptName').val();
|
|
var AvilBudget = $('#AvlBudAmt').val();
|
|
var costCode = $('#CostCenter').val();
|
|
var materialCode = $('#MaterialCode').val();
|
|
var materialName = $("#ItemName").val();
|
|
var uom = $("#UOM").val();
|
|
var quantity = $("#Quantity").val();
|
|
var itemRate = $("#Rate").val();
|
|
var BasicAmt = parseFloat($("#txtBasicValue").val());
|
|
var taxamt = parseFloat($("#RMCIncludingCustomers").val());
|
|
var totalexp = parseFloat($("#TotalExp").val());
|
|
|
|
var Exchangerate = parseFloat($("#ExchangeRt").val());
|
|
var Basicpriceinus = parseFloat($("#imBasicPrice").val());
|
|
var taxexp = taxamt * quantity;
|
|
var txtbasicINR = parseFloat($('#INRBasicvalue').val());
|
|
|
|
|
|
var BasicPrice = $("#BasicPriceTax").val();
|
|
var AfterBasicPrice = parseFloat($("#AfterBasicPriceTax").val());
|
|
var LandingChargee = $("#LandingCharge").val();
|
|
var AfterLandingChargee = $("#AfterLandingCharge").val();
|
|
var Accessible = $('#AfterAssessable').val();
|
|
var CustomDutyy = $("#Customduty").val();
|
|
var AfterCustomDutyy = $("#AfterCustomduty").val();
|
|
var CustomED = $("#CustomEDcess").val();
|
|
var AfterCustomED = $("#AfterCustomEDcess").val();
|
|
var CustomSH = $("#CustomSHcess").val();
|
|
var AfterCustomSH = $("#AfterCustomSHcess").val();
|
|
var Subtotal = $('#Subtotal').val();
|
|
var Igst = $('#Igst').val();
|
|
var AfterIgst = $('#AfterIgst').val();
|
|
var GrossDuty = $("#Grossdutypayable").val();
|
|
var PurchaseQuantity = $("#PurQuantity").val();
|
|
var Dutyimpact = $('#DutyImpact').val();
|
|
var CustomDutyExpense = $("#CustomDutyExpenses").val();
|
|
var ClearingCharges = $('#ClearingCharges').val();
|
|
var Nett = $('#Nett').val();
|
|
|
|
var FreightType = $('#drpFreight').val();
|
|
var Nooftrip = $('#NOOfTrips').val();
|
|
var Freightrate = $('#txtFreight').val();
|
|
var AfterFreightAmount = $('#txtAfterFreight').val();
|
|
|
|
|
|
var splins = $.trim(tinymce.get('addtxtInstruction').getContent());
|
|
// alert(splins);
|
|
var per = $('#AddPer').val();
|
|
if (per == '') {
|
|
var per = $('#UOM').val();
|
|
}
|
|
|
|
var receivedqty = '';
|
|
var rejectedqty = '';
|
|
var pendingqty = '';
|
|
|
|
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
|
|
|
|
|
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
|
SelectedMaterialCode[CollIndex] = materialCode;
|
|
CollIndex = CollIndex + 1;
|
|
|
|
SelectedMaterialList.Mat.push({
|
|
"materialCode": materialCode,
|
|
"ReqNo": Reqnumber,
|
|
|
|
});
|
|
|
|
|
|
|
|
populateValueMainFormForImportTax();
|
|
|
|
index = parseInt(index) + 1;
|
|
//alert('in');
|
|
var template = jQuery("#ImportList").html();
|
|
$('#ImportAppend').append(_.template(template, {
|
|
index: temp,
|
|
ReqNo: Reqnumber,
|
|
MaterialCode: materialCode,
|
|
Description: materialName,
|
|
Quantity: quantity,
|
|
UOM: uom,
|
|
Rate: itemRate,
|
|
BasicAmount: BasicAmt,
|
|
Taxvalue: taxexp,
|
|
TotalValue: totalexp,
|
|
ReceivedQty: receivedqty,
|
|
RejectedQty: rejectedqty,
|
|
PendingQty: pendingqty
|
|
}));
|
|
//alert(JSON.strigify(BasicAmt));
|
|
|
|
|
|
//$('#ImportAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,ItemName:materialName,Quantity:quantity,UOM:uom,Rate:itemRate,BasicAmount:BasicAmt,Taxvalue:taxamt,TotalValue:totalexp}));
|
|
//clearTaxField();
|
|
|
|
//from above defined variables
|
|
|
|
var theForm = $(".ImportPO");
|
|
|
|
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
|
|
addHidden(theForm, "departmentName" + temp, departmentName);
|
|
addHidden(theForm, "AvilBudget" + temp, AvilBudget);
|
|
addHidden(theForm, "costCode" + temp, costCode);
|
|
addHidden(theForm, "materialCode" + temp, materialCode);
|
|
addHidden(theForm, "materialName" + temp, materialName);
|
|
addHidden(theForm, "uom" + temp, uom);
|
|
addHidden(theForm, "quantity" + temp, quantity);
|
|
addHidden(theForm, "itemRate" + temp, itemRate);
|
|
addHidden(theForm, "BasicAmt" + temp, BasicAmt);
|
|
addHidden(theForm, "taxamt" + temp, taxamt);
|
|
addHidden(theForm, "Exchangerate" + temp, Exchangerate);
|
|
addHidden(theForm, "BasicPriceTax" + temp, BasicPriceTax);
|
|
addHidden(theForm, "BasicPriceINR" + temp, txtbasicINR);
|
|
addHidden(theForm, "BasicPriceinUS" + temp, Basicpriceinus);
|
|
|
|
addHidden(theForm, "AfterBasicPriceTax" + temp, AfterBasicPrice);
|
|
addHidden(theForm, "LandingChargee" + temp, LandingChargee);
|
|
addHidden(theForm, "AfterLandingChargee" + temp, AfterLandingChargee);
|
|
addHidden(theForm, "AfterAssessable" + temp, Accessible);
|
|
addHidden(theForm, "Customduty" + temp, CustomDutyy);
|
|
addHidden(theForm, "AfterCustomduty" + temp, AfterCustomDutyy);
|
|
addHidden(theForm, "CustomEDcess" + temp, CustomED);
|
|
addHidden(theForm, "AfterCustomEDcess" + temp, AfterCustomED);
|
|
addHidden(theForm, "CustomSHcess" + temp, CustomSH);
|
|
addHidden(theForm, "AfterCustomSHcess" + temp, AfterCustomSH);
|
|
addHidden(theForm, "Grossdutypayable" + temp, GrossDuty);
|
|
addHidden(theForm, "Subtotal" + temp, Subtotal);
|
|
addHidden(theForm, "PurQuantity" + temp, PurchaseQuantity);
|
|
addHidden(theForm, "CustomDutyExpenses" + temp, CustomDutyExpense);
|
|
addHidden(theForm, "Igst" + temp, Igst);
|
|
addHidden(theForm, "AfterIgst" + temp, AfterIgst);
|
|
addHidden(theForm, "Dutyimpact" + temp, Dutyimpact);
|
|
addHidden(theForm, "ClearingCharges" + temp, ClearingCharges);
|
|
addHidden(theForm, "Nett" + temp, Nett);
|
|
|
|
|
|
|
|
addHidden(theForm, "TotalExp" + temp, totalexp);
|
|
addHidden(theForm, "TotalValue" + temp, BasicAmt);
|
|
|
|
addHidden(theForm, "FreightType" + temp, FreightType);
|
|
addHidden(theForm, "NoofTrip" + temp, Nooftrip);
|
|
addHidden(theForm, "FreightRate" + temp, Freightrate);
|
|
addHidden(theForm, "AfterFreightRate" + temp, AfterFreightAmount);
|
|
addHidden(theForm, "Per" + temp, per.trim());
|
|
|
|
addHidden(theForm, "Addinstruction" + temp, splins.trim());
|
|
|
|
|
|
// alert(JSON.stringify(totalexp));
|
|
|
|
//var a=$('#Addinstruction'+temp).val();
|
|
// var b=$('#NoofTrip'+temp).val();
|
|
// var c=$('#FreightRate'+temp).val();
|
|
// var d=$('#AfterFreightRate'+temp).val();
|
|
|
|
|
|
//console.log(a);
|
|
// console.log(b);
|
|
// console.log(c);
|
|
// console.log(d);
|
|
|
|
|
|
|
|
// addHidden(theForm,"AfterBasicPriceTax"+temp,AfterBasicPriceTax);
|
|
//addHidden(theForm,"AfterBasicPriceTax"+temp,AfterBasicPriceTax);
|
|
$('#txtRowCount').val(temp);
|
|
clearTaxField();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function validateImport() {
|
|
//alert();
|
|
if ($('#ReqNo').val() == "0") {
|
|
alert('Please select the Requisition Number');
|
|
$('#ReqNo').focus();
|
|
return false;
|
|
} else if ($('#CostCenter').val() == "0") {
|
|
alert('Please select the Cost center');
|
|
$('#CostCenter').focus();
|
|
return false;
|
|
} else if ($('#MaterialCode').val() == "0") {
|
|
('Please select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
return false;
|
|
} else if ($('#Quantity').val() == '') {
|
|
alert('Please Enter the Quantity value');
|
|
$('#Quantity').focus();
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate of the Item');
|
|
$('#Rate').focus();
|
|
return false;
|
|
} else if ($('#imBasicPrice').val() == '') {
|
|
alert('Please Enter Basic Price In Us');
|
|
$('#imBasicPrice').focus();
|
|
return false;
|
|
}
|
|
/* else if(ExceedQuantityCheck() == false)
|
|
{
|
|
return false;
|
|
}*/
|
|
else
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
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 populateValueMainFormForImportTax() {
|
|
|
|
//$('#txtToatlOrder').val(parseFloat(TotalOrderValue)).toFixed(2);
|
|
|
|
var AfterLandingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
|
|
var AfterCustomduty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
|
|
var AfterCustomEDcess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
|
|
var AfterCustomSHcess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
|
|
var Grossdutypayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val();
|
|
var totalexp = $('#TotalExp').val() == '' ? '0.00' : $('#TotalExp').val();
|
|
|
|
//console.log(totalexp);
|
|
var freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
|
var Assessable = $('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val();
|
|
var subtotal = $('#Subtotal').val() == '' ? '0.00' : $('#Subtotal').val();
|
|
var igst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
|
var Dutypayable = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
|
|
|
var TotalLanding = $('#txttotallanding').val() == '' ? '0.00' : $('#txttotallanding').val();
|
|
var TotalCustom = $('#txttotalcustom').val() == '' ? '0.00' : $('#txttotalcustom').val();
|
|
var TotalCustomED = $('#txttotalcustomED').val() == '' ? '0.00' : $('#txttotalcustomED').val();
|
|
var TotalCustomSH = $('#txttotalcustomSH').val() == '' ? '0.00' : $('#txttotalcustomSH').val();
|
|
var TotalGrossDuty = $('#txttotalgrossduty').val() == '' ? '0.00' : $('#txttotalgrossduty').val();
|
|
var TotalOrder = $('#txtToatlOrder').val() == '' ? '0.00' : $('#txtToatlOrder').val();
|
|
var TotalFreight = $('#txtTotalFreight').val() == '' ? '0.00' : $('#txtTotalFreight').val();
|
|
var TotalAssesable = $('#txttotalAssessable').val() == '' ? '0.00' : $('#txttotalAssessable').val();
|
|
var TotalSubtotal = $('#txttotalSubtotal').val() == '' ? '0.00' : $('#txttotalSubtotal').val();
|
|
var Totaligst = $('#txttotalIgst').val() == '' ? '0.00' : $('#txttotalIgst').val();
|
|
|
|
$('#txttotallanding').val((parseFloat(AfterLandingCharge) + parseFloat(TotalLanding)).toFixed(2));
|
|
|
|
$('#txttotalcustom').val((parseFloat(TotalCustom) + parseFloat(AfterCustomduty)).toFixed(2));
|
|
|
|
|
|
$('#txttotalcustomED').val((parseFloat(TotalCustomED) + parseFloat(AfterCustomEDcess)).toFixed(2));
|
|
$('#txttotalcustomSH').val((parseFloat(TotalCustomSH) + parseFloat(AfterCustomSHcess)).toFixed(2));
|
|
|
|
$('#txttotalgrossduty').val((parseFloat(TotalGrossDuty) + parseFloat(Grossdutypayable)).toFixed(2));
|
|
|
|
|
|
$('#txtToatlOrder').val((parseFloat(TotalOrder) + parseFloat(totalexp)).toFixed(2));
|
|
|
|
$('#txtTotalFreight').val((parseFloat(TotalFreight) + parseFloat(freight)).toFixed(2));
|
|
|
|
$('#txttotalAssessable').val((parseFloat(TotalAssesable) + parseFloat(Assessable)).toFixed(2));
|
|
|
|
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal) + parseFloat(subtotal)).toFixed(2));
|
|
|
|
$('#txttotalIgst').val((parseFloat(Totaligst) + parseFloat(igst)).toFixed(2));
|
|
//alert(JSON.stringify(totalexp));
|
|
//alert(TotalOrder);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function clearTaxField() {
|
|
//$('#AfterBasicPriceTax').val('');
|
|
// $('#ReqNo').val('');
|
|
//$('#deptName').val('');
|
|
//$('#CostCenter').val('');
|
|
//$('#AvlBudAmt').val('');
|
|
$('#MaterialCode').val('');
|
|
$('#ItemName').val('');
|
|
$('#UOM').val('');
|
|
$('#Quantity').val('');
|
|
$('#Rate').val('');
|
|
$('#txtBasicValue').val('');
|
|
$('#imBasicPrice').val('');
|
|
$('#ExchangeRt').val('');
|
|
$('#INRBasicvalue').val('');
|
|
$('#BasicPriceTax').val('');
|
|
$('#AfterBasicPriceTax').val('');
|
|
$('#TotalExp').val('');
|
|
$('#AfterLandingCharge').val('');
|
|
$('#LandingCharge').val(0);
|
|
$('#AfterHighseas').val('');
|
|
$('#Highseas').val(0);
|
|
$('#AfterCustomduty').val('');
|
|
$('#Customduty').val(0);
|
|
$('#AfterExcisedutyTax').val('');
|
|
$('#ExcisedutyTax').val(0);
|
|
$('#AfterExcisedutyEDcess').val('');
|
|
$('#ExcisedutyEDcess').val(0);
|
|
$('#AfterExcisedutySHcess').val('');
|
|
$('#ExcisedutySHcess').val(0);
|
|
$('#AfterCustomEDcess').val('');
|
|
$('#CustomEDcess').val(0);
|
|
$('#AfterCustomSHcess').val('')
|
|
$('#CustomSHcess').val(0);
|
|
$('#AfterCustomSHcess').val('');
|
|
$('#AfterAdditionalExciseduty').val('');
|
|
$('#AdditionalExciseduty').val(0);
|
|
$('#Grossdutypayable').val('');
|
|
$('#AvailableModvat').val('');
|
|
$('#Grossexpenses').val('');
|
|
$('#PurQuantity').val('');
|
|
$('#purchaserate').val('');
|
|
$('#CustomDutyExpenses').val('');
|
|
$('#RMCIncludingCustomers').val('');
|
|
|
|
$('#drpFreight').val('');
|
|
|
|
$('#NOOfTrips').val('');
|
|
|
|
$('#txtFreight').val('');
|
|
|
|
$('#txtAfterFreight').val('');
|
|
|
|
$('#AddPer').val('');
|
|
|
|
|
|
$('#AfterAssessable').val('');
|
|
$('#Subtotal').val('');
|
|
$('#Igst').val(0);
|
|
$('#AfterIgst').val('');
|
|
$('#DutyImpact').val('');
|
|
$('#ClearingCharges').val('');
|
|
$('#Nett').val('');
|
|
|
|
//$('#addtxtInstruction').val('');
|
|
|
|
tinymce.get('addtxtInstruction').setContent('');
|
|
}
|
|
|
|
|
|
$("#editimportpomodel").on("shown.bs.modal", function(e) {
|
|
userid = $(e.relatedTarget).data('userid');
|
|
//alert(userid);
|
|
//alert('inadd');
|
|
var tr = document.getElementById(userid);
|
|
//alert(tr);
|
|
var cellval = tr.cells;
|
|
//alert(cellval);
|
|
var id = $('#Reqnumber' + userid).val();
|
|
//alert(id);
|
|
$('#EditReqNo').val($('#Reqnumber' + userid).val());
|
|
|
|
//alert($('#Reqnumber'+userid).val());
|
|
$('#EditdeptName').val($('#departmentName' + userid).val());
|
|
$("#EditCostCenter").val($('#costCode' + userid).val());
|
|
$('#EditAvlBudAmt').val($('#AvilBudget' + userid).val());
|
|
|
|
$('#EditItemName').val($('#materialName' + userid).val());
|
|
$('#EditUOM').val($('#uom' + userid).val());
|
|
var uom = parseFloat($('#uom' + userid).val());
|
|
//console.log(uom);
|
|
$('#EditQuantity').val($('#quantity' + userid).val());
|
|
RequistQuantity = $('#quantity' + userid).val();
|
|
var editrate = parseFloat($('#itemRate' + userid).val()).toFixed(2);
|
|
// console.log(editrate);
|
|
$('#EditRate').val(editrate);
|
|
//$('#EditRate').val($('#itemRate'+userid).val());
|
|
var basic = parseFloat($('#BasicAmt' + userid).val()).toFixed(2);
|
|
//console.log(basic);
|
|
//$('#EdittxtBasicValue').val($('#BasicAmt'+userid).val());
|
|
//$('#EditimBasicPrice').val($("#BasicAmt"+userid).val());
|
|
|
|
$('#EdittxtBasicValue').val(basic);
|
|
$('#EditimBasicPrice').val(basic);
|
|
|
|
var inrbasicval = parseFloat($('#BasicPriceINR' + userid).val()).toFixed(2);
|
|
|
|
// $('#EditINRBasicvalue').val($("#BasicPriceINR"+userid).val());
|
|
$('#EditINRBasicvalue').val(inrbasicval);
|
|
$('#EditLandingCharge').val($("#LandingChargee" + userid).val());
|
|
$('#EditAfterLandingCharge').val($("#AfterLandingChargee" + userid).val());
|
|
|
|
$('#EditAfterAssessable').val($("#AfterAssessable" + userid).val());
|
|
|
|
|
|
$('#EditCustomduty').val($("#Customduty" + userid).val());
|
|
$('#EditAfterCustomduty').val($("#AfterCustomduty" + userid).val());
|
|
|
|
|
|
$('#EditCustomEDcess').val($("#CustomEDcess" + userid).val());
|
|
$('#EditAfterCustomEDcess').val($("#AfterCustomEDcess" + userid).val());
|
|
$('#EditCustomSHcess').val($("#CustomSHcess" + userid).val());
|
|
$('#EditAfterCustomSHcess').val($("#AfterCustomSHcess" + userid).val());
|
|
|
|
$('#EditSubtotal').val($("#Subtotal" + userid).val());
|
|
|
|
|
|
$('#EditIgst').val($("#Igst" + userid).val());
|
|
$('#EditAfterIgst').val($("#AfterIgst" + userid).val());
|
|
|
|
$('#EditGrossdutypayable').val($("#Grossdutypayable" + userid).val());
|
|
$('#EditGrossexpenses').val($("#Grossexpenses" + userid).val());
|
|
$('#EditPurQuantity').val($("#PurQuantity" + userid).val());
|
|
|
|
$('#EditCustomDutyExpenses').val($("#CustomDutyExpenses" + userid).val());
|
|
|
|
$('#EditDutyImpact').val($("#Dutyimpact" + userid).val());
|
|
$('#EditClearingCharges').val($("#ClearingCharges" + userid).val());
|
|
$('#EditNett').val($("#Nett" + userid).val());
|
|
|
|
var basicinr = parseFloat($('#AfterBasicPriceTax' + userid).val()).toFixed(2);
|
|
// $('#EditAfterBasicPriceTax').val($("#AfterBasicPriceTax"+userid).val());
|
|
$('#EditAfterBasicPriceTax').val(basicinr);
|
|
|
|
$('#EditTotalExp').val($("#TotalExp" + userid).val());
|
|
|
|
|
|
$('#drpeditFreight').val($('#FreightType' + userid).val());
|
|
$('#editNOOfTrips').val($('#NoofTrip' + userid).val());
|
|
$('#txtEditFreight').val($('#FreightRate' + userid).val());
|
|
$('#edittxtAfterFreight').val($('#AfterFreightRate' + userid).val());
|
|
|
|
//$('#edittxtInstruction').val($('#Addinstruction'+userid).val());
|
|
|
|
tinyMCE.get('edittxtInstruction').setContent($('#Addinstruction' + userid).val());
|
|
|
|
var FreightType = $('#drpeditFreight').val();
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#editTripsValue').show();
|
|
} else { //alert();
|
|
|
|
$('#editTripsValue').hide();
|
|
}
|
|
|
|
|
|
$('#EditPer').val($('#Per' + userid).val());
|
|
|
|
|
|
$('#EditTotalOrderValue').val(cellval[8].innerHTML);
|
|
$("#EditMaterialCode").empty();
|
|
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
|
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
|
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") {
|
|
|
|
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.EditImport').click(function() {
|
|
//alert('inside edit');
|
|
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
|
|
var CostCode = $("#EditCostCenter").val();
|
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
|
var editMaterialCode = $("#EditMaterialCode").val();
|
|
var edititemname = $("#EditItemName").val();
|
|
var editUOM = $('#EditUOM').val();
|
|
var editQuantity = $('#EditQuantity').val();
|
|
//console.log(editQuantity);
|
|
var itemRate = $("#EditRate").val();
|
|
var BasicValue = $("#EdittxtBasicValue").val();
|
|
var BasicPriceinUS = $('#EditimBasicPrice').val();
|
|
var BasicPriceinINR = $('#EditINRBasicvalue').val();
|
|
//var BasicValue=$("#EdittxtBasicValue").val();
|
|
var BasicPrice = $("#EditBasicPriceTax").val();
|
|
var AfterBasicPrice = $("#EditAfterBasicPriceTax").val();
|
|
var Landingcharge = $("#EditLandingCharge").val();
|
|
var AfterLanding = $("#EditAfterLandingCharge").val();
|
|
|
|
var CustomDuty = $("#EditCustomduty").val();
|
|
var AfterCustomDuty = $("#EditAfterCustomduty").val();
|
|
|
|
var CustomED = $("#EditCustomEDcess").val();
|
|
var AfterCustomED = $("#EditAfterCustomEDcess").val();
|
|
var CustomSH = $("#EditCustomSHcess").val();
|
|
var AfterCustomSH = $("#EditAfterCustomSHcess").val();
|
|
var GrossDuty = $("#EditGrossdutypayable").val();
|
|
|
|
|
|
var PurchaseRate = $("#Editpurchaserate").val();
|
|
var Quantity = $("#EditPurQuantity").val();
|
|
var CustomDutyExpense = $("#EditCustomDutyExpenses").val();
|
|
|
|
var Igst = $('#EditIgst').val();
|
|
var AfterIgst = $('#EditAfterIgst').val();
|
|
var Dutyimpact = $('#EditDutyImpact').val();
|
|
var Clearing = $('#EditClearingCharges').val();
|
|
var Nett = $('#EditNett').val();
|
|
var assessble = $('#EditAfterAssessable').val();
|
|
//console.log(assessble);
|
|
var Subtotal = $('#EditSubtotal').val();
|
|
|
|
|
|
var TotalExp = $('#EditTotalExp').val();
|
|
|
|
|
|
|
|
var FreightType = $('#drpeditFreight').val();
|
|
var FreightRate = $('#txtEditFreight').val();
|
|
var FreightRateAmount = $('#edittxtAfterFreight').val();
|
|
var Nooftrip = $('#editNOOfTrips').val();
|
|
var per = $('#EditPer').val();
|
|
|
|
var spclins = $.trim(tinymce.get('edittxtInstruction').getContent());
|
|
|
|
//console.log(spclins);
|
|
|
|
if (per == '') {
|
|
per = $('#EditUOM').val();
|
|
}
|
|
|
|
|
|
var FreightTypename = $('#drpeditFreight').val();
|
|
if (FreightTypename != "PER TRIP") {
|
|
|
|
Nooftrip = '';
|
|
}
|
|
|
|
// console.log(FreightType);
|
|
// console.log(FreightRate);
|
|
// console.log(FreightRateAmount);
|
|
// console.log(Nooftrip);
|
|
|
|
|
|
var tr = document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
|
|
|
|
cellval[4].innerHTML = editQuantity;
|
|
cellval[5].innerHTML = editUOM;
|
|
cellval[6].innerHTML = itemRate;
|
|
cellval[7].innerHTML = BasicValue;
|
|
|
|
$('#materialCode' + userid).val(editMaterialCode);
|
|
$('#materialName' + userid).val(edititemname);
|
|
$('#uom' + userid).val(editUOM);
|
|
$('#quantity' + userid).val(editQuantity);
|
|
$('#itemRate' + userid).val(itemRate);
|
|
$('#BasicAmt' + userid).val(BasicValue);
|
|
$('#BasicPriceinUS' + userid).val(BasicPriceinUS);
|
|
$('#BasicPriceINR' + userid).val(BasicPriceinINR);
|
|
$('#BasicPriceTax' + userid).val(BasicPrice);
|
|
$('#AfterBasicPriceTax' + userid).val(AfterBasicPrice);
|
|
$('#LandingChargee' + userid).val(Landingcharge);
|
|
$('#AfterLandingChargee' + userid).val(AfterLanding);
|
|
|
|
$('#Customduty' + userid).val(CustomDuty);
|
|
$('#AfterCustomduty' + userid).val(AfterCustomDuty);
|
|
|
|
$('#CustomEDcess' + userid).val(CustomED);
|
|
$('#AfterCustomEDcess' + userid).val(AfterCustomED);
|
|
$('#CustomSHcess' + userid).val(CustomSH);
|
|
$('#AfterCustomSHcess' + userid).val(AfterCustomSH);
|
|
|
|
|
|
$('#Grossdutypayable' + userid).val(GrossDuty);
|
|
|
|
|
|
$('#PurQuantity' + userid).val(Quantity);
|
|
$('#CustomDutyExpenses' + userid).val(CustomDutyExpense);
|
|
|
|
$('#Igst' + userid).val(Igst);
|
|
$('#AfterIgst' + userid).val(AfterIgst);
|
|
$('#Dutyimpact' + userid).val(Dutyimpact);
|
|
$('#AfterAssessable' + userid).val(assessble);
|
|
$('#Nett' + userid).val(Nett);
|
|
$('#CustomDutyExpenses' + userid).val(CustomDutyExpense);
|
|
$('#Subtotal' + userid).val(Subtotal);
|
|
|
|
$('#TotalExp' + userid).val(TotalExp);
|
|
|
|
$('#TotalValue' + userid).val(TotalExp);
|
|
|
|
$('#FreightType' + userid).val(FreightType);
|
|
|
|
$('#NoofTrip' + userid).val(Nooftrip);
|
|
|
|
$('#FreightRate' + userid).val(FreightRate);
|
|
|
|
$('#AfterFreightRate' + userid).val(FreightRateAmount);
|
|
|
|
$('#Per' + userid).val(per);
|
|
|
|
$('#Addinstruction' + userid).val(spclins);
|
|
|
|
|
|
//var a=$('#quantity'+userid).val();
|
|
// var b=$('#NoofTrip'+userid).val();
|
|
// var c=$('#FreightRate'+userid).val();
|
|
// var d=$('#AfterFreightRate'+userid).val();
|
|
|
|
|
|
//console.log(a);
|
|
// console.log(b);
|
|
// console.log(c);
|
|
// console.log(d);
|
|
|
|
|
|
populateValueMainFormForEditImportTax();
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
function populateValueMainFormForEditImportTax() {
|
|
var rows = document.getElementById('ImportTax').rows.length;
|
|
var TotalLanding = 0;
|
|
var TotalHighseas = 0;
|
|
var TotalCustom = 0;
|
|
var TotalExcise = 0;
|
|
var TotalExciseED = 0;
|
|
var TotalExciseSH = 0;
|
|
var TotalCustomED = 0;
|
|
var TotalCustomSH = 0;
|
|
var TotalAdditionalExcise = 0;
|
|
var TotalGrossDuty = 0;
|
|
var TotalAvlmodvat = 0;
|
|
var TotalGrossExpense = 0;
|
|
var TotalOrder = 0;
|
|
var TotalOrdervalue = 0;
|
|
var i = 0;
|
|
var TotalRMC = 0;
|
|
var TotalFrieght = 0;
|
|
var TotalAssesable = 0;
|
|
var TotalSubtotal = 0;
|
|
var TotalIGST = 0;
|
|
do {
|
|
i += 1;
|
|
var tr = document.getElementById(i);
|
|
if (tr != null) {
|
|
cells = tr.getElementsByTagName('td');
|
|
var rowid = cells[0].innerHTML;
|
|
|
|
var AfterLandingCharge = $('#AfterLandingChargee' + rowid).val() == '' ? '0.00' : $('#AfterLandingChargee' + rowid).val();
|
|
//console.log(AfterLandingCharge);
|
|
var AfterCustomduty = $('#AfterCustomduty' + rowid).val() == '' ? '0.00' : $('#AfterCustomduty' + rowid).val();
|
|
var AfterCustomEDcess = $('#AfterCustomEDcess' + rowid).val() == '' ? '0.00' : $('#AfterCustomEDcess' + rowid).val();
|
|
var AfterCustomSHcess = $('#AfterCustomSHcess' + rowid).val() == '' ? '0.00' : $('#AfterCustomSHcess' + rowid).val();
|
|
var Grossdutypayable = $('#Grossdutypayable' + rowid).val() == '' ? '0.00' : $('#Grossdutypayable' + rowid).val();
|
|
var Totalvalue = $('#TotalValue' + rowid).val() == '' ? '0.00' : $('#TotalValue' + rowid).val();
|
|
var AfterFreight = $('#AfterFreightRate' + rowid).val() == '' ? '0.00' : $('#AfterFreightRate' + rowid).val();
|
|
|
|
var Assessable = $('#AfterAssessable' + rowid).val() == '' ? '0.00' : $('#AfterAssessable' + rowid).val();
|
|
var Subtotal = $('#Subtotal' + rowid).val() == '' ? '0.00' : $('#Subtotal' + rowid).val();
|
|
var Igst = $('#AfterIgst' + rowid).val() == '' ? '0.00' : $('#AfterIgst' + rowid).val();
|
|
|
|
|
|
TotalLanding = parseFloat(TotalLanding) + parseFloat(AfterLandingCharge);
|
|
TotalCustom = parseFloat(TotalCustom) + parseFloat(AfterCustomduty);
|
|
TotalCustomED = parseFloat(TotalCustomED) + parseFloat(AfterCustomEDcess);
|
|
TotalCustomSH = parseFloat(TotalCustomSH) + parseFloat(AfterCustomSHcess);
|
|
TotalGrossDuty = parseFloat(TotalGrossDuty) + parseFloat(Grossdutypayable);
|
|
TotalOrdervalue = parseFloat(TotalOrdervalue) + parseFloat(Totalvalue);
|
|
TotalFrieght = parseFloat(TotalFrieght) + parseFloat(AfterFreight);
|
|
TotalAssesable = parseFloat(TotalAssesable) + parseFloat(Assessable);
|
|
TotalSubtotal = parseFloat(TotalSubtotal) + parseFloat(Subtotal);
|
|
TotalIGST = parseFloat(TotalIGST) + parseFloat(Igst);
|
|
|
|
//TotalRMC=parseFloat(TotalRMC)+parseFloat(RMC);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
} while (i < rows);
|
|
|
|
$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));
|
|
$('#txttotalcustom').val(parseFloat(TotalCustom).toFixed(2));
|
|
$('#txttotalcustomED').val(parseFloat(TotalCustomED).toFixed(2));
|
|
$('#txttotalcustomSH').val(parseFloat(TotalCustomSH).toFixed(2));
|
|
$('#txttotalgrossduty').val(parseFloat(TotalGrossDuty).toFixed(2));
|
|
//$('#txtToatlOrder').val(parseFloat(TotalOrder).toFixed(2));
|
|
$('#txtToatlOrder').val(parseFloat(TotalOrdervalue).toFixed(2));
|
|
$('#txtTotalFreight').val(parseFloat(TotalFrieght).toFixed(2));
|
|
$('#txttotalAssessable').val(parseFloat(TotalAssesable).toFixed(2));
|
|
$('#txttotalSubtotal').val(parseFloat(TotalSubtotal).toFixed(2));
|
|
$('#txttotalIgst').val(parseFloat(TotalIGST).toFixed(2));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));
|
|
}
|
|
|
|
|
|
|
|
function DeleteRow(rowid) { //alert('Delete');
|
|
var DelRows = $('#txtDeletedRow').val();
|
|
var answer = confirm(" Do you want to delete the Item from the List?")
|
|
if (answer) {
|
|
//alert('Confirm');
|
|
var td = document.getElementById(rowid);
|
|
td.parentNode.removeChild(td);
|
|
|
|
var removeItem = $('#materialCode' + rowid).val();
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
populateValueMainFormForDeleteItem(rowid);
|
|
|
|
}
|
|
|
|
|
|
|
|
function populateValueMainFormForDeleteItem(rowid) { //alert();
|
|
var TotalLanding = $('#txttotallanding').val();
|
|
|
|
var TotalCustom = $('#txttotalcustom').val();
|
|
|
|
var TotalCustomED = $('#txttotalcustomED').val();
|
|
var TotalCustomSH = $('#txttotalcustomSH').val();
|
|
|
|
var TotalGrossDuty = $('#txttotalgrossduty').val();
|
|
|
|
var TotalOrderValue = $('#txtToatlOrder').val();
|
|
var TotalFrieght = $('#txtTotalFreight').val();
|
|
|
|
var TotalAssessable = $('#txttotalAssessable').val();
|
|
|
|
var TotalSubtotal = $('#txttotalSubtotal').val();
|
|
|
|
var TotalIgst = $('#txttotalIgst').val();
|
|
//console.log(TotalSubtotal);
|
|
var AfterLandingCharge = $('#AfterLandingChargee' + rowid).val() == '' ? '0.00' : $('#AfterLandingChargee' + rowid).val();
|
|
//console.log(AfterLandingCharge);
|
|
|
|
var AfterCustomduty = $('#AfterCustomduty' + rowid).val() == '' ? '0.00' : $('#AfterCustomduty' + rowid).val();
|
|
|
|
|
|
var AfterCustomEDcess = $('#AfterCustomEDcess' + rowid).val() == '' ? '0.00' : $('#AfterCustomEDcess' + rowid).val();
|
|
var AfterCustomSHcess = $('#AfterCustomSHcess' + rowid).val() == '' ? '0.00' : $('#AfterCustomSHcess' + rowid).val();
|
|
|
|
var Grossdutypayable = $('#Grossdutypayable' + rowid).val() == '' ? '0.00' : $('#Grossdutypayable' + rowid).val();
|
|
|
|
var totalExp = $('#TotalExp' + rowid).val() == '' ? '0.00' : $('#TotalExp' + rowid).val();
|
|
var AfterFreight = $('#AfterFreightRate' + rowid).val() == '' ? '0.00' : $('#AfterFreightRate' + rowid).val();
|
|
|
|
|
|
|
|
var AfterAssessable = $('#AfterAssessable' + rowid).val() == '' ? '0.00' : $('#AfterAssessable' + rowid).val();
|
|
|
|
var AfterIgst = $('#AfterIgst' + rowid).val() == '' ? '0.00' : $('#AfterIgst' + rowid).val();
|
|
|
|
var AfterSubtotal = $('#Subtotal' + rowid).val() == '' ? '0.00' : $('#Subtotal' + rowid).val();
|
|
|
|
TotalLanding = parseFloat(TotalLanding) - parseFloat(AfterLandingCharge);
|
|
//console.log(AfterSubtotal);
|
|
|
|
TotalCustom = parseFloat(TotalCustom) - parseFloat(AfterCustomduty);
|
|
|
|
TotalCustomED = parseFloat(TotalCustomED) - parseFloat(AfterCustomEDcess);
|
|
TotalCustomSH = parseFloat(TotalCustomSH) - parseFloat(AfterCustomSHcess);
|
|
|
|
TotalGrossDuty = parseFloat(TotalGrossDuty) - parseFloat(Grossdutypayable);
|
|
|
|
TotalOrderValue = parseFloat(TotalOrderValue) - parseFloat(totalExp);
|
|
TotalFrieght = parseFloat(TotalFrieght) - parseFloat(AfterFreight);
|
|
|
|
TotalAssessable = parseFloat(TotalAssessable) - parseFloat(AfterAssessable);
|
|
|
|
TotalIgst = parseFloat(TotalIgst) - parseFloat(AfterIgst);
|
|
|
|
TotalSubtotal = parseFloat(TotalSubtotal) - parseFloat(AfterSubtotal);
|
|
|
|
|
|
$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));
|
|
|
|
$('#txttotalcustom').val(parseFloat(TotalCustom).toFixed(2));
|
|
|
|
$('#txttotalcustomED').val(parseFloat(TotalCustomED).toFixed(2));
|
|
$('#txttotalcustomSH').val(parseFloat(TotalCustomSH).toFixed(2));
|
|
|
|
$('#txttotalgrossduty').val(parseFloat(TotalGrossDuty).toFixed(2));
|
|
|
|
$('#txtToatlOrder').val(parseFloat(TotalOrderValue).toFixed(2));
|
|
$('#txtTotalFreight').val(parseFloat(TotalFrieght).toFixed(2));
|
|
|
|
$('#txttotalAssessable').val(parseFloat(TotalAssessable).toFixed(2));
|
|
|
|
$('#txttotalSubtotal').val(parseFloat(TotalSubtotal).toFixed(2));
|
|
|
|
$('#txttotalIgst').val(parseFloat(TotalIgst).toFixed(2));
|
|
|
|
|
|
}
|
|
|
|
$('#Scheduleby').change(function() {
|
|
|
|
$("#Deliverydt").datepicker({
|
|
minDate: 'now',
|
|
dateFormat: 'mm/dd/yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '0:+10'
|
|
});
|
|
|
|
});
|
|
$('#Deliverydt').change(function() {
|
|
|
|
$('#Scheduleby').val('');
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function Budgetcheck() {
|
|
//alert();
|
|
//die();
|
|
var totalorderedamount = parseFloat($('#txtToatlOrder').val());
|
|
// console.log(totalorderedamount)
|
|
var Exchange = parseFloat($('#ExchangeRate').val());
|
|
//console.log(Exchange);
|
|
|
|
var totordring = totalorderedamount * Exchange;
|
|
var TotalSum = avalbudAmte;
|
|
// if(totordring>TotalSum)
|
|
// {
|
|
// alert('You are Exceeding The Budget');
|
|
// return false;
|
|
// }
|
|
|
|
// else
|
|
// {
|
|
return true;
|
|
//}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function Save(status) {
|
|
//alert();
|
|
if (status == '0') {
|
|
stat = '<?php echo PO_DRAFT; ?>';
|
|
} else {
|
|
stat = '<?php echo PO_CREATED; ?>';
|
|
// stat = '<?php echo PO_RELEASED; ?>';
|
|
}
|
|
|
|
$('#txtStatus').val(stat);
|
|
|
|
|
|
tinyMCE.triggerSave();
|
|
|
|
var txtRowCount = $('#txtRowCount').val();
|
|
var txtDeletedRow = $('#txtDeletedRow').val();
|
|
//alert(stat);
|
|
//alert(JSON.stringify(txtStatus));
|
|
//exit();
|
|
if (validate() && Budgetcheck()) {
|
|
if (document.getElementById('ImportTax').rows.length <= 0) {
|
|
|
|
alert('Please Select Line item to Create PO');
|
|
$('#Deliverydt').focus();
|
|
return false;
|
|
|
|
|
|
|
|
} else if ($('#Importoption').val() == "0") {
|
|
alert('Please Select POType');
|
|
$('#Importoption').focus();
|
|
return false;
|
|
|
|
} else {
|
|
|
|
$('#content').loader('show');
|
|
var formData = new FormData($('.ImportPO')[0]);
|
|
formData.append('txtRowCount', txtRowCount);
|
|
formData.append('txtDeletedRow', txtDeletedRow);
|
|
formData.append('textStatus', stat);
|
|
$.ajax({
|
|
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
|
|
//data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus,
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>purchaseorder/addNewImportPurchaseOrder",
|
|
data: formData,
|
|
processData: false,
|
|
contentType: false,
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
alert(data);
|
|
$('#txtRowCount').val('');
|
|
$('#txtDeletedRow').val('');
|
|
//$('#SpcialInstruction').val('');
|
|
//$('#txtDeliveryAddress').val('');
|
|
window.location = "purchaseorderListing";
|
|
|
|
} else {
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function() {
|
|
//$("#revenueTax").DataTable();
|
|
$('#ImportTax').DataTable({
|
|
"paging": false,
|
|
"lengthChange": true,
|
|
"searching": false,
|
|
"ordering": false,
|
|
// "info": true,
|
|
"autoWidth": true
|
|
|
|
});
|
|
});
|
|
|
|
|
|
var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
|
//console.log(Detail);
|
|
|
|
// $.each(Detail, function (index, value)
|
|
// {
|
|
|
|
|
|
// $("#PaymentTerms").append( $('<option></option>').val(value.PaymentTerms).html(value.PaymentTerms) );
|
|
|
|
|
|
|
|
// } );
|
|
$("#PaymentTerms").change(function() {
|
|
//console.log($('#PaymentTerms').val().trim());
|
|
if ($('#PaymentTerms').val().trim() == 'PT08')
|
|
|
|
{
|
|
|
|
$('#otheroptiondiv').show();
|
|
} else {
|
|
$('#otheroptiondiv').hide();
|
|
}
|
|
});
|
|
$('#drpFreight').change(function() {
|
|
var FreightType = $('#drpFreight').val();
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#TripsValue').show();
|
|
} else {
|
|
|
|
$('#TripsValue').hide();
|
|
}
|
|
|
|
});
|
|
$('#drpeditFreight').change(function() {
|
|
var FreightType = $('#drpeditFreight').val();
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#editTripsValue').show();
|
|
} else {
|
|
|
|
$('#editTripsValue').hide();
|
|
}
|
|
|
|
|
|
|
|
if ($('#EditRate').val() != '' && $('#EditMaterialCode').val() != "0") {
|
|
selValue = $("#drpEditFreight").val();
|
|
$('#txtEditFreight').val('');
|
|
$('#edittxtAfterFreight').val('');
|
|
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtEditFreight').attr('readonly', 'true');
|
|
$('#txtEditFreight').val('0.00');
|
|
|
|
} else {
|
|
$('#txtEditFreight').removeAttr('readonly', 'true');
|
|
$('#txtEditFreight').val('');
|
|
}
|
|
} else {
|
|
alert('Please Select MaterialCode and Rate Field Value');
|
|
$('#drpEditFreight').val("0");
|
|
$('#EditRate').focus();
|
|
}
|
|
calculateFreight(1);
|
|
|
|
});
|
|
</script>
|