ria/app/Views/editCapitalPo.php

9343 lines
384 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<style>
.edit-container {
display: inline-flex;
align-items: center;
gap: 10px;
}
.edit-input-field {
padding: 2px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
width: 150px;
}
.edit-input-field:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.save-btn,
.cancel-btn {
border: none;
background: none;
cursor: pointer;
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
border-radius: 50%;
transition: background-color 0.3s ease;
}
.save-btn {
color: #28a745;
background-color: #e8f5e9;
}
.save-btn:hover {
background-color: #c3e6cb;
}
.cancel-btn {
color: #dc3545;
background-color: #f8d7da;
}
.cancel-btn:hover {
background-color: #f5c6cb;
}
</style>
<script>
$(document).ready(function() {
$(document).on('click', '.editable-field', function(e) {
e.preventDefault();
const $link = $(this);
const value = $link.text().trim();
// Hide the <a> tag and show the edit container
$link.hide();
const $editContainer = $link.siblings('.edit-container');
$editContainer.find('.edit-input-field').val(value);
$editContainer.show();
});
// Handle click on the tick (save) button
$(document).on('click', '.save-btn', function(e) {
e.preventDefault();
const $btn = $(this);
const $editContainer = $btn.closest('.edit-container');
const $input = $editContainer.find('.edit-input-field');
const value = $input.val().trim();
const $link = $editContainer.siblings('.editable-field');
const LineItemNoteForAuditor = $link.data('notes');
const id = $link.data('id');
var theForm = $(".CreatePO");
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
$link.text(value).show(); // to update table cell
$editContainer.hide();
});
// Handle click on the close (cancel) button
$(document).on('click', '.cancel-btn', function(e) {
e.preventDefault();
const $btn = $(this);
const $editContainer = $btn.closest('.edit-container');
const $link = $editContainer.siblings('.editable-field');
// Hide the edit container and show the <a> tag
$editContainer.hide();
$link.show();
});
});
</script>
<?php $parentPO = '';
$AvlCapitalBudAmt = isset($AvlCapitalBudAmt) ? (int) $AvlCapitalBudAmt : 0;
$insuranceStatus = array(
array("name" => "NO", "value" => "0"),
array("name" => "YES", "value" => "1")
);
$requestedBy = $RequistionDetails[0]->FirstName;
$Updateddt = new DateTime($RequistionDetails[0]->ReqDate);
$UpdatedOn = $Updateddt->format('d-m-Y');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-Y');
$res_arr_values = array();
$DeliverOption = '';
$SupId = '';
$SupName = '';
$Address = '';
$PODate = '';
$TotalCgst = '';
$TotalSgst = '';
$TotalIgst = '';
$DeliveryAddress = '';
$POStatus = '';
$PONO = '';
$TotalCgst = 0;
$TotalSgst = 0.0;
$TotalIgst = 0.0;
$OtherAmt = 0.0;
$TotalFreightvalue = 0.0;
$PrePOFile = '';
$totassesable = 0;
$totSubtotal = 0;
$totigst = 0;
$TotalSummary = 0.0;
$TotalBasicAmount = 0.0;
$ServiceDescription = '';
$Import_DispatchDetails = '';
$Import_PlaceofOrgin = '';
$CapitalRange = '';
$tt = 0.0;
$Deliverydt = '';
$DeliverSchedule = '';
$PONOStatus = '';
$MaxPoDate = '';
$AvlAmount = 0;
$currentCurrencyType = '';
$exchangeRate = $ExchangeRate;
$ConfigValue = '';
$TotalLanding = 0;
$tothighseas = 0;
$totcustom = 0;
$totexciseduty = 0;
$totexcisedutyED = 0;
$totexciseSH = 0;
$totcustomED = 0;
$totcustomSH = 0;
$totaddtnlexcise = 0;
$totgrossduty = 0;
$totavlmodvat = 0;
$totgrossexpense = 0;
$totordervalue = 0;
$ExchangeRate = 0;
$totorder = 0;
$totDis = 0;
$totFreight = 0;
$ExchangeRate = '';
$PaymentTerms = '';
$PaymentDays = '';
$PayableAT = '';
$ExchangeDate = '';
$ExchangeRateOn = '';
$CapitalRange = '';
$PoStatusName = '';
$otherPayment = '';
$INR = '';
$INRSYM = '';
$ExitTotalOrderValue = 0;
$ExitTotalBasicOrderValue = 0;
$ExitExchangeRate = '';
$ModeOfShipment = '';
$SupplierReference = '';
$SuppliersOfferNo = '';
$OtherReferences = '';
$InsuranceOptions = '';
$InsuranceNumber = '';
$ServiceTypeOptions = '';
$BudgetType = '';
if (!empty($INRSYMBOL)) {
foreach ($INRSYMBOL as $INR) {
$INRSYM = $INR->Currency_Code;
$INR = $INR->FontCode2000;
}
}
//echo $INR;
if (!empty($MaxPODate)) {
foreach ($MaxPODate as $date) {
$MaxPoDate = $date->PODate;
}
}
if (!empty($POMaster)) {
foreach ($POMaster as $Req) {
$parentPO = $Req->ParentPO;
$SupId = $Req->SupplierID;
$SupName = $Req->SupplierName;
$Address = $Req->MSME ? "MSME : " . $Req->MSME . "\n" . $Req->Address : $Req->Address;
$pdt = new DateTime($Req->PODate);
$PODate = $pdt->format('d-m-Y');
$DeliverOption = $Req->DeliveryOption;
$DeliverSchedule = $Req->DeliverySchedule;
$Ddt = new DateTime($Req->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
$DeliveryAddress = $Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode;
$POStatus = $Req->StatusCode;
$PoStatusName = $Req->StatusName;
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$Exchangedt = new DateTime($Req->ExchangeRateCalculatedon);
$ExchangeRateOn = $Exchangedt->format('d-m-Y');
$PaymentTerms = $Req->PaymentTerms;
$otherPayment = $Req->PaymentOtherDescription;
$CapitalRange = $Req->CapitalRange;
$Import_DispatchDetails = $Req->Import_DispatchDetails;
$Import_PlaceofOrgin = $Req->Import_PlaceofOrgin;
$CapitalRange = $Req->CapitalRange;
if ($CapitalRange == '0') {
$ExitExchangeRate = $Req->ExchangeRate;
$ExitTotalOrderValue = number_format($Req->TotalOrderValue * $ExitExchangeRate, 2, '.', '');
} else {
$ExitTotalOrderValue = $Req->TotalOrderValue;
}
$ModeOfShipment = $Req->Mode_Of_Shipment;
$SupplierReference = $Req->Supplier_Reference;
$SuppliersOfferNo = $Req->Supplier_Offer_No;
$OtherReferences = $Req->Other_Reference;
$InsuranceOptions = $Req->InsuranceStatus;
$InsuranceNumber = $Req->InsuranceNumber;
$ServiceTypeOptions = $Req->POSubType;
$BudgetType = $Req->BudgetType;
$PrePOFile = $Req->POFile;
}
}
if (!empty($POItem) && $CapitalRange == '1') {
$currentPoBasicAmt = 0;
$currentPoDiscountedAmt = 0;
foreach ($POItem as $getTotalAmt) {
$currentPoBasicAmt = $currentPoBasicAmt + ($getTotalAmt->Rate * $getTotalAmt->Quantity);
$currentPoDiscountedAmt = $currentPoDiscountedAmt + $getTotalAmt->Afterdiscountval;
}
if (!empty($AvlBudAmt)) {
$AvlAmount = number_format($AvlCapitalBudAmt + $currentPoBasicAmt - $currentPoDiscountedAmt, 2, '.', '');
}
} else {
$AvlAmount = number_format($AvlCapitalBudAmt + $ExitTotalOrderValue, 2, '.', '');
}
//print_r($getlogpodtl);die;
if (!empty($getlogpodtl)) {
foreach ($getlogpodtl as $values) {
$update = $values->FirstName;
}
} else {
$update = [];
}
?>
<style>
#mceu_1 {
border-width: 0px 0px 0px !important;
}
#mceu_0 {
padding: 1px !important;
}
.modal {
overflow: auto !important;
}
.dataTables_paginate {
margin-top: -5%;
}
.dataTables_wrapper {
padding-bottom: 0px;
}
.select2 {
width: 100% ! important;
}
.num {
text-align: right;
}
.centered {
display: flex;
/* justify-content: center; */
align-items: center;
height: 10vh;
}
.centered label,
.centered input {
margin: 0 5px;
}
</style>
<script src="<?php echo base_url() ?>public/assets/tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea#txtSpcialInstruction",
menubar: false,
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#ItemDescription",
menubar: false,
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#EditItemDescription",
menubar: false,
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#ViewItemDescription",
menubar: false,
statusbar: false,
toolbar: false,
readonly: 1
});
var insuranceOpt = '<?php echo $InsuranceOptions; ?>';
var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
var DelDt = '<?php echo $Deliverydt; ?>';
$(document).ready(function() {
$("#PaymentTerms").select2();
if (insuranceOpt == "1") {
} else {
$('#insuranceTxtDiv').hide();
}
if (DelOpt == "0") {
$('#Deliverydtdiv').hide();
$('#Schedulediv').hide();
$('#deliverydateby').show();
$('#Deliverydate').val(DelDt);
} else if (DelOpt == "1") {
$('#Deliverydtdiv').hide();
$('#Schedulediv').show();
$('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
} else if (DelOpt == "2") {
$('#Deliverydtdiv').show();
$('#Schedulediv').hide();
$('#deliverydateby').hide();
$('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $PaymentTerms; ?>';
if (PayTerms == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
/*****************************/
var update = '<?php echo json_encode($update) ?>';
// if (update != 'null') {
// $('#editpodiv').show();
// } else {
// $('#editpodiv').hide();
// }
/*****************************/
var capitalType = '';
window.onload = function() {
$('#PoTypeOptions').attr("style", "pointer-events: none;");
var CapRan = '<?php echo $CapitalRange; ?>';
if (CapRan == '1') {
document.getElementById('FromOnline').style.display = 'none';
document.getElementById('ExchangeRateOnDiv').style.display = 'none';
document.getElementById('ExchangeRateDiv').style.display = 'none';
document.getElementById('currencyTypeDiv').style.display = 'none';
document.getElementById('ExchangeRateModalDiv').style.display = 'none';
document.getElementById('ExchangeRateModalEditDiv').style.display = 'none';
document.getElementById('HideImportTaxTotal').style.display = 'none';
document.getElementById('ModalImportTaxHide').style.display = 'none';
document.getElementById('EditModalImportTaxHide').style.display = 'none';
document.getElementById('ExchangeRateModalViewDiv').style.display = 'none';
document.getElementById('ViewModalImportTaxHide').style.display = 'none';
document.getElementById('PlaceOforigindiv').style.display = 'none';
document.getElementById('dispatchinternational').style.display = 'none';
document.getElementById('datedomestic').style.display = 'block';
capitalType = 'Domestic';
} else {
document.getElementById('FromOnline').style.display = 'block';
document.getElementById('ExchangeRateOnDiv').style.display = 'block';
document.getElementById('ExchangeRateDiv').style.display = 'block';
document.getElementById('currencyTypeDiv').style.display = 'block';
document.getElementById('ExchangeRateModalDiv').style.display = 'block';
document.getElementById('ExchangeRateModalEditDiv').style.display = 'block';
document.getElementById('ExchangeRateModalViewDiv').style.display = 'block';
capitalType = 'International';
document.getElementById('currencyTypeDiv').style.display = 'block';
document.getElementById('ViewModalImportTaxHide').style.display = 'block';
document.getElementById('dispatchinternational').style.display = 'block';
document.getElementById('datedomestic').style.display = 'none';
}
}
</script>
<script>
$(document).ready(function() {
$("#PaymentMethod").select2();
//Initialize Select2 Elements
$("#drpSupplier").select2();
$("#Reqnumber").select2();
$("#CapitalCostCenter").select2();
$("#MaterialCode").select2();
$("#currencytype").select2();
// $("#PODate").datepicker({
// //minDate : d,
// // maxDate : 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true
// }); //,yearRange: '-100:+0'
// $("#Deliverydt").datepicker({
// minDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
// $("#Exchangerateon").datepicker({
// //minDate : d,
// maxDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '-100:+0'
// });
$('#Date').click(function() {
//for Dispatch range selection
$('#Schedulediv').hide();
$('#Deliverydtdiv').show();
$('#deliverydateby').hide();
});
// $("#Deliverydate").datepicker({
// minDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
$('#Schedule').click(function() {
//for schedule range selection
$('#Deliverydtdiv').hide();
$('#Schedulediv').show();
$('#deliverydateby').hide();
});
$('#DeliverycheckDate').click(function() {
//for Delivery Date selection
$('#Schedulediv').hide();
$('#deliverydateby').show();
$('#Deliverydtdiv').hide();
});
});
</script>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<?php
if ($PONOStatus != 'ST030') {
$title = ($parentPO == '') ? "Edit Capital Purchase Order - $PONO" : "Amended Capital Purchase Order - $PONO";
} else {
$title = "View Amended Capital Purchase Order - $PONO";
}
?>
<h4><?= $title; ?></h4>
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-secondary" id="back"
value="Back">Back</a>
</div>
</div>
</div>
<!-- end page title -->
<!-- Form row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<?php
$attributes = array('class' => 'form-label-left CapitalPO ', 'name' => 'CapitalPO', 'id' => 'CapitalPO', 'enctype' => 'multipart/form-data');
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
<div class="form-row">
<div class="form-group col-md-3">
<label>Requistion No</label>
<?php
$options = array("0" => 'Selected Requisition Numbers');
if (!empty($ReqList)) {
foreach ($ReqList as $SID):
$options[$SID->ReqNo] = $SID->ReqNo;
endforeach;
}
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"');
?>
</div>
<div class="form-group col-md-3">
<label>Purchase Order Type</label>
<div class="form-group">
<?php
$data = array('name' => 'POType', 'value' => set_value('POType', CAPITAL), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Supplier<span class="text-danger">*</span></label>
<?php
if (!empty($Suplist)) {
foreach ($Suplist as $SID):
$options2[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
endforeach;
}
echo form_dropdown('drpSupplier', $options2, set_value('drpSupplier', $SupId), 'id="drpSupplier"', 'required="true"', 'class="form-control select2"');
?>
<input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId; ?>">
<input type="hidden" name="newsup" id="changeSup">
</div>
<div class="form-group col-md-3">
<label>Address</label>
<?php
$data = array('name' => 'SupAddress', 'value' => set_value('SupAddress', $Address), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40');
echo Form_textarea($data);
?>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3" id="currencyTypeDiv">
<label>Currency Type<span class="text-danger">*</span></label>
<?php if (!empty($Currency)) {
// $currentCurrencyType=$CurrencyDetail[0]->CurrencyCode;
$options1[$CurrencyDetail[0]->Currency_Code] = $CurrencyDetail[0]->Currency_Code . ' ' . ' - ' . ' ' . $CurrencyDetail[0]->Country_and_Currency;
foreach ($Currency as $Cur):
if ($CurrencyDetail[0]->Currency_Code != $Cur->Currency_Code) {
$options1[$Cur->Currency_Code] = $Cur->Currency_Code . ' ' . ' - ' . ' ' . $Cur->Country_and_Currency;
}
endforeach;
}
echo form_dropdown('currencytype', $options1, set_value('currencytype', $currentCurrencyType), 'id="currencytype"', 'class="form-control select2"', 'required="true"');
?>
</div>
<div class="form-group col-md-3">
<b><u>Select Delivery By<span class="text-danger">*</span></u></b> <br />
<div style="display:inline-flex;">
<div class="centered">
<div id="dispatchinternational" style="display:none;">
<?php echo form_label('Dispatch instruction', 'Dispatch instruction') . "&nbsp;&nbsp;" . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "2", 'checked' => ('2' == $DeliverOption) ? TRUE : FALSE)); ?>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<div id="datedomestic" style="display:none;">
<?php echo form_label('Deilvery Date', 'Deilvery Date') . "&nbsp;&nbsp;" . form_radio(array("name" => "DateRange", "id" => "DeliverycheckDate", "value" => "0", 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE)); ?>&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</div>
<div>
<?php echo form_label('Schedule', 'Schedule') . "&nbsp;&nbsp;" . form_radio(array('name' => 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?>
</div>
</div>
</div>
</div>
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
<label>Schedule BY<span class="text-danger">*</span></label>
<?php
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
echo Form_textarea($data);
?>
</div>
<div class="form-group col-md-3" id="deliverydateby" style="display:none;">
<label>Delivery Date<span class="text-danger">*</span></label>
<?php
$data = array('type' => 'date', 'name' => 'Deliverydate', 'value' => set_value('Deliverydate', $CurrentDate), 'id' => 'Deliverydate', 'class' => 'form-control', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" id="Deliverydtdiv">
<label>Dispatch Instruction<span class="text-danger">*</span></label>
<?php
// $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true');
// echo form_input($data);
$data = array('name' => 'Dispatch', 'value' => set_value('Dispatch', $Import_DispatchDetails), 'id' => 'Dispatch', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
echo Form_textarea($data);
?>
</div>
<div class="form-group col-md-3">
<label>Delivery Address</label>
<?php
$data = array('name' => 'DeliveryAddr', 'value' => set_value('DeliveryAddr', $DeliveryAddress), 'id' => 'DeliveryAddr', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40');
echo Form_textarea($data);
?>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3" id="FromOnline" style="display:none;">
Check Today's Foreign Exchange value <a href="http://www.xe.com/" target="_blank"><u>(Click
here)</u></a>
</div>
<div class="form-group col-md-3" id="ExchangeRateOnDiv" style="display:none;">
<label>Exchange Rate On</label>
<div class="form-group">
<?php
$data = array('name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $ExchangeRateOn), 'id' => 'Exchangerateon', 'class' => 'form-control num date-picker-common', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3" id="ExchangeRateDiv" style="display:none;">
<label id="CurrencySymbol">Exchange Rate </label><span class="text-danger">*</span>
<div class="form-group">
<?php
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt', $exchangeRate), 'id' => 'ExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3" id="PlaceOforigindiv">
<label>Place of Origin<span class="text-danger">*</span></label>
<div 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', $Import_PlaceofOrgin), 'id' => 'PlaceOforigin', 'class' => 'form-control', 'required' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label>PO Date</label>
<?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num form-date-search', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>">
</div>
<div class="form-group col-md-3">
<label>Mode Of Shipment</label>
<?php
$data = array('name' => 'editmodeofshipment', 'value' => set_value('editmodeofshipment', $ModeOfShipment), 'id' => 'editmodeofshipment', 'class' => 'form-control');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Contact Reference</label>
<?php
$data = array('name' => 'editsupplierreference', 'value' => set_value('editsupplierreference', $SupplierReference), 'id' => 'editsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3"><label>Supplier's Offer No</label>
<div class="form-group">
<?php
$data = array('name' => 'editsupplierofferno', 'value' => set_value('editsupplierofferno', $SuppliersOfferNo), 'id' => 'editsupplierofferno', 'class' => 'form-control');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label>Our Reference(S)</label>
<div class="form-group">
<?php
$data = array('name' => 'editotherreference', 'value' => set_value('editotherreference', $OtherReferences), 'id' => 'editotherreference', 'class' => 'form-control');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Capital Type Options</label>
<?php
//$optionsWork = array("0"=>'Select Work Status');
if (!empty($PoTypeOptions)) {
foreach ($PoTypeOptions as $POpt):
if ($ServiceTypeOptions == $POpt->ConfigValue) {
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
}
endforeach;
foreach ($PoTypeOptions as $POpt1):
if ($ServiceTypeOptions != $POpt1->ConfigValue) {
$optionsPO[$POpt1->ConfigValue] = $POpt1->ConfigValue;
}
endforeach;
}
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions" required="true" class="form-control select2"');
?>
</div>
<div class="form-group col-md-3">
<label for="payablefrom">Payable Terms</label>
<?php
foreach ($Payment as $rl):
if ($PaymentTerms == $rl->PaymentTerms) {
$options6[$rl->PaymentID] = $rl->PaymentTerms;
}
endforeach;
if (!empty($Payment)) {
foreach ($Payment as $rl2):
if ($PaymentTerms != $rl2->PaymentTerms) {
$options6[$rl2->PaymentID] = $rl2->PaymentTerms;
}
endforeach;
}
echo form_dropdown('PaymentMethod', $options6, set_value('PaymentMethod', $PaymentTerms), 'id="PaymentMethod"', 'required="true"', 'class="form-control select2"');
?>
</div>
<div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms<span class="text-danger">*</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 class="form-row">
<div class="form-group col-md-3">
<label>Insurance Options</label>
<?php
if (!empty($insuranceStatus)) {
foreach ($insuranceStatus as $INS):
if ($InsuranceOptions == $INS['value']) {
$optionsInsurance[$INS['value']] = $INS['name'];
}
endforeach;
foreach ($insuranceStatus as $INS1):
if ($InsuranceOptions != $INS1['value']) {
$optionsInsurance[$INS1['value']] = $INS1['name'];
}
endforeach;
}
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
?>
</div>
<div class="form-group col-md-3" id="insuranceTxtDiv" style="display:block;">
<label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
<?php
$data = array('name' => 'InsuranceNumber', 'value' => set_value('InsuranceNumber', $InsuranceNumber), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label for="BudgetType">Budget Type</label>
<select id='BudgetType' name='BudgetType' class="form-control">
<?php if ($BudgetType == 'CAPITAL') {
$opt1 = 'CAPITAL';
$opt2 = 'REVENUE';
} else {
$opt1 = 'REVENUE';
$opt2 = 'CAPITAL';
} ?>
<option value=<?php echo $opt1; ?>><?php echo $opt1; ?></option>
<option value=<?php echo $opt2; ?>><?php echo $opt2; ?></option>
</select>
</div>
<div class="form-group col-md-3">
</div>
</div>
<div class="form-row">
<!-- <div class="col-md-9" style="text-align:right !important" style="padding:10px"> -->
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
<!-- </div> -->
<div class="form-group col-md-12" align=" right">
<?php if ($POStatus == PO_DRAFT || $POStatus == PO_CREATED) { ?>
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success"
id="abcd">Select Line Item</button> </a>
<?php } ?>
</div>
<br>
</div>
<div class="box-body">
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INR)" ?></th>
<!-- <th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
<th>Action</th>
</tr>
</thead>
<tbody id='capitalAppend'>
<?php
if (!empty($POItem)) {
$index = 0;
$totalCapitalOrder = 0;
$TotalDiscountedAmt = 0;
$TotalFreightAmt = 0;
$ExitDiscountedAmt = 0;
foreach ($POItem as $record) {
$index = $index + 1;
$ExitTotalBasicOrderValue = $ExitTotalBasicOrderValue + ($record->Rate * $record->Quantity);
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td>
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
class="editable-field"
data-id="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
</a>
<div class="edit-container" style="display:none;">
<input type="text" class="edit-input-field" />
<button class="save-btn">✔</button>
<button class="cancel-btn">✖</button>
</div>
<?php } else {
echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-";
} ?>
</td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<?php if ($CapitalRange == '1') { ?>
<td style="text-align:right !important"><?php echo $record->ServiceTaxamount; ?></td>
<td style="text-align:right !important">
<?php echo number_format($record->Rate * $record->Quantity + $record->ServiceTaxamount + $record->otherallowance + $record->Afvalue - $record->Afterdiscountval, 2, '.', '') ?>
</td>
<?php } ?>
<?php if ($CapitalRange == '0') { ?>
<td style="text-align:right !important"><?php echo '0'; ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<?php } ?>
<!-- <td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:right !important"><?php echo $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
<?php
$row = array("materialCode" => $record->MaterialCode, "ReqNo" => $record->ReqNo);
array_push($res_arr_values, $row);
?>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>"
id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>"
id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>"
id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo "$AvlAmount"; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>"
id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'CPCostCode' . $index ?>"
id="<?php echo 'CPCostCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>"
id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>"
id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>"
value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>"
value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'CapitalItemDescrition' . $index ?>"
id="<?php echo 'CapitalItemDescrition' . $index ?>"
value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>"
id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'b4qty' . $index ?>"
id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>"
id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'b4rate' . $index ?>"
id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<?php if ($CapitalRange == '1') { ?>
<input type="hidden" name="<?php echo 'rateInUs' . $index ?>"
id="<?php echo 'rateInUs' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>"
value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>"
id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>"
value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>"
id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>"
value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>"
id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'OtherAmt' . $index ?>"
id="<?php echo 'OtherAmt' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue' . $index ?>"
id="<?php echo 'ServiceTotalOrderValue' . $index ?>"
value="<?php echo $record->ServiceTaxamount; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisType' . $index ?>"
id="<?php echo 'DisType' . $index ?>" value="<?php echo $record->discount; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisVal' . $index ?>"
id="<?php echo 'DisVal' . $index ?>" value="<?php echo $record->discountval; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
id="<?php echo 'AfterDisVal' . $index ?>" value="<?php echo $record->Afterdiscountval; ?>" />
<input type="hidden" name="<?php echo 'basicvalInINR' . $index ?>"
id="<?php echo 'basicvalInINR' . $index ?>"
value="<?php echo $record->Rate * $record->Quantity + $record->After_CGST + $record->After_SGST + $record->After_IGST + $record->otherallowance - $record->Afterdiscountval; ?>" />
<input type="hidden" name="<?php echo 'Ftype' . $index ?>" id="<?php echo 'Ftype' . $index ?>"
value="<?php echo $record->Ftype; ?>" />
<input type="hidden" name="<?php echo 'NoTrip' . $index ?>" id="<?php echo 'NoTrip' . $index ?>"
value="<?php echo $record->NoTrip; ?>" />
<input type="hidden" name="<?php echo 'Fvalue' . $index ?>" id="<?php echo 'Fvalue' . $index ?>"
value="<?php echo $record->Fvalue; ?>" />
<input type="hidden" name="<?php echo 'Afvalue' . $index ?>" id="<?php echo 'Afvalue' . $index ?>"
value="<?php echo $record->Afvalue; ?>" />
<?php } ?>
<?php if ($CapitalRange == '0') { ?>
<input style="text-align:right !important" type="hidden" name="<?php echo 'FreightType' . $index ?>"
id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'NoOfTrip' . $index ?>"
id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'FreightVal' . $index ?>"
id="<?php echo 'FreightVal' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterFreightVal' . $index ?>"
id="<?php echo 'AfterFreightVal' . $index ?>"
value="<?php echo $record->AfterFreightValue; ?>" />
<input type="hidden" name="<?php echo 'rateInUs' . $index ?>"
id="<?php echo 'rateInUs' . $index ?>" value="<?php echo $record->BasicPriceInMTon; ?>" />
<input type="hidden" name="<?php echo 'basicvalInINR' . $index ?>"
id="<?php echo 'basicvalInINR' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'beforeLanding' . $index ?>"
id="<?php echo 'beforeLanding' . $index ?>" value="<?php echo $record->LandingCharge; ?>" />
<input type="hidden" name="<?php echo 'landingCharge' . $index ?>"
id="<?php echo 'landingCharge' . $index ?>"
value="<?php echo $record->AfterLandingCharge; ?>" />
<input type="hidden" name="<?php echo 'beforeCustomDuty' . $index ?>"
id="<?php echo 'beforeCustomDuty' . $index ?>" value="<?php echo $record->CustomDuty; ?>" />
<input type="hidden" name="<?php echo 'CustomDuty' . $index ?>"
id="<?php echo 'CustomDuty' . $index ?>" value="<?php echo $record->AfterCustomDuty; ?>" />
<input type="hidden" name="<?php echo 'beforeCustomEDCess' . $index ?>"
id="<?php echo 'beforeCustomEDCess' . $index ?>" value="<?php echo $record->CustomEdCess; ?>" />
<input type="hidden" name="<?php echo 'CustomEDCess' . $index ?>"
id="<?php echo 'CustomEDCess' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" />
<input type="hidden" name="<?php echo 'beforeCustomSHCess' . $index ?>"
id="<?php echo 'beforeCustomSHCess' . $index ?>" value="<?php echo $record->CustomSHCess; ?>" />
<input type="hidden" name="<?php echo 'CustomSHCess' . $index ?>"
id="<?php echo 'CustomSHCess' . $index ?>" value="<?php echo $record->AfterCustomSHCess; ?>" />
<input type="hidden" name="<?php echo 'echangeRate' . $index ?>"
id="<?php echo 'echangeRate' . $index ?>" value="<?php echo $record->ExchangeRate; ?>" />
<input type="hidden" name="<?php echo 'GrossDutyPayable' . $index ?>"
id="<?php echo 'GrossDutyPayable' . $index ?>"
value="<?php echo $record->Grossdutypayable; ?>" />
<input type="hidden" name="<?php echo 'CustomDutyExpenses' . $index ?>"
id="<?php echo 'CustomDutyExpenses' . $index ?>"
value="<?php echo $record->CustomDutyExpensesPerKG; ?>" />
<input type="hidden" name="<?php echo 'PurQuantity' . $index ?>"
id="<?php echo 'PurQuantity' . $index ?>" value="<?php echo $record->QuantityKG; ?>" />
<input type="hidden" name="<?php echo 'PerKgExpense' . $index ?>"
id="<?php echo 'PerKgExpense' . $index ?>" value="<?php echo $record->ImportTotalValue; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>"
value="0" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>"
id="<?php echo 'AfterCgst' . $index ?>" value="0" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>"
value="0" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>"
id="<?php echo 'AfterSgst' . $index ?>" value="0" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>"
value="0" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>"
id="<?php echo 'AfterIgst' . $index ?>" value="0" />
<input type="hidden" name="<?php echo 'OtherAmt' . $index ?>"
id="<?php echo 'OtherAmt' . $index ?>" value="0" />
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue' . $index ?>"
id="<?php echo 'ServiceTotalOrderValue' . $index ?>" value="0" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisType' . $index ?>"
id="<?php echo 'DisType' . $index ?>" value="0" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisVal' . $index ?>"
id="<?php echo 'DisVal' . $index ?>" value="0" />
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
id="<?php echo 'AfterDisVal' . $index ?>" value="0" />
<input type="hidden" name="<?php echo 'AssessableValue' . $index ?>"
id="<?php echo 'AssessableValue' . $index ?>" value="<?php echo $record->AssessableValue; ?>" />
<input type="hidden" name="<?php echo 'SubTotal' . $index ?>"
id="<?php echo 'SubTotal' . $index ?>" value="<?php echo $record->SubTotal; ?>" />
<input type="hidden" name="<?php echo 'IGSTInt' . $index ?>" id="<?php echo 'IGSTInt' . $index ?>"
value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIGSTInt' . $index ?>"
id="<?php echo 'AfterIGSTInt' . $index ?>" value="<?php echo $record->AfterIGST; ?>" />
<input type="hidden" name="<?php echo 'DutyImpact' . $index ?>"
id="<?php echo 'DutyImpact' . $index ?>" value="<?php echo $record->DutyImpact; ?>" />
<input type="hidden" name="<?php echo 'ClearingCharge' . $index ?>"
id="<?php echo 'ClearingCharge' . $index ?>" value="<?php echo $record->ClearingCharge; ?>" />
<input type="hidden" name="<?php echo 'NetValue' . $index ?>"
id="<?php echo 'NetValue' . $index ?>" value="<?php echo $record->NetValue; ?>" />
<?php } ?>
<input type="hidden" name="<?php echo 'basicval' . $index ?>"
id="<?php echo 'basicval' . $index ?>"
value="<?php echo $record->Rate * $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
<?php
if ($POStatus == PO_DRAFT || $POStatus == PO_CREATED) { ?>
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>"
data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITCAPITAL"><i
class="ri-pencil-fill" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#'
onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>"
data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<?php
} else { ?>
<td>
<a data-target='#VIEWCAPITAL' data-id="<?php echo $index; ?>"
data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWCAPITAL"><i
class="fa fa-eye" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> </td>
<?php
} ?>
</tr> <?php
if ($CapitalRange == '1') {
$TotalCgst = $TotalCgst + $record->After_CGST;
$TotalSgst = $TotalSgst + $record->After_SGST;
$TotalIgst = $TotalIgst + $record->After_IGST;
$OtherAmt = $OtherAmt + $record->otherallowance;
$TotalFreightvalue = $TotalFreightvalue + $record->Afvalue;
$TotalSummary = $TotalSummary + $record->ServiceTaxamount;
$TotalDiscountedAmt = $record->Afterdiscountval;
$ExitDiscountedAmt = $ExitDiscountedAmt + $record->Afterdiscountval;
$totalCapitalOrder = $totalCapitalOrder + $record->Rate * $record->Quantity + $record->After_CGST + $record->After_SGST + $record->After_IGST + $record->otherallowance + $record->Afvalue - $TotalDiscountedAmt;
}
$TotalBasicAmount = $TotalBasicAmount + $record->BasicValue;
$ServiceDescription = $ServiceDescription;
if ($CapitalRange == '0') {
$TotalLanding = $TotalLanding + $record->AfterLandingCharge;
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
$totcustom = $totcustom + $record->AfterCustomDuty;
$totexciseduty = $totexciseduty + $record->AfterExciseDuty;
$totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess;
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
$totcustomED = $totcustomED + $record->AfterCustomEdCess;
$totcustomSH = $totcustomSH + $record->AfterCustomSHCess;
$totaddtnlexcise = $totaddtnlexcise + $record->AfterAddlExciseDuty;
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
$totavlmodvat = $totavlmodvat + $record->AvailableModvat;
$TotalFreightAmt = $TotalFreightAmt + $record->AfterFreightValue;
$totgrossexpense = $totgrossexpense + $record->Grossexpensesduetocustomduty;
$ExchangeRate = $record->ExchangeRate;
$totalCapitalOrder = $totalCapitalOrder + $record->Rate * $record->Quantity;
$totassesable = $totassesable + $record->AssessableValue;
$totSubtotal = $totSubtotal + $record->SubTotal;
$totigst = $totigst + $record->AfterIGST;
}
// $totorder=$totorder+$record->TotalOrderValue;
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<!-- <input type="hidden" name="CapitalToatlOrder" id="CapitalToatlOrder" value="<?php echo $totalCapitalOrder; ?>"> -->
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>" />
<input type="hidden" name="capitalType" id="capitalType" value="<?php echo $CapitalRange; ?>" />
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="form-row" id="CAPdiv">
<div class="form-group col-md-3">
<label>Total Basic Amount <?php echo "($INR)" ?> </label>
<?php
$data = array('name' => 'CapitalBasicOrder', 'value' => set_value('CapitalBasicOrder', number_format($ExitTotalBasicOrderValue, 2, '.', '')), 'id' => 'CapitalBasicOrder', 'class' => 'form-control num', 'readonly' => 'true',);
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Total Discount Amount <?php echo "($INR)" ?> </label>
<?php
$data = array('name' => 'txtTotalDiscount', 'value' => set_value('txtTotalDiscount', number_format($ExitDiscountedAmt, 2, '.', '')), 'id' => 'txtTotalDiscount', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>CGST <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txtTotCgst', 'value' => set_value('txtTotCgst', number_format($TotalCgst, 2, '.', '')), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>SGST <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txtTotSgst', 'value' => set_value('txtTotSgst', number_format($TotalSgst, 2, '.', '')), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>IGST <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txtTotIgst', 'value' => set_value('txtTotIgst', number_format($TotalIgst, 2, '.', '')), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Other Allowances <?php echo "($INR)" ?> </label>
<?php
$data = array('name' => 'TotalOtherAllowances', 'value' => set_value('TotalOtherAllowances', number_format($OtherAmt, 2, '.', '')), 'id' => 'TotalOtherAllowances', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Total Freight <?php echo "($INR)" ?> </label>
<?php
$data = array('name' => 'TotalFreight', 'value' => set_value('TotalFreight', number_format($TotalFreightvalue, 2, '.', '')), 'id' => 'TotalFreight', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" style="padding:1% 0%;" id="HideImportTaxTotal" style="display:none;">
<div class="form-group col-md-4">
<label>Total Landing Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotallanding', 'value' => set_value('txttotallanding', number_format($TotalLanding, 2, '.', '')), 'id' => 'txttotallanding', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Assessable Value <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalAssessable', 'value' => set_value('txttotalAssessable', $totassesable), 'id' => 'txttotalAssessable', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Custom Duty Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalcustom', 'value' => set_value('txttotalcustom', number_format($totcustom, 2, '.', '')), 'id' => 'txttotalcustom', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Subtotal Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalSubtotal', 'value' => set_value('txttotalSubtotal', $totSubtotal), 'id' => 'txttotalSubtotal', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total IGST <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalIgst', 'value' => set_value('txttotalIgst', $totigst), 'id' => 'txttotalIgst', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Custom ED_cess Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalcustomED', 'value' => set_value('txttotalcustomED', number_format($totcustomED, 2, '.', '')), 'id' => 'txttotalcustomED', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Custom S & H cess Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalcustomSH', 'value' => set_value('txttotalcustomSH', number_format($totcustomSH, 2, '.', '')), 'id' => 'txttotalcustomSH', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Gross duty payable Charge <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txttotalgrossduty', 'value' => set_value('txttotalgrossduty', number_format($totgrossduty, 2, '.', '')), 'id' => 'txttotalgrossduty', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<label>Total Freight Amount <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight', number_format($TotalFreightAmt, 2, '.', '')), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<div class="form-row"> <!-- style="padding:1% 1%;" -->
<div class="form-group col-md-4">
<label id="lbl_international">Total Order Value <?php echo "($INR)" ?> </label>
<?php
$data = array('name' => 'CapitalToatlOrder', 'value' => set_value('CapitalToatlOrder', number_format($totalCapitalOrder, 2, '.', '')), 'id' => 'CapitalToatlOrder', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<!--################################################################## -->
<?php if (!empty($update)) { ?>
<!-- <div id="editpodiv">
<div class="form-row"><label>Editable POScreen</label>
<table id="edittable" class="table table-hover table-bordered"
style="background-color:#fff;font-size:12px;">
<thead>
<tr>
<th>Sno</th>
<th>PONO</th>
<!- - <th>Material</th> - ->
<!- - <th>Date</th> - ->
<th>LineItemNo</th>
<th>Entity</th>
<th>OldValue</th>
<th>NewValue</th>
<th>UpdatedBy</th>
<th>UpdateOn</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($getlogpodtl)) {
//print_r($getlogpodtl); die;
$inde = 0;
foreach ($getlogpodtl as $oldpo) {
$inde = $inde + 1;
?>
<tr id="<?php echo $inde; ?>">
<td><?php echo $inde; ?></td>
<td><?php echo $oldpo->PONO ?></td>
<!- -
<?php
if (isset($oldpo->logDate) && $oldpo->logDate != '-' && !empty($oldpo->logDate)) {
$logdate = date('d-m-Y', strtotime($oldpo->logDate));
} else {
$logdate = '-';
}
?>
<td><?= $logdate; ?></td> - ->
<td><?php echo $oldpo->LineItemNos; ?></td>
<td><?php echo $oldpo->entity ?></td>
<?php if ($oldpo->entity == 'PO DateChanged') {
$oldValue = date('d-m-Y', strtotime($oldpo->oldValue));
} else {
$oldValue = $oldpo->oldValue;
} ?>
<td><?php echo $oldValue . '-' . $oldpo->SupplierName; ?></td>
<?php if ($oldpo->entity == 'PO DateChanged') {
$newValue = date('d-m-Y', strtotime($oldpo->newValue));
} else {
$newValue = $oldpo->newValue;
} ?>
<td><?php echo $newValue ?></td>
<td><?php echo $oldpo->FirstName ?></td>
<td><?php $date = new DateTime($oldpo->UpdatedOn);
echo $date->format('d-m-Y'); ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div> -->
<?php } else {
} ?>
<div class="form-row">
<div class="form-group col-md-12">
<label>Special Instructions </label> <?php
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
echo form_textarea($data);
?>
</div>
</div>
<br>
<label> Select Purchase Order File </label>
<div class="form-row" align="left">
<div class="form-group col-md-12">
<input type="file" name="POFile" id="POFile">
</div>
</div>
<br>
<div class="form-row" id="deletePreviousPurchaseOrderFileDiv" align="left">
<div class="form-group col-md-12">
<?php if ($PrePOFile) { ?>
<label for="deletePreviousPurchaseOrderFile"><a title="previously uploaded PO File"
href="<?php echo base_url() . 'public/uploads/POfiles/' . $PrePOFile ?>"><span>previously uploaded purchase order file- </span><small><?= $PrePOFile; ?></small></a></label>
&nbsp;&nbsp;&nbsp;&nbsp;
<button class="btn btn-danger btn-sm " id="deletePreviousPurchaseOrderFile">Delete </button>
<?php } ?>
</div>
</div>
<div style="text-align:right !important" style="padding:3% 2%;">
<div>
<input type="hidden" id="PrePOFile" name="PrePOFile" value="<?php echo $PrePOFile; ?>" /><br>
</div>
<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="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED) { ?>
<a class="btn btn-secondary Save" ID="Cancel" href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<?php if ($PONOStatus == PO_DRAFT) { ?>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save as Draft</span></a>
<?php } ?>
<a class="btn btn-success Save" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-success Save" ID="Submit" onclick="Save(4)">&nbsp;&nbsp;<span class="bold">Approve</span></a>
<?php } else if($PONOStatus == PO_AMENDED){ ?>
<a class="btn btn-success" ID="OK" onclick="PageRedirect()">OK</a>
<?php } else {
if ($DEPCode == FINANCE) { ?>
<a class="btn btn-success" ID="OK" onclick="PageRedirect()">OK</a>
<?php } else if($DEPCode != FINANCE) {
if (($CapitalRange != 1)) { ?>
<a class="btn btn-success Save" ID="Save" onclick="Save(2)">&nbsp;&nbsp;<span
class="bold">Submit</span></a>
<a class="btn btn-success" ID="OK"
href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a>
<?php } else { ?>
<a class="btn btn-success Submit" ID="Submit" onclick="Save(2)">&nbsp;&nbsp;<span
class="bold">Submit</span></a>
<a class="btn btn-success" ID="OK"
href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a>
<?php }
} ?>
<!-- <a class="btn btn-success" ID="OK" href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> -->
<?php } ?>
</div>
<label>Request On :</label><?php echo $UpdatedOn; ?><br />
<label>Request By :</label><?php echo $requestedBy; ?><br />
<!--<label>Status :</label><?php echo $PoStatusName; ?> -->
<label>Status : </label><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED',
];
if (isset($PoStatusName) && !empty($PoStatusName)) {
if (isset($statusMappings[$PoStatusName])) {
echo $statusMappings[$PoStatusName];
} else {
echo $PoStatusName;
}
} else {
echo "Status not provided";
}
?>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div><!-- row -->
</div> <!-- container -->
</div> <!-- content -->
</div>
<div id="packagingcalmodel" class="modal fade" data-backdrop-limit="1" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-sm" style="width: 1060px;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Freight Calculation On </h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form>
<div>
<label><input type="radio" name="optPackaging" checked="checked" value='0' id="optPackaging">
Basic Amount</label>
</div>
<div>
<label><input type="radio" name="optPackaging" id="optPackaging" value='1'> After Discount
Amount</label>
</div>
</form>
</div>
<div class="modal-footer" style="border:none;">
<a class="btn btn-secondary" data-dismiss="modal" style="margin: 10px;" value="Cancel">Cancel</a>
<a class="btn btn-success" ID="PackagingOption" onclick="calculateFreightlocaddper();">&nbsp;&nbsp;<span
class="bold">Ok</span></a>
</div>
</div>
</div>
</div><!-- /.modal -->
<!-- Modal for Packing Calculation -->
<div id="editpackagingcalmodel" data-backdrop-limit="1" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Freight Calculation On </h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> x </button>
</div>
<div class="modal-body p-4">
<form>
<div>
<label><input type="radio" name="editoptPackaging" checked="checked" value='0' id="editoptPackaging"> Basic
Amount</label>
</div>
<div>
<label><input type="radio" name="editoptPackaging" id="editoptPackaging" value='1'> After
Discount Amount</label>
</div>
</form>
</div>
<div class="modal-footer" style="border:none;">
<a class="btn btn-secondary" data-dismiss="modal" style="margin: 10px;" value="Cancel">Cancel</a>
<a class="btn btn-success" ID="editPackagingOption" onclick="calculateFreightloceditper();">&nbsp;&nbsp;<span
class="bold">Ok</span></a>
</div>
</div>
</div>
</div><!-- /.modal -->
<div id="viewpackagingcalmodel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Freight Calculation On</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form>
<div>
<label><input type="radio" name="viewoptPackaging" checked="checked" value='0' id="editoptPackaging"> Basic
Amount</label>
</div>
<div>
<label><input type="radio" name="viewoptPackaging" id="editoptPackaging" value='1'> After
Discount Amount</label>
</div>
</form>
</div>
<div class="modal-footer" style="border:none;">
<a class="btn btn-secondary" data-dismiss="modal" style="margin: 10px;" value="Cancel">Cancel</a>
<a class="btn btn-success" ID="viewPackagingOption" onclick="calculateFreightlocviewper();">&nbsp;&nbsp;<span
class="bold">Ok</span></a>
</div>
</div>
</div>
</div><!-- /.modal -->
<div id="CAPITAL" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
style="display: none;">
<div class="modal-dialog modal-full-width" style="width :1060px !important ;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add Capital Purchase Order Item</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form>
<div class="modal-body p-4">
<div class="form-row">
<div class="form-group col-md-3" style="padding:0px">
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
$RL = array("0" => 'Select Req No');
if (!empty($RequistionDetails)) {
foreach ($RequistionDetails as $SID):
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
endforeach;
}
echo form_dropdown('Reqnumber', $RL, set_value('Reqnumber'), 'id="Reqnumber"', 'class="form-control select2 required"');
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'CapitalDepartmentName', 'value' => set_value('CapitalDepartmentName'), 'id' => 'CapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Cost Center Code</label>
<div>
<?php
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Avail Bud Amount<?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'CapitalbudAmt', 'value' => set_value('CapitalbudAmt'), 'id' => 'CapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-9"></div>
<div class="form-group col-md-3" id="ExchangeRateModalDiv" style="display:none;padding-right: 0px;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
$data = array('name' => 'ExchangeRtModal', 'value' => set_value('ExchangeRtModal'), 'id' => 'ExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$options = array("0" => 'Item Code');
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode"', 'class="form-control select2"');
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Item Name</label>
<div class="form-group">
<?php
$data = array('name' => 'CapitalItemName', 'value' => set_value('ICapitalItemName'), 'id' => 'CapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>UOM</label>
<div class="form-group">
<?php
$data = array('name' => 'CPUOM', 'value' => set_value('CPUOM'), 'id' => 'CPUOM', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'CPQuantity', 'value' => set_value('CPQuantity'), 'id' => 'CPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();calculateFreight(3);calculateFreightlocaddper()');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3" style="padding: 0px;">
<label id="RateIn">Rate(In INR /UOM)</label><span class="text-danger">*</span>
<div class="form-group">
<?php
$data = array('name' => 'CPRate', 'value' => set_value('CPRate'), 'id' => 'CPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();calculateFreight(3);calculateFreightlocaddper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Per</label> <?php
$data = array('name' => 'AddPer', 'value' => set_value('AddPer'), 'id' => 'AddPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-3">
<label id="TotalAmount">Basic value <?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'CPTotalAmount', 'value' => set_value('CPTotalAmount'), 'id' => 'CPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" id="ADDCAPdiv" style="padding:0px;">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<label>Discount Type </label>
<div>
<?php
$options = array("0" => 'Select Discount Type');
if (!empty($TaxType)) {
foreach ($TaxType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType"', 'class="form-control"');
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Discount Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtDiscount', 'value' => set_value('txtDiscount'), 'id' => 'txtDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateDiscount(0);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3"> <!--style="padding:0px"> -->
<label>Discounted Amt <?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'txtAfterDiscount', 'value' => set_value('txtAfterDiscount', 0.00), 'id' => 'txtAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<label>Freight Type </label>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpFreightloc', $options, set_value('drpFreightloc'), 'id="drpFreightloc"', 'class="form-control "');
?>
</div>
<div class="form-group col-md-3" id="TripsValueloc" style="display:none;">
<label>NO Of Trips</label>
<?php
$data = array('name' => 'NOOfTripsloc', 'value' => set_value('NOOfTripsloc'), 'id' => 'NOOfTripsloc', 'class' => 'form-control num', 'onchange' => 'calculateFreightlocaddper(0);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Freight Rate </label>
<?php
$data = array('name' => 'txtFreightloc', 'value' => set_value('txtFreightloc'), 'id' => 'txtFreightloc', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightlocaddper();');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" style="padding-left: -2px;">
<label>Freight Amt <?php echo "($INR)"; ?></label>
<?php
$data = array('name' => 'txtAfterFreightloc', 'value' => set_value('txtAfterFreightloc'), 'id' => 'txtAfterFreightloc', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-6" style="text-align:right !important">
<label> CGST In % </label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'Cgst', 'value' => set_value('Cgst', 0), 'id' => 'Cgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'Ratechange();ChangeSgst();', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'AfterCgst', 'value' => set_value('AfterCgst', 0), 'id' => 'AfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" id="ADDCAPdiv3" style="padding:0px">
<div class="form-group col-md-6" style="text-align:right !important">
<label> SGST In % </label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'Sgst', 'value' => set_value('Sgst', 0), 'id' => 'Sgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst', 0), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" id="ADDCAPdiv2" style="padding:0px">
<div class="form-group col-md-6" style="text-align:right !important">
<label> IGST In % </label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'Igst', 'value' => set_value('Igst', 0), 'id' => 'Igst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst', 0), 'id' => 'AfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" id="ADDCAPdiv1" style="padding:0px">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'OtherAllowances', 'value' => set_value('OtherAllowances', 0), 'id' => 'OtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue', 0), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total Order Amount', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" style="padding:1%;"></div>
<div class="form-row" style="border:1px solid #000;padding:0px;" id="ModalImportTaxHide"
style="display:none;">
<br />
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
Basic Price <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div style="display:none;">
<div class="form-group">
<?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>
<div class="form-group 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="form-row">
<div class="form-group col-md-4">
Landing charge <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'LandingCharge', 'value' => set_value('LandingCharge'), 'id' => 'LandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterLandingCharge', 'value' => set_value('AfterLandingCharge'), 'id' => 'AfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Assessable Value (A) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'Highseas ', 'value' => set_value('Highseas'), 'id' => 'Highseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterAssessable', 'value' => set_value('AfterAssessable'), 'id' => 'AfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom duty (B)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'Customduty', 'value' => set_value('Customduty'), 'id' => 'Customduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterCustomduty', 'value' => set_value('AfterCustomduty'), 'id' => 'AfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom ED_cess (C)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'CustomEDcess', 'value' => set_value('CustomEDcess'), 'id' => 'CustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterCustomEDcess', 'value' => set_value('AfterCustomEDcess'), 'id' => 'AfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom S & H cess (D)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'CustomSHcess', 'value' => set_value('CustomSHcess'), 'id' => 'CustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterCustomSHcess', 'value' => set_value('AfterCustomSHcess'), 'id' => 'AfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
<!-- Subtotal (E)<?php echo "($INR)" ?> -->
Subtotal (E)
<?php echo "($INR) (A+B+C+D)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none">
<?php
$data = array('name' => 'AdditionalExciseduty ', 'value' => set_value('AdditionalExciseduty'), 'id' => 'AdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'Subtotal', 'value' => set_value('Subtotal'), 'id' => 'Subtotal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<!-- Additional Excise duty : (g) -->
IGST on (E): (F)<?php echo " ($INR)"; ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'IgstInt', 'value' => set_value('IgstInt', 0), 'id' => 'IgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'CalculateIgst()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'AfterIgstInt', 'value' => set_value('AfterIgstInt', 0), 'id' => 'AfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-8">
<!-- Total Duty (G)<?php echo "($INR)" ?> -->
Total Duty (G)
<?php echo "($INR) (B+C+D+F)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'Grossdutypayable ', 'value' => set_value('Grossdutypayable'), 'id' => 'Grossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<!--Start of Adding of Frieght model-->
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-4">
<span>Freight Type </span>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight"', 'class="form-control "');
?>
</div>
<div class="form-group col-md-4" id="AddTripsValue" style="display:none;">
<span>NO Of Trips</span>
<?php
$data = array('name' => 'NOOfTrips', 'value' => set_value('NOOfTrips'), 'id' => 'NOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(0);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<span>Freight Rate </span>
<?php
$data = array('name' => 'txtFreight', 'value' => set_value('txtFreight'), 'id' => 'txtFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(0);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4" style="padding-left: 0px;">
<span>Freight Amt <?php echo "($INR)" ?></span>
<?php
$data = array('name' => 'txtAfterFreight', 'value' => set_value('txtAfterFreight'), 'id' => 'txtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<!--End of Adding of freight in edit model -->
<br>
<p style="text-align:center; font-size: 16px; "><b>Cost Of The Product Per UOM</b></p>
<hr>
<br>
<div class="form-row">
<div class="form-group col-md-4">
Duty Impact
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'DutyImpact', 'value' => set_value('DutyImpact'), 'id' => 'DutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top:-20px;">
<span>Quantity</span>
<div class="form-group">
<?php
$data = array('name' => 'PurQuantity', 'value' => set_value('PurQuantity'), 'id' => 'PurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom Duty Expenses <?php echo "($INR)/UOM " ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'CustomDutyExpenses ', 'value' => set_value('CustomDutyExpenses'), 'id' => 'CustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Clearing Charges <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ClearingCharges', 'value' => set_value('ClearingCharges'), 'id' => 'ClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top: -25px;">
<!-- RMC Including Customers -->
<span><?php echo "Net per Uom($INR)"; ?></span>
<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="form-group col-md-4">
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Capital Description </label>
<?php
$data = array('name' => 'ItemDescription', 'value' => set_value('ItemDescription'), 'id' => 'ItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel" style="margin-right:20px;">Cancel</a>
<a class="btn btn-success font AddCapital" ID="AddCapital"> &nbsp;&nbsp;<span class="bold">Add
Capital</span></a>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<!-- 2nd modal -->
<div id="EDITCAPITAL" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
style="display: none;">
<div class="modal-dialog modal-full-width" style="width: 1060px !important;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Capital Purchase Order Item</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div><!-- /.header -->
<form>
<div class="modal-body p-4">
<div class="form-row">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
$RL = array("0" => 'Select Req No');
if (!empty($RequistionDetails)) {
foreach ($RequistionDetails as $SID):
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
endforeach;
}
$data = array('name' => 'EditReqnumber', 'value' => set_value('EditReqnumber'), 'id' => 'EditReqnumber', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'EditCapitalDepartmentName', 'value' => set_value('EditCapitalDepartmentName'), 'id' => 'EditCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Cost Center Code</label>
<div>
<?php
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Avail Bud Amount<?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'EditCapitalbudAmt', 'value' => set_value('EditCapitalbudAmt'), 'id' => 'EditCapitalbudAmt', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.1strow-->
<div class="form-row">
<div class="form-group col-md-9"></div>
<div class="form-group col-md-3" id="ExchangeRateModalEditDiv" style="display:none;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
$data = array('name' => 'EditExchangeRtModal', 'value' => set_value('EditExchangeRtModal'), 'id' => 'EditExchangeRtModal', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.2ndrow-->
<div class="form-row" style="padding: 0px;">
<div class="form-group col-md-3">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$options = array("0" => 'Item Code');
echo form_dropdown('MaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode"', 'class="form-control select2"');
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Item Name</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCapitalItemName', 'value' => set_value('EditCapitalItemName'), 'id' => 'EditCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>UOM</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPUOM', 'value' => set_value('EditCPUOM'), 'id' => 'EditCPUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.3rdrow-->
<div class="form-row">
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3" style="padding: 0px;">
<label id="EditRateIn">Rate(in INR/UOM)</label><span class="text-danger">*</span>
<div class="form-group">
<?php
$data = array('name' => 'EditCPRate', 'value' => set_value('EditCPRate'), 'id' => 'EditCPRate', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Per</label> <?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-3" style="padding-right: 0px;">
<label id="EditTotalAmount">Basic value <?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'EditCPTotalAmount', 'value' => set_value('EditCPTotalAmount'), 'id' => 'EditCPTotalAmount', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.4throw-->
<div class="form-row" style="padding:0px;" id="EDITCAPdiv">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<label>Discount Type </label>
<div>
<?php
$options = array("0" => 'Select Discount Type');
//print_r( $options);
if (!empty($TaxType)) {
foreach ($TaxType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType"', 'class="form-control"');
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Discount Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditDiscount', 'value' => set_value('txtEditDiscount'), 'id' => 'txtEditDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateDiscount(1);', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3" style="padding:0px;">
<label>Discounted Amt <?php echo "($INR)" ?> </label>
<div class="form-group">
<?php
$data = array('name' => 'txtEditAfterDiscount', 'value' => set_value('txtEditAfterDiscount'), 'id' => 'txtEditAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<label>Freight Type </label>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpFreighteditloc', $options, set_value('drpFreighteditloc'), 'id="drpFreighteditloc"', 'class="form-control "');
?>
</div>
<div class="form-group col-md-3" id="TripsValuelocedit" style="display:none;">
<label>NO Of Trips</label>
<?php
$data = array('name' => 'NOOfTripslocedit', 'value' => set_value('NOOfTripslocedit'), 'id' => 'NOOfTripslocedit', 'class' => 'form-control num', 'onchange' => 'calculateFreightloceditper();');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<label>Freight Rate </label>
<?php
$data = array('name' => 'txtFreightlocedit', 'value' => set_value('txtFreightlocedit'), 'id' => 'txtFreightlocedit', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightloceditper();');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" style="padding: 1px;">
<label>Freight Amt <?php echo "($INR)"; ?></label>
<?php
$data = array('name' => 'txtAfterFreightlocedit', 'value' => set_value('txtAfterFreightlocedit'), 'id' => 'txtAfterFreightlocedit', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-6" style="text-align:right !important">
<label> CGST In % <label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditCgst', 'value' => set_value('EditCgst'), 'id' => 'EditCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'EditRatechange();ChangeEditSgst();', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterCgst', 'value' => set_value('EditAfterCgst'), 'id' => 'EditAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.5throw-->
<div class="form-row" id="EDITCAPdiv1">
<div class="form-group col-md-6" style="text-align:right !important">
<label> SGST In % </label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditSgst', 'value' => set_value('EditSgst'), 'id' => 'EditSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterSgst', 'value' => set_value('EditAfterSgst'), 'id' => 'EditAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.C.D1-->
<div class="form-row" id="EDITCAPdiv2">
<div class="form-group col-md-6" style="text-align:right !important">
<label> IGST In % </label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditIgst', 'value' => set_value('EditIgst'), 'id' => 'EditIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst'), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.C.D2-->
<div class="form-row" id="EDITCAPdiv3">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EditOtherAllowances', 'value' => set_value('EditOtherAllowances'), 'id' => 'EditOtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'EdittxtTotalOrderValue', 'value' => set_value('EdittxtTotalOrderValue'), 'id' => 'EdittxtTotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total Order Amount', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- /.C.D3-->
<div class="form-row" style="padding:1%;"></div><!-- /.layer-->
<div class="form-row" style="border:1px solid #000;padding:0px;" id="ViewModalImportTaxHide"
style="display:none;">
<br />
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
Basic Price <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display:none;">
<?php
$data = array('name' => 'EditBasicPriceTax', 'value' => set_value('EditBasicPriceTax'), 'id' => 'EditBasicPriceTax', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterBasicPriceTax', 'value' => set_value('EditAfterBasicPriceTax'), 'id' => 'EditAfterBasicPriceTax', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- f1strow -->
<div class="form-row">
<div class="form-group col-md-4">
Landing charge <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterLandingCharge', 'value' => set_value('EditAfterLandingCharge'), 'id' => 'EditAfterLandingCharge', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 2ndrow -->
<div class="form-row">
<div class="form-group col-md-4">
Assessable Value (A) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'EditHighseas ', 'value' => set_value('EditHighseas'), 'id' => 'EditHighseas', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterAssessable', 'value' => set_value('EditAfterAssessable'), 'id' => 'EditAfterAssessable', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 3rdrow -->
<div class="form-row">
<div class="form-group col-md-4">
Custom duty (B)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditCustomduty', 'value' => set_value('EditCustomduty'), 'id' => 'EditCustomduty', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterCustomduty', 'value' => set_value('EditAfterCustomduty'), 'id' => 'EditAfterCustomduty', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 4throw -->
<div class="form-row">
<div class="form-group col-md-4">
Custom ED_cess (C)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditCustomEDcess', 'value' => set_value('EditCustomEDcess'), 'id' => 'EditCustomEDcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterCustomEDcess', 'value' => set_value('EditAfterCustomEDcess'), 'id' => 'EditAfterCustomEDcess', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 5throw -->
<div class="form-row">
<div class="form-group col-md-4">
Custom S & H cess (D)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditCustomSHcess', 'value' => set_value('EditCustomSHcess'), 'id' => 'EditCustomSHcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterCustomSHcess', 'value' => set_value('EditAfterCustomSHcess'), 'id' => 'EditAfterCustomSHcess', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 6throw -->
</div><!-- 1st 6th-->
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
Subtotal (E) <?php echo "($INR) (A+B+C+D)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'EditAdditionalExciseduty ', 'value' => set_value('EditAdditionalExciseduty'), 'id' => 'EditAdditionalExciseduty', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditSubtotal', 'value' => set_value('EditSubtotal'), 'id' => 'EditSubtotal', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 7throw -->
<div class="form-row">
<div class="form-group col-md-4">
<!-- Additional Excise duty : (g) -->
IGST on (E): (F) <?php echo " ($INR)"; ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditIgstInt ', 'value' => set_value('EditIgstInt', 0), 'id' => 'EditIgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateIgst()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditAfterIgstInt', 'value' => set_value('EditAfterIgstInt', 0), 'id' => 'EditAfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 8throw -->
<div class="form-row">
<div class="form-group col-md-8">
Total Duty (G) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditGrossdutypayable ', 'value' => set_value('EditGrossdutypayable'), 'id' => 'EditGrossdutypayable', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 9throw -->
<!--Start of Adding of Frieght model-->
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-4">
<span>Freight Type </span>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight" class="form-control "');
?>
</div>
<div class="form-group col-md-4" id="EditTripsValue" style="display:none;">
<span>NO Of Trips</span>
<?php
$data = array('name' => 'EditNOOfTrips', 'value' => set_value('EditNOOfTrips'), 'id' => 'EditNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(1);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<span>Freight Rate </span>
<?php
$data = array('name' => 'txtEditFreight', 'value' => set_value('txtEditFreight'), 'id' => 'txtEditFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(1);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4" style="padding-left: 0px;">
<span>Freight Amt <?php echo "($INR)" ?></span>
<?php
$data = array('name' => 'txtEditAfterFreight', 'value' => set_value('txtEditAfterFreight'), 'id' => 'txtEditAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 10throw -->
<!--End of Adding of freight in edit model -->
<br>
<p style="text-align:center; font-size: 16px; "><b>Cost Of The Product Per UOM</b></p>
<hr>
<br>
<div class="form-row">
<div class="form-group col-md-4">
Duty Impact
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditDutyImpact', 'value' => set_value('EditDutyImpact'), 'id' => 'EditDutyImpact', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top: -20px;">
<span>Quantity</span>
<div class="form-group">
<?php
$data = array('name' => 'EditPurQuantity', 'value' => set_value('EditPurQuantity'), 'id' => 'EditPurQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
</div><!-- 11throw -->
<div class="form-row">
<div class="form-group col-md-4">
Custom Duty Expenses <?php echo "($INR)/UOM" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 12throw -->
<div class="form-row">
<div class="form-group col-md-4">
Clearing Charges <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top: -19px;">
<!-- RMC Including Customers -->
<span><?php echo "Net per UOM($INR)"; ?></span>
<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="form-group col-md-4">
</div>
</div><!-- 13throw -->
</div><!-- 2nd 6th-->
</div><!-- Import.Tax.Hide -->
<div class="form-row">
<div class="form-group col-md-12">
<label>Capital Description </label>
<?php
$data = array('name' => 'EditItemDescription', 'value' => set_value('EditItemDescription'), 'id' => 'EditItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- C.Desc -->
</div><!-- /.body -->
<div class="modal-footer">
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel" style="margin-right: 10px;">Cancel</a>
<a class="btn btn-success font EditCapital" ID="UpdateCapital">&nbsp;&nbsp;<span class="bold">Update
Capital</span></a>
</div><!-- /.footer -->
</form>
</div><!-- /.content -->
</div><!-- /.modal-dialog-->
</div><!-- /.modal -->
<!-- 3rd modal new-->
<div id="VIEWCAPITAL" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-full-width" style="width: 1060px !important;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">View Capital Purchase Order Item</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div><!-- modal-header -->
<form>
<div class="modal-body p-4">
<div class="form-row">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'ViewReqnumber', 'value' => set_value('ViewReqnumber'), 'id' => 'ViewReqnumber', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Req No -->
<div class="form-group col-md-3">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'ViewCapitalDepartmentName', 'value' => set_value('ViewCapitalDepartmentName'), 'id' => 'ViewCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Department Name -->
<div class="form-group col-md-3">
<label>Cost Center Code</label>
<div>
<?php
$data = array('name' => 'ViewCostCenter', 'value' => set_value('ViewCostCenter'), 'id' => 'ViewCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Cost Center Code -->
<div class="form-group col-md-3">
<label>Avail Bud Amount<?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCapitalbudAmt', 'value' => set_value('ViewCapitalbudAmt'), 'id' => 'ViewCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Avail Bud Amount -->
</div><!-- 1st form-row -->
<div class="form-row">
<div class="form-group col-md-9"></div>
<div class="form-group col-md-3" id="ExchangeRateModalEditDiv" style="display:none;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewExchangeRtModal', 'value' => set_value('ViewExchangeRtModal'), 'id' => 'ViewExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 2nd form-row -->
<div class="form-row" style="padding: 0px;">
<div class="form-group col-md-3">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'ViewMaterialCode', 'value' => set_value('ViewMaterialCode'), 'id' => 'ViewMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Item Code -->
<div class="form-group col-md-3">
<label>Item Name</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCapitalItemName', 'value' => set_value('ViewCapitalItemName'), 'id' => 'ViewCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Item Name -->
<div class="form-group col-md-3">
<label>UOM</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPUOM', 'value' => set_value('ViewCPUOM'), 'id' => 'ViewCPUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- UOM -->
<div class="form-group col-md-3">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPQuantity', 'value' => set_value('ViewCPQuantity'), 'id' => 'ViewCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Quantity -->
</div><!-- 3rd form-row -->
<div class="form-row">
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3" style="padding: 0px;">
<label id="EditRateIn">Rate(in INR/UOM)</label><span class="text-danger">*</span>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPRate', 'value' => set_value('ViewCPRate'), 'id' => 'ViewCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Rate(in INR/UOM) -->
<div class="form-group col-md-3">
<label>Per</label>
<?php $data = array('name' => 'ViewPer', 'value' => set_value('ViewPer'), 'id' => 'ViewPer', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); ?>
</div><!--Per -->
<div class="form-group col-md-3" style="padding-right: 0px;">
<label id="ViewTotalAmount">Basic value <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'ViewCPTotalAmount', 'value' => set_value('ViewCPTotalAmount'), 'id' => 'ViewCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div><!-- Basic value -->
</div><!-- 4th form-row -->
<div class="form-row" style="padding:0px;" id="VIEWCAPdiv">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<label>Discount Type </label>
<div>
<?php
$data = array('name' => 'ViewDiscountType', 'value' => set_value('ViewDiscountType'), 'id' => 'ViewDiscountType', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Discount Type -->
<div class="form-group col-md-3">
<label>Discount Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtViewDiscount', 'value' => set_value('txtViewDiscount'), 'id' => 'txtViewDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateDiscount(1);', 'style' => 'text-align:right;', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- Discount Rate -->
<div class="form-group col-md-3" style="padding:0px;">
<label>Discounted Amt <?php echo "($INR)" ?> </label>
<div class="form-group">
<?php
$data = array('name' => 'txtViewAfterDiscount', 'value' => set_value('txtViewAfterDiscount'), 'id' => 'txtViewAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div><!-- Discounted Amt -->
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3">
<label>Freight Type </label>
<?php
$options = array("0" => 'Select Freight Type');
//print_r( $options);
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpFreightviewloc', $options, set_value(field: 'drpFreightviewloc'), 'id="drpFreightviewloc" disabled class="form-control "');
?>
</div><!-- Freight Type -->
<div class="form-group col-md-3" id="TripsValuelocedit" style="display:none;">
<label>NO Of Trips</label>
<?php
$data = array('name' => 'NOOfTripslocview', 'value' => set_value('NOOfTripslocview'), 'id' => 'NOOfTripslocview', 'class' => 'form-control num', 'onchange' => 'calculateFreightlocviewper();', 'disabled' => 'disabled');
echo form_input($data);
?>
</div><!-- NO Of Trips -->
<div class="form-group col-md-3">
<label>Freight Rate </label>
<?php
$data = array('name' => 'txtFreightlocview', 'value' => set_value('txtFreightlocview'), 'id' => 'txtFreightlocview', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightlocviewper();', 'disabled' => 'disabled');
echo form_input($data);
?>
</div><!-- Freight Rate -->
<div class="form-group col-md-3" style="padding: 1px;">
<label>Freight Amt <?php echo "($INR)"; ?></label>
<?php
$data = array('name' => 'txtAfterFreightlocview', 'value' => set_value('txtAfterFreightlocview'), 'id' => 'txtAfterFreightlocview', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div><!-- Freight Amt -->
<div class="form-group col-md-6" style="text-align:right !important">
<label> CGST In % <label>
</div><!-- CGST -->
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewCgst', 'value' => set_value('ViewCgst'), 'id' => 'ViewCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- CGST -->
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewAfterCgst', 'value' => set_value('ViewAfterCgst'), 'id' => 'ViewAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
echo form_input($data);
?>
</div><!-- CGST -->
</div><!-- VIEWCAPdiv form-row -->
<div class="form-row" id="VIEWCAPdiv1">
<div class="form-group col-md-6" style="text-align:right !important">
<label> SGST In % </label>
</div><!-- SGST -->
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewSgst', 'value' => set_value('ViewSgst'), 'id' => 'ViewSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- SGST1 -->
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterSgst', 'value' => set_value('ViewAfterSgst'), 'id' => 'ViewAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- SGST2 -->
</div><!-- VIEWCAPdiv1 form-row -->
<div class="form-row" id="VIEWCAPdiv2">
<div class="form-group col-md-6" style="text-align:right !important">
<label> IGST In % </label>
</div><!-- IGST -->
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewIgst', 'value' => set_value('ViewIgst'), 'id' => 'ViewIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- IGST 1 -->
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterIgst', 'value' => set_value('ViewAfterIgst'), 'id' => 'ViewAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- IGST 2 -->
</div><!-- VIEWCAPdiv2 form-row -->
<div class="form-row" id="VIEWCAPdiv3">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewOtherAllowances', 'value' => set_value('ViewOtherAllowances'), 'id' => 'ViewOtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<div class="form-group">
<?php
$data = array('name' => 'ViewTotalAmountlocal', 'value' => set_value('ViewTotalAmountlocal'), 'id' => 'ViewTotalAmountlocal', 'class' => 'form-control num', 'placeholder' => 'Total Amount', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- VIEWCAPdiv3 form-row -->
<div class="form-row" style="padding:1%;"></div>
<div class="form-row" style="border:1px solid #000;padding:0px;" id="EditModalImportTaxHide"
style="display:none;">
<br />
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
Basic Price <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display:none;">
<?php
$data = array('name' => 'ViewBasicPriceTax', 'value' => set_value('ViewBasicPriceTax'), 'id' => 'ViewBasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterBasicPriceTax', 'value' => set_value('ViewAfterBasicPriceTax'), 'id' => 'ViewAfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 1strow -->
<div class="form-row">
<div class="form-group col-md-4">
Landing charge <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewLandingCharge', 'value' => set_value('ViewLandingCharge'), 'id' => 'ViewLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterLandingCharge', 'value' => set_value('ViewAfterLandingCharge'), 'id' => 'ViewAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 2ndrow -->
<div class="form-row">
<div class="form-group col-md-4">
Assessable Value (A) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'ViewHighseas ', 'value' => set_value('ViewHighseas'), 'id' => 'ViewHighseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterAssessable', 'value' => set_value('ViewAfterAssessable'), 'id' => 'ViewAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 3rdrow -->
<div class="form-row">
<div class="form-group col-md-4">
Custom duty (B)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomduty', 'value' => set_value('ViewCustomduty'), 'id' => 'ViewCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'viewAfterCustomduty', 'value' => set_value('viewAfterCustomduty'), 'id' => 'viewAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 4throw -->
<div class="form-row">
<div class="form-group col-md-4">
Custom ED_cess (C)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomEDcess', 'value' => set_value('ViewCustomEDcess'), 'id' => 'ViewCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterCustomEDcess', 'value' => set_value('ViewAfterCustomEDcess'), 'id' => 'ViewAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 5throw -->
<div class="form-row">
<div class="form-group col-md-4">
Custom S & H cess (D)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomSHcess', 'value' => set_value('ViewCustomSHcess'), 'id' => 'ViewCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterCustomSHcess', 'value' => set_value('ViewAfterCustomSHcess'), 'id' => 'ViewAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 6throw -->
</div><!-- international 1st col -->
<div class="form-group col-md-6" style="padding:10px;">
<div class="form-row">
<div class="form-group col-md-4">
Subtotal (E) <?php echo "($INR) (A+B+C+D)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'ViewAdditionalExciseduty ', 'value' => set_value('ViewAdditionalExciseduty'), 'id' => 'ViewAdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewSubtotal', 'value' => set_value('ViewSubtotal'), 'id' => 'ViewSubtotal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 7throw -->
<div class="form-row">
<div class="form-group col-md-4">
<!-- Additional Excise duty : (g) -->
IGST on (E): (F) <?php echo " ($INR)"; ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewIgstInt ', 'value' => set_value('ViewIgstInt', 0), 'id' => 'ViewIgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true', 'onchange' => 'EditCalculateIgst()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterIgstInt', 'value' => set_value('ViewAfterIgstInt', 0), 'id' => 'ViewAfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 8throw -->
<div class="form-row">
<div class="form-group col-md-8">
Total Duty (G) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewGrossdutypayable ', 'value' => set_value('ViewGrossdutypayable'), 'id' => 'ViewGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 9throw -->
<!--Start of Frieght model-->
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-4">
<span>Freight Type </span>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpViewFreight', $options, set_value('drpViewFreight'), 'id="drpViewFreight"', 'class="form-control "');
?>
</div>
<div class="form-group col-md-4" id="ViewTripsValue" style="display:none;">
<span>NO Of Trips</span>
<?php
$data = array('name' => 'ViewNOOfTrips', 'value' => set_value('ViewNOOfTrips'), 'id' => 'ViewNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(2);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4">
<span>Freight Rate </span>
<?php
$data = array('name' => 'txtViewFreight', 'value' => set_value('txtViewFreight'), 'id' => 'txtViewFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(2);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-4" style="padding-left: 0px;">
<span>Freight Amt <?php echo "($INR)" ?></span>
<?php
$data = array('name' => 'txtViewAfterFreight', 'value' => set_value('txtViewAfterFreight'), 'id' => 'txtViewAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 10throw -->
<!--End of Adding of freight in view model -->
<br>
<p style="text-align:center; font-size: 16px; "><b>Cost Of The Product Per UOM</b></p>
<hr>
<br>
<div class="form-row">
<div class="form-group col-md-6">
<label>Duty Impact</label>
<?php
$data = array('name' => 'ViewDutyImpact', 'value' => set_value('ViewDutyImpact'), 'id' => 'ViewDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-6">
<label>Quantity</label>
<?php
$data = array('name' => 'ViewPurQuantity', 'value' => set_value('ViewPurQuantity'), 'id' => 'ViewPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 11throw -->
<div class="form-row">
<div class="form-group col-md-6">
<label> Custom Duty Expenses <?php echo "($INR)/UOM" ?></label>
<?php
$data = array('name' => 'ViewCustomDutyExpenses ', 'value' => set_value('ViewCustomDutyExpenses'), 'id' => 'ViewCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 12throw -->
<div class="form-row">
<div class="form-group col-md-6">
<label> Clearing Charges <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'ViewClearingCharges', 'value' => set_value('ViewClearingCharges'), 'id' => 'ViewClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-6">
<label> Net per UOM <?php echo "($INR)" ?></label>
<?php
$data = array('name' => 'ViewNett', 'value' => set_value('ViewNett'), 'id' => 'ViewNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div><!-- net -->
</div><!-- 13throw -->
<div class="form-row">
<!-- <div class="form-group col-md-6" style="text-align:right !important" style="display:none;"> <label>Total Order Amount :</label></div> -->
<div class="form-group col-md-6" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'ViewtxtTotalOrderValue', 'value' => set_value('ViewtxtTotalOrderValue'), 'id' => 'ViewtxtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- 14throw row hidden -->
</div><!-- international 2nd col -->
</div><!-- ViewModalImportTaxHide -->
<br>
<div class="form-row">
<div class="form-group col-md-12">
<label>Capital Description </label>
<?php
$data = array('name' => 'ViewItemDescription', 'value' => set_value('ViewItemDescription'), 'id' => 'ViewItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- form-row capitial Description -->
</div><!-- modal-body -->
<div class="modal-footer">
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel" style="margin-right:10px">Cancel</a>
<?php if ($CapitalRange == 1 || $CapitalRange == 0) { ?>
<!-- <a class="btn btn-success font ViewCapital" ID="ViewUpdateCapital">&nbsp;&nbsp;<span class="bold">Update Capital</span></a> -->
<?php } ?>
</div><!-- modal-footer -->
</form><!-- form -->
</div><!-- modal-content -->
</div><!-- modal-dialog modal-full-width -->
</div><!-- /.modal -->
<!-- 3rd modal old-->
<div id="VIEWCAPITALOLD" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
style="display: none;">
<div class="modal-dialog modal-full-width">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">View Capital Purchase Order Item</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form>
<div class="modal-body p-4">
<div class="form-row" style="padding: 0px;">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'ViewReqnumber', 'value' => set_value('ViewReqnumber'), 'id' => 'ViewReqnumber', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'ViewCapitalDepartmentName', 'value' => set_value('ViewCapitalDepartmentName'), 'id' => 'ViewCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Cost Center Code</label>
<div>
<?php
$data = array('name' => 'ViewCostCenter', 'value' => set_value('ViewCostCenter'), 'id' => 'ViewCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2" id="ExchangeRateModalViewDiv" style="display:none;padding-right: 0px;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewExchangeRtModal', 'value' => set_value('ViewExchangeRtModal'), 'id' => 'ViewExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Avail Bud Amount<?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCapitalbudAmt', 'value' => set_value('ViewCapitalbudAmt'), 'id' => 'ViewCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" style="padding: 0px;">
<div class="form-group col-md-2">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'ViewMaterialCode', 'value' => set_value('ViewMaterialCode'), 'id' => 'ViewMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Item Name</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCapitalItemName', 'value' => set_value('ViewCapitalItemName'), 'id' => 'ViewCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>UOM</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPUOM', 'value' => set_value('ViewCPUOM'), 'id' => 'ViewCPUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Quantity<span class="text-danger">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPQuantity', 'value' => set_value('ViewCPQuantity'), 'id' => 'ViewCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2" style="padding: 0px;">
<label id="ViewRateIn">Rate(in INR/UOM)</label><span class="text-danger">*</span>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPRate', 'value' => set_value('ViewCPRate'), 'id' => 'ViewCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>Per</label>
<?php $data = array('name' => 'ViewPer', 'value' => set_value('ViewPer'), 'id' => 'ViewPer', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); ?>
</div>
<div class="form-group col-md-2">
<label id="EditTotalAmount">Basic value <?php echo "($INR)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPTotalAmount', 'value' => set_value('ViewCPTotalAmount'), 'id' => 'ViewCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div id="VIEWCAPdiv" style="padding: 0px;">
<div class="form-row">
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3">
<label>Discount Type </label>
<div>
<?php
$data = array('name' => 'ViewDiscountType', 'value' => set_value('ViewDiscountType'), 'id' => 'ViewDiscountType', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Discount Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtViewDiscount', 'value' => set_value('txtViewDiscount'), 'id' => 'txtViewDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateDiscount(1);', 'style' => 'text-align:right;', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3">
<label>Discounted Amt <?php echo "($INR)" ?> </label>
<div class="form-group">
<?php
$data = array('name' => 'txtViewAfterDiscount', 'value' => set_value('txtViewAfterDiscount'), 'id' => 'txtViewAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3"></div>
<div class="form-group col-md-3">
<label>Freight Type </label>
<?php
$options = array("0" => 'Select Freight Type');
//print_r( $options);
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpFreightviewloc', $options, set_value(field: 'drpFreightviewloc'), 'id="drpFreightviewloc" disabled class="form-control "');
?>
</div>
<div class="form-group col-md-3" id="TripsValuelocview" style="display:none;">
<label>NO Of Trips</label>
<?php
$data = array('name' => 'NOOfTripslocview', 'value' => set_value('NOOfTripslocview'), 'id' => 'NOOfTripslocview', 'class' => 'form-control num', 'onchange' => 'calculateFreightlocviewper();', 'disabled' => 'disabled');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" style=padding:15px">
<label>Freight Rate </label>
<?php
$data = array('name' => 'txtFreightlocview', 'value' => set_value('txtFreightlocview'), 'id' => 'txtFreightlocview', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightlocviewper();', 'disabled' => 'disabled');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" style="padding-left: -2px;">
<label>Freight Amt <?php echo "($INR)"; ?></label>
<?php
$data = array('name' => 'txtAfterFreightlocview', 'value' => set_value('txtAfterFreightlocview'), 'id' => 'txtAfterFreightlocview', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6" style="text-align:right !important">
CGST In %
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewCgst', 'value' => set_value('ViewCgst'), 'id' => 'ViewCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewAfterCgst', 'value' => set_value('ViewAfterCgst'), 'id' => 'ViewAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" id="VIEWCAPdiv1" style="padding: 0px;">
<div class="form-group col-md-6" style="text-align:right !important">
SGST In %
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewSgst', 'value' => set_value('ViewSgst'), 'id' => 'ViewSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewAfterSgst', 'value' => set_value('ViewAfterSgst'), 'id' => 'ViewAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" id="VIEWCAPdiv2" style="padding: 0px;">
<div class="form-group col-md-6" style="text-align:right !important">
IGST In %
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewIgst', 'value' => set_value('ViewIgst'), 'id' => 'ViewIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewAfterIgst', 'value' => set_value('ViewAfterIgst'), 'id' => 'ViewAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" id="VIEWCAPdiv3" style="padding: 0px;">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewOtherAllowances', 'value' => set_value('ViewOtherAllowances'), 'id' => 'ViewOtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" id="" style="padding: 0px;">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
<?php
$data = array('name' => 'ViewTotalAmountlocal', 'value' => set_value('ViewTotalAmountlocal'), 'id' => 'ViewTotalAmountlocal', 'class' => 'form-control num', 'placeholder' => 'Total Amount', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" style="padding:1%;"></div>
<div class="form-row" style="border:1px solid #000;padding:0px;" id="ViewModalImportTaxHide"
style="display:none;">
<br />
<div class="form-group col-md-6" style="padding:0px;">
<div class="form-row">
<div class="form-group col-md-4">
Basic Price <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'ViewBasicPriceTax', 'value' => set_value('ViewBasicPriceTax'), 'id' => 'ViewBasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterBasicPriceTax', 'value' => set_value('ViewAfterBasicPriceTax'), 'id' => 'ViewAfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Landing charge <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewLandingCharge', 'value' => set_value('ViewLandingCharge'), 'id' => 'ViewLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterLandingCharge', 'value' => set_value('ViewAfterLandingCharge'), 'id' => 'ViewAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Assessable Value (A) <?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'ViewHighseas ', 'value' => set_value('ViewHighseas'), 'id' => 'ViewHighseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterAssessable', 'value' => set_value('ViewAfterAssessable'), 'id' => 'ViewAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom duty (B)<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomduty', 'value' => set_value('ViewCustomduty'), 'id' => 'ViewCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'viewAfterCustomduty', 'value' => set_value('viewAfterCustomduty'), 'id' => 'viewAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom ED_cess (C)
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomEDcess', 'value' => set_value('ViewCustomEDcess'), 'id' => 'ViewCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterCustomEDcess', 'value' => set_value('ViewAfterCustomEDcess'), 'id' => 'ViewAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom S & H cess (D)
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomSHcess', 'value' => set_value('ViewCustomSHcess'), 'id' => 'ViewCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterCustomSHcess', 'value' => set_value('ViewAfterCustomSHcess'), 'id' => 'ViewAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="form-group col-md-6" style="padding:0px;">
<div class="form-row">
<div class="form-group col-md-4">
Subtotal (E)<?php echo "($INR) (A+B+C+D)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group" style="display: none;">
<?php
$data = array('name' => 'ViewAdditionalExciseduty ', 'value' => set_value('ViewAdditionalExciseduty'), 'id' => 'ViewAdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewSubtotal', 'value' => set_value('ViewSubtotal'), 'id' => 'ViewSubtotal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<!-- Additional Excise duty : (g) -->
IGST on (E): (F)
<?php echo " ($INR)"; ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewIgstInt ', 'value' => set_value('ViewIgstInt', 0), 'id' => 'ViewIgstInt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true', 'onchange' => 'EditCalculateIgst()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewAfterIgstInt', 'value' => set_value('ViewAfterIgstInt', 0), 'id' => 'ViewAfterIgstInt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-8">
Total Duty (G) <?php echo "($INR) (B+C+D+F)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewGrossdutypayable ', 'value' => set_value('ViewGrossdutypayable'), 'id' => 'ViewGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<!--Start of Adding of Frieght model-->
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-3">
<span>Freight Type </span>
<?php
$options = array("0" => 'Select Freight Type');
if (!empty($FreightType)) {
foreach ($FreightType as $SID):
$options[$SID->ConfigValue] = $SID->ConfigValue;
endforeach;
}
echo form_dropdown('drpViewFreight', $options, set_value('drpViewFreight'), 'id="drpViewFreight"', 'class="form-control "');
?>
</div>
<div class="form-group col-md-3" id="ViewTripsValue" style="display:none;">
<span>NO Of Trips</span>
<?php
$data = array('name' => 'ViewNOOfTrips', 'value' => set_value('ViewNOOfTrips'), 'id' => 'ViewNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(2);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3">
<span>Freight Rate </span>
<?php
$data = array('name' => 'txtViewFreight', 'value' => set_value('txtViewFreight'), 'id' => 'txtViewFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(2);');
echo form_input($data);
?>
</div>
<div class="form-group col-md-3" style="padding-left: 0px;">
<span>Freight Amt <?php echo "($INR)" ?></span>
<?php
$data = array('name' => 'txtViewAfterFreight', 'value' => set_value('txtViewAfterFreight'), 'id' => 'txtViewAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<!--End of Adding of freight in edit model -->
<div class="form-row">
<center> <label>Cost of the product Per UOM</label></center>
<hr />
</div>
<div class="form-row">
<div class="form-group col-md-4">
Duty Impact
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewDutyImpact', 'value' => set_value('ViewDutyImpact'), 'id' => 'ViewDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top: -20px;">
<span>Quantity</span>
<div class="form-group">
<?php
$data = array('name' => 'ViewPurQuantity', 'value' => set_value('ViewPurQuantity'), 'id' => 'ViewPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Custom Duty Expenses<?php echo "($INR)/UOM" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewCustomDutyExpenses ', 'value' => set_value('ViewCustomDutyExpenses'), 'id' => 'ViewCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
Clearing Charges<?php echo "($INR)" ?>
</div>
<div class="form-group col-md-4">
<div class="form-group">
<?php
$data = array('name' => 'ViewClearingCharges', 'value' => set_value('ViewClearingCharges'), 'id' => 'ViewClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4" style="margin-top: -25px;">
<!-- RMC Including Customers -->
<span><?php echo "Net per Uom($INR)"; ?></span>
<div class="form-group">
<?php
$data = array('name' => 'ViewNett', 'value' => set_value('ViewNett'), 'id' => 'ViewNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-4">
</div>
</div>
<div class="form-group col-md-6" style="text-align:right !important" style="display:none;"> <label>Total Order Amount
:</label></div>
<div class="form-group col-md-6" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'ViewtxtTotalOrderValue', 'value' => set_value('ViewtxtTotalOrderValue'), 'id' => 'ViewtxtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
</div>
<div class="form-row" style="padding: 0px 30px 10px 30px;text-align:left">
<div class="form-group col-md-12">
<label>Capital Description </label>
<?php
$data = array('name' => 'ViewItemDescription', 'value' => set_value('ViewItemDescription'), 'id' => 'ViewItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel" style="margin-right:10px">Cancel</a>
<?php if ($CapitalRange == 1 || $CapitalRange == 0) { ?>
<!-- <a class="btn btn-success font ViewCapital" ID="ViewUpdateCapital">&nbsp;&nbsp;<span class="bold">Update Capital</span></a> -->
<?php } ?>
</div>
</form>
</div>
</div>
</div><!-- /.modal -->
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
<!-- <script type="text/html" id="CapitalList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
<td align="left"><%=MaterialCode%></td>
<td align="left"><%=MaterialName%></td>
<td align="left"><%=Quantity%></td>
<td align="left"><%=UOM%></td>
<td align="left"><%=Rate%></td>
<td align="left"><%=BasicAmount%></td>
<td align="left"><%=Taxvalue%></td>
<td align="left"><%=TotalValue%></td>
<td align="left"><%=ActualQuantity%></td>
<td align="left"><%=ReceivedQuantity%></td>
<td align="left"><%=PendingQuantity%></td>
<td>
<a data-target='#EDITCAPITAL' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
</td>
</tr>
</script> -->
<script>
$(document).ready(function() {
var PONOStatus = "<?= $PONOStatus ?>";
console.log(PONOStatus);
if (PONOStatus === 'ST030') {
$('input, textarea, select').attr('readonly', true);
$('input[type="file"], input[type="radio"], input[type="checkbox"]').attr('disabled', true);
$("#MaterialCode,#EditMaterialCode,#Reqnumber,#drpSupplier,#currencytype,#PoTypeOptions,#PaymentMethod,#insuranceStatus,#CapitalCostCenter").prop("disabled", true);
}
});
</script>
<script>
var RequistQuantity = '';
var AvilBudAmt = '';
var POMaxDate = '<?php echo $MaxPoDate; ?>';
var d = new Date(POMaxDate);
var SelectedMaterialCode = [];
var CollIndex = 0;
var SelectedMaterialList = {
Mat: []
};
var index = <?php echo $index; ?> + 1;
var myArray = <?php echo json_encode($res_arr_values); ?>;
$.each(myArray, function(idx, obj) {
SelectedMaterialCode[CollIndex] = obj.materialCode;
CollIndex = CollIndex + 1;
SelectedMaterialList.Mat.push({
"materialCode": obj.materialCode,
"ReqNo": obj.ReqNo,
});
});
$("#BudgetType").change(function() {
var aa = $("#BudgetType option:selected").text();
$('#Budget').val(aa);
});
$(function() {
// $("#PODate").datepicker({
// minDate: d,
// maxDate: 'now',
// dateFormat: 'mm/dd/yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '-100:+0'
// });
// $("#Deliverydt").datepicker({
// minDate: 'now',
// dateFormat: 'mm/dd/yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
//alert(capital);
if (capital == 0) {
$('#CAPdiv').hide();
$('#ADDCAPdiv').hide();
$('#ADDCAPdiv1').hide();
$('#ADDCAPdiv2').hide();
$('#ADDCAPdiv3').hide();
$('#EDITCAPdiv').hide();
$('#EDITCAPdiv1').hide();
$('#EDITCAPdiv2').hide();
$('#EDITCAPdiv3').hide();
$('#VIEWCAPdiv').hide();
$('#VIEWCAPdiv1').hide();
$('#VIEWCAPdiv2').hide();
$('#VIEWCAPdiv3').hide();
//$('#DOMdiv').hide();
}
$('#drpSupplier').change(function() {
var cd = $("#drpSupplier option:selected").text();
//alert(cd);
$("#changeSup").val(cd);
var PaymentOtherData = '<?php echo $otherPayment; ?>';
var id = $('#drpSupplier').val();
var supPaymentTerms = '';
$("#SupAddress").val('');
if (id != '0') {
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if (obj.SupplierID === id) {
if (obj.MSME) {
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
} else {
$("#SupAddress").val(obj.Address);
}
supPaymentTerms = obj.PaymentID;
$("#PaymentMethod").val(obj.PaymentID);
}
});
if (supPaymentTerms != 'PT08') {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
} else if (supPaymentTerms == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOtherData);
}
$('#PaymentMethod').empty();
var paymentList = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
$.each(paymentList, function(idx1, obj1) {
if (obj1.PaymentID == supPaymentTerms) {
$("#PaymentMethod").append($('<option></option>').val(obj1.PaymentID).html(obj1.PaymentTerms));
}
});
$.each(paymentList, function(idx, obj) {
if (obj.PaymentID != supPaymentTerms) {
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
}
});
} else {
alert('Please select the SupplierID');
return false;
}
});
$('#Reqnumber').change(function() {
var ExchangeRate = '';
var ExchangeRate = $('#ExchangeRt').val();
var id = $('#Reqnumber').val();
$("#CapitalbudAmt").val('');
$("#ExchangeRtModal").val(ExchangeRate);
$("#MaterialCode").empty();
$("#CapitalDepartmentName").val('');
$("#CPUOM").val('');
$("#CPQuantity").val('');
$("#CapitalItemName").val('');
$("#CPTotalAmount").val('');
$("#txtBasicValue").val('');
$("#CostCenter").val('');
clearTaxField();
if (id != '0') {
var y = <?php echo json_encode($RequistionDetails, JSON_PRETTY_PRINT) ?>;
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
var AvlBudAmt = '<?php echo $AvlAmount ?>';
// For Binding DepartmentName
$.each(y, function(idx, obj) {
if (obj.ReqNo === id) {
$("#CapitalDepartmentName").val(obj.DepartmentName);
$("#CostCenter").val(obj.CostCenterCode);
}
});
$("#CapitalbudAmt").val(AvlBudAmt);
// For Binding Material list center for the selected Requistion Number
$("#MaterialCode").append($('<option></option>').val("0").html("Select Material Code"));
var isAdded = "0";
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.ReqNo === id) {
$.each(SelectedMaterialList.Mat, function(idx1, el) {
if (id == el.ReqNo) {
if (el.materialCode == obj.MaterialCode) {
isAdded = "1";
return false;
} else {
isAdded = "0";
}
}
});
if (isAdded == "0") {
$("#MaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
}
}
});
}
} else {
alert('Please select the Requisition Number');
return false;
}
id = '';
});
$('#MaterialCode').change(function() {
var id = $('#MaterialCode').val();
$("#CapitalItemName").val('');
$("#CPUOM").val('');
$("#CPQuantity").val('');
$("#CPTotalAmount").val('');
$("#CPRate").val('');
RequistQuantity = '';
clearTaxField();
if (id != '0') {
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode === id) {
$("#CapitalItemName").val(obj.MaterialName);
$("#CPUOM").val(obj.UOM);
$("#CPQuantity").val(obj.Quantity);
$("#CPRate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
var CPUOMDisplay = obj.UOM ? obj.UOM : '';
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
if (obj.material_rate != 0) {
Ratechange();
calculateFreight(3);
calculateFreightlocaddper();
}
}
});
}
var d = $('#drpSupplier').val();
$('#loader').show();
$.ajax({
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
type: 'POST',
data: {
supplierid: d,
materialcode: id
},
success: function(response) {
$('#loader').hide();
if (response) alert(response);
}
});
} else {
alert('Please select the MaterialCode');
return false;
}
var d = $('#drpSupplier').val();
});
$('#EditMaterialCode').change(function() {
var id = $('#EditMaterialCode').val();
$("#EditItemName").val('');
$("#EditUOM").val('');
$("#EditQuantity").val('');
$("#EditRate").val('');
$("#txtEditBasicValue").val('');
RequistQuantity = '';
clearEditTaxField();
if (id != '0') {
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode === id) {
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
$("#EditQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
var CPUOMDisplay = obj.UOM ? obj.UOM : '';
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
}
});
}
var d = $('#drpSupplier').val();
$('#loader').show();
$.ajax({
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
type: 'POST',
data: {
supplierid: d,
materialcode: id
},
success: function(response) {
$('#loader').hide();
if (response) alert(response);
}
});
} else {
alert('Please select the MaterialCode');
return false;
}
var d = $('#drpSupplier').val();
});
});
function clearTaxField() {
$('#CPTotalAmount').val('');
$('#AfterServiceTax').val('');
$('#AfterEduCess').val('');
$('#AfterSecHighTax').val('');
$('#AfterKrishiTax').val('');
$('#AfterSwachhTax').val('');
$('#BasicPriceTax ').val('');
$('#AfterBasicPriceTax').val('');
$("#LandingCharge").val('');
$("#AfterLandingCharge").val('');
$("#Highseas").val('');
$("#AfterHighseas").val('');
$("#Customduty").val('');
$("#AfterCustomduty").val('');
$("#ExcisedutyTax").val('');
$("#AfterExcisedutyTax").val('');
$("#ExcisedutyEDcess").val('');
$("#AfterExcisedutyEDcess").val('');
$("#ExcisedutySHcess").val('');
$("#AfterExcisedutySHcess").val('');
$("#CustomEDcess").val('');
$("#AfterCustomEDcess").val('');
$("#CustomSHcess").val('');
$("#AfterCustomSHcess").val('');
$("#AdditionalExciseduty").val('');
$("#AfterAdditionalExciseduty").val('');
$("#Grossdutypayable").val('');
$("#AvailableModvat").val('');
$("#Grossexpenses").val('');
$("#purchaserate").val('');
$("#CustomDutyExpenses").val('');
$("#RMCIncludingCustomers").val('');
$("#PurQuantity").val('');
RequistQuantity = '';
}
function ChangeSgst() {
$('#Sgst').val($('#Cgst').val());
Ratechange();
}
function ChangeEditSgst() {
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
}
/*
This function is used to validate all field
*/
function Ratechange() {
if ($('#Reqnumber').val() == "0") {
alert('Please select the Requisition Number');
$('#Reqnumber').focus();
return false;
} else if ($('#MaterialCode').val() == "0") {
alert('Please select the Material Code');
$('#MaterialCode').focus();
return false;
} else if ($('#CostCenter').val() == "0") {
alert('Please select the CostCenterCode');
$('#CostCenter').focus();
return false;
}
//ExceedQuantityCheck();
if (ExceedQuantityCheck()) {
if ($('#CPQuantity').val() != '' && $('#CPRate').val() != '') {
var txtQuantity = parseFloat($('#CPQuantity').val());
//var txtExchangeRate = parseFloat( $('#ExchangeRtModal').val());
var RatePerTon = parseFloat($('#CPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var txtExchangeRate = '';
var BasicInINR = '';
if (capitalType == 'International') {
txtExchangeRate = parseFloat($('#ExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
BasicInINR = Tot * txtExchangeRate;
} else {
var Tot = txtQuantity * RatePerTon;
if ($('#txtDiscount').val() != '' && $('#txtDiscount').val() != '0') {
$('#txtAfterDiscount').val(updateDiscountValuesChange(parseFloat(Tot).toFixed(2), $("#DiscountType").val(), $('#txtDiscount').val()));
}
var discountedValue = parseFloat($('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val()).toFixed(2);
var Freight = parseFloat($('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val()).toFixed(2);
txtExchangeRate = 1;
BasicInINR = Tot * txtExchangeRate - discountedValue;
}
var CPtotal = parseFloat(BasicInINR) + parseFloat(Freight);
$('#CPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#AfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
if (ExceedBudget($('#CPTotalAmount').val(), $('#CapitalbudAmt').val())) {
//Service Tax calculation
$('#AfterCgst').val(calculateCgstTax(CPtotal, $("#Cgst").val() == '' ? "0.00" : $('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax(CPtotal, $("#Sgst").val() == '' ? "0.00" : $('#Sgst').val()));
$('#AfterIgst').val(calculateIgstTax(CPtotal, $("#Igst").val() == '' ? "0.00" : $('#Igst').val()));
Calculateloadingcharge();
// This is for import basic price
//$('#AfterBasicPriceTax').val(Math.round($('#CPTotalAmount').val()));
// if($('#LandingCharge').val()!='' && $('#AfterBasicPriceTax').val()!=''){
// $('#AfterLandingCharge').val(calculateLandingCharge($('#LandingCharge').val(),$('#AfterBasicPriceTax').val()));
// if($('#Highseas').val()!='' && $('#AfterLandingCharge').val()!=''){
// $('#AfterHighseas').val(calculateHighseasCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#Highseas').val()));
// if($('#Customduty').val()!='' && $('#AfterHighseas').val()!=''){
// $('#AfterCustomduty').val(calculateCustomdutyCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#Customduty').val()));
// if($('#AfterCustomduty').val()!='' && $('#ExcisedutyTax').val()!=''){
// $('#AfterExcisedutyTax').val(calculateExciseCharge($('#AfterLandingCharge').val(),$('#AfterBasicPriceTax').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#ExcisedutyTax').val()));
// if($('#AfterExcisedutyTax').val()!='' && $('#ExcisedutyEDcess').val()!=''){
// $('#AfterExcisedutyEDcess').val(calculateExciseEDcessCharge($('#AfterExcisedutyTax').val(),$('#ExcisedutyEDcess').val()));
// if($('#AfterExcisedutyTax').val()!='' && $('#ExcisedutySHcess').val()!=''){
// $('#AfterExcisedutySHcess').val(calculateExciseSHcessCharge($('#AfterExcisedutyTax').val(),$('#ExcisedutySHcess').val()));
// if($('#AfterExcisedutySHcess').val()!='' && $('#CustomEDcess').val()!=''){
// $('#AfterCustomEDcess').val(calculateCustomEDcessCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#CustomEDcess').val()));
// }
// if($('#AfterExcisedutySHcess').val()!='' && $('#CustomSHcess').val()!=''){
// $('#AfterCustomSHcess').val(calculateCustomSHcessCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#CustomSHcess').val()));
// if($('#AfterCustomSHcess').val()!='' && $('#AdditionalExciseduty').val()!=''){
// $('#AfterAdditionalExciseduty').val(calculateAdditionalExciseDutyCharge($('#AfterBasicPriceTax').val(),$('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterCustomEDcess').val(),$('#AfterCustomSHcess').val(),$('#AdditionalExciseduty').val()));
// $('#Grossdutypayable').val(calculateGrossdutypayableCharge($('#AfterLandingCharge').val(),$('#AfterHighseas').val(),$('#AfterCustomduty').val(),$('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterCustomEDcess').val(),$('#AfterCustomSHcess').val(),$('#AfterAdditionalExciseduty').val()));
// $('#AvailableModvat').val(calculateAvailableModvatCharge($('#AfterExcisedutyTax').val(),$('#AfterExcisedutyEDcess').val(),$('#AfterExcisedutySHcess').val(),$('#AfterAdditionalExciseduty').val()));
// $('#Grossexpenses').val(calculateGrossexpensesCharge($('#Grossdutypayable').val(),$('#AvailableModvat').val()));
// if($('#PurQuantity').val()!='' && $('#PurQuantity').val()!='0'){
// $('#purchaserate').val(calculatepurchaserate($('#AfterBasicPriceTax').val(),$('#PurQuantity').val()));
// $('#CustomDutyExpenses').val(calculateCustomDutyExpenses($('#Grossexpenses').val(),$('#PurQuantity').val()));
// $('#RMCIncludingCustomers').val(calculateRMCIncludingCustomers($('#purchaserate').val(),$('#CustomDutyExpenses').val()));
// var Rmc = $('#RMCIncludingCustomers').val();
// var Quanty =$('#CPQuantity').val();
// var BasicAmt = $('#CPTotalAmount').val();
// var perKg = parseFloat(BasicAmt).toFixed(2);
// $('#txtTotalOrderValue').val(perKg);
// }
// else {
// $('#purchaserate').val('0.00');
// $('#CustomDutyExpenses').val('0.00');
// $('#RMCIncludingCustomers').val('0.00');
// var Rmc = $('#RMCIncludingCustomers').val();
// var Quanty =$('#CPQuantity').val();
// var BasicAmt = $('#CPTotalAmount').val();
// var perKg = parseFloat(BasicAmt).toFixed(2);
// $('#txtTotalOrderValue').val(perKg);
// }
// }
// }
// }
// else{
// //alert('Please Enter Excise duty S & H cess');
// }
// }
// else{
// //alert('Please Enter Excise Duty ED_cess');
// }
// }
// else{
// //alert('Please Enter Excise Duty');
// }
// }
// else{
// //alert('Please Enter Custom Duty');
// }
// }
// }
// else{
// //alert('Please Enter Landing Charge ')
// }
calculateTotalValue();
// var res = ExceedBudget($('#TotalOrderValue').val(), $('#CapitalbudAmt').val());
//if(!res)
// {
// $('#CPRate').focus();
// return false;
// }
}
} else {
$('CPRate').focus();
}
} else {
//clearTaxField();
}
}
/* This function used to check quantity exceeding or not */
function ExceedQuantityCheck() {
var EnterQuantity = $("#CPQuantity").val() == '' ? "0.00" : parseFloat($("#CPQuantity").val());
var ReqQuantity = parseFloat(RequistQuantity);
//alert(ReqQuantity);
//if(EnterQuantity > ReqQuantity)
// {
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
// $('#CPQuantity').focus();
// return false;
// }
// else
//{
return true;
//}
}
/*
This function is used to calculate tax
*/
function calculateServiceTax(varBasicValue) {
var basicValue = parseFloat(varBasicValue);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_SERVICETAX_14PERCENT; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
function calculateEduess(varAfterServiceTax) {
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_EDUCESS_2PERCENT; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; // $('#AfterEduCess').val(TAXval);
}
function calculateHigherEdu(varAfterServiceTax) {
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_HIGHEREDUCESS_1PERCENT; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; //$('#AfterSecHighTax').val(TAXval);
}
function calculateKrishiKalyantax(varBasicValue) {
var basicValue = parseFloat(varBasicValue);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_KRISHIKALYAN; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; //$('#AfterKrishiTax').val(TAXval);
}
function calculateSwachhBharattax(varBasicValue) {
var basicValue = parseFloat(varBasicValue);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_SWACHHBHARAT; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; //$('#AfterSwachhTax').val(TAXval);
}
/*
Calculate Landing charge
*/
function calculateLandingCharge(landingCharge, basicValue) {
var landCharge = landingCharge;
var basicPrice = parseFloat(basicValue);
afterLandingCharge = <?php echo Capital_Landing_Charge; ?>;
return parseFloat(afterLandingCharge).toFixed(2);
}
/*Calculate Highseas Charge*/
function calculateHighseasCharge(AfterLanding, basicPrices, Highseass) {
var afterLandingCharge = parseFloat(AfterLanding);
var basicPrice = parseFloat(basicPrices);
var highSeas = Highseass;
afterHighseasCharge = <?php echo Capital_Highseas_Charge; ?>;
return parseFloat(afterHighseasCharge).toFixed(2);
}
/*Calculate calculate Customduty Charge */
function calculateCustomdutyCharge(AfterLanding, basicPrices, afterHighseass, Customduty) {
var afterLandingCharge = parseFloat(AfterLanding);
var basicPrice = parseFloat(basicPrices);
var afterHighseas = parseFloat(afterHighseass);
var Customduty = Customduty;
afterCustomdutyCharge = <?php echo Capital_Customduty_Charge; ?>;
return parseFloat(afterCustomdutyCharge).toFixed(2);
}
/*
calculate Excise Charge
*/
function calculateExciseCharge(AfterLanding, basicPrices, afterHighseass, afterCustomduty, Excise) {
var afterLandingCharge = parseFloat(AfterLanding);
var basicPrice = parseFloat(basicPrices);
var afterHighseas = parseFloat(afterHighseass);
var afterCustomduty = parseFloat(afterCustomduty);
var Excise = Excise;
afterExciseCharge = <?php echo Capital_Excise_Charge; ?>;
return parseFloat(afterExciseCharge).toFixed(2);
}
/* calculateExciseEDcessCharge*/
function calculateExciseEDcessCharge(ExciseDuty, ExciseEDcessCharge) {
var ExciseDuty = parseFloat(ExciseDuty);
var ExciseEDcessCharge = ExciseEDcessCharge;
afterExciseEDcessCharge = <?php echo Capital_ExciseEDcess_Charge; ?>;
return parseFloat(afterExciseEDcessCharge).toFixed(2);
}
/* calculate Excise duty S & H cess :(d) */
function calculateExciseSHcessCharge(ExciseDuty, ExciseSHcessCharge) {
var ExciseDuty = parseFloat(ExciseDuty);
var ExciseSHcessCharge = ExciseSHcessCharge;
afterExciseSHcessCharge = <?php echo Capital_ExciseSHcess_Charge; ?>;
return parseFloat(afterExciseSHcessCharge).toFixed(2);
}
/*
calculate CustomEDcess Charge
*/
function calculateCustomEDcessCharge(AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, CustomEDcess) {
var afterLandingCharge = parseFloat(AfterLanding);
var AfterHighseas = parseFloat(AfterHighseas);
var AfterCustomduty = parseFloat(AfterCustomduty);
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
var CustomEDcess = CustomEDcess;
afterCustomEDcessCharge = <?php echo Capital_CustomEDcess_Charge; ?>;
return parseFloat(afterCustomEDcessCharge).toFixed(2);
}
/*
calculate custom S & H cess
*/
function calculateCustomSHcessCharge(AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, CustomSHcess) {
var afterLandingCharge = parseFloat(AfterLanding);
var AfterHighseas = parseFloat(AfterHighseas);
var AfterCustomduty = parseFloat(AfterCustomduty);
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
var CustomSHcess = CustomSHcess;
afterCustomCustomSHcessCharge = <?php echo Capital_CustomSHcess_Charge; ?>;
return parseFloat(afterCustomCustomSHcessCharge).toFixed(2);
}
/*
calculate Additional ExciseDuty Charge
*/
function calculateAdditionalExciseDutyCharge(basicPrices, AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterCustomEDcess, AfterCustomSHcess, AdditionalExciseduty) {
var basicPrices = parseFloat(basicPrices);
var afterLandingCharge = parseFloat(AfterLanding);
var AfterHighseas = parseFloat(AfterHighseas);
var AfterCustomduty = parseFloat(AfterCustomduty);
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
var AfterCustomEDcess = parseFloat(AfterCustomEDcess);
var AfterCustomSHcess = parseFloat(AfterCustomSHcess);
var AdditionalExciseduty = AdditionalExciseduty;
afterAdditionalExcisedutyCharge = <?php echo Capital_AdditionalExciseduty_Charge; ?>;
return parseFloat(afterAdditionalExcisedutyCharge).toFixed(2);
}
/*
calculate Additional Grossdutypayable Charge
*/
function calculateGrossdutypayableCharge(AfterLanding, AfterHighseas, AfterCustomduty, AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterCustomEDcess, AfterCustomSHcess, AfterAdditionalExciseduty) {
var AfterAdditionalExciseduty = parseFloat(AfterAdditionalExciseduty);
var afterLandingCharge = parseFloat(AfterLanding);
var AfterHighseas = parseFloat(AfterHighseas);
var AfterCustomduty = parseFloat(AfterCustomduty);
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
var AfterCustomEDcess = parseFloat(AfterCustomEDcess);
var AfterCustomSHcess = parseFloat(AfterCustomSHcess);
GrossdutypayableCharge = <?php echo Capital_Grossdutypayable_Charge; ?>;
return parseFloat(GrossdutypayableCharge).toFixed(2);
}
/*
calculate ModvatCharge Charge
*/
function calculateAvailableModvatCharge(AfterExcisedutyTax, AfterExcisedutyEDcess, AfterExcisedutySHcess, AfterAdditionalExciseduty) {
var AfterExcisedutyTax = parseFloat(AfterExcisedutyTax);
var AfterExcisedutyEDcess = parseFloat(AfterExcisedutyEDcess);
var AfterExcisedutySHcess = parseFloat(AfterExcisedutySHcess);
var AfterAdditionalExciseduty = parseFloat(AfterAdditionalExciseduty);
ModvatCharge = <?php echo Capital_ModvatCharge_Charge; ?>;
return parseFloat(ModvatCharge).toFixed(2);
}
/*
calculate Grossexpenses Charge
*/
function calculateGrossexpensesCharge(Grossdutypayable, AvailableModvat) {
var Grossdutypayable = parseFloat(Grossdutypayable);
var AvailableModvat = parseFloat(AvailableModvat);
Grossexpenses = <?php echo Capital_Grossexpenses_Charge; ?>;
return parseFloat(Grossexpenses).toFixed(2);
}
/*
calculate purchaserate
*/
function calculatepurchaserate(AfterBasicPriceTax, PurQuantity) {
var AfterBasicPriceTax = parseFloat(AfterBasicPriceTax);
var PurQuantity = parseFloat(PurQuantity);
purchaserate = <?php echo Capital_purchaserate_Charge; ?>;
//return parseFloat(purchaserate).toFixed(2);
if (isFinite(purchaserate)) {
return parseFloat(purchaserate).toFixed(2);
} else
return (0);
}
/*
calculateCustomDutyExpenses
*/
function calculateCustomDutyExpenses(Grossexpenses, PurQuantity) {
var Grossexpenses = parseFloat(Grossexpenses);
var PurQuantity = parseFloat(PurQuantity);
CustomDutyExpenses = <?php echo Capital_CustomDutyExpenses_Charge; ?>;
// return parseFloat(CustomDutyExpenses).toFixed(2);
if (isNaN(CustomDutyExpenses)) {
return (0);
} else if (isFinite(CustomDutyExpenses)) {
return parseFloat(CustomDutyExpenses).toFixed(2);
} else
return (0);
}
/*
calculateRMCIncludingCustomers
*/
function calculateRMCIncludingCustomers(purchaserate, CustomDutyExpenses) {
var purchaserate = parseFloat(purchaserate);
var CustomDutyExpenses = parseFloat(CustomDutyExpenses);
RMCIncludingCustomers = <?php echo Capital_RMCIncludingCustomers_Charge; ?>;
return parseFloat(RMCIncludingCustomers).toFixed(2);
}
/*
This is used to calculate Total order value
*/
function calculateTotalOrdervalue() {
var basicValue = parseFloat($('#CPTotalAmount').val());
var ServiceTaxAmount = parseFloat($('#AfterServiceTax').val());
var EduCessTaxAmount = parseFloat($('#AfterEduCess').val());
var SecHighTaxAmount = parseFloat($('#AfterSecHighTax').val());
var KrishiTaxAmount = parseFloat($('#AfterKrishiTax').val());
var SwachhTaxAmount = parseFloat($('#AfterSwachhTax').val());
var TotAmt = basicValue + ServiceTaxAmount + EduCessTaxAmount + SecHighTaxAmount + KrishiTaxAmount + SwachhTaxAmount;
// $('#TotalOrderValue').val( parseFloat(TotAmt).toFixed(2));
}
/*
Used to check the exceed budget
*/
function ExceedBudget(ValuetoCheck, budgetAmount) {
var ReqAmount = parseFloat(ValuetoCheck);
var BudAmount = parseFloat(budgetAmount);
// if(ReqAmount > BudAmount )
// {
// alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.');
// return false;
// }
// else
// {
return true;
// }
}
/* This is used add capital po line item */
$('.AddCapital').click(function() {
tinyMCE.triggerSave();
if (validateCapitalTax() && validateExceedLimit() && ExceedQuantityCheck()) {
var temp = index;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var Reqnumber = $('#Reqnumber').val();
var departmentName = $('#CapitalDepartmentName').val();
var AvilBudget = $('#CapitalbudAmt').val();
var costCode = $('#CostCenter').val();
var materialCode = $('#MaterialCode').val();
var materialName = $("#CapitalItemName").val();
var uom = $("#CPUOM").val();
var addPer = '';
if ($("#AddPer").val().trim() == '') {
addPer = $("#CPUOM").val();
} else {
addPer = $("#AddPer").val();
}
var exchangeRate = $("#ExchangeRtModal").val();
var quantity = $("#CPQuantity").val();
var convertRate = $("#CPRate").val();
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2);
var OtherAmt = parseFloat($("#OtherAllowances").val() == '' ? "0.00" : $('#OtherAllowances').val()).toFixed(2);
var Cgst = $("#Cgst").val();
var AfterCgst = $("#AfterCgst").val();
var Sgst = $("#Sgst").val();
var AfterSgst = $("#AfterSgst").val();
var Igst = $("#Igst").val();
var AfterIgst = $("#AfterIgst").val();
var DisType = $("#DiscountType").val();
var DisVal = $("#txtDiscount").val();
var AfterDisVal = $("#txtAfterDiscount").val();
var landingCharge = $('#AfterLandingCharge').val();
var CustomDuty = $('#AfterCustomduty').val();
var CustomEDCess = $('#AfterCustomEDcess').val();
var CustomSHCess = $('#AfterCustomSHcess').val();
var GrossDutyPayable = $('#Grossdutypayable').val();
var PurQuantity = $('#PurQuantity').val();
var CustomDutyExpenses = $('#CustomDutyExpenses').val();
var Assessable = $('#AfterAssessable').val();
var Subtotal = $('#Subtotal').val();
var AfterIgst = $('#AfterIgstInt').val();
var Dutyimpact = $('#DutyImpact').val();
//console.log(Dutyimpact);
var ClearingCharges = $('#ClearingCharges').val();
var Nett = $('#Nett').val();
var Igst = $('#IgstInt').val();
var basicvalInINR = $('#AfterBasicPriceTax').val();
/*get % values */
var beforeLanding = $('#LandingCharge').val();
var beforeHighSeasSalesCharge = $('#Highseas').val();
var beforeCustomDuty = $('#Customduty').val();
var beforeExciseDuty = $('#ExcisedutyTax').val();
var beforeExciseDutyEDCess = $('#ExcisedutyEDcess').val();
var beforeExciseDutySHCess = $('#ExcisedutySHcess').val();
var beforeCustomEDCess = $('#CustomEDcess').val();
var beforeCustomSHCess = $('#CustomSHcess').val();
var beforeAdditionalExciseDuty = $('#AdditionalExciseduty').val();
var PurQuantity = $('#PurQuantity').val();
var FreightType = $("#drpFreight").val();
var FreightVal = $("#txtFreight").val();
var AfterFreightVal = $("#txtAfterFreight").val();
var NoOfTrip = $("#NOOfTrips").val();
var FreightTypeloc = $('#drpFreightloc').val();
var Nooftriploc = $('#NOOfTripsloc').val();
var Freightrateloc = $('#txtFreightloc').val();
var AfterFreightAmountloc = $('#txtAfterFreightloc').val();
var Total = (parseFloat(basicval) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) - parseFloat(AfterDisVal) + parseFloat(AfterFreightAmountloc)).toFixed(2);
var TotalOrderValuePerkg = $("#txtTotalOrderValue").val();
var CapitalDescription = $('#ItemDescription').val();
var TotalTaxValue = calculateTaxValue();
if (capital == 0) {
TotalTaxValue = 0.00;
Total = parseFloat(basicval);
}
$('#MaterialCode option[value=' + materialCode + ']').remove();
SelectedMaterialCode[CollIndex] = materialCode;
CollIndex = CollIndex + 1;
SelectedMaterialList.Mat.push({
"materialCode": materialCode,
"ReqNo": Reqnumber,
});
populateValueMainFormForCapital();
index = parseInt(index) + 1;
// var template = jQuery("#CapitalList").html();
// $('#capitalAppend').append(_.template(template, {
// index: temp,
// ReqNo: Reqnumber,
// MaterialCode: materialCode,
// MaterialName: materialName,
// Quantity: quantity,
// UOM: uom,
// Rate: itemRate,
// BasicAmount: basicval,
// Taxvalue: TotalTaxValue,
// TotalValue: Total,
// ActualQuantity: quantity,
// ReceivedQuantity: 0,
// PendingQuantity: quantity
// }));
var PONOStatus = "<?php echo $PONOStatus; ?>";
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="center">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
rowHtml += `<td><a href="#" class="editable-field"
data-id="${temp}"
data-notes="-">-</a>
<div class="edit-container" style="display:none;">
<input type="text" class="edit-input-field" />
<button class="save-btn">✔</button>
<button class="cancel-btn">✖</button>
</div></td>`;
} else {
rowHtml += `<td>-</td>`;
}
rowHtml += `<td style="text-align:right !important">${quantity}</td>
<td style="text-align:right !important">${uom}</td>
<td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${Total}</td>
<td>
<a data-target='#EDITCAPITAL' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
</a>&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span>
</a>
</td>
</tr>
`;
// Append the generated row HTML to the target element
$('#capitalAppend').append(rowHtml);
var theForm = $(".CapitalPO");
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
addHidden(theForm, "departmentName" + temp, departmentName);
addHidden(theForm, "AvilBudget" + temp, AvilBudget);
addHidden(theForm, "CPCostCode" + temp, costCode);
addHidden(theForm, "materialCode" + temp, materialCode);
addHidden(theForm, "materialName" + temp, materialName);
addHidden(theForm, "echangeRate" + temp, exchangeRate);
addHidden(theForm, "uom" + temp, uom);
addHidden(theForm, "per" + temp, addPer);
addHidden(theForm, "quantity" + temp, quantity);
addHidden(theForm, "rateInUs" + temp, itemRate);
addHidden(theForm, "itemRate" + temp, itemRate);
addHidden(theForm, "basicval" + temp, basicval);
addHidden(theForm, "landingCharge" + temp, landingCharge);
addHidden(theForm, "CustomDuty" + temp, CustomDuty);
addHidden(theForm, "CustomEDCess" + temp, CustomEDCess);
addHidden(theForm, "CustomSHCess" + temp, CustomSHCess);
addHidden(theForm, "GrossDutyPayable" + temp, GrossDutyPayable);
addHidden(theForm, "CustomDutyExpenses" + temp, CustomDutyExpenses);
addHidden(theForm, "ServiceTotalOrderValue" + temp, TotalTaxValue);
addHidden(theForm, "beforeLanding" + temp, beforeLanding);
addHidden(theForm, "beforeHighSeasSalesCharge" + temp, beforeHighSeasSalesCharge);
addHidden(theForm, "beforeCustomDuty" + temp, beforeCustomDuty);
addHidden(theForm, "beforeCustomEDCess" + temp, beforeCustomEDCess);
addHidden(theForm, "beforeCustomSHCess" + temp, beforeCustomSHCess);
addHidden(theForm, "PurQuantity" + temp, PurQuantity);
addHidden(theForm, "PerKgExpense" + temp, TotalOrderValuePerkg);
addHidden(theForm, "LineItemNo" + temp, "");
addHidden(theForm, "basicvalInINR" + temp, basicvalInINR);
addHidden(theForm, "Cgst" + temp, Cgst);
addHidden(theForm, "AfterCgst" + temp, AfterCgst);
addHidden(theForm, "Sgst" + temp, Sgst);
addHidden(theForm, "AfterSgst" + temp, AfterSgst);
addHidden(theForm, "Igst" + temp, Igst);
addHidden(theForm, "AfterIgst" + temp, AfterIgst);
addHidden(theForm, "OtherAmt" + temp, OtherAmt);
addHidden(theForm, "FreightType" + temp, FreightType);
addHidden(theForm, "FreightVal" + temp, FreightVal);
addHidden(theForm, "AfterFreightVal" + temp, AfterFreightVal);
addHidden(theForm, "NoOfTrip" + temp, NoOfTrip);
addHidden(theForm, "CapitalItemDescrition" + temp, CapitalDescription);
addHidden(theForm, "DisType" + temp, DisType);
addHidden(theForm, "DisVal" + temp, DisVal);
addHidden(theForm, "AfterDisVal" + temp, AfterDisVal);
$('#txtRowCount').val(temp);
addHidden(theForm, "Ftype" + temp, FreightTypeloc);
addHidden(theForm, "NoTrip" + temp, Nooftriploc);
addHidden(theForm, "Fvalue" + temp, Freightrateloc);
addHidden(theForm, "Afvalue" + temp, AfterFreightAmountloc);
addHidden(theForm, "AssessableValue" + temp, Assessable);
addHidden(theForm, "SubTotal" + temp, Subtotal);
addHidden(theForm, "IGSTInt" + temp, Igst);
addHidden(theForm, "AfterIGSTInt" + temp, AfterIgst);
addHidden(theForm, "DutyImpact" + temp, Dutyimpact);
addHidden(theForm, "NetValue" + temp, Nett);
addHidden(theForm, "ClearingCharge" + temp, ClearingCharges);
//addHidden(theForm,"ClearingCharge"+temp,Nett);
clearCapitalModalFields();
$('#CAPITAL').modal('hide');
}
});
/* used to validateExceedLimit */
function validateExceedLimit() {
var avalbudAmt = parseFloat($('#CapitalbudAmt').val());
var basicAmountRate = parseFloat($('#CPTotalAmount').val());
var discountRate = parseFloat($('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val());
var totalAmount = parseFloat($('#txtTotalOrderValue').val());
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
if (capitalType != 'Domestic') {
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
} else {
basicAmountRate = parseFloat(basicAmountRate) - parseFloat(discountRate);
}
// if(basicAmountRate > avalbudAmt)
// {
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
// $('#CPRate').focus();
// return false;
// }
// else
// {
return true;
// }
}
function validateCapitalTax() {
if ($('#Reqnumber').val() == "0") {
alert('Please select the Requisition Number');
$('#Reqnumber').focus();
return false;
} else if ($('#CostCenter').val() == "0") {
alert('Please select the Cost center');
$('#CostCenter').focus();
return false;
} else if ($('#MaterialCode').val() == "0") {
alert('Please select the Material Code');
$('#MaterialCode').focus();
return false;
} else if ($('#CPQuantity').val() == '') {
alert('Please Enter the Quantity value');
$('#CPQuantity').focus();
return false;
} else if ($('#CPQuantity').val() == "0") {
alert('Please Enter the Valid Quantity value');
$('#CPQuantity').focus();
return false;
} else if ($('#CPRate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#CPRate').focus();
return false;
} else if ($('#CPRate').val() == "0") {
alert('Please Enter the Valid Rate of the Item');
$('#CPRate').focus();
return false;
}
/* else if($('#ItemDescription').val() == '')
{
alert('Please Enter the Capital Description');
$('#ItemDescription').focus();
return false;
} */
else {
return true;
}
}
function calculateTotalValue() {
var BasicVal = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
var disRate = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
BasicVal = BasicVal - disRate;
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
var Freight = parseFloat($('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val()).toFixed(2);
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
var ServiceTaxAmount = $('#AfterServiceTax').val() == '' ? '0.00' : $('#AfterServiceTax').val();
var EduCessTaxAmount = $('#AfterEduCess').val() == '' ? '0.00' : $('#AfterEduCess').val();
var SecHighTaxAmount = $('#AfterSecHighTax').val() == '' ? '0.00' : $('#AfterSecHighTax').val();
var KrishiTaxAmount = $('#AfterKrishiTax').val() == '' ? '0.00' : $('#AfterKrishiTax').val();
var SwachhTaxAmount = $('#AfterSwachhTax').val() == '' ? '0.00' : $('#AfterSwachhTax').val();
var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
var HighSeasSalesCharge = $('#AfterHighseas').val() == '' ? '0.00' : $('#AfterHighseas').val();
var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
var ExciseDuty = $('#AfterExcisedutyTax').val() == '' ? '0.00' : $('#AfterExcisedutyTax').val();
var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val() == '' ? '0.00' : $('#AfterExcisedutyEDcess').val();
var ExciseDutySHCess = $('#AfterExcisedutySHcess').val() == '' ? '0.00' : $('#AfterExcisedutySHcess').val();
var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val() == '' ? '0.00' : $('#AfterAdditionalExciseduty').val();
var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val();
var AvailableModvat = $('#AvailableModvat').val() == '' ? '0.00' : $('#AvailableModvat').val();
var GrossExpensesDuetoCustom = $('#Grossexpenses').val() == '' ? '0.00' : $('#Grossexpenses').val();
var purchaseRate = $('#purchaserate').val() == '' ? '0.00' : $('#purchaserate').val();
var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
var RMCIncludingCustomers = $('#RMCIncludingCustomers').val() == '' ? '0.00' : $('#RMCIncludingCustomers').val();
var totvalue = (parseFloat(BasicVal) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(Freight)).toFixed(2);
var tot = parseFloat(totvalue).toFixed(2);
$('#txtTotalOrderValue').val(tot);
validateExceedLimit();
ExceedQuantityCheck();
}
/* calculate tax value*/
function calculateTaxValue() {
var Cgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
var Sgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
var Igst = 0.00;
if (capitalType == 'Domestic') {
Igst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
}
if(capitalType == 'International') {
Igst = $('#AfterIgstInt').val() == '' ? '0.00' : $('#AfterIgstInt').val(); // caps interna
}
var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
var HighSeasSalesCharge = $('#AfterHighseas').val() == '' ? '0.00' : $('#AfterHighseas').val();
var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
var ExciseDuty = $('#AfterExcisedutyTax').val() == '' ? '0.00' : $('#AfterExcisedutyTax').val();
var ExciseDutyEDCess = $('#AfterExcisedutyEDcess').val() == '' ? '0.00' : $('#AfterExcisedutyEDcess').val();
var ExciseDutySHCess = $('#AfterExcisedutySHcess').val() == '' ? '0.00' : $('#AfterExcisedutySHcess').val();
var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
var AdditionalExciseDuty = $('#AfterAdditionalExciseduty').val() == '' ? '0.00' : $('#AfterAdditionalExciseduty').val();
var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val();
var AvailableModvat = $('#AvailableModvat').val() == '' ? '0.00' : $('#AvailableModvat').val();
var GrossExpensesDuetoCustom = $('#Grossexpenses').val() == '' ? '0.00' : $('#Grossexpenses').val();
var purchaseRate = $('#purchaserate').val() == '' ? '0.00' : $('#purchaserate').val();
var CustomDutyExpenses = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
var RMCIncludingCustomers = $('#RMCIncludingCustomers').val() == '' ? '0.00' : $('#RMCIncludingCustomers').val();
var totTaxvalue = (parseFloat(Sgst) + parseFloat(Cgst) + parseFloat(Igst));
//+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers)
var totTax = parseFloat(totTaxvalue).toFixed(2);
return totTax;
}
function populateValueMainFormForCapital() {
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var BasicVal = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
var BasicVal1 = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
//console.log(BasicVal1);
var disRate = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
BasicVal = BasicVal - disRate;
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
var landingCharge = $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
console.log("$('#AfterLandingCharge').val()",$('#AfterLandingCharge').val());
var CustomDuty = $('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
var CustomEDCess = $('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
var CustomSHCess = $('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
var GrossDutyPayable = $('#Grossdutypayable').val() == '' ? '0.00' : $('#Grossdutypayable').val();
var Assessable = $('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val();
var Subtotal = $('#Subtotal').val() == '' ? '0.00' : $('#Subtotal').val();
var IgstInt = $('#AfterIgstInt').val() == '' ? '0.00' : $('#AfterIgstInt').val();
// var totvalue = $('#txtTotalOrderValue').val() == '' ? '0.00' : $('#txtTotalOrderValue').val();
var AfterFreight = $('#txtAfterFreightloc').val() == '' ? '0.00' : $('#txtAfterFreightloc').val();
var totvalue = (parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst)).toFixed(2);
var TotalOrderValueSummary = $('#txtToatlOrder').val() == '' ? '0.00' : $('#txtToatlOrder').val();
var TotalCgst = $('#txtTotCgst').val() == '' ? '0.00' : $('#txtTotCgst').val();
var TotSgst = $('#txtTotSgst').val() == '' ? '0.00' : $('#txtTotSgst').val();
var TotalIgst = $('#txtTotIgst').val() == '' ? '0.00' : $('#txtTotIgst').val();
var TotalAllowance = $('#TotalOtherAllowances').val() == '' ? '0.00' : $('#TotalOtherAllowances').val();
var totfreight = $('#TotalFreight').val() == '' ? '0.00' : $('#TotalFreight').val();
var TotLanding = $('#txttotallanding').val() == '' ? '0.00' : $('#txttotallanding').val();
var TotCustom = $('#txttotalcustom').val() == '' ? '0.00' : $('#txttotalcustom').val();
var TotCustomED = $('#txttotalcustomED').val() == '' ? '0.00' : $('#txttotalcustomED').val();
var TotCustomSH = $('#txttotalcustomSH').val() == '' ? '0.00' : $('#txttotalcustomSH').val();
var TotGrossduty = $('#txttotalgrossduty').val() == '' ? '0.00' : $('#txttotalgrossduty').val();
var TotalAssessable = $('#txttotalAssessable').val() == '' ? '0.00' : $('#txttotalAssessable').val();
var TotalIgst = $('#txttotalIgst').val() == '' ? '0.00' : $('#txttotalIgst').val();
var TotalSubtotal = $('#txttotalSubtotal').val() == '' ? '0.00' : $('#txttotalSubtotal').val();
var TotalCapitalOrder = $('#CapitalToatlOrder').val() == '' ? '0.00' : $('#CapitalToatlOrder').val();
//console.log(TotalCapitalOrder );
var TotalBasicOrder = $('#CapitalBasicOrder').val() == '' ? '0.00' : $('#CapitalBasicOrder').val();
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
var totDiscountAmt = $('#txtTotalDiscount').val() == '' ? '0.00' : $('#txtTotalDiscount').val();
var totFreightAmt = $('#txtTotalFreight').val() == '' ? '0.00' : $('#txtTotalFreight').val();
$('#txtTotalDiscount').val((parseFloat(totDiscountAmt) + parseFloat(disRate)).toFixed(2));
$('#txtTotalFreight').val((parseFloat(totFreightAmt) + parseFloat(Freight)).toFixed(2));
$('#txtTotCgst').val((parseFloat(TotalCgst) + parseFloat(AfterCgst)).toFixed(2));
$('#txtTotSgst').val((parseFloat(TotSgst) + parseFloat(AfterSgst)).toFixed(2));
$('#txtTotIgst').val((parseFloat(TotalIgst) + parseFloat(AfterIgst)).toFixed(2));
$('#TotalOtherAllowances').val((parseFloat(TotalAllowance) + parseFloat(OtherAmt)).toFixed(2));
$('#TotalFreight').val((parseFloat(totfreight) + parseFloat(AfterFreight)).toFixed(2));
$('#txttotallanding').val((parseFloat(TotLanding) + parseFloat(landingCharge)).toFixed(2));
$('#txttotalcustom').val((parseFloat(TotCustom) + parseFloat(CustomDuty)).toFixed(2));
$('#txttotalcustomED').val((parseFloat(TotCustomED) + parseFloat(CustomEDCess)).toFixed(2));
$('#txttotalcustomSH').val((parseFloat(TotCustomSH) + parseFloat(CustomSHCess)).toFixed(2));
$('#txttotalgrossduty').val((parseFloat(TotGrossduty) + parseFloat(GrossDutyPayable)).toFixed(2));
$('#txttotalAssessable').val((parseFloat(Assessable) + parseFloat(TotalAssessable)).toFixed(2));
$('#txttotalSubtotal').val((parseFloat(Subtotal) + parseFloat(TotalSubtotal)).toFixed(2));
$('#txttotalIgst').val((parseFloat(TotalIgst) + parseFloat(IgstInt)).toFixed(2));
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary) + parseFloat(totvalue)).toFixed(2));
var tot = parseFloat(TotalCapitalOrder) + parseFloat(BasicVal1);
// console.log(tot);
if (capital == 0) {
$('#CapitalToatlOrder').val(tot.toFixed(2));
} else {
$('#CapitalToatlOrder').val((parseFloat(TotalCapitalOrder) + parseFloat(BasicVal) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(AfterFreight)).toFixed(2));
}
$('#CapitalBasicOrder').val((parseFloat(TotalBasicOrder) + parseFloat(BasicVal) + parseFloat(disRate)).toFixed(2));
}
function clearCapitalModalFields() {
$('#Reqnumber').val('0');
$('#CapitalDepartmentName').val('');
$('#CapitalbudAmt').val('');
$('#CostCenter').val('0');
$('#MaterialCode').val('0');
$("#CapitalItemName").val('');
$("#CPUOM").val('');
//var exchangeRate = $("#ExchangeRtModal").val();
$("#CPQuantity").val('');
$("#CPRate").val('');
$("#CPTotalAmount").val('');
$("#AfterCgst").val(0);
$("#AfterSgst").val(0);
$("#AfterIgst").val(0);
$("#Cgst").val(0);
$("#Sgst").val(0);
$("#Igst").val(0);
$("#OtherAllowances").val(0);
$('#AfterBasicPriceTax').val('');
$('#LandingCharge').val('');
$('#AfterLandingCharge').val('');
$('#Highseas').val('');
$('#AfterHighseas').val('');
$('#Customduty').val('');
$('#AfterCustomduty').val('');
$('#ExcisedutyTax').val('');
$('#AfterExcisedutyTax').val('');
$('#ExcisedutyEDcess').val('');
$('#AfterExcisedutyEDcess').val('');
$('#ExcisedutySHcess').val('');
$('#AfterExcisedutySHcess').val('');
$('#CustomEDcess').val('');
$('#AfterCustomEDcess').val('');
$('#CustomSHcess').val('');
$('#AfterCustomSHcess').val('');
$('#AdditionalExciseduty').val('');
$('#AfterAdditionalExciseduty').val('');
$('#Grossdutypayable').val('');
$('#AvailableModvat').val('');
$('#Grossexpenses').val('');
$('#PurQuantity').val('');
$('#purchaserate').val('');
$('#CustomDutyExpenses').val('');
$('#RMCIncludingCustomers').val('');
$("#txtTotalOrderValue").val('');
$("#AddPer").val('');
$("#drpFreight").val('0');
$("#txtFreight").val('');
$("#txtAfterFreight").val('');
$("#NOOfTrips").val('');
tinyMCE.get('ItemDescription').setContent('');
$("#DiscountType").val('0');
$("#txtDiscount").val('');
$("#txtAfterDiscount").val('');
$("#drpFreightloc").val('0');
$("#NOOfTripsloc").val('');
$("#txtFreightloc").val('');
$("#txtAfterFreightloc").val('');
$("#AfterAssessable").val('');
$("#IgstInt").val(0);
$("#AfterIgstInt").val('');
$("#DutyImpact").val('');
$("#ClearingCharges").val('');
$("#Nett").val('');
$("#Subtotal").val('');
}
function addHidden(theForm, key, value) {
// Create a hidden input element, and append it to the form:
var input = document.createElement('input');
input.type = 'hidden';
input.name = key;
'name-as-seen-at-the-server';
input.id = key;
'name-as-seen-at-the-server';
input.value = value;
theForm.append(input);
}
function DeleteRow(rowid) {
var id = [];
var DelRows = $('#txtDeletedRow').val();
var answer = confirm(" Do you want to delete the Item from the List?")
if (answer) {
var materialCode = $('#materialCode' + rowid).val();
var LineItemNo = $('#LineItemNo' + rowid).val();
var ReqNo = $('#Reqnumber' + rowid).val();
var POType = '<?php echo CAPITAL ?>';
id[0] = LineItemNo;
id[1] = ReqNo;
id[2] = materialCode;
id[3] = POType;
var removeItem = $('#materialCode' + rowid).val();
var td = document.getElementById(rowid);
td.parentNode.removeChild(td);
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(index, value) {
if (value.MaterialCode == materialCode) {
$("#MaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
}
});
}
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
$.each(SelectedMaterialList.Mat, function(i, el) {
if (this.materialCode == removeItem) {
SelectedMaterialList.Mat.splice(i, 1);
}
});
var x = <?php echo json_encode($POItem, JSON_PRETTY_PRINT) ?>;
var result = '0';
$.each(x, function(idx, obj) {
if (obj.LineItemNo === LineItemNo) {
result = '1';
return false;
}
});
// alert(result);
if (result == '0') {
var DelRows = $('#txtDeletedRow').val();
//tr.parentNode.removeChild(tr);
if (DelRows != '') {
DelRows = DelRows + ":" + rowid;
} else {
DelRows = "0" + ":" + rowid;
}
$('#txtDeletedRow').val(DelRows);
}
// To delete the value from Tables
else if (result == '1') {
var DelRows = $('#txtDeletedRow').val();
//tr.parentNode.removeChild(tr);
if (DelRows != '') {
DelRows = DelRows + ":" + rowid;
} else {
DelRows = "0" + ":" + rowid;
}
$('#txtDeletedRow').val(DelRows);
$('#loader').show();
$.ajax({
data: {
id: id
},
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
$('#loader').hide();
(data) ? alert(response): alert("Error");
}
});
}
populateValueMainFormForDeleteServiceTax(rowid);
}
}
/**
* This function is used to calculate the total amounts after delete the row
*/
function populateValueMainFormForDeleteServiceTax(deletedRow) {
var rows = document.getElementById('serviceTax').rows.length;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0;
var TotCgst = 0;
var TotSgst = 0;
var TotIgst = 0;
var TotOther = 0;
var TotLanding = 0;
var TotHighseas = 0;
var TotCustom = 0;
var TotCustomED = 0;
var TotCustomSH = 0;
var TotGrossduty = 0;
var TotalAssable = 0;
var TotalSubtotal = 0;
var TotalIgstInt = 0;
var Capinttotal = 0;
var TotGrossexpense = 0;
var CapitalToatlOrder = 0;
var TotFreight = 0;
var TotDiscount = 0;
var TotBasicAmt = 0;
for (var i = 1; i < rows; i++) {
if (deletedRow == i) {
$('#AfterCgst' + i).val('');
$('#AfterSgst' + i).val('');
$('#AfterIgst' + i).val('');
$('#OtherAmt' + i).val('');
$('#landingCharge' + i).val('');
$('#CustomDuty' + i).val('');
$('#CustomEDCess' + i).val('');
$('#CustomSHCess' + i).val('');
$('#GrossDutyPayable' + i).val('');
$('#basicval' + i).val('');
$('#ServiceTotalOrderValue' + i).val('');
$('#AfterAssessable' + i).val('');
$('#Subtotal' + i).val('');
$('#IgstInt' + i).val('');
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
var TotCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
var TotSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
var TotIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
var TotAdditionalExcisedutyI = $('#AdditionalExciseDuty' + i).val() == '' ? '0.00' : $('#AdditionalExciseDuty' + i).val();
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
var TotAvlmodvatI = $('#AvailableModvat' + i).val() == '' ? '0.00' : $('#AvailableModvat' + i).val();
var TotGrossexpenseI = $('#GrossExpensesDuetoCustom' + i).val() == '' ? '0.00' : $('#GrossExpensesDuetoCustom' + i).val();
var Assessable = $('#AssessableValue' + i).val() == '' ? '0.00' : $('#AssessableValue' + i).val();
var Subtotal = $('#SubTotal' + i).val() == '' ? '0.00' : $('#SubTotal' + i).val();
var IgstInt = $('#AfterIGST' + i).val() == '' ? '0.00' : $('#AfterIGST' + i).val();
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
} else if (deletedRow != i) {
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
var TotCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
var TotSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
var TotIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
// console.log("TotLandingI",TotLandingI);
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
var Assessable = $('#AssessableValue' + i).val() == '' ? '0.00' : $('#AssessableValue' + i).val();
var Subtotal = $('#SubTotal' + i).val() == '' ? '0.00' : $('#SubTotal' + i).val();
var IgstInt = $('#AfterIGSTInt' + i).val() == '' ? '0.00' : $('#AfterIGSTInt' + i).val();
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
} else {
}
TotFreight = parseFloat(TotFreight) + parseFloat(TotFreightI);
TotDiscount = parseFloat(TotDiscount) + parseFloat(TotDiscountI);
TotCgst = parseFloat(TotCgst) + parseFloat(TotCgstI);
TotSgst = parseFloat(TotSgst) + parseFloat(TotSgstI);
TotIgst = parseFloat(TotIgst) + parseFloat(TotIgstI);
TotOther = parseFloat(TotOther) + parseFloat(TotOtherI);
TotLanding = parseFloat(TotLanding) + parseFloat(TotLandingI);
TotCustom = parseFloat(TotCustom) + parseFloat(TotCustomI);
TotCustomED = parseFloat(TotCustomED) + parseFloat(TotCustomEDI);
TotCustomSH = parseFloat(TotCustomSH) + parseFloat(TotCustomSHI);
TotGrossduty = parseFloat(TotGrossduty) + parseFloat(TotGrossdutyI);
TotalOrderValueSummary = parseFloat(TotalOrderValueSummary) + parseFloat(TotalOrderValueSummaryI);
CapitalToatlOrder = parseFloat(CapitalToatlOrder) + parseFloat(CapitalToatlOrderI) + parseFloat(TotCgstI) + parseFloat(TotSgstI) + parseFloat(TotIgstI) + parseFloat(TotOtherI);
TotBasicAmt = parseFloat(TotBasicAmt) + parseFloat(TotBasicAmtI);
Capinttotal = parseFloat(Capinttotal) + parseFloat(CapitalToatlOrderI);
TotalAssable = parseFloat(TotalAssable) + parseFloat(Assessable);
TotalSubtotal = parseFloat(TotalSubtotal) + parseFloat(Subtotal);
TotalIgstInt = parseFloat(TotalIgstInt) + parseFloat(IgstInt);
}
$('#txtTotalDiscount').val(parseFloat(TotDiscount).toFixed(2));
$('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2));
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
$('#TotalOtherAllowances').val(parseFloat(TotOther).toFixed(2));
$('#txttotallanding').val((parseFloat(TotLanding)).toFixed(2));
$('#txttotalcustom').val((parseFloat(TotCustom)).toFixed(2));
$('#txttotalcustomED').val((parseFloat(TotCustomED)).toFixed(2));
$('#txttotalcustomSH').val((parseFloat(TotCustomSH)).toFixed(2));
$('#txttotalgrossduty').val((parseFloat(TotGrossduty)).toFixed(2));
if (capital == 0) {
$('#CapitalToatlOrder').val((parseFloat(Capinttotal)).toFixed(2));
} else {
$('#CapitalToatlOrder').val((parseFloat(CapitalToatlOrder)).toFixed(2));
}
$('#CapitalBasicOrder').val((parseFloat(TotBasicAmt)).toFixed(2));
$('#txttotalAssessable').val((parseFloat(TotalAssable)).toFixed(2));
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal)).toFixed(2));
$('#txttotalIgst').val((parseFloat(TotalIgstInt)).toFixed(2));
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary)).toFixed(2));
}
$(document).ready(function() {
setTimeout(() => {
$('#drpFreight').addClass('form-control');
}, 1000);
/* get Edit Capital Po Modal*/
$("#EDITCAPITAL").on("shown.bs.modal", function(e) {
// alert("***");
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$('#EditReqnumber').val($('#Reqnumber' + userid).val());
$('#EditCapitalDepartmentName').val($('#departmentName' + userid).val());
$("#EditCostCenter").val($('#CPCostCode' + userid).val());
$('#EditCapitalbudAmt').val(parseFloat($('#AvilBudget' + userid).val()).toFixed(2));
$('#EditExchangeRtModal').val($('#echangeRate' + userid).val());
$('#EditCapitalItemName').val($('#materialName' + userid).val());
$('#EditCPUOM').val($('#uom' + userid).val());
$('#EditPer').val($('#per' + userid).val());
$('#EditCPQuantity').val($('#quantity' + userid).val());
$('#EditCPRate').val($('#rateInUs' + userid).val());
$('#EditCPTotalAmount').val(parseFloat($('#basicval' + userid).val()).toFixed(2));
RequistQuantity = $('#quantity' + userid).val();
$('#EditCgst').val($('#Cgst' + userid).val());
$('#EditSgst').val($('#Sgst' + userid).val());
$('#EditIgst').val($('#Igst' + userid).val());
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
$('#EditAfterSgst').val($('#AfterSgst' + userid).val());
$('#EditAfterIgst').val($('#AfterIgst' + userid).val());
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
$('#drpFreighteditloc').val($('#Ftype' + userid).val());
$('#NOOfTripslocedit').val($('#NoTrip' + userid).val());
$('#txtFreightlocedit').val($('#Fvalue' + userid).val());
$('#txtAfterFreightlocedit').val($('#Afvalue' + userid).val());
var FreightType = $('#drpFreighteditloc').val();
if (FreightType == "PER TRIP") {
///salert();
$('#TripsValuelocedit').show();
} else {
$('#TripsValuelocedit').hide();
}
$('#EditAfterBasicPriceTax').val($('#basicvalInINR' + userid).val());
$('#EditAfterLandingCharge').val($('#landingCharge' + userid).val());
$('#EditAfterCustomduty').val($('#CustomDuty' + userid).val());
$('#EditAfterCustomEDcess').val($('#CustomEDCess' + userid).val());
$('#EditAfterCustomSHcess').val($('#CustomSHCess' + userid).val());
$('#EditGrossdutypayable').val($('#GrossDutyPayable' + userid).val());
$('#EditCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
//$('#txtEditInsurance').val($('#RMCIncludingCustomers'+userid).val());
$('#EdittxtTotalOrderValue').val(cellval[10].innerHTML);
$('#EditAfterAssessable').val($("#AssessableValue" + userid).val());
$('#EditSubtotal').val($("#SubTotal" + userid).val());
$('#EditIgstInt').val($("#IGSTInt" + userid).val());
// alert("Fetched the value GST"+$("#IGSTInt" + userid).val());
$('#EditAfterIgstInt').val($("#AfterIGSTInt" + userid).val());
// alert("Fetched the value IGST"+$("#AfterIGSTInt" + userid).val());
$('#EditDutyImpact').val($("#DutyImpact" + userid).val());
$('#EditNett').val($("#NetValue" + userid).val());
$('#EditClearingCharges').val($("#ClearingCharge" + userid).val());
/* get % value */
$('#EditLandingCharge').val($('#beforeLanding' + userid).val());
$('#EditCustomduty').val($('#beforeCustomDuty' + userid).val());
$('#EditCustomEDcess').val($('#beforeCustomEDCess' + userid).val());
$('#EditCustomSHcess').val($('#beforeCustomSHCess' + userid).val());
$('#EditAdditionalExciseduty').val($('#beforeAdditionalExciseDuty' + userid).val());
$('#EditPurQuantity').val($('#PurQuantity' + userid).val());
var EditUOM = $('#uom' + userid).val();
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EditUOM + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EditUOM + ')');
$('#txtEditFreight').val($('#FreightVal' + userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
$("#drpEditFreight").val($('#FreightType' + userid).val());
var FreightType = $('#FreightType' + userid).val();
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
} else {
$('#EditTripsValue').hide();
}
$("#EditDiscountType").val($('#DisType' + userid).val());
$('#txtEditDiscount').val($('#DisVal' + userid).val());
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
tinyMCE.get('EditItemDescription').setContent($('#CapitalItemDescrition' + userid).val());
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
$("#EditMaterialCode").empty();
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode != $('#materialCode' + userid).val()) {
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
}
});
}
});
/* get View Capital Po Modal*/
$("#VIEWCAPITAL").on("shown.bs.modal", function(e) {
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
$('#ViewReqnumber').val($('#Reqnumber' + userid).val());
$('#ViewCapitalDepartmentName').val($('#departmentName' + userid).val());
$("#ViewCostCenter").val($('#CPCostCode' + userid).val());
$('#ViewCapitalbudAmt').val(parseFloat($('#AvilBudget' + userid).val()).toFixed(2));
$('#ViewExchangeRtModal').val($('#echangeRate' + userid).val());
$('#ViewCapitalItemName').val($('#materialName' + userid).val());
$('#ViewCPUOM').val($('#uom' + userid).val());
$('#ViewCPQuantity').val($('#quantity' + userid).val());
$('#ViewCPRate').val($('#rateInUs' + userid).val());
$('#ViewCPTotalAmount').val($('#basicval' + userid).val());
RequistQuantity = $('#quantity' + userid).val();
$('#ViewCgst').val($('#Cgst' + userid).val());
$('#ViewSgst').val($('#Sgst' + userid).val());
$('#ViewIgst').val($('#Igst' + userid).val());
$('#ViewAfterCgst').val($('#AfterCgst' + userid).val());
$('#ViewAfterSgst').val($('#AfterSgst' + userid).val());
$('#ViewAfterIgst').val($('#AfterIgst' + userid).val());
$('#ViewOtherAllowances').val($('#OtherAmt' + userid).val());
$('#ViewTotalAmountlocal').val(cellval[10].innerHTML);
$('#drpFreightviewloc').val($("#Ftype" + userid).val());
$('#NOOfTripslocview').val($("#NoTrip" + userid).val());
$('#txtFreightlocview').val($("#Fvalue" + userid).val());
$('#txtAfterFreightlocview').val($("#Afvalue" + userid).val());
var FreightType = $('#drpFreightviewloc').val();
if (FreightType == "PER TRIP") {
$('#TripsValuelocview').show();
} else {
$('#TripsValuelocview').hide();
}
$('#ViewAfterBasicPriceTax').val($('#basicvalInINR' + userid).val());
$('#ViewAfterLandingCharge').val($('#landingCharge' + userid).val());
$('#ViewAfterHighseas').val($('#HighSeasSalesCharge' + userid).val());
$('#viewAfterCustomduty').val($('#CustomDuty' + userid).val());
$('#ViewAfterCustomEDcess').val($('#CustomEDCess' + userid).val());
$('#ViewAfterCustomSHcess').val($('#CustomSHCess' + userid).val());
$('#ViewGrossdutypayable').val($('#GrossDutyPayable' + userid).val());
$('#ViewCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
$('#ViewtxtTotalOrderValue').val($('#PerKgExpense' + userid).val());
/* get % value */
$('#ViewLandingCharge').val($('#beforeLanding' + userid).val());
$('#ViewCustomduty').val($('#beforeCustomDuty' + userid).val());
$('#ViewCustomEDcess').val($('#beforeCustomEDCess' + userid).val());
$('#ViewCustomSHcess').val($('#beforeCustomSHCess' + userid).val());
$('#ViewPurQuantity').val($('#PurQuantity' + userid).val());
$('#ViewPer').val($('#per' + userid).val());
var ViewUOM = $('#uom' + userid).val();
$('#ViewAfterAssessable').val($('#AssessableValue' + userid).val());
$('#ViewSubtotal').val($('#SubTotal' + userid).val());
$('#ViewIgstInt').val($('#IGSTInt' + userid).val());
$('#ViewAfterIgstInt').val($('#AfterIGSTInt' + userid).val());
$('#ViewDutyImpact').val($('#DutyImpact' + userid).val());
$('#ViewClearingCharges').val($('#ClearingCharge' + userid).val());
$('#ViewNett').val($('#NetValue' + userid).val());
//$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+ViewUOM+')');
//$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+ViewUOM+')');
$('#ViewRateIn').html('Rate(in' + " " + ViewCurrencySymbol + '/' + ViewUOM + ')');
$('#ViewTotalAmount').html('Basic Value (' + ViewCurrencySymbol + ')');
$("#ViewMaterialCode").val($('#materialCode' + userid).val());
$('#txtViewFreight').val($('#FreightVal' + userid).val());
$('#txtViewAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#ViewNOOfTrips').val($('#NoOfTrip' + userid).val());
$("#drpViewFreight").val($('#FreightType' + userid).val());
var FreightType = $('#FreightType' + userid).val();
if (FreightType == "PER TRIP") {
$('#ViewTripsValue').show();
} else {
$('#ViewTripsValue').hide();
}
$("#ViewDiscountType").val($('#DisType' + userid).val());
$('#txtViewDiscount').val($('#DisVal' + userid).val());
$('#txtViewAfterDiscount').val($('#AfterDisVal' + userid).val());
tinyMCE.get('ViewItemDescription').setContent($('#CapitalItemDescrition' + userid).val());
});
});
/*get edit material list*/
$('#EditMaterialCode').change(function() {
var id = $('#EditMaterialCode').val();
$("#EditCapitalItemName").val('');
$("#EditCPUOM").val('');
$("#EditCPQuantity").val('');
$("#EditCPTotalAmount").val('');
RequistQuantity = '';
clearTaxField();
if (id != '0') {
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode === id) {
$("#EditCapitalItemName").val(obj.MaterialName);
$("#EditCPUOM").val(obj.UOM);
var EDITUOMDisplay = obj.UOM ? obj.UOM : '';
$("#EditCPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EDITUOMDisplay + ')');
}
});
}
var d = $('#drpSupplier').val();
$('#loader').show();
$.ajax({
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
type: 'POST',
data: {
supplierid: d,
materialcode: id
},
success: function(response) {
$('#loader').hide();
if (response) alert(response);
}
});
} else {
alert('Please select the MaterialCode');
return false;
}
});
function clearEditTaxField() {
$('#EditCPRate').val('');
$('#EditCPTotalAmount').val('');
$('#EditAfterServiceTax').val('');
$('#EditAfterEduCess').val('');
$('#EditAfterSecHighTax').val('');
$('#EditAfterKrishiTax').val('');
$('#EditAfterSwachhTax').val('');
$('#EditBasicPriceTax ').val('');
$('#EditAfterBasicPriceTax').val('');
$("#EditLandingCharge").val('');
$("#EditAfterLandingCharge").val('');
$("#EditHighseas").val('');
$("#EditAfterHighseas").val('');
$("#EditCustomduty").val('');
$("#EditAfterCustomduty").val('');
$("#EditExcisedutyTax").val('');
$("#EditAfterExcisedutyTax").val('');
$("#EditExcisedutyEDcess").val('');
$("#EditAfterExcisedutyEDcess").val('');
$("#EditExcisedutySHcess").val('');
$("#EditAfterExcisedutySHcess").val('');
$("#EditCustomEDcess").val('');
$("#EditAfterCustomEDcess").val('');
$("#EditCustomSHcess").val('');
$("#EditAfterCustomSHcess").val('');
$("#EditAdditionalExciseduty").val('');
$("#EditAfterAdditionalExciseduty").val('');
$("#EditGrossdutypayable").val('');
$("#EditAvailableModvat").val('');
$("#EditGrossexpenses").val('');
$("#Editpurchaserate").val('');
$("#EditCustomDutyExpenses").val('');
$("#EditRMCIncludingCustomers").val('');
$("#EditPurQuantity").val('');
$("#EdittxtTotalOrderValue").val('');
RequistQuantity = '';
}
function Save(status) {
if (status == '0') {
stat = '<?php echo PO_DRAFT; ?>';
} else if (status == '2') {
stat = '<?php echo $POStatus; ?>';
} else if (status == '4') {
stat = '<?php echo PO_RELEASED; ?>';
} else {
stat = '<?php echo PO_CREATED; ?>';
}
var AvlBudAmt = '<?php echo $AvlAmount ?>';
tinyMCE.triggerSave();
var splinstr = $('#txtSpcialInstruction').val();
var deladd = $('#DeliveryAddr').val();
var ExchangeRateOn = $('#Exchangerateon').val();
var PaymentMethod = $('#PaymentMethod').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
$('#txtStatus').val(stat);
var basicAmountRate = parseFloat($('#CapitalToatlOrder').val());
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
if (capitalType != 'Domestic') {
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
} else {
basicAmountRate = parseFloat($('#CapitalBasicOrder').val()) - parseFloat($('#txtTotalDiscount').val());
}
if (capitalValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// } else {
//alert('else');
$('#loader').show();
// disableButtons();
//alert('ss');
var formData = new FormData($('.CapitalPO')[0]);
formData.append('ExchangeRateOn', ExchangeRateOn);
formData.append('PaymentMethod', PaymentMethod);
formData.append('txtRowCount', $('#txtRowCount').val());
formData.append('txtPONO', $('#txtPONO').val());
formData.append('capitalType', $('#capitalType').val());
const fileInput = document.getElementById('POFile');
const prePOFileInput = document.getElementById('PrePOFile');
console.log(fileInput.vlaue);
console.log(prePOFileInput.value);
if (fileInput && fileInput.vlaue && fileInput.files.length > 0) {
formData.append('POFile', fileInput.files[0]);
} else if (prePOFileInput && prePOFileInput.files && prePOFileInput.files.length > 0) {
formData.append('PrePOFile', prePOFileInput.files[0]);
} else {
formData.append('POFile', " ");
console.error('No file selected.');
}
$('input, select, textarea').each(function() {
var input = $(this);
var inputID = input.attr('id'); // Get the ID of the input field
formData.append(inputID, input.val());
});
$.ajax({
data: formData,
processData: false,
contentType: false,
// data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod,
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditCapitalPurchaseOrder",
success: function(data) {
$('#loader').hide();
if (data) {
// console.log(data);
alert(data);
// $('#content').loader('hide');
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('');
clearAfterAddLineItemAdd();
window.location = "purchaseorderListing";
// <!-- setTimeout(function() { enableButtons(); }, 2000); -->
} else {
// $('#content').loader('hide');
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
});
// }
}
}
function clearAfterAddLineItemAdd() {
$('#TotalAfterServiceTax').val('');
$('#TotalAfterEduCess').val('');
$('#TotalAfterSecHighTax').val('');
$('#TotalAfterKrishiTax').val('');
$('#TotalAfterSwachhTax').val('');
$('#txttotallanding').val('');
$('#txttotalhighseas').val('');
$('#txttotalcustom').val('');
$('#txttotalexcise').val('');
$('#txttotalexciseED').val('');
$('#txttotalexciseSH').val('');
$('#txttotalcustomED').val('');
$('#txttotalcustomSH').val('');
$('#txttotalAdditionalExciseduty').val('');
$('#txttotalgrossduty').val('');
$('#txttotalavlmodvat').val('');
$('#txttotalgrossexpense').val('');
$('#txtToatlOrder').val('');
}
/*
This function is used to validate all field and caluclate all field while edit capital po
*/
function EditRatechange() {
if ($('#EditReqnumber').val() == "0") {
alert('Please select the Requisition Number');
$('#EditReqnumber').focus();
return false;
} else if ($('#EditMaterialCode').val() == "0") {
alert('Please select the Material Code');
$('#EditMaterialCode').focus();
return false;
} else if ($('#EditCostCenter').val() == "0") {
alert('Please select the CostCenterCode');
$('#EditCostCenter').focus();
return false;
}
// EditExceedQuantityCheck();
if (EditExceedQuantityCheck()) {
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
var txtQuantity = parseFloat($('#EditCPQuantity').val());
//var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var RatePerTon = parseFloat($('#EditCPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var txtExchangeRate = '';
var BasicInINR = '';
if (capitalType == 'International') {
txtExchangeRate = parseFloat($('#EditExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
BasicInINR = Tot * txtExchangeRate;
} else {
var Tot = txtQuantity * RatePerTon;
if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') {
$('#txtEditAfterDiscount').val(updateDiscountValuesChange(parseFloat(Tot).toFixed(2), $("#EditDiscountType").val(), $('#txtEditDiscount').val()));
}
var discountedValue = parseFloat($('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val()).toFixed(2);
txtExchangeRate = 1;
var BasicInINR = Tot * txtExchangeRate - discountedValue;
}
var Freight = parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#txtAfterFreightlocedit').val()).toFixed(2);
var editCPtotal = parseFloat(BasicInINR) + parseFloat(Freight);
// alert(editCPtotal);
$('#EditCPTotalAmount').val(parseFloat(Tot).toFixed(2));
$('#EditAfterBasicPriceTax').val(Math.round(BasicInINR));
//ExceedBudget($('#CPTotalAmount').val(),$('#CapitalbudAmt').val());
if (ExceedBudget($('#EditCPTotalAmount').val(), $('#EditCapitalbudAmt').val())) {
//Service Tax calculation
$('#EditAfterCgst').val(calculateCgstTax(editCPtotal, $("#EditCgst").val() == '' ? "0.00" : $('#EditCgst').val()));
$('#EditAfterSgst').val(calculateSgstTax(editCPtotal, $("#EditSgst").val() == '' ? "0.00" : $('#EditSgst').val()));
$('#EditAfterIgst').val(calculateIgstTax(editCPtotal, $("#EditIgst").val() == '' ? "0.00" : $('#EditIgst').val()));
EditCalculateloadingcharge();
// This is for import basic price
// $('#EditAfterBasicPriceTax').val(Math.round($('#EditCPTotalAmount').val()));
// if($('#EditLandingCharge').val()!='' && $('#EditAfterBasicPriceTax').val()!=''){
// $('#EditAfterLandingCharge').val(calculateLandingCharge($('#EditLandingCharge').val(),$('#EditAfterBasicPriceTax').val()));
// if($('#EditHighseas').val()!='' && $('#EditAfterLandingCharge').val()!=''){
// $('#EditAfterHighseas').val(calculateHighseasCharge($('#EditAfterLandingCharge').val(),$('#EditAfterBasicPriceTax').val(),$('#EditHighseas').val()));
// if($('#EditCustomduty').val()!='' && $('#EditAfterHighseas').val()!=''){
// $('#EditAfterCustomduty').val(calculateCustomdutyCharge($('#EditAfterLandingCharge').val(),$('#EditAfterBasicPriceTax').val(),$('#EditAfterHighseas').val(),$('#EditCustomduty').val()));
// if($('#EditAfterCustomduty').val()!='' && $('#EditExcisedutyTax').val()!=''){
// $('#EditAfterExcisedutyTax').val(calculateExciseCharge($('#EditAfterLandingCharge').val(),$('#EditAfterBasicPriceTax').val(),$('#EditAfterHighseas').val(),$('#EditAfterCustomduty').val(),$('#EditExcisedutyTax').val()));
// if($('#EditAfterExcisedutyTax').val()!='' && $('#EditExcisedutyEDcess').val()!=''){
// $('#EditAfterExcisedutyEDcess').val(calculateExciseEDcessCharge($('#EditAfterExcisedutyTax').val(),$('#EditExcisedutyEDcess').val()));
// if($('#EditAfterExcisedutyTax').val()!='' && $('#EditExcisedutySHcess').val()!=''){
// $('#EditAfterExcisedutySHcess').val(calculateExciseSHcessCharge($('#EditAfterExcisedutyTax').val(),$('#EditExcisedutySHcess').val()));
// if($('#EditAfterExcisedutySHcess').val()!='' && $('#EditCustomEDcess').val()!=''){
// $('#EditAfterCustomEDcess').val(calculateCustomEDcessCharge($('#EditAfterLandingCharge').val(),$('#EditAfterHighseas').val(),$('#EditAfterCustomduty').val(),$('#EditAfterExcisedutyTax').val(),$('#EditAfterExcisedutyEDcess').val(),$('#EditAfterExcisedutySHcess').val(),$('#EditCustomEDcess').val()));
// }
// if($('#EditAfterExcisedutySHcess').val()!='' && $('#EditCustomSHcess').val()!=''){
// $('#EditAfterCustomSHcess').val(calculateCustomSHcessCharge($('#EditAfterLandingCharge').val(),$('#EditAfterHighseas').val(),$('#EditAfterCustomduty').val(),$('#EditAfterExcisedutyTax').val(),$('#EditAfterExcisedutyEDcess').val(),$('#EditAfterExcisedutySHcess').val(),$('#EditCustomSHcess').val()));
// if($('#EditAfterCustomSHcess').val()!='' && $('#EditAdditionalExciseduty').val()!=''){
// $('#EditAfterAdditionalExciseduty').val(calculateAdditionalExciseDutyCharge($('#EditAfterBasicPriceTax').val(),$('#EditAfterLandingCharge').val(),$('#EditAfterHighseas').val(),$('#EditAfterCustomduty').val(),$('#EditAfterExcisedutyTax').val(),$('#EditAfterExcisedutyEDcess').val(),$('#EditAfterExcisedutySHcess').val(),$('#EditAfterCustomEDcess').val(),$('#EditAfterCustomSHcess').val(),$('#EditAdditionalExciseduty').val()));
// $('#EditGrossdutypayable').val(calculateGrossdutypayableCharge($('#EditAfterLandingCharge').val(),$('#EditAfterHighseas').val(),$('#EditAfterCustomduty').val(),$('#EditAfterExcisedutyTax').val(),$('#EditAfterExcisedutyEDcess').val(),$('#EditAfterExcisedutySHcess').val(),$('#EditAfterCustomEDcess').val(),$('#EditAfterCustomSHcess').val(),$('#EditAfterAdditionalExciseduty').val()));
// $('#EditAvailableModvat').val(calculateAvailableModvatCharge($('#EditAfterExcisedutyTax').val(),$('#EditAfterExcisedutyEDcess').val(),$('#EditAfterExcisedutySHcess').val(),$('#EditAfterAdditionalExciseduty').val()));
// $('#EditGrossexpenses').val(calculateGrossexpensesCharge($('#EditGrossdutypayable').val(),$('#EditAvailableModvat').val()));
// if($('#EditPurQuantity').val()!='' && $('#EditPurQuantity').val()!='0'){
// $('#Editpurchaserate').val(calculatepurchaserate($('#EditAfterBasicPriceTax').val(),$('#EditPurQuantity').val()));
// $('#EditCustomDutyExpenses').val(calculateCustomDutyExpenses($('#EditGrossexpenses').val(),$('#EditPurQuantity').val()));
// $('#EditRMCIncludingCustomers').val(calculateRMCIncludingCustomers($('#Editpurchaserate').val(),$('#EditCustomDutyExpenses').val()));
// var Rmc = $('#EditRMCIncludingCustomers').val();
// var Quanty =$('#EditCPQuantity').val();
// var BasicAmt = $('#EditCPTotalAmount').val();
// var perKg = parseFloat(BasicAmt).toFixed(2);
// $('#EdittxtTotalOrderValue').val(perKg);
// }
// else {
// $('#Editpurchaserate').val('0.00');
// $('#EditCustomDutyExpenses').val('0.00');
// $('#EditRMCIncludingCustomers').val('0.00');
// var Rmc = $('#EditRMCIncludingCustomers').val();
// var Quanty =$('#EditCPQuantity').val();
// var BasicAmt = $('#EditCPQuantity').val();
// var perKg = parseFloat(BasicAmt).toFixed(2);
// $('#EdittxtTotalOrderValue').val(perKg);
// }
// }
// }
// }
// else{
// //alert('Please Enter Excise duty S & H cess');
// }
// }
// else{
// //alert('Please Enter Excise Duty ED_cess');
// }
// }
// else{
// //alert('Please Enter Excise Duty');
// }
// }
// else{
// //alert('Please Enter Custom Duty');
// }
// }
// }
// else{
// //alert('Please Enter Landing Charge ')
// }
EditcalculateTotalValue();
// var res = ExceedBudget($('#TotalOrderValue').val(), $('#CapitalbudAmt').val());
//if(!res)
// {
// $('#CPRate').focus();
// return false;
// }
}
} else {
$('CPRate').focus();
}
} else {
//clearTaxField();
}
}
function ViewRatechange() {
//alert('fdc');
var txtQuantity = parseFloat($('#ViewCPQuantity').val());
//var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var RatePerTon = parseFloat($('#ViewCPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var txtExchangeRate = '';
var BasicInINR = '';
var Tot = txtQuantity * RatePerTon;
var discountedValue = parseFloat($('#txtViewAfterDiscount').val() == '' ? '0.00' : $('#txtViewAfterDiscount').val()).toFixed(2);
txtExchangeRate = 1;
var BasicInINR = Tot * txtExchangeRate - discountedValue;
var Freight = parseFloat($('#txtAfterFreightlocview').val() == '' ? '0.00' : $('#txtAfterFreightlocview').val()).toFixed(2);
var editCPtotal = parseFloat(BasicInINR) + parseFloat(Freight);
//Service Tax calculation
$('#ViewAfterCgst').val(calculateCgstTax(editCPtotal, $("#ViewCgst").val() == '' ? "0.00" : $('#ViewCgst').val()));
$('#ViewAfterSgst').val(calculateSgstTax(editCPtotal, $("#ViewSgst").val() == '' ? "0.00" : $('#ViewSgst').val()));
$('#ViewAfterIgst').val(calculateIgstTax(editCPtotal, $("#ViewIgst").val() == '' ? "0.00" : $('#ViewIgst').val()));
}
/* This function used to check quantity exceeding or not while Editing*/
function EditExceedQuantityCheck() {
var EnterQuantity = $("#EditCPQuantity").val() == '' ? "0.00" : parseFloat($("#EditCPQuantity").val());
var ReqQuantity = parseFloat(RequistQuantity);
//alert(ReqQuantity);
// if(EnterQuantity != ReqQuantity)
// {
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
// $('#EditCPQuantity').focus();
// return false;
// }
// else
// {
return true;
//}
}
/**
* This function is used for Edit Capital
*/
$('.EditCapital').click(function() {
tinyMCE.triggerSave();
if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) {
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var tr = document.getElementById(userid);
var cellval = tr.cells;
var Reqnumber = $('#EditReqnumber').val();
var departmentName = $('#EditCapitalDepartmentName').val();
var AvilBudget = $('#EditCapitalbudAmt').val();
var costCode = $('#EditCostCenter').val();
var materialCode = $('#EditMaterialCode').val();
var materialName = $("#EditCapitalItemName").val();
var uom = $("#EditCPUOM").val();
var editPer = '';
if ($("#EditPer").val().trim() == '') {
editPer = $("#EditCPUOM").val();
} else {
editPer = $("#EditPer").val();
}
var exchangeRate = $("#EditExchangeRtModal").val();
var quantity = $("#EditCPQuantity").val();
var convertRate = $("#EditCPRate").val();
var itemRate = parseFloat(convertRate).toFixed(2);
var basicval = $("#EditCPTotalAmount").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
var Sgst = $("#EditSgst").val();
var AfterSgst = $("#EditAfterSgst").val();
var Igst = $("#EditIgst").val();//Dom Caps
var AfterIgst = $("#EditAfterIgst").val();//Dom Caps
var OtherAmt = parseFloat($("#EditOtherAllowances").val() == '' ? "0.00" : $('#EditOtherAllowances').val()).toFixed(2);
var TotalTaxValue = EditcalculateTaxValue();
var landingCharge = $('#EditAfterLandingCharge').val();
var HighSeasSalesCharge = $('#EditAfterHighseas').val();
var CustomDuty = $('#EditAfterCustomduty').val();
var ExciseDuty = $('#EditAfterExcisedutyTax').val();
var ExciseDutyEDCess = $('#EditAfterExcisedutyEDcess').val();
var ExciseDutySHCess = $('#EditAfterExcisedutySHcess').val();
var CustomEDCess = $('#EditAfterCustomEDcess').val();
var CustomSHCess = $('#EditAfterCustomSHcess').val();
var AdditionalExciseDuty = $('#EditAfterAdditionalExciseduty').val();
var GrossDutyPayable = $('#EditGrossdutypayable').val();
var AvailableModvat = $('#EditAvailableModvat').val();
var GrossExpensesDuetoCustom = $('#EditGrossexpenses').val();
var PurQuantity = $('#EditPurQuantity').val();
var purchaseRate = $('#Editpurchaserate').val();
var CustomDutyExpenses = $('#EditCustomDutyExpenses').val();
var RMCIncludingCustomers = $('#EditRMCIncludingCustomers').val();
var TotalOrderValuePerkg = $("#EdittxtTotalOrderValue").val();
/*get % values */
var beforeLanding = $('#EditLandingCharge').val();
var beforeHighSeasSalesCharge = $('#EditHighseas').val();
var beforeCustomDuty = $('#EditCustomduty').val();
var beforeExciseDuty = $('#EditExcisedutyTax').val();
var beforeExciseDutyEDCess = $('#EditExcisedutyEDcess').val();
var beforeExciseDutySHCess = $('#EditExcisedutySHcess').val();
var beforeCustomEDCess = $('#EditCustomEDcess').val();
var beforeCustomSHCess = $('#EditCustomSHcess').val();
var beforeAdditionalExciseDuty = $('#EditAdditionalExciseduty').val();
var PurQuantity = $('#EditPurQuantity').val();
var basicvalInINR = $('#EditAfterBasicPriceTax').val();
var EditCapitalDescription = $("#EditItemDescription").val();
var FreightType = $("#drpEditFreight").val();
var FreightVal = $("#txtEditFreight").val();
var AfterFreightVal = $("#txtEditAfterFreight").val();
var NoOfTrip = $("#EditNOOfTrips").val();
var DisType = $("#EditDiscountType").val();
var DisVal = $("#txtEditDiscount").val();
var AfterDisVal = $("#txtEditAfterDiscount").val();
var Assessable = $("#EditAfterAssessable").val();
var SubTotal = $("#EditSubtotal").val();
var InternationalIgst = $("#EditIgstInt").val() == '' ? 0 : $("#EditIgstInt").val();
var InternationalAfterIgst = $("#EditAfterIgstInt").val() == '' ? 0 : $("#EditAfterIgstInt").val();
var DutyImpact = $("#EditDutyImpact").val();
var ClearingCharges = $('#EditClearingCharges').val();
var Nett = $('#EditNett').val();
var FreightTypeloc = $('#drpFreighteditloc').val();
var FreightRateloc = $('#txtFreightlocedit').val();
var FreightRateAmountloc = $('#txtAfterFreightlocedit').val();
var Nooftriploc = $('#NOOfTripslocedit').val();
var Total = (parseFloat(basicval) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) - parseFloat(AfterDisVal) + parseFloat(FreightRateAmountloc)).toFixed(2);
if (capital == 0) {
Total = parseFloat(basicval);
}
$('#Reqnumber' + userid).val(Reqnumber);
$('#departmentName' + userid).val(departmentName);
$('#CPCostCode' + userid).val(costCode);
$('#AvilBudget' + userid).val(AvilBudget);
$('#echangeRate' + userid).val(exchangeRate);
$('#materialCode' + userid).val(materialCode);
$('#materialName' + userid).val(materialName);
$('#uom' + userid).val(uom);
$('#per' + userid).val(editPer);
$('#quantity' + userid).val(quantity);
$('#rateInUs' + userid).val(itemRate);
$('#basicval' + userid).val(basicval);
RequistQuantity = $('#quantity' + userid).val();
$('#Cgst' + userid).val(Cgst);
$('#AfterCgst' + userid).val(AfterCgst);
$('#Sgst' + userid).val(Sgst);
$('#AfterSgst' + userid).val(AfterSgst);
$('#Igst' + userid).val(Igst);
$('#AfterIgst' + userid).val(AfterIgst);
$('#OtherAmt' + userid).val(OtherAmt);
$('#DisType' + userid).val(DisType);
$('#DisVal' + userid).val(DisVal);
$('#AfterDisVal' + userid).val(AfterDisVal);
$('#ServiceTotalOrderValue' + userid).val(TotalTaxValue);
$('#FreightType' + userid).val(FreightType);
$('#FreightVal' + userid).val(FreightVal);
$('#NoOfTrip' + userid).val(NoOfTrip);
$('#AfterFreightVal' + userid).val(AfterFreightVal);
$('#CapitalItemDescrition' + userid).val(EditCapitalDescription);
$('#landingCharge' + userid).val(landingCharge);
$('#HighSeasSalesCharge' + userid).val(HighSeasSalesCharge);
$('#CustomDuty' + userid).val(CustomDuty);
$('#ExciseDuty' + userid).val(ExciseDuty);
$('#ExciseDutyEDCess' + userid).val(ExciseDutyEDCess);
$('#ExciseDutySHCess' + userid).val(ExciseDutySHCess);
$('#CustomEDCess' + userid).val(CustomEDCess);
$('#CustomSHCess' + userid).val(CustomSHCess);
$('#AdditionalExciseDuty' + userid).val(AdditionalExciseDuty);
$('#GrossDutyPayable' + userid).val(GrossDutyPayable);
$('#AvailableModvat' + userid).val(AvailableModvat);
$('#GrossExpensesDuetoCustom' + userid).val(GrossExpensesDuetoCustom);
$('#purchaseRate' + userid).val(purchaseRate);
$('#CustomDutyExpenses' + userid).val(CustomDutyExpenses);
$('#RMCIncludingCustomers' + userid).val(RMCIncludingCustomers);
$('#basicvalInINR' + userid).val(basicvalInINR);
$('#itemRate' + userid).val(itemRate);
/* get % value */
$('#beforeLanding' + userid).val(beforeLanding);
$('#beforeHighSeasSalesCharge' + userid).val(beforeHighSeasSalesCharge);
$('#beforeCustomDuty' + userid).val(beforeCustomDuty);
$('#beforeExciseDuty' + userid).val(beforeExciseDuty);
$('#beforeExciseDutyEDCess' + userid).val(beforeExciseDutyEDCess);
$('#beforeExciseDutySHCess' + userid).val(beforeExciseDutySHCess);
$('#beforeCustomEDCess' + userid).val(beforeCustomEDCess);
$('#beforeCustomSHCess' + userid).val(beforeCustomSHCess);
$('#beforeAdditionalExciseDuty' + userid).val(beforeAdditionalExciseDuty);
$('#PurQuantity' + userid).val(PurQuantity);
$('#PerKgExpense' + userid).val(TotalOrderValuePerkg);
$('#Ftype' + userid).val(FreightTypeloc);
$('#NoTrip' + userid).val(Nooftriploc);
$('#Fvalue' + userid).val(FreightRateloc);
$('#Afvalue' + userid).val(FreightRateAmountloc);
$('#AssessableValue' + userid).val(Assessable);
$('#SubTotal' + userid).val(SubTotal);
$('#IGSTInt' + userid).val(InternationalIgst);
$('#AfterIGSTInt' + userid).val(InternationalAfterIgst);
$('#DutyImpact' + userid).val(DutyImpact);
$('#NetValue' + userid).val(Nett);
$('#ClearingCharge' + userid).val(ClearingCharges);
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
cellval[2].innerHTML = materialCode;
cellval[3].innerHTML = shorten;
cellval[5].innerHTML = quantity;
cellval[6].innerHTML = uom;
cellval[7].innerHTML = parseFloat(itemRate).toFixed(2);
cellval[8].innerHTML = parseFloat(basicval).toFixed(2);
cellval[9].innerHTML = parseFloat(TotalTaxValue).toFixed(2);// what should i display here ?? if international means
cellval[10].innerHTML = parseFloat(Total).toFixed(2);
populateValueMainFormForEditCapitalTax();
clearTaxField();
$('#EDITCAPITAL').modal('hide');
}
});
$('.ViewCapital').click(function() {
var tr = document.getElementById(userid);
var cellval = tr.cells;
var FreightType = $("#drpViewFreight").val();
var FreightVal = $("#txtViewFreight").val();
var AfterFreightVal = $("#txtViewAfterFreight").val();
var NoOfTrip = $("#ViewNOOfTrips").val();
$('#FreightType' + userid).val(FreightType);
$('#FreightVal' + userid).val(FreightVal);
$('#NoOfTrip' + userid).val(NoOfTrip);
$('#AfterFreightVal' + userid).val(AfterFreightVal);
var Freightloc = $("#drpFreightviewloc").val();
var Nostriploc = $("#NOOfTripslocview").val();
var freightvalloc = $("#txtFreightlocview").val();
var AfterFreightloc = $("#txtAfterFreightlocview").val();
var cgst = $("#ViewCgst").val();
var AfterCgst = $("#ViewAfterCgst").val();
var sgst = $("#ViewSgst").val();
var AfterSgst = $("#ViewAfterSgst").val();
var igst = $("#ViewIgst").val();
var afterIgst = $("#ViewAfterIgst").val();
var allowance = $("#ViewOtherAllowances").val();
var basicval = $("#ViewCPTotalAmount").val();
//console.log(basicval);
$('#Cgst' + userid).val(cgst);
$('#AfterCgst' + userid).val(AfterCgst);
$('#Sgst' + userid).val(sgst);
$('#AfterSgst' + userid).val(AfterSgst);
$('#Igst' + userid).val(igst);
$('#AfterIgst' + userid).val(afterIgst);
$('#Ftype' + userid).val(Freightloc);
$('#NoTrip' + userid).val(Nostriploc);
$('#Fvalue' + userid).val(freightvalloc);
$('#Afvalue' + userid).val(AfterFreightloc);
populateValueMainFormForViewCapitalTax();
});
function validateEditCapitalTax() {
if ($('#EditReqnumber').val() == "0") {
alert('Please select the Requisition Number');
$('#EditReqnumber').focus();
return false;
} else if ($('#EditCostCenter').val() == "0") {
alert('Please select the Cost center');
$('#EditCostCenter').focus();
return false;
} else if ($('#EditMaterialCode').val() == "0") {
alert('Please select the Material Code');
$('#EditMaterialCode').focus();
return false;
} else if ($('#EditCPQuantity').val() == '') {
alert('Please Enter the Quantity value');
$('#EditCPQuantity').focus();
return false;
} else if ($('#EditCPQuantity').val() == "0") {
alert('Please Enter the Valid Quantity value');
$('#EditCPQuantity').focus();
return false;
} else if ($('#EditCPRate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#EditCPRate').focus();
return false;
} else if ($('#EditCPRate').val() == "0") {
alert('Please Enter the Valid Rate of the Item');
$('#EditCPRate').focus();
return false;
}
/* else if($('#EditItemDescription').val() == '')
{
alert('Please Enter the Capital Description');
$('#EditItemDescription').focus();
return false;
} */
else {
return true;
}
}
function EditcalculateTotalValue() {
var BasicVal = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
var disRate = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
BasicVal = BasicVal - disRate;
var AfterCgst = $('#EditAfterCgst').val() == '' ? '0.00' : $('#EditAfterCgst').val();
var AfterSgst = $('#EditAfterSgst').val() == '' ? '0.00' : $('#EditAfterSgst').val();
var AfterIgst = $('#EditAfterIgst').val() == '' ? '0.00' : $('#EditAfterIgst').val();
var OtherAmt = $('#EditOtherAllowances').val() == '' ? '0.00' : $('#EditOtherAllowances').val();
var Freight = parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#txtAfterFreightlocedit').val()).toFixed(2);
var ServiceTaxAmount = $('#EditAfterServiceTax').val() == '' ? '0.00' : $('#EditAfterServiceTax').val();
var EduCessTaxAmount = $('#EditAfterEduCess').val() == '' ? '0.00' : $('#EditAfterEduCess').val();
var SecHighTaxAmount = $('#EditAfterSecHighTax').val() == '' ? '0.00' : $('#EditAfterSecHighTax').val();
var KrishiTaxAmount = $('#EditAfterKrishiTax').val() == '' ? '0.00' : $('#EditAfterKrishiTax').val();
var SwachhTaxAmount = $('#EditAfterSwachhTax').val() == '' ? '0.00' : $('#EditAfterSwachhTax').val();
var landingCharge = $('#EditAfterLandingCharge').val() == '' ? '0.00' : $('#EditAfterLandingCharge').val();
var HighSeasSalesCharge = $('#EditAfterHighseas').val() == '' ? '0.00' : $('#EditAfterHighseas').val();
var CustomDuty = $('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val();
var ExciseDuty = $('#EditAfterExcisedutyTax').val() == '' ? '0.00' : $('#EditAfterExcisedutyTax').val();
var ExciseDutyEDCess = $('#EditAfterExcisedutyEDcess').val() == '' ? '0.00' : $('#EditAfterExcisedutyEDcess').val();
var ExciseDutySHCess = $('#EditAfterExcisedutySHcess').val() == '' ? '0.00' : $('#EditAfterExcisedutySHcess').val();
var CustomEDCess = $('#EditAfterCustomEDcess').val() == '' ? '0.00' : $('#EditAfterCustomEDcess').val();
var CustomSHCess = $('#EditAfterCustomSHcess').val() == '' ? '0.00' : $('#EditAfterCustomSHcess').val();
var AdditionalExciseDuty = $('#EditAfterAdditionalExciseduty').val() == '' ? '0.00' : $('#EditAfterAdditionalExciseduty').val();
var GrossDutyPayable = $('#EditGrossdutypayable').val() == '' ? '0.00' : $('#EditGrossdutypayable').val();
var AvailableModvat = $('#EditAvailableModvat').val() == '' ? '0.00' : $('#EditAvailableModvat').val();
var GrossExpensesDuetoCustom = $('#EditGrossexpenses').val() == '' ? '0.00' : $('#EditGrossexpenses').val();
var purchaseRate = $('#Editpurchaserate').val() == '' ? '0.00' : $('#Editpurchaserate').val();
var CustomDutyExpenses = $('#EditCustomDutyExpenses').val() == '' ? '0.00' : $('#EditCustomDutyExpenses').val();
var RMCIncludingCustomers = $('#EditRMCIncludingCustomers').val() == '' ? '0.00' : $('#EditRMCIncludingCustomers').val();
var totvalue = (parseFloat(BasicVal) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) + parseFloat(Freight)).toFixed(2);
var tot = parseFloat(totvalue).toFixed(2);
$('#EdittxtTotalOrderValue').val(tot);
validateEditExceedLimit();
EditExceedQuantityCheck();
}
/* calculate tax value*/
function EditcalculateTaxValue() {
var Cgst = $('#EditAfterCgst').val() == '' ? '0.00' : $('#EditAfterCgst').val();
var Sgst = $('#EditAfterSgst').val() == '' ? '0.00' : $('#EditAfterSgst').val();
var Igst = 0.00;
if (capitalType == 'Domestic') {
Igst = $('#EditAfterIgst').val() == '' ? '0.00' : $('#EditAfterIgst').val(); // caps dom
}
if(capitalType == 'International') {
Igst = $('#EditAfterIgstInt').val() == '' ? '0.00' : $('#EditAfterIgstInt').val(); // caps interna
}
console.log(Igst);
var landingCharge = $('#EditAfterLandingCharge').val() == '' ? '0.00' : $('#EditAfterLandingCharge').val();
var HighSeasSalesCharge = $('#EditAfterHighseas').val() == '' ? '0.00' : $('#EditAfterHighseas').val();
var CustomDuty = $('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val();
var ExciseDuty = $('#EditAfterExcisedutyTax').val() == '' ? '0.00' : $('#EditAfterExcisedutyTax').val();
var ExciseDutyEDCess = $('#EditAfterExcisedutyEDcess').val() == '' ? '0.00' : $('#EditAfterExcisedutyEDcess').val();
var ExciseDutySHCess = $('#EditAfterExcisedutySHcess').val() == '' ? '0.00' : $('#EditAfterExcisedutySHcess').val();
var CustomEDCess = $('#EditAfterCustomEDcess').val() == '' ? '0.00' : $('#EditAfterCustomEDcess').val();
var CustomSHCess = $('#EditAfterCustomSHcess').val() == '' ? '0.00' : $('#EditAfterCustomSHcess').val();
var AdditionalExciseDuty = $('#EditAfterAdditionalExciseduty').val() == '' ? '0.00' : $('#EditAfterAdditionalExciseduty').val();
var GrossDutyPayable = $('#EditGrossdutypayable').val() == '' ? '0.00' : $('#EditGrossdutypayable').val();
var AvailableModvat = $('#EditAvailableModvat').val() == '' ? '0.00' : $('#EditAvailableModvat').val();
var GrossExpensesDuetoCustom = $('#EditGrossexpenses').val() == '' ? '0.00' : $('#EditGrossexpenses').val();
var purchaseRate = $('#Editpurchaserate').val() == '' ? '0.00' : $('#Editpurchaserate').val();
var CustomDutyExpenses = $('#EditCustomDutyExpenses').val() == '' ? '0.00' : $('#EditCustomDutyExpenses').val();
var RMCIncludingCustomers = $('#EditRMCIncludingCustomers').val() == '' ? '0.00' : $('#EditRMCIncludingCustomers').val();
var totTaxvalue = (parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst));
//+parseFloat(landingCharge)+parseFloat(HighSeasSalesCharge)+parseFloat(CustomDuty)+parseFloat(ExciseDuty)+parseFloat(ExciseDutyEDCess)+parseFloat(ExciseDutySHCess)+parseFloat(CustomEDCess)+parseFloat(CustomSHCess)+parseFloat(AdditionalExciseDuty)+parseFloat(GrossDutyPayable)+parseFloat(AvailableModvat)+parseFloat(GrossExpensesDuetoCustom)+parseFloat(purchaseRate)+parseFloat(CustomDutyExpenses)+parseFloat(RMCIncludingCustomers)
var totTax = parseFloat(totTaxvalue).toFixed(2);
return totTax;
}
/* used to validateExceedLimit for edit*/
function validateEditExceedLimit() {
var avalbudAmt = parseFloat($('#EditCapitalbudAmt').val());
var basicAmountRate = parseFloat($('#EditCPTotalAmount').val());
var discountRate = parseFloat($('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val());
var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val());
var ExchangeRate = $('#ExchangeRt').val() == '' ? '1.00' : $('#ExchangeRt').val();
if (capitalType != 'Domestic') {
basicAmountRate = parseFloat(basicAmountRate * ExchangeRate);
} else {
basicAmountRate = parseFloat(basicAmountRate) - parseFloat(discountRate);
}
// if(basicAmountRate > avalbudAmt)
// {
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
// $('#EditCPRate').focus();
// return false;
// }
// else
// {
return true;
//}
}
/**
* This function is used to calculate the total amounts after Edit row
*/
function populateValueMainFormForEditCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length;
console.log("rr",rows);
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0;
var TotCgst = 0;
var TotSgst = 0;
var TotIgst = 0;
var TotOther = 0;
var TotLanding = 0;
var TotCustom = 0;
var TotCustomED = 0;
var TotCustomSH = 0;
var TotGrossduty = 0;
var TotalAssessable = 0;
var TotalSubtotal = 0;
var TotalIgst = 0;
var CapitalToatlOrder = 0;
var TotFreight = 0;
var TotDiscount = 0;
var TotBasicAmt = 0;
var TotaFreight = 0;
console.log("***---***");
for (var i = 1; i < rows; i++) {
console.log(">>>---<<<");
var TotalOrderValueSummaryI = $('#ServiceTotalOrderValue' + i).val() == '' ? '0.00' : $('#ServiceTotalOrderValue' + i).val();
var TotalCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
var TotalSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
var TotalIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
var TotalFreight = $('#Afvalue' + i).val() == '' ? '0.00' : $('#Afvalue' + i).val();
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
var TotLandingI = $('#landingCharge' + i).val() == '' ? '0.00' : $('#landingCharge' + i).val();
console.log(TotLandingI,"TotLandingI");
var TotCustomI = $('#CustomDuty' + i).val() == '' ? '0.00' : $('#CustomDuty' + i).val();
var TotCustomEDI = $('#CustomEDCess' + i).val() == '' ? '0.00' : $('#CustomEDCess' + i).val();
var TotCustomSHI = $('#CustomSHCess' + i).val() == '' ? '0.00' : $('#CustomSHCess' + i).val();
var TotGrossdutyI = $('#GrossDutyPayable' + i).val() == '' ? '0.00' : $('#GrossDutyPayable' + i).val();
var Assesable = $('#AssessableValue' + i).val() == '' ? '0.00' : $('#AssessableValue' + i).val();
var Subtotal = $('#SubTotal' + i).val() == '' ? '0.00' : $('#SubTotal' + i).val();
var Igst = $('#AfterIGSTInt' + i).val() == '' ? '0.00' : $('#AfterIGSTInt' + i).val();
var TotGrossexpenseI = $('#GrossExpensesDuetoCustom' + i).val() == '' ? '0.00' : $('#GrossExpensesDuetoCustom' + i).val();
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
if (capital == 1) {
CapitalToatlOrderI = CapitalToatlOrderI - discountedRateValue;
} else {
var CapitalToatlOrderI = $('#basicval' + i).val() == '' ? '0.00' : $('#basicval' + i).val();
}
var TotBasicAmtI = parseFloat(CapitalToatlOrderI) + parseFloat(discountedRateValue);
// if(capital==0)
// {
// Total=parseFloat(CapitalToatlOrderI);
// }
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
var TotDiscountI = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
TotCgst = parseFloat(TotCgst) + parseFloat(TotalCgstI);
TotSgst = parseFloat(TotSgst) + parseFloat(TotalSgstI);
TotIgst = parseFloat(TotIgst) + parseFloat(TotalIgstI);
TotOther = parseFloat(TotOther) + parseFloat(TotOtherI);
TotaFreight = parseFloat(TotaFreight) + parseFloat(TotalFreight);
TotalAssessable = parseFloat(TotalAssessable) + parseFloat(Assesable);
TotalSubtotal = parseFloat(TotalSubtotal) + parseFloat(Subtotal);
TotalIgst = parseFloat(TotalIgst) + parseFloat(Igst);
TotLanding = parseFloat(TotLanding) + parseFloat(TotLandingI);
TotCustom = parseFloat(TotCustom) + parseFloat(TotCustomI);
TotCustomED = parseFloat(TotCustomED) + parseFloat(TotCustomEDI);
TotCustomSH = parseFloat(TotCustomSH) + parseFloat(TotCustomSHI);
TotGrossduty = parseFloat(TotGrossduty) + parseFloat(TotGrossdutyI);
TotalOrderValueSummary = parseFloat(TotalOrderValueSummary) + parseFloat(TotalOrderValueSummaryI);
if (capital == 1) {
CapitalToatlOrder = parseFloat(CapitalToatlOrder) + parseFloat(CapitalToatlOrderI) + parseFloat(TotalCgstI) + parseFloat(TotalSgstI) + parseFloat(TotalIgstI) + parseFloat(TotOtherI) + parseFloat(TotalFreight);
} else {
CapitalToatlOrder = parseFloat(CapitalToatlOrder) + parseFloat(CapitalToatlOrderI);
}
TotBasicAmt = parseFloat(TotBasicAmt) + parseFloat(TotBasicAmtI);
TotFreight = parseFloat(TotFreight) + parseFloat(TotFreightI);
TotDiscount = parseFloat(TotDiscount) + parseFloat(TotDiscountI);
}
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
$('#TotalOtherAllowances').val(parseFloat(TotOther).toFixed(2));
$('#TotalFreight').val(parseFloat(TotaFreight).toFixed(2));
$('#txttotallanding').val((parseFloat(TotLanding)).toFixed(2));
$('#txttotalcustom').val((parseFloat(TotCustom)).toFixed(2));
$('#txttotalcustomED').val((parseFloat(TotCustomED)).toFixed(2));
$('#txttotalcustomSH').val((parseFloat(TotCustomSH)).toFixed(2));
$('#txttotalgrossduty').val((parseFloat(TotGrossduty)).toFixed(2));
//$('#txttotalgrossexpense').val((parseFloat(TotGrossexpense)).toFixed(2) );
$('#CapitalToatlOrder').val((parseFloat(CapitalToatlOrder)).toFixed(2));
$('#CapitalBasicOrder').val((parseFloat(TotBasicAmt)).toFixed(2));
$('#txtTotalDiscount').val(parseFloat(TotDiscount).toFixed(2));
$('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2));
$('#txtToatlOrder').val((parseFloat(TotalOrderValueSummary)).toFixed(2));
$('#txttotalAssessable').val((parseFloat(TotalAssessable)).toFixed(2));
$('#txttotalSubtotal').val((parseFloat(TotalSubtotal)).toFixed(2));
$('#txttotalIgst').val((parseFloat(TotalIgst)).toFixed(2));
}
function populateValueMainFormForViewCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0;
var TotCgst = 0;
var TotSgst = 0;
var TotIgst = 0;
var TotOther = 0;
var TotLanding = 0;
var TotHighseas = 0;
var TotCustom = 0;
var TotExcise = 0;
var TotExciseED = 0;
var TotExciseSH = 0;
var TotCustomED = 0;
var TotCustomSH = 0;
var TotAdditionalExciseduty = 0;
var TotGrossduty = 0;
var TotAvlmodvat = 0;
var TotGrossexpense = 0;
var CapitalToatlOrder = 0;
var TotFreight = 0;
var TotDiscount = 0;
var TotaFreight = 0;
for (var i = 1; i < rows; i++) {
var TotFreightI = $('#AfterFreightVal' + i).val() == '' ? '0.00' : $('#AfterFreightVal' + i).val();
TotFreight = parseFloat(TotFreight) + parseFloat(TotFreightI);
var TotalCgstI = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
var TotalSgstI = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
var TotalIgstI = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
var TotOtherI = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
var TotalFreight = $('#Afvalue' + i).val() == '' ? '0.00' : $('#Afvalue' + i).val();
var discountedRateValue = $('#AfterDisVal' + i).val() == '' ? '0.00' : $('#AfterDisVal' + i).val();
//console.log(discountedRateValue);
TotCgst = parseFloat(TotCgst) + parseFloat(TotalCgstI);
TotSgst = parseFloat(TotSgst) + parseFloat(TotalSgstI);
TotIgst = parseFloat(TotIgst) + parseFloat(TotalIgstI);
TotaFreight = parseFloat(TotaFreight) + parseFloat(TotalFreight);
}
$('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2));
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
$('#TotalFreight').val(parseFloat(TotaFreight).toFixed(2));
var basicval = parseFloat($('#CapitalBasicOrder').val());
var totdiscount = parseFloat($('#txtTotalDiscount').val());
var totcgstt = parseFloat($('#txtTotCgst').val());
var totsgstt = parseFloat($('#txtTotSgst').val());
var totigstt = parseFloat($('#txtTotIgst').val());
var totfreightt = parseFloat($('#TotalFreight').val());
var otherallowance = parseFloat($('#TotalOtherAllowances').val());
var totorder = parseFloat(basicval) + parseFloat(totcgstt) + parseFloat(totsgstt) + parseFloat(totigstt) + parseFloat(totfreightt) + parseFloat(otherallowance) - parseFloat(totdiscount);
// console.log(totorder);
if (capital == 1) {
$('#CapitalToatlOrder').val(parseFloat(totorder).toFixed(2));
}
}
var DisplayCurrencySymbol = '';
var ViewCurrencySymbol = '';
var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
$.each(currency, function(idx, obj) {
if (obj.Currency_Code === $("#currencytype").val()) {
$("#CurrencySymbol").val(obj.FontCode2000);
DisplayCurrencySymbol = obj.FontCode2000;
ViewCurrencySymbol = obj.FontCode2000;
var DisplayUOM = $('#uom').val();
$('#CurrencySymbol').html('Exchange Rate In' + " " + obj.FontCode2000);
$('#RateIn').html('Rate(in' + " " + obj.FontCode2000 + '/' + DisplayUOM + ')');
$('#EditRateIn').html('Rate(in' + " " + obj.FontCode2000 + '/' + DisplayUOM + ')');
$('#TotalAmount').html('Basic Value (' + DisplayCurrencySymbol + ')');
$('#EditTotalAmount').html('Basic Value (' + DisplayCurrencySymbol + ')');
$('#lbl_international').html('Total Order Value (' + "" + DisplayCurrencySymbol + ')');
//$('#ViewTotalAmount').html('Basic Value in' + " "+ViewCurrencySymbol);
// $('#ViewRateIn').html('Rate(in' + " "+ViewCurrencySymbol + '/'+DisplayUOM+')');
}
});
$('#currencytype').change(function() {
var SelectCurrency = $('#currencytype').val();
$.each(currency, function(idx, obj) {
if (obj.Currency_Code === SelectCurrency) {
$("#CurrencySymbol").val(obj.FontCode2000);
DisplayCurrencySymbol = obj.FontCode2000;
$('#CurrencySymbol').html('Exchange Rate In' + " " + obj.FontCode2000);
$('#RateIn').html('Rate(in' + " " + obj.FontCode2000 + '/Ton)');
$('#EditRateIn').html('Rate(in' + " " + obj.FontCode2000 + '/Ton)');
$('#TotalAmount').html('Basic Value (' + DisplayCurrencySymbol + ')');
$('#EditTotalAmount').html('Basic Value (' + DisplayCurrencySymbol + ')');
$('#lbl_international').html('Total Order Value (' + "" + obj.FontCode2000 + ')');
}
});
});
function calculateCgstTax(varBasicValue, Cgst) {
var basicValue = parseFloat(varBasicValue);
var Cgst = parseFloat(Cgst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
function calculateSgstTax(varBasicValue, Sgst) {
var basicValue = parseFloat(varBasicValue);
var Sgst = parseFloat(Sgst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_SGST; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
function calculateIgstTax(varBasicValue, Igst) {
var basicValue = parseFloat(varBasicValue);
var Igst = parseFloat(Igst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function() {
var otherPayment = '<?php echo $otherPayment; ?>';
if ($('#PaymentMethod').val().trim() == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val(otherPayment);
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
$("#insuranceStatus").change(function() {
var InsNo = '<?php echo $InsuranceNumber; ?>';
if ($("#insuranceStatus").val() == "1") {
$('#insuranceTxtDiv').show();
$('#InsuranceNumber').val('Yes');
} else {
$('#insuranceTxtDiv').hide();
$('#InsuranceNumber').val('');
}
});
$('#drpFreight').change(function() {
var FreightType = $("#drpFreight").val();
if (FreightType == "PER TRIP") {
$('#TripsValue').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#NOOfTrips').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtFreight').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtAfterFreight').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#TripsValue').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#NOOfTrips').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtFreight').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtAfterFreight').parent().removeClass('col-md-2').addClass('col-md-3');
}
if ($('#AfterBasicPriceTax').val() != '') {
selValue = $("#drpFreight").val();
$('#txtFreight').val('');
$('#txtAfterFreight').val('');
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtFreight').attr('readonly', 'true');
$('#txtFreight').val('0.00');
} else {
$('#txtFreight').removeAttr('readonly', 'true');
$('#txtFreight').val('');
}
} else {
alert('Please Enter the Rate value');
$('#drpFreight').val("0");
$('#CPRate').focus();
}
calculateFreight(0);
});
$('#drpEditFreight').change(function() {
var FreightType = $("#drpEditFreight").val();
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#EditNOOfTrips').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtEditFreight').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtEditAfterFreight').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#EditTripsValue').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#EditNOOfTrips').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtEditFreight').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtEditAfterFreight').parent().removeClass('col-md-2').addClass('col-md-3');
}
if ($('#EditAfterBasicPriceTax').val() != '') {
selValue = $("#drpEditFreight").val();
$('#txtEditFreight').val('');
$('#txtEditAfterFreight').val('');
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtEditFreight').attr('readonly', 'true');
$('#txtEditFreight').val('0.00');
} else {
$('#txtEditFreight').removeAttr('readonly', 'true');
$('#txtEditFreight').val('');
}
} else {
alert('Please Enter the Rate value');
$('#drpEditFreight').val("0");
$('#EditCPRate').focus();
}
calculateFreight(1);
});
$('#drpViewFreight').change(function() {
var FreightType = $("#drpViewFreight").val();
if (FreightType == "PER TRIP") {
$('#ViewTripsValue').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#ViewNOOfTrips').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtViewFreight').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtViewAfterFreight').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#ViewTripsValue').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#ViewNOOfTrips').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtViewFreight').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtViewAfterFreight').parent().removeClass('col-md-2').addClass('col-md-3');
}
if ($('#ViewAfterBasicPriceTax').val() != '') {
selValue = $("#drpViewFreight").val();
$('#txtViewFreight').val('');
$('#txtViewAfterFreight').val('');
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtViewFreight').attr('readonly', 'true');
$('#txtViewFreight').val('0.00');
} else {
$('#txtViewFreight').removeAttr('readonly', 'true');
$('#txtViewFreight').val('');
}
} else {
alert('Please Enter the Rate value');
$('#drpViewFreight').val("0");
$('#ViewCPRate').focus();
}
calculateFreight(2);
});
function calculateFreight(isEdit) {
if (isEdit == '0') {
if ($('#AfterBasicPriceTax').val() == '') {
alert('Please Enter the Rate value');
$('#CPRate').focus();
$('#txtFreight').val('');
return false;
} else {
var basicValue = parseFloat($('#AfterBasicPriceTax').val());
var FreightType = $("#drpFreight").val();
if (FreightType == "0") {
alert('Please select Freight Type');
$('#txtFreight').val('');
$("#drpFreight").focus();
} else if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
var FreightValue = parseFloat($('#txtFreight').val());
var Quantity = parseFloat($('#CPQuantity').val());
var AfterFreight = 0.0;
if (FreightType == '<?php echo PERCENTAGE; ?>') {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
} else if (FreightType == '<?php echo NILTYPE; ?>') {
AfterFreight = 0.0;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
} else if (FreightType == '<?php echo PERUOM; ?>') {
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
} else if (FreightType == '<?php echo PERTRIP; ?>') {
if ($('#NOOfTrips').val() == '') {
alert('Please Enter No of Trip');
$("#NOOfTrips").focus();
$('#txtFreight').val(0)
AfterFreight = 0;
$('#txtAfterFreight').val("0.00");
return false;
} else {
var noOftrip = $("#NOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
} else {
AfterFreight = $("#txtFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreight').val(AfterFreightval);
} else {
$('#txtAfterFreight').val("0.00");
}
}
} else if (isEdit == '2') {
if ($('#ViewAfterBasicPriceTax').val() == '') {
alert('Please Enter the Rate value');
$('#ViewCPRate').focus();
$('#txtViewFreight').val('');
return false;
} else {
var basicValue = parseFloat($('#ViewAfterBasicPriceTax').val());
var FreightType = $("#drpViewFreight").val();
if (FreightType == "0") {
alert('Please select Freight Type');
$('#txtViewFreight').val('');
$("#drpViewFreight").focus();
} else if ($('#txtViewFreight').val() != "0" && $('#txtViewFreight').val() != '') {
var FreightValue = parseFloat($('#txtViewFreight').val());
var Quantity = parseFloat($('#ViewCPQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == '<?php echo PERCENTAGE; ?>') {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
} else if (FreightType == '<?php echo NILTYPE; ?>') {
AfterFreight = 0.0;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
} else if (FreightType == '<?php echo PERUOM; ?>') {
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
} else if (FreightType == '<?php echo PERTRIP; ?>') {
if ($('#ViewNOOfTrips').val() == '') {
alert('Please Enter No of Trip');
$("#ViewNOOfTrips").focus();
$('#txtViewFreight').val(0)
AfterFreight = 0;
$('#txtViewAfterFreight').val("0.00");
return false;
} else {
var noOftrip = $("#ViewNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
} else {
AfterFreight = $("#txtViewFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtViewAfterFreight').val(AfterFreightval);
} else {
$('#txtViewAfterFreight').val("0.00");
}
}
} else if (isEdit == '3') {
if ($('#AfterBasicPriceTax').val() != '') {
var basicValue = parseFloat($('#AfterBasicPriceTax').val());
var FreightType = $("#drpFreight").val();
if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
var FreightValue = parseFloat($('#txtFreight').val());
var Quantity = parseFloat($('#CPQuantity').val());
var AfterFreight = 0.0;
if (FreightType == '<?php echo PERCENTAGE; ?>') {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
} else if (FreightType == '<?php echo NILTYPE; ?>') {
AfterFreight = 0.0;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
} else if (FreightType == '<?php echo PERUOM; ?>') {
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
} else if (FreightType == '<?php echo PERTRIP; ?>') {
if ($('#NOOfTrips').val() == '') {
alert('Please Enter No of Trip');
$("#NOOfTrips").focus();
$('#txtFreight').val(0)
AfterFreight = 0;
$('#txtAfterFreight').val("0.00");
return false;
} else {
var noOftrip = $("#NOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
} else {
AfterFreight = $("#txtFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreight').val(AfterFreightval);
} else {
$('#txtAfterFreight').val("0.00");
}
}
} else if (isEdit == '4') {
if ($('#EditAfterBasicPriceTax').val() != '') {
var basicValue = parseFloat($('#EditAfterBasicPriceTax').val());
var FreightType = $("#drpEditFreight").val();
if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
var FreightValue = parseFloat($('#txtEditFreight').val());
var Quantity = parseFloat($('#EditCPQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == '<?php echo PERCENTAGE; ?>') {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
} else if (FreightType == '<?php echo NILTYPE; ?>') {
AfterFreight = 0.0;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
} else if (FreightType == '<?php echo PERUOM; ?>') {
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
} else if (FreightType == '<?php echo PERTRIP; ?>') {
if ($('#EditNOOfTrips').val() == '') {
alert('Please Enter No of Trip');
$("#EditNOOfTrips").focus();
$('#txtEditFreight').val(0)
AfterFreight = 0;
$('#txtEditAfterFreight').val("0.00");
return false;
} else {
var noOftrip = $("#EditNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
} else {
AfterFreight = $("#txtEditFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtEditAfterFreight').val(AfterFreightval);
} else {
$('#txtEditAfterFreight').val("0.00");
}
}
} else {
if ($('#EditAfterBasicPriceTax').val() == '') {
alert('Please Enter the Rate value');
$('#EditCPRate').focus();
$('#txtEditFreight').val('');
return false;
} else {
var basicValue = parseFloat($('#EditAfterBasicPriceTax').val());
var FreightType = $("#drpEditFreight").val();
if (FreightType == "0") {
alert('Please select Freight Type');
$('#txtEditFreight').val('');
$("#drpEditFreight").focus();
} else if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
var FreightValue = parseFloat($('#txtEditFreight').val());
var Quantity = parseFloat($('#EditCPQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == '<?php echo PERCENTAGE; ?>') {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
} else if (FreightType == '<?php echo NILTYPE; ?>') {
AfterFreight = 0.0;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
} else if (FreightType == '<?php echo PERUOM; ?>') {
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
} else if (FreightType == '<?php echo PERTRIP; ?>') {
if ($('#EditNOOfTrips').val() == '') {
alert('Please Enter No of Trip');
$("#EditNOOfTrips").focus();
$('#txtEditFreight').val(0)
AfterFreight = 0;
$('#txtEditAfterFreight').val("0.00");
return false;
} else {
var noOftrip = $("#EditNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
} else {
AfterFreight = $("#txtEditFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtEditAfterFreight').val(AfterFreightval);
} else {
$('#txtEditAfterFreight').val("0.00");
}
}
}
}
/* Capital Discount calcualation */
$('#DiscountType').change(function() {
if ($('#CPRate').val() != '') {
selValue = $("#DiscountType").val();
$('#txtDiscount').val('');
$('#txtAfterDiscount').val('');
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtDiscount').attr('readonly', 'true');
$('#txtDiscount').val('0.00');
$('#txtAfterDiscount').val('0.00');
} else {
$('#txtDiscount').removeAttr('readonly', 'true');
$('#txtDiscount').val('');
$('#txtAfterDiscount').val('');
}
} else {
alert('Please Rate Field Value');
$('#CPRate').focus();
}
Ratechange();
});
$('#EditDiscountType').change(function() {
if ($('#EditCPRate').val() != '') {
selValue = $("#EditDiscountType").val();
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val("0.00");
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtEditDiscount').attr('readonly', 'true');
$('#txtEditDiscount').val('0.00');
$('#txtEditAfterDiscount').val('0.00');
} else {
$('#txtEditDiscount').removeAttr('readonly', 'true');
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val("0.00");
}
} else {
alert('Please Select MaterialCode and Rate Field Value');
$('#EditDiscountType').val("0");
$('#EditCPRate').focus();
}
EditRatechange();
});
/*
* To calcuate the Discount */
function calculateDiscount(isEdit) {
if (isEdit == '0') {
if ($('#CPRate').val() == '') {
alert('Please Enter the Rate value');
$('#CPRate').focus();
$('#txtDiscount').val('');
return false;
}
if ($('#CPRate').val() != '') {
var basicValue = parseFloat($('#CPTotalAmount').val());
var DiscountType = $("#DiscountType").val();
if (DiscountType == "0") {
alert('Please Select the discount Type');
$('#txtDiscount').val('');
$("#DiscountType").focus();
} else if ($('#txtDiscount').val() != '' && $('#txtDiscount').val() != '0') {
var AfterDiscount = 0.0;
var Discountval = parseFloat($('#txtDiscount').val());
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
AfterDiscount = "0.00";
} else {
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
}
var discount = parseFloat(AfterDiscount).toFixed(2);
$('#txtAfterDiscount').val(discount);
} else {
$('#txtAfterDiscount').val("0.00");
}
Ratechange();
}
} else {
if ($('#EditCPRate').val() != '') {
var basicValue = parseFloat($('#EditCPTotalAmount').val());
var DiscountType = $("#EditDiscountType").val();
if (DiscountType == "0") {
alert('Please Select the discount Type');
$('#txtEditDiscount').val('');
$("#EditDiscountType").focus();
} else if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') {
var AfterDiscount = 0.0;
var Discountval = parseFloat($('#txtEditDiscount').val());
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
AfterDiscount = "0.00";
} else {
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
}
var discount = parseFloat(AfterDiscount).toFixed(2);
$('#txtEditAfterDiscount').val(discount);
} else {
$('#txtEditAfterDiscount').val("0.00");
}
EditRatechange();
}
}
}
function updateDiscountValuesChange(totAmt, disType, disAmt) {
var basicValue = totAmt;
var DiscountType = disType;
var AfterDiscount = 0.0;
var Discountval = parseFloat(disAmt);
if (DiscountType == '<?php echo PERCENTAGE; ?>') {
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
} else if (DiscountType == '<?php echo NILTYPE; ?>') {
AfterDiscount = "0.00";
} else {
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
}
var discount = parseFloat(AfterDiscount).toFixed(2);
return discount;
}
function PageRedirect() {
window.location = "poapproval";
}
var edit = '';
$('#drpFreightloc').change(function() {
var FreightType = $("#drpFreightloc").val();
if (FreightType == "PER TRIP") {
$('#TripsValueloc').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#NOOfTripsloc').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtFreightloc').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtAfterFreightloc').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#TripsValueloc').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#NOOfTripsloc').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtFreightloc').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtAfterFreightloc').parent().removeClass('col-md-2').addClass('col-md-3');
}
if ($('#Rate').val() != '' && $('#MaterialCode').val() != "0") {
selValue = $("#drpFreightloc").val();
$('#txtFreightloc').val('');
$('#txtAfterFreight').val('');
var PackagingCalculation = '';
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtFreightloc').attr('readonly', 'true');
$('#txtFreightloc').val('0.00');
}
if (selValue == '<?php echo PERCENTAGE; ?>') {
var PackagingCalculation = '';
edit = 'FreightCalculationOn';
$('#packagingcalmodel').modal('show');
//PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
} else {
$('#txtFreightloc').removeAttr('readonly', 'true');
$('#txtFreightloc').val('');
calculateFreightlocaddper()
}
} else {
alert('Please Select MaterialCode and Rate Field Value');
$('#drpFreightloc').val("0");
$('#Rate').focus();
}
});
$('#packagingcalmodel').on('hidden.bs.modal', function() {
console.log("add form ");
$('#CAPITAL').modal('show');
});
function calculateFreightlocaddper() {
var Calculation = document.querySelector('input[name = "optPackaging"]:checked').value;
var FreightType = $("#drpFreightloc").val();
$('#packagingcalmodel').modal('hide');
$('#CAPITAL').modal('show');
if (FreightType == '<?php echo PERCENTAGE; ?>') {
$('#txtAfterFreightloc').val('');
if (Calculation == 0) {
var basicValue = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
} else if (Calculation == 1) {
var basicinrValue = $('#CPTotalAmount').val() == '' ? '0.00' : $('#CPTotalAmount').val();
var discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
var basicValue = basicinrValue - discount;
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
}
} else if (FreightType == '<?php echo NILTYPE; ?>') {
$('#txtAfterFreightloc').val('');
AfterFreight = 0.00;
$('#txtFreightloc').val('');
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
document.getElementById("txtAfterFreightloc").readOnly = true;
document.getElementById("txtFreightloc").readOnly = true;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
$('#txtAfterFreightloc').val('');
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
document.getElementById("txtAfterFreightloc").readOnly = true;
} else if (FreightType == '<?php echo PERUOM; ?>') {
$('#txtAfterFreightloc').val('');
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
var Quantity = $('#CPQuantity').val() == '' ? '0.00' : $('#CPQuantity').val();
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
} else if (FreightType == '<?php echo PERTRIP; ?>') {
$('#txtAfterFreightloc').val('');
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
var noOftrip = $('#NOOfTripsloc').val() == '' ? '0.00' : $('#NOOfTripsloc').val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
} else {
$('#txtAfterFreightloc').val('');
var FreightValue = $('#txtFreightloc').val() == '' ? '0.00' : $('#txtFreightloc').val();
var txtAfterFreightloc = parseFloat(FreightValue).toFixed(2);
$('#txtAfterFreightloc').val(txtAfterFreightloc);
}
Ratechange();
}
$('#drpFreighteditloc').change(function() {
var FreightType = $("#drpFreighteditloc").val();
if (FreightType == '<?php echo PERTRIP; ?>') {
$('#TripsValuelocedit').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#TripsValuelocedit').removeClass('col-md-3').addClass('col-md-2');
$('#txtFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtAfterFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#TripsValuelocedit').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#TripsValuelocedit').removeClass('col-md-2').addClass('col-md-3');
$('#txtFreightlocedit').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtAfterFreightlocedit').parent().removeClass('col-md-2').addClass('col-md-3');
}
if ($('#EditCPRate').val() != '' && $('#EditMaterialCode').val() != "0") {
selValue = $("#drpFreighteditloc").val();
$('#txtFreightlocedit').val('');
$('#txtAfterFreightlocedit').val('');
var PackagingCalculation = '';
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtFreightlocedit').attr('readonly', 'true');
$('#txtFreightlocedit').val('0.00');
}
if (selValue == '<?php echo PERCENTAGE; ?>') {
var PackagingCalculation = '';
$('#editpackagingcalmodel').modal('show');
//PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
} else {
// $('#txtFreightlocedit').removeAttr( 'readonly','true' );
$('#txtFreightlocedit').val('');
calculateFreightloceditper()
}
} else {
alert('Please Select MaterialCode and Rate Field Value');
$('#drpFreighteditloc').val("0");
$('#Rate').focus();
}
});
function calculateFreightloceditper() {
var Calculation = document.querySelector('input[name = "editoptPackaging"]:checked').value;
var FreightType = $("#drpFreighteditloc").val();
if (FreightType == '<?php echo PERCENTAGE; ?>') {
$('#txtAfterFreightlocedit').val('');
if (Calculation == 0) {
var basicValue = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
} else if (Calculation == 1) {
var basicinrValue = $('#EditCPTotalAmount').val() == '' ? '0.00' : $('#EditCPTotalAmount').val();
var discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
var basicValue = basicinrValue - discount;
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
}
} else if (FreightType == '<?php echo NILTYPE; ?>') {
$('#txtAfterFreightlocedit').val('');
AfterFreight = 0.00;
$('#txtFreightlocedit').val('');
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
document.getElementById("txtAfterFreightlocedit").readOnly = true;
document.getElementById("txtFreightlocedit").readOnly = true;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
$('#txtAfterFreightlocedit').val('');
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
document.getElementById("txtAfterFreightlocedit").readOnly = true;
} else if (FreightType == '<?php echo PERUOM; ?>') {
$('#txtAfterFreightlocedit').val('');
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
var Quantity = $('#EditCPQuantity').val() == '' ? '0.00' : $('#EditCPQuantity').val();
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
} else if (FreightType == '<?php echo PERTRIP; ?>') {
$('#txtAfterFreightlocedit').val('');
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
var noOftrip = $('#NOOfTripslocedit').val() == '' ? '0.00' : $('#NOOfTripslocedit').val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
} else {
$('#txtAfterFreightlocedit').val('');
var FreightValue = $('#txtFreightlocedit').val() == '' ? '0.00' : $('#txtFreightlocedit').val();
var txtAfterFreightloc = parseFloat(FreightValue).toFixed(2);
$('#txtAfterFreightlocedit').val(txtAfterFreightloc);
}
EditRatechange();
$('#editpackagingcalmodel').modal('hide');
}
$('#drpFreightviewloc').change(function() {
var FreightType = $("#drpFreightviewloc").val();
if (FreightType == '<?php echo PERTRIP; ?>') {
$('#TripsValuelocview').show();
$(this).parent().removeClass('col-md-3').addClass('col-md-2');
$('#NOOfTripslocview').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtFreightlocview').parent().removeClass('col-md-3').addClass('col-md-2');
$('#txtAfterFreightlocview').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#TripsValuelocview').hide();
$(this).parent().removeClass('col-md-2').addClass('col-md-3');
$('#NOOfTripslocview').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtFreightlocview').parent().removeClass('col-md-2').addClass('col-md-3');
$('#txtAfterFreightlocview').parent().removeClass('col-md-2').addClass('col-md-3');
}
selValue = $("#drpFreightviewloc").val();
$('#txtFreightlocview').val('');
$('#txtAfterFreightlocview').val('');
var PackagingCalculation = '';
if (selValue == '<?php echo NILTYPE; ?>') {
$('#txtFreightlocview').attr('readonly', 'true');
$('#txtFreightlocview').val('0.00');
}
if (selValue == '<?php echo PERCENTAGE; ?>') {
$('#viewpackagingcalmodel').modal('show');
//PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
} else {
// $('#txtFreightlocedit').removeAttr( 'readonly','true' );
$('#txtFreightlocview').val('');
calculateFreightlocviewper()
}
});
function calculateFreightlocviewper() {
var Calculation = document.querySelector('input[name = "viewoptPackaging"]:checked').value;
var FreightType = $("#drpFreightviewloc").val();
$('#viewpackagingcalmodel').modal('hide');
if (FreightType == '<?php echo PERCENTAGE; ?>') {
$('#txtAfterFreightlocview').val('');
if (Calculation == 0) {
var basicValue = $('#ViewCPTotalAmount').val() == '' ? '0.00' : $('#ViewCPTotalAmount').val();
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
} else if (Calculation == 1) {
var basicinrValue = $('#ViewCPTotalAmount').val() == '' ? '0.00' : $('#ViewCPTotalAmount').val();
var discount = $('#txtViewAfterDiscount').val() == '' ? '0.00' : $('#txtViewAfterDiscount').val();
var basicValue = basicinrValue - discount;
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
var AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
}
} else if (FreightType == '<?php echo NILTYPE; ?>') {
$('#txtAfterFreightlocview').val('');
AfterFreight = 0.00;
$('#txtFreightlocview').val('');
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
//document.getElementById("txtAfterFreightlocview").readOnly = true;
document.getElementById("txtFreightlocview").readOnly = true;
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
$('#txtAfterFreightlocview').val('');
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
document.getElementById("txtAfterFreightlocview").readOnly = true;
} else if (FreightType == '<?php echo PERUOM; ?>') {
$('#txtAfterFreightlocview').val('');
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
var Quantity = $('#ViewCPQuantity').val() == '' ? '0.00' : $('#ViewCPQuantity').val();
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
} else if (FreightType == '<?php echo PERTRIP; ?>') {
$('#txtAfterFreightlocview').val('');
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
var noOftrip = $('#NOOfTripslocview').val() == '' ? '0.00' : $('#NOOfTripslocview').val();
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
var txtAfterFreightloc = parseFloat(AfterFreight).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
} else {
$('#txtAfterFreightlocview').val('');
var FreightValue = $('#txtFreightlocview').val() == '' ? '0.00' : $('#txtFreightlocview').val();
var txtAfterFreightloc = parseFloat(FreightValue).toFixed(2);
$('#txtAfterFreightlocview').val(txtAfterFreightloc);
}
ViewRatechange();
}
$('.UpdateViewCapital').click(function() {
var FreightType = $('#drpFreightviewloc').val();
var FreightRate = $('#txtFreightlocview').val();
var FreightRateAmount = $('#txtAfterFreightlocview').val();
var Nooftrip = $('#NOOfTripslocview').val();
var FreightTypename = $('#drpFreightviewloc').val();
if (FreightTypename != "PER TRIP") {
Nooftrip = '';
}
var tr = document.getElementById(userid);
$('#Ftype' + userid).val(FreightType);
$('#NoTrip' + userid).val(Nooftrip);
$('#Fvalue' + userid).val(FreightRate);
$('#Afvalue' + userid).val(FreightRateAmount);
populateValueMainFormForupdateCapitalTax();
});
function populateValueMainFormForupdateCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length;
var TotalFreight = 0;
var i = 0;
do {
i += 1;
var tr = document.getElementById(i);
if (tr != null) {
cells = tr.getElementsByTagName('td');
var rowid = cells[0].innerHTML;
var Frieght = $('#Afvalue' + rowid).val() == '' ? '0.00' : $('#Afvalue' + rowid).val();
TotalFreight = parseFloat(TotalFreight) + parseFloat(Frieght);
}
} while (i < rows);
$('#TotalFreight').val(parseFloat(TotalFreight).toFixed(2));
}
function EditCalculateloadingcharge() {
//alert();
var txtlanding = 0;
var txtbasicprice = 0;
var asss = 0;
txtlanding = parseFloat($('#EditLandingCharge').val() == '' ? '0.00' : $('#EditLandingCharge').val());
//txtlanding=parseFloat($('#EditLandingCharge').val());
//txtbasicprice=parseFloat($('#EditAfterBasicPriceTax').val());
txtbasicprice = parseFloat($('#EditAfterBasicPriceTax').val() == '' ? '0.00' : $('#EditAfterBasicPriceTax').val());
// console.log(txtbasicprice);
var result = <?php echo LOADING_CHARGE; ?>;
//console.log(result);
asss = result;
//console.log(asss);
// var Assessable= <?php echo ASSESSBLE; ?>;
var Assessable = parseFloat(txtbasicprice) + parseFloat(asss);
//console.log(Assessable);
//alert(Assessable);
$('#EditAfterLandingCharge').val(result.toFixed(2));
$('#EditAfterAssessable').val(Assessable);
EditCalculateCustomduty();
//alert();
}
function EditCalculateCustomduty() {
var txtbasic = 0;
var txtcustompercentage = 0;
var txthighse = 0;
var txtlandingch = 0;
var sumcustom = 0;
var txtcustomduty = 0;
//var accessible=parseFloat($('#EditAfterAssessable').val());
var accessible = parseFloat($('#EditAfterAssessable').val() == '' ? '0.00' : $('#EditAfterAssessable').val());
// var txtcustompercentage=parseFloat($('#EditCustomduty').val());
var txtcustompercentage = parseFloat($('#EditCustomduty').val() == '' ? '0.00' : $('#EditCustomduty').val());
//sumcustom=txthighse+txtlandingch+txtbasic;
txtcustomduty = <?php echo CUSTOM_DUTY1; ?>;
if (isNaN(txtcustomduty)) {
$('#EditAfterCustomduty').val('');
} else {
$('#EditAfterCustomduty').val(parseFloat(txtcustomduty).toFixed(2));
}
EditCalculateCustomEdcess();
}
function EditCalculateCustomEdcess() {
var txtloading = 0;
var txthighses = 0;
var txtcustomduty1 = 0;
var txtexciseduty = 0;
var txtedexciseduty = 0;
var txtshexcisesess = 0;
var totalval = 0;
var txtedcesspercentage = 0;
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
var txtcustomedsess = 0;
//txtcustomduty1=parseFloat($('#EditAfterCustomduty').val());
//txtedcesspercentage=parseFloat($('#EditCustomEDcess').val());
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
txtcustomduty1 = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
// txtedcesspercentage=parseFloat($('#CustomEDcess').val());
txtedcesspercentage = parseFloat($('#EditCustomEDcess').val() == '' ? '0.00' : $('#EditCustomEDcess').val());
txtcustomedsess = <?php echo CUSTOM_ED1; ?>;
if (isNaN(txtcustomedsess)) {
$('#EditAfterCustomEDcess').val('');
} else {
$('#EditAfterCustomEDcess').val(parseFloat(txtcustomedsess).toFixed(2));
}
EditCalculateCustomSHcess();
}
function EditCalculateCustomSHcess() { //alert();
var landingch = 0;
var highsesssalles = 0;
var customch = 0;
var excisech = 0;
var exciseedch = 0;
var exciseshch = 0;
var totcustomsh = 0;
var txtshpercentage = 0;
//var totresult=(totcustomsh*txtshpercentage)/100;
var totresult = 0;
var basucprice = parseFloat($('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val());
//landingch=parseFloat($('#EditAfterLandingCharge').val());
landingch = parseFloat($('#EditAfterLandingCharge').val() == '' ? '0.00' : $('#EditAfterLandingCharge').val());
//highsesssalles=parseFloat($('#EditAfterHighseas').val());
// customch=parseFloat($('#EditAfterCustomduty').val());
customch = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
//excisech=parseFloat($('#EditAfterExcisedutyTax').val());
totcustomsh = landingch + highsesssalles + customch + excisech + exciseedch + exciseshch;
//txtshpercentage=parseFloat($('#EditCustomSHcess').val());
txtshpercentage = $('#EditCustomSHcess').val() == '' ? '0.00' : $('#EditCustomSHcess').val()
//var totresult=(totcustomsh*txtshpercentage)/100;
var totresult = <?php echo CUSTOM_SH1; ?>;
if (isNaN(totresult)) {
$('#EditAfterCustomSHcess').val('');
} else {
$('#EditAfterCustomSHcess').val(parseFloat(totresult).toFixed(2));
}
//EditCalculateaddlExciseDuty();
EditCalculateIgst()
}
function EditCalculateIgst() {
// var custom=parseFloat($('#EditAfterCustomduty').val());
// var customsh=parseFloat($('#EditAfterCustomSHcess').val());
// var customed=parseFloat($('#EditAfterCustomEDcess').val());
// var assessble=parseFloat($('#EditAfterAssessable').val());
var custom = parseFloat($('#EditAfterCustomduty').val() == '' ? '0.00' : $('#EditAfterCustomduty').val());
var customsh = parseFloat($('#EditAfterCustomSHcess').val() == '' ? '0.00' : $('#EditAfterCustomSHcess').val());
var customed = parseFloat($('#EditAfterCustomEDcess').val() == '' ? '0.00' : $('#EditAfterCustomEDcess').val());
var assessble = parseFloat($('#EditAfterAssessable').val() == '' ? '0.00' : $('#EditAfterAssessable').val());
var tot = <?php echo SUBTOTAL; ?>;
//console.log(tot);
//var igstpercentage=parseFloat($('#EditIgst').val());
var igstpercentage = $('#EditIgstInt').val() == '' ? '0.00' : $('#EditIgstInt').val()
var afterigst = <?php echo IGST; ?>;
if (isNaN(tot)) {
$('#EditSubtotal').val('');
} else {
$('#EditSubtotal').val(parseFloat(tot).toFixed(2));
}
if (isNaN(afterigst)) {
$('#EditAfterIgstInt').val('');
} else {
$('#EditAfterIgstInt').val(parseFloat(afterigst).toFixed(2));
}
var grossexp = custom + customsh + customed + afterigst;
var txtgrossduty = <?php echo GROSS_DUTY1; ?>;
;
if (isNaN(txtgrossduty)) {
$('#EditGrossdutypayable').val('');
} else {
$('#EditGrossdutypayable').val(parseFloat(txtgrossduty).toFixed(2));
}
EditCalculateCtable()
}
function EditCalculateCtable() {
var quantity = 0;
var txtbasicinrprice = 0;
var txtpurchaserate = 0;
var txtgrossexp = 0;
var txtcustomdutyexp = 0;
var txtrmc = 0;
var total = 0;
var basicamt = 0;
var qty = parseFloat($('#EditQuantity').val());
var igst = parseFloat($('#EditAfterIgstInt').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($('#EditCPQuantity').val());
var clearing = $('#EditClearingCharges').val() == '' ? '0.00' : $('#EditClearingCharges').val();
var basicres = <?php echo MATBYQTY; ?>;
var clear = <?php echo CLEARINGQTY; ?>;
//console.log(basicres);
//console.log(clear);
var basicnett = parseFloat(basicres) + parseFloat(clear) + parseFloat(customdutyexp);
//console.log(basicnett);
if (isNaN(basicnett)) {
$('#EditNett').val('');
} else {
$('#EditNett').val((basicnett).toFixed(2));
}
}
function Calculateloadingcharge() {
//alert();
$('#AfterHighseas').val('');
$('#AfterCustomduty').val('');
$('#AfterExcisedutyTax').val('');
$('#AfterExcisedutyEDcess').val('');
$('#AfterExcisedutySHcess').val('');
$('#AfterCustomEDcess').val('');
$('#AfterCustomSHcess').val('');
$('#AfterAdditionalExciseduty').val('');
$('#Grossdutypayable').val('');
$('#AvailableModvat').val('');
$('#Grossexpenses').val('');
$('#purchaserate').val('');
$('#CustomDutyExpenses').val('');
$('#RMCIncludingCustomers').val('');
var txtlanding = 0;
var txtbasicprice = 0;
//txtlanding=$('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val()
txtlanding = parseFloat($('#LandingCharge').val() == '' ? '0.00' : $('#LandingCharge').val());
//$('#Rate').val() == '' ? '0.00' : $('#Rate').val()
//txtbasicprice=parseFloat($('#AfterBasicPriceTax').val());
txtbasicprice = parseFloat($('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val());
//var result=(txtlanding*txtbasicprice/100);
var result = <?php echo LOADING_CHARGE; ?>;
var assessble = parseFloat(result) + parseFloat(txtbasicprice);
var assessble = <?php echo ASSESSBLE; ?>;
//$('#AfterLandingCharge').val(parseFloat(Math.round(result)));
if (isNaN(result)) {
$('#AfterLandingCharge').val('');
$('#AfterAssessable').val(txtbasicprice.toFixed(2));
} else {
$('#AfterLandingCharge').val(result.toFixed(2));
//$('#AfterAssessable').val(assessble.toFixed(2));
}
if (isNaN(assessble)) {
$('#AfterAssessable').val(txtbasicprice);
} else {
$('#AfterAssessable').val(assessble.toFixed(2));
}
CalculateCustomduty()
}
function CalculateCustomduty() {
var txtbasic = 0;
var txtcustompercentage = 0;
var txthighse = 0;
var txtlandingch = 0;
var sumcustom = 0;
var txtcustomduty = 0;
//var accessible=parseFloat($('#AfterAssessable').val());
var accessible = parseFloat($('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val());
//var txtcustompercentage=parseFloat($('#Customduty').val());
var txtcustompercentage = parseFloat($('#Customduty').val() == '' ? '0.00' : $('#Customduty').val());
txtcustomduty = <?php echo CUSTOM_DUTY1; ?>;
if (isNaN(txtcustomduty)) {
$('#AfterCustomduty').val('');
} else {
$('#AfterCustomduty').val(parseFloat(txtcustomduty).toFixed(2));
}
CalculateCustomEdcess()
}
function CalculateCustomEdcess() {
var txtloading = 0;
var txthighses = 0;
var txtcustomduty1 = 0;
var txtexciseduty = 0;
var txtedexciseduty = 0;
var txtshexcisesess = 0;
var totalval = 0;
var txtedcesspercentage = 0;
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
var txtcustomedsess = 0;
//txtcustomduty1=parseFloat($('#AfterCustomduty').val());
txtcustomduty1 = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
// txtedcesspercentage=parseFloat($('#CustomEDcess').val());
txtedcesspercentage = parseFloat($('#CustomEDcess').val() == '' ? '0.00' : $('#CustomEDcess').val());
//var txtcustomedsess=(totalval*txtedcesspercentage)/100;
txtcustomedsess = <?php echo CUSTOM_ED1; ?>;
if (isNaN(txtcustomedsess)) {
$('#AfterCustomEDcess').val('');
} else {
$('#AfterCustomEDcess').val(parseFloat(txtcustomedsess).toFixed(2));
}
CalculateCustomSHcess();
}
function CalculateCustomSHcess() { //alert();
var landingch = 0;
var customch = 0;
var totcustomsh = 0;
var txtshpercentage = 0;
var totresult = 0;
//customch=parseFloat($('#AfterCustomduty').val());
//console.log(customch);
customch = parseFloat($('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val());
//txtshpercentage=parseFloat($('#CustomSHcess').val());
txtshpercentage = parseFloat($('#CustomSHcess').val() == '' ? '0.00' : $('#CustomSHcess').val());
//var totresult=(totcustomsh*txtshpercentage)/100;
totresult = <?php echo CUSTOM_SH1; ?>;
if (isNaN(totresult)) {
$('#AfterCustomSHcess').val('');
} else {
$('#AfterCustomSHcess').val(parseFloat(totresult).toFixed(2));
}
//CalculateaddlExciseDuty();
CalculateIgst();
}
function CalculateIgst() {
var basucprice = parseFloat($('#AfterBasicPriceTax').val());
//var basucprice=$('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val();
var landing = parseFloat($('#AfterLandingCharge').val());
//var landing=$('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
var custom = parseFloat($('#AfterCustomduty').val());
//var custom=$('#AfterCustomduty').val() == '' ? '0.00' : $('#AfterCustomduty').val();
var customsh = parseFloat($('#AfterCustomSHcess').val());
//var customsh=$('#AfterCustomSHcess').val() == '' ? '0.00' : $('#AfterCustomSHcess').val();
var customed = parseFloat($('#AfterCustomEDcess').val());
//var customed=$('#AfterCustomEDcess').val() == '' ? '0.00' : $('#AfterCustomEDcess').val();
var assessble = parseFloat($('#AfterAssessable').val());
//var assessble=$('#AfterAssessable').val() == '' ? '0.00' : $('#AfterAssessable').val();
// var tot=parseFloat(assessble)+parseFloat(custom)+parseFloat(customsh)+
// parseFloat(customed);
var tot = <?php echo SUBTOTAL; ?>;
var igstpercentage = parseFloat($('#IgstInt').val());
var afterigst = <?php echo IGST; ?>;
if (isNaN(tot)) {
$('#Subtotal').val('');
} else {
$('#Subtotal').val(parseFloat(tot).toFixed(2));
}
if (isNaN(afterigst)) {
$('#AfterIgstInt').val('');
} else {
$('#AfterIgstInt').val(parseFloat(afterigst).toFixed(2));
}
var grossexp = custom + customsh + customed + afterigst;
//$('#Grossdutypayable').val(parseFloat(grossexp).toFixed(2));
var txtgrossduty = <?php echo GROSS_DUTY1; ?>;
//console.log(grossexp);
if (isNaN(txtgrossduty)) {
$('#Grossdutypayable').val('');
} else {
$('#Grossdutypayable').val(parseFloat(txtgrossduty).toFixed(2));
}
CalculateCtable();
}
function CalculateCtable() {
var quantity = 0;
var txtbasicinrprice = 0;
var txtpurchaserate = 0;
var txtgrossexp = 0;
var txtcustomdutyexp = 0;
var txtrmc = 0;
var total = 0;
var basicamt = 0;
var qty = parseFloat($('#Quantity').val());
var igst = parseFloat($('#AfterIgstInt').val());
var totduty = parseFloat($('#Grossdutypayable').val());
var txtdutyimpact = <?php echo DUTYIMPACT; ?>;
// console.log(txtdutyimpact);
if (isNaN(txtdutyimpact)) {
$('#DutyImpact').val('');
} else {
$('#DutyImpact').val(parseFloat(txtdutyimpact).toFixed(2));
}
quantity = parseFloat($('#PurQuantity').val());
var dutyimpact = parseFloat($('#DutyImpact').val());
var peruom = <?php echo PURCHASE_RATE1; ?>;
if (isNaN(peruom)) {
$('#CustomDutyExpenses').val('');
} else {
$('#CustomDutyExpenses').val((peruom).toFixed(2));
}
var customdutyexp = $('#CustomDutyExpenses').val() == '' ? '0.00' : $('#CustomDutyExpenses').val();
var basicqtyval = $('#AfterBasicPriceTax').val() == '' ? '0.00' : $('#AfterBasicPriceTax').val();
var qty = parseFloat($('#CPQuantity').val());
var clearing = $('#ClearingCharges').val() == '' ? '0.00' : $('#ClearingCharges').val();
var basicres = <?php echo MATBYQTY; ?>;
var clear = <?php echo CLEARINGQTY; ?>;
var basicnett = parseFloat(basicres) + parseFloat(clear) + parseFloat(customdutyexp);
if (isNaN(basicnett)) {
$('#Nett').val('');
} else {
$('#Nett').val((basicnett).toFixed(2));
}
}
</script>
<script>
$(document).ready(function() {
// When the second modal is about to be shown
$('#packagingcalmodel').on('show.bs.modal', function() {
// Set a higher z-index for the second modal to appear on top
$('#packagingcalmodel').css('z-index', 1060); // Set the z-index for the second modal
// Ensure the second modal backdrop appears above the first one
setTimeout(function() {
$('.modal-backdrop').last().css('z-index', 1055);
}, 0);
});
// Reset z-index when the second modal is hidden (optional)
$('#packagingcalmodel').on('hidden.bs.modal', function() {
$('#packagingcalmodel').css('z-index', ''); // Reset to default
});
});
</script>
<script>
$(document).ready(function() {
// When the second modal is about to be shown
$('#editpackagingcalmodel').on('show.bs.modal', function() {
// Set a higher z-index for the second modal to appear on top
$('#editpackagingcalmodel').css('z-index', 1060); // Set the z-index for the second modal
// Ensure the second modal backdrop appears above the first one
setTimeout(function() {
$('.modal-backdrop').last().css('z-index', 1055);
}, 0);
});
// Reset z-index when the second modal is hidden (optional)
$('#editpackagingcalmodel').on('hidden.bs.modal', function() {
$('#editpackagingcalmodel').css('z-index', ''); // Reset to default
});
});
</script>