5851 lines
202 KiB
PHP
Executable File
5851 lines
202 KiB
PHP
Executable File
<script>
|
||
$(document).ready(function () {
|
||
// When the second modal is about to be shown
|
||
$('#freightcalmodel').on('show.bs.modal', function () {
|
||
// Set a higher z-index for the second modal to appear on top
|
||
$('#freightcalmodel').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)
|
||
$('#freightcalmodel').on('hidden.bs.modal', function () {
|
||
$('#freightcalmodel').css('z-index', ''); // Reset to default
|
||
});
|
||
|
||
$('#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>
|
||
<?php $ReqType = '';
|
||
$CompanyAddress = '';
|
||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||
$CurrentDate = $dt->format('d-m-Y');
|
||
$MaxPoDate = '';
|
||
$AvlAmount = 0;
|
||
$DeliverSchedule = '';
|
||
$DeliverOption = '';
|
||
$StatusName = '';
|
||
$modeofshipment = '';
|
||
$supplierref = '';
|
||
$suppofferno = '';
|
||
$otherref = '';
|
||
$revenuesubtype = '';
|
||
$insurencestatus = '';
|
||
$insurenceno = '';
|
||
$parentPO = '';
|
||
if (!empty($MaxPODate)) {
|
||
foreach ($MaxPODate as $date) {
|
||
$MaxPoDate = $date->PODate;
|
||
}
|
||
}
|
||
if (!empty($CompanyDetails)) {
|
||
foreach ($CompanyDetails as $Req) {
|
||
$CompanyAddress = $Req->Address;
|
||
}
|
||
}
|
||
if (!empty($AvlBudAmt)) {
|
||
|
||
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
|
||
}
|
||
if (!empty($INRSYMBOL)) {
|
||
foreach ($INRSYMBOL as $INRS) {
|
||
$INRSYM = $INRS->FontCode2000;
|
||
}
|
||
}
|
||
foreach ($PaymentTerms as $TER) {
|
||
$Terms = $TER->PaymentTerms;
|
||
}
|
||
|
||
$SupId = '';
|
||
$SupName = '';
|
||
$Address = '';
|
||
$PODate = '';
|
||
$Deliverydt = '';
|
||
$DeliveryAddress = '';
|
||
$PONOStatus = '';
|
||
$PONO = '';
|
||
$totBasicAmt = 0;
|
||
$totDiscountAmt = 0.0;
|
||
$totPackagingAmt = 0.0;
|
||
$totCgst = 0.0;
|
||
$totSgst = 0.0;
|
||
$totIgst = 0.0;
|
||
$totFreightAmt = 0.0;
|
||
$totInsuranceAmt = 0.0;
|
||
$totOrderSummaryAmt = 0.0;
|
||
|
||
$ServiceDescription = '';
|
||
$CapitalRange = '';
|
||
$otherPayment = '';
|
||
$BudgetType = '';
|
||
$PrePOFile = '';
|
||
$Reqon = '';
|
||
$RequesterName = '';
|
||
|
||
if (!empty($POMaster)) {
|
||
//print_r($POMaster);
|
||
//print_r($POItem);
|
||
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');
|
||
|
||
|
||
|
||
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
|
||
if ($IsOpenOrder !== null && (int) $IsOpenOrder !== 0) {
|
||
$isChecked = true;
|
||
} else {
|
||
$isChecked = false;
|
||
}
|
||
|
||
$DeliveryAddress = $Req->DeliveryAddress;
|
||
$PONOStatus = $Req->StatusCode;
|
||
$PONO = $Req->PONO;
|
||
$ServiceDescription = $Req->ServiceDescription;
|
||
$CapitalRange = $Req->CapitalRange;
|
||
$StatusName = $Req->StatusName;
|
||
$otherPayment = $Req->PaymentOtherDescription;
|
||
$modeofshipment = $Req->Mode_Of_Shipment;
|
||
$supplierref = $Req->Supplier_Reference;
|
||
$suppofferno = $Req->Supplier_Offer_No;
|
||
$otherref = $Req->Other_Reference;
|
||
$revenuesubtype = $Req->POSubType;
|
||
$insurencestatus = (int) $Req->InsuranceStatus;
|
||
$insurenceno = $Req->InsuranceNumber;
|
||
$BudgetType = $Req->BudgetType;
|
||
$IGRNO = $Req->IGRNO;
|
||
$PrePOFile = $Req->POFile;
|
||
// echo $otherPayment;
|
||
}
|
||
}
|
||
//echo $BudgetType;
|
||
if (!empty($RequistionDetails)) {
|
||
foreach ($RequistionDetails as $ReqDet) {
|
||
$Reqonn = new DateTime($ReqDet->ReqDate);
|
||
$Reqon = $Reqonn->format('d-m-Y');
|
||
|
||
// $Pdt = new DateTime($Req->PODate);
|
||
// $PODate = $Pdt->format('Y-m-d');
|
||
$Requestedby = $ReqDet->Requestedby;
|
||
$RequesterName = isset($ReqDet->FirstName) ? $ReqDet->FirstName : '';
|
||
//$Status=$ReqDet->Status;
|
||
}
|
||
}
|
||
// foreach ($POSTATUS as $PST )
|
||
// {
|
||
// $POStatus=$PST->StatusName;
|
||
// }
|
||
|
||
|
||
|
||
if (!empty($getlogpodtl)) {
|
||
foreach ($getlogpodtl as $values) {
|
||
$update = $values->FirstName;
|
||
}
|
||
} else {
|
||
$update = [];
|
||
}
|
||
?>
|
||
<style>
|
||
.modal {
|
||
overflow: auto !important;
|
||
}
|
||
|
||
/* #packagingcalmodel {
|
||
margin-top: 200px;
|
||
z-index: 1080 !important;
|
||
} */
|
||
|
||
/* #freightcalmodel {
|
||
margin-top: 200px;
|
||
z-index: 1080 !important;
|
||
} */
|
||
|
||
/* #ExciseDutyCalModel {
|
||
margin-top: 200px;
|
||
z-index: 1080 !important;
|
||
} */
|
||
|
||
/* #VatCalModel {
|
||
margin-top: 200px;
|
||
z-index: 1080 !important;
|
||
} */
|
||
|
||
/* #CSTCalModel {
|
||
margin-top: 200px;
|
||
z-index: 1080 !important;
|
||
} */
|
||
|
||
/* .modal {
|
||
padding-right: 30% ! important;
|
||
} */
|
||
</style>
|
||
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||
<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#Add_Service_Description",
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
|
||
tinymce.init({
|
||
selector: "textarea#Edit_Service_Description",
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#View_Service_Description",
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false,
|
||
readonly: 1
|
||
});
|
||
</script>
|
||
<script type="text/javascript">
|
||
var DelOpt = '<?php echo $DeliverOption; ?>';
|
||
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
|
||
var DelDt = '<?php echo $Deliverydt; ?>';
|
||
var insurancestatus = '<?php echo $insurencestatus; ?>';
|
||
var budgettype = '<?php echo $BudgetType; ?>';
|
||
// if(budgettype == 'CAPITAL')
|
||
// {
|
||
// alert('capital')
|
||
// document.getElementById('BudgetType').text = 2;
|
||
// document.getElementById('BudgetType').value = 'player';
|
||
// $('[name=BudgetType]').val(budgettype);
|
||
//}
|
||
//else
|
||
//{
|
||
// alert('revenue')
|
||
//document.getElementById('BudgetType').text = 1;
|
||
// document.getElementById('BudgetType').value = 'player';
|
||
//}
|
||
|
||
//alert(budgettype);
|
||
var InsuranceNumber = '<?php echo $insurenceno; ?>';
|
||
var statuscheck = '<?php echo $PONOStatus; ?>';
|
||
$(document).ready(function () {
|
||
//alert('capital-');
|
||
if (statuscheck == "<?php echo SPECIAL_PO; ?>") {
|
||
$('#splpodiv').show();
|
||
// var js_array =<?php echo json_encode($billfile); ?>;
|
||
|
||
// if(js_array.length === 0) {
|
||
// $('#table3').hide();
|
||
// }
|
||
|
||
} else {
|
||
$('#splpodiv').hide();
|
||
}
|
||
/*****************************/
|
||
var update = '<?php echo json_encode($update) ?>';
|
||
if (update != 'null') {
|
||
$('#editpodiv').show();
|
||
} else {
|
||
$('#editpodiv').hide();
|
||
}
|
||
/*****************************/
|
||
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
||
if (DelOpt == "0") {
|
||
$('#Deliverydtdiv').show();
|
||
$('#Schedulediv').hide();
|
||
$('#Deliverydt').val(DelDt);
|
||
} else if (DelOpt == "1") {
|
||
$('#Deliverydtdiv').hide();
|
||
$('#Schedulediv').show();
|
||
$('#Deliverydt').val('');
|
||
$('#Scheduleby').val(SchName);
|
||
}
|
||
var PaymentOther = '<?php echo $otherPayment; ?>';
|
||
var PayTerms = '<?php echo $Terms; ?>';
|
||
if (PayTerms == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
$('#Otherpayment').val(PaymentOther);
|
||
} else {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
}
|
||
// var insurancestatus = <?php echo $insurencestatus; ?>;
|
||
// var InsuranceNumber = <?php echo $insurenceno; ?>;
|
||
if (insurancestatus == 1) {
|
||
|
||
$('#insurancestatus').val(insurancestatus);
|
||
$("#InsuranceNumberdiv").show();
|
||
$('#InsuranceNumber').val(InsuranceNumber);
|
||
|
||
|
||
} else {
|
||
$('#insurancestatus').val(insurancestatus);
|
||
$('#InsuranceNumber').val("");
|
||
$("#InsuranceNumberdiv").hide();
|
||
}
|
||
});
|
||
</script>
|
||
<script>
|
||
var NilType = '<?php echo NILTYPE; ?>';
|
||
var PercentageType = '<?php echo PERCENTAGE; ?>';
|
||
var POMaxDate = '<?php echo $MaxPoDate; ?>';
|
||
var PackagingCalculation = '';
|
||
var FreightCalculation = '';
|
||
var ExciseCalculation = '';
|
||
var StateTaxCheck = '';
|
||
var VatCalculation = '';
|
||
var CSTCalculation = '';
|
||
var RequistQuantity = '';
|
||
var IsEdit = '0';
|
||
var d = new Date(POMaxDate);
|
||
var SelectedMaterialCode = [];
|
||
var CollIndex = 0;
|
||
var SelectedMaterialList = {
|
||
Mat: []
|
||
};
|
||
// alert(new Date(year,month,day));
|
||
$(function () {
|
||
|
||
$("#PODate").datepicker({
|
||
//minDate : d,
|
||
//maxDate : 'now',
|
||
dateFormat: 'dd-mm-yy',
|
||
changeMonth: false,
|
||
changeYear: false
|
||
}); //,yearRange: '-100:+0'
|
||
$("#Deliverydt").datepicker({
|
||
minDate: 'now',
|
||
dateFormat: 'dd-mm-yy',
|
||
changeMonth: true,
|
||
changeYear: true,
|
||
yearRange: '0:+10'
|
||
});
|
||
$("#PODate1").datepicker({
|
||
//minDate : d,
|
||
//maxDate : 'now',
|
||
dateFormat: 'dd-mm-yy',
|
||
changeMonth: false,
|
||
changeYear: false
|
||
});
|
||
$("#MaterialRcvdDate,#InvDate").datepicker({
|
||
//minDate : d,
|
||
//maxDate : 'now',
|
||
dateFormat: 'dd-mm-yy',
|
||
changeMonth: false,
|
||
changeYear: false
|
||
});
|
||
|
||
|
||
$('#drpSupplier').change(function () {
|
||
var cd = $("#drpSupplier option:selected").text();
|
||
//alert(cd);
|
||
$("#changeSup").val(cd);
|
||
|
||
var id = $('#drpSupplier').val();
|
||
$("#SupAddress").val('');
|
||
|
||
if (id != '0') {
|
||
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
||
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||
var PaymentID = '';
|
||
$('#PaymentTerms').empty();
|
||
|
||
$.each(y, function (idx, obj) {
|
||
if (obj.SupplierID === id) {
|
||
if (obj.MSME) {
|
||
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
|
||
} else {
|
||
$("#SupAddress").val(obj.Address);
|
||
}
|
||
PaymentID = obj.PaymentID;
|
||
|
||
|
||
}
|
||
|
||
});
|
||
if (PaymentID != 'PT08') {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
} else if (PaymentID == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
}
|
||
$.each(Payment, function (pay, payobj) {
|
||
if (payobj.PaymentID == PaymentID) {
|
||
|
||
|
||
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||
|
||
}
|
||
|
||
|
||
});
|
||
$.each(Payment, function (pay, payobj) {
|
||
if (payobj.PaymentID == PaymentID) {
|
||
|
||
} else {
|
||
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||
}
|
||
|
||
});
|
||
|
||
} else {
|
||
alert('Please select the SupplierID');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
$('#MaterialCode').change(function () {
|
||
|
||
var id = $('#MaterialCode').val();
|
||
$("#ItemName").val('');
|
||
$("#UOM").val('');
|
||
$("#Quantity").val('');
|
||
$("#ItemName").val('');
|
||
$("#Rate").val('');
|
||
$("#txtBasicValue").val('');
|
||
RequistQuantity = '';
|
||
resetTaxField();
|
||
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) {
|
||
$("#ItemName").val(obj.MaterialName);
|
||
$("#UOM").val(obj.UOM);
|
||
$("#Quantity").val(obj.Quantity);
|
||
RequistQuantity = obj.Quantity;
|
||
}
|
||
});
|
||
}
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
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);
|
||
}
|
||
});
|
||
|
||
});
|
||
$('#EditMaterialCode').change(function () {
|
||
|
||
var id = $('#EditMaterialCode').val();
|
||
$("#EditItemName").val('');
|
||
$("#EditUOM").val('');
|
||
$("#EditQuantity").val('');
|
||
$("#EditRate").val('');
|
||
$("#txtEditBasicValue").val('');
|
||
RequistQuantity = '';
|
||
resetTaxField();
|
||
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;
|
||
}
|
||
});
|
||
}
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
var d = $('#drpSupplier').val();
|
||
$('#loader').show();
|
||
$.ajax({
|
||
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
||
type: 'POST',
|
||
data: {
|
||
supplierid: d,
|
||
materialcode: id
|
||
},
|
||
success: function (response) {
|
||
$('#loader').show();
|
||
if (response) alert(response);
|
||
}
|
||
});
|
||
|
||
});
|
||
/* Revenue Tax calcualation */
|
||
$('#DiscountType').change(function () {
|
||
selValue = $("#DiscountType").val();
|
||
$('#txtDiscount').val('');
|
||
$('#txtAfterDiscount').val('');
|
||
if (selValue == NilType) {
|
||
|
||
$('#txtDiscount').attr('readonly', 'true');
|
||
$('#txtDiscount').val('0.00');
|
||
$('#txtAfterDiscount').val('0.00');
|
||
|
||
} else {
|
||
$('#txtDiscount').removeAttr('readonly', 'true');
|
||
$('#txtDiscount').val('');
|
||
$('#txtAfterDiscount').val('');
|
||
}
|
||
change();
|
||
|
||
});
|
||
$('#EditDiscountType').change(function () {
|
||
selValue = $("#EditDiscountType").val();
|
||
$('#txtEditDiscount').val('');
|
||
$('#txtEditAfterDiscount').val('');
|
||
if (selValue == NilType) {
|
||
|
||
$('#txtEditDiscount').attr('readonly', 'true');
|
||
$('#txtEditDiscount').val('0.00');
|
||
$('#txtEditAfterDiscount').val('0.00');
|
||
|
||
} else {
|
||
$('#txtEditDiscount').removeAttr('readonly', 'true');
|
||
$('#txtEditDiscount').val('');
|
||
$('#txtEditAfterDiscount').val('');
|
||
}
|
||
Editchange();
|
||
|
||
});
|
||
var edit = '';
|
||
$('#PackagingType').change(function () {
|
||
$('#txtPackaging').val('');
|
||
$('#txtAfterPackaging').val('');
|
||
selValue = $("#PackagingType").val();
|
||
if (selValue == PercentageType) {
|
||
// $('#REVENUE').modal('hide');
|
||
edit = 'PackingCalculationOn';
|
||
var PackagingCalculation = '';
|
||
$('#packagingcalmodel').modal('show');
|
||
$('#txtPackaging').removeAttr('readonly', 'true');
|
||
} else {
|
||
if (selValue == NilType) {
|
||
|
||
$('#txtPackaging').attr('readonly', 'true');
|
||
$('#txtPackaging').val('0.00');
|
||
change();
|
||
} else {
|
||
$('#txtPackaging').removeAttr('readonly', 'true');
|
||
}
|
||
}
|
||
calculatePackaging(0);
|
||
|
||
});
|
||
$('#packagingcalmodel').on('hidden.bs.modal', function () {
|
||
// Reopen the first modal when the second modal is closed
|
||
if (edit == 'PackingCalculationOn') {
|
||
$('#REVENUE').modal('show');
|
||
} else if (edit == 'EditPackingCalculationOn') {
|
||
$('#EDITREVENUE').modal('show');
|
||
}
|
||
});
|
||
$('#EditPackagingType').change(function () {
|
||
$('#txtEditPackaging').val('');
|
||
$('#txtEditAfterPackaging').val('');
|
||
selValue = $("#EditPackagingType").val();
|
||
if (selValue == PercentageType) {
|
||
// $('#EDITREVENUE').modal('hide');
|
||
var PackagingCalculation = '';
|
||
edit = 'EditPackingCalculationOn';
|
||
$('#packagingcalmodel').modal('show');
|
||
$('#txtEditPackaging').removeAttr('readonly', 'true');
|
||
} else {
|
||
if (selValue == NilType) {
|
||
|
||
$('#txtEditPackaging').attr('readonly', 'true');
|
||
$('#txtEditPackaging').val('0.00');
|
||
Editchange();
|
||
} else {
|
||
$('#txtEditPackaging').removeAttr('readonly', 'true');
|
||
}
|
||
}
|
||
calculatePackaging(1);
|
||
|
||
});
|
||
$('#txtExciseDuty').change(function () {
|
||
|
||
$('#ExciseDutyCalModel').modal('show');
|
||
});
|
||
$('#txtEditExciseDuty').change(function () {
|
||
|
||
$('#ExciseDutyCalModel').modal('show');
|
||
|
||
|
||
});
|
||
$('#txtVat').change(function () {
|
||
|
||
|
||
$('#VatCalModel').modal('show');
|
||
|
||
|
||
});
|
||
$('#txtEditVat').change(function () {
|
||
|
||
|
||
$('#VatCalModel').modal('show');
|
||
|
||
|
||
});
|
||
$('#txtCST').change(function () {
|
||
|
||
$('#CSTCalModel').modal('show');
|
||
|
||
|
||
});
|
||
$('#txtEditCST').change(function () {
|
||
|
||
|
||
$('#CSTCalModel').modal('show');
|
||
|
||
});
|
||
var freight = '';
|
||
|
||
$('#drpFreight').change(function () {
|
||
var FreightType = $("#drpFreight").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#TripsValue').show();
|
||
|
||
} else {
|
||
$('#TripsValue').hide();
|
||
|
||
}
|
||
|
||
selValue = $("#drpFreight").val();
|
||
$('#txtFreight').val('');
|
||
$('#txtAfterFreight').val('');
|
||
console.log("onchange initiated..!!");
|
||
|
||
if (selValue == PercentageType) {
|
||
console.log("inside opening freight model ");
|
||
freight = 'FreightCalculationOn';
|
||
var FreightCalculation = '';
|
||
$('#freightcalmodel').modal('show');
|
||
$('#txtFreight').removeAttr('readonly', 'true');
|
||
} else if (selValue == NilType) {
|
||
|
||
$('#txtFreight').attr('readonly','true');
|
||
$('#txtFreight').val('0.00');
|
||
change();
|
||
} else {
|
||
$('#txtFreight').removeAttr('readonly', 'true');
|
||
$('#txtFreight').val('');
|
||
|
||
|
||
}
|
||
calculateFreight(0);
|
||
});
|
||
/* $('#drpViewFreight').change(function() {
|
||
var FreightType =$("#drpViewFreight").val();
|
||
|
||
if (FreightType == "PER TRIP")
|
||
{
|
||
|
||
$('#ViewTripsValue').show();
|
||
}
|
||
else {
|
||
|
||
$('#ViewTripsValue').hide();
|
||
}
|
||
}); */
|
||
$('#freightcalmodel').on('hidden.bs.modal', function () {
|
||
// Reopen the first modal when the second modal is closed
|
||
if (freight == 'FreightCalculationOn') {
|
||
$('#REVENUE').modal('show');
|
||
} else if (freight == 'EditFreightCalculationOn') {
|
||
$('#EDITREVENUE').modal('show');
|
||
}
|
||
});
|
||
|
||
$('#drpEditFreight').change(function () {
|
||
var FreightType = $("#drpEditFreight").val();
|
||
|
||
if (FreightType == "PER TRIP") {
|
||
$('#EditTripsValue').show();
|
||
|
||
} else {
|
||
$('#EditTripsValue').hide();
|
||
|
||
}
|
||
|
||
selValue = $("#drpEditFreight").val();
|
||
$('#txtEditFreight').val('');
|
||
$('#txtEditAfterFreight').val('');
|
||
if (selValue == PercentageType) {
|
||
freight = 'EditFreightCalculationOn';
|
||
var FreightCalculation = '';
|
||
$('#freightcalmodel').modal('show');
|
||
$('#txtEditFreight').removeAttr('readonly', 'true');
|
||
|
||
} else if (selValue == NilType) {
|
||
|
||
$('#txtEditFreight').attr('readonly', 'true');
|
||
$('#txtEditFreight').val('0.00');
|
||
Editchange();
|
||
|
||
} else {
|
||
$('#txtEditFreight').removeAttr('readonly', 'true');
|
||
$('#txtEditFreight').val('');
|
||
}
|
||
calculateFreight(1);
|
||
|
||
});
|
||
|
||
$('#drpViewFreight').change(function () {
|
||
var FreightType = $("#drpViewFreight").val();
|
||
if (FreightType == "PER TRIP") {
|
||
$('#ViewTripsValue').show();
|
||
$(this).parent().removeClass('col-md-4').addClass('col-md-2');
|
||
} else {
|
||
$('#ViewTripsValue').hide();
|
||
$(this).parent().removeClass('col-md-2').addClass('col-md-4');
|
||
}
|
||
|
||
selValue = $("#drpViewFreight").val();
|
||
$('#txtViewFreight').val('');
|
||
$('#txtViewAfterFreight').val('');
|
||
if (selValue == PercentageType) {
|
||
var FreightCalculation = '';
|
||
$('#freightcalmodel').modal('show');
|
||
$('#txtViewFreight').removeAttr('readonly', 'true');
|
||
} else if (selValue == NilType) {
|
||
|
||
$('#txtViewFreight').attr('readonly', 'true');
|
||
$('#txtViewFreight').val('0.00');
|
||
|
||
} else {
|
||
$('#txtViewFreight').removeAttr('readonly', 'true');
|
||
$('#txtViewFreight').val('');
|
||
}
|
||
calculateFreight(2);
|
||
|
||
});
|
||
});
|
||
/*
|
||
* To calcuate the Discount */
|
||
function calculateDiscount(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
}
|
||
if ($('#Rate').val() != '' && $('#MaterialCode').val() != "0") {
|
||
|
||
var basicValue = parseFloat($('#txtBasicValue').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 == PercentageType) {
|
||
|
||
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
||
|
||
} else if (DiscountType == NilType) {
|
||
AfterDiscount = "0.00";
|
||
} else {
|
||
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
||
}
|
||
var discount = parseFloat(AfterDiscount).toFixed(2);
|
||
$('#txtAfterDiscount').val(discount);
|
||
} else {
|
||
$('#txtAfterDiscount').val("0.00");
|
||
}
|
||
}
|
||
calculateTotalValue();
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
}
|
||
if ($('#EditRate').val() != '' && $('#EditMaterialCode').val() != "0") {
|
||
|
||
var basicValue = parseFloat($('#txtEditBasicValue').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 == PercentageType) {
|
||
|
||
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
||
|
||
} else if (DiscountType == NilType) {
|
||
AfterDiscount = "0.00";
|
||
} else {
|
||
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
||
}
|
||
var discount = parseFloat(AfterDiscount).toFixed(2);
|
||
$('#txtEditAfterDiscount').val(discount);
|
||
} else {
|
||
$('#txtEditAfterDiscount').val("0.00");
|
||
}
|
||
}
|
||
calculateEditTotalValue();
|
||
}
|
||
}
|
||
/*
|
||
* To calcuate the Packaging */
|
||
function calculatePackaging(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
|
||
var PackagingType = $("#PackagingType").val();
|
||
|
||
if (PackagingType == "0") {
|
||
alert('Please select the Packaging Type');
|
||
$('#txtPackaging').val('');
|
||
$("#PackagingType").focus();
|
||
} else if ($('#txtPackaging').val() != '' && $('#txtPackaging').val() != '0') {
|
||
var Packagingvalue = parseFloat($('#txtPackaging').val());
|
||
var AfterPackaging = 0.0;
|
||
|
||
if (PackagingType == PercentageType) {
|
||
if ($(PackagingCalculation != 0 && '#txtAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#txtPackaging').val('');
|
||
$('#DiscountType').focus();
|
||
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
||
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_PERCENTAGE_BYBASICVALUE; ?> : <?php echo PACKAGING_PERCENTAGE_BYDISCOUNTVALUE; ?>;
|
||
}
|
||
|
||
} else if (PackagingType == NilType) {
|
||
AfterPackaging = "0.00";
|
||
|
||
} else {
|
||
|
||
|
||
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_LUMPSUM_BYBASICVALUE; ?> : <?php echo PACKAGING_LUMPSUM_BYDISCOUNTVALUE; ?>;
|
||
|
||
}
|
||
var Packaging = parseFloat(AfterPackaging).toFixed(2);
|
||
|
||
$('#txtAfterPackaging').val(Packaging);
|
||
//RevenueChangeSgst();
|
||
} else {
|
||
$('#txtAfterPackaging').val("0.00");
|
||
}
|
||
}
|
||
calculateTotalValue();
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
|
||
var PackagingType = $("#EditPackagingType").val();
|
||
|
||
if (PackagingType == "0") {
|
||
alert('Please select the Packaging Type');
|
||
$('#txtEditPackaging').val('');
|
||
$("#EditPackagingType").focus();
|
||
} else if ($('#txtEditPackaging').val() != '' && $('#txtEditPackaging').val() != '0') {
|
||
var Packagingvalue = parseFloat($('#txtEditPackaging').val());
|
||
var AfterPackaging = 0.0;
|
||
|
||
if (PackagingType == PercentageType) {
|
||
if (PackagingCalculation != 0 && $('#txtEditAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#EditDiscountType').focus();
|
||
$('#txtEditPackaging').val('');
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
||
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_PERCENTAGE_BYBASICVALUE; ?> : <?php echo PACKAGING_PERCENTAGE_BYDISCOUNTVALUE; ?>;
|
||
}
|
||
|
||
} else if (PackagingType == NilType) {
|
||
AfterPackaging = "0.00";
|
||
} else {
|
||
|
||
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_LUMPSUM_BYBASICVALUE; ?> : <?php echo PACKAGING_LUMPSUM_BYDISCOUNTVALUE; ?>;
|
||
|
||
}
|
||
var Packaging = parseFloat(AfterPackaging).toFixed(2);
|
||
|
||
$('#txtEditAfterPackaging').val(Packaging);
|
||
//RevenueChangeEditSgst();
|
||
} else {
|
||
$('#txtEditAfterPackaging').val("0.00");
|
||
}
|
||
}
|
||
calculateEditTotalValue();
|
||
}
|
||
}
|
||
|
||
function calculateExcise(isEdit) {
|
||
if (isEdit == '0') {
|
||
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
$('#txtExciseDuty').val('');
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#txtExciseDuty').val('');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
|
||
|
||
if ($('#txtExciseDuty').val() != '' && $('#txtExciseDuty').val() != '0') {
|
||
var AfterExciseDuty = 0.0;
|
||
var ExciseDuty = parseFloat($('#txtExciseDuty').val());
|
||
if (ExciseCalculation == '0') {
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASICVALUE; ?>;
|
||
} else if (ExciseCalculation == '1') {
|
||
if ($('#txtAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#DiscountType').focus();
|
||
$('#txtExciseDuty').val('');
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT; ?>;
|
||
}
|
||
} else if (ExciseCalculation == '2') {
|
||
if ($('#txtAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#DiscountType').focus();
|
||
$('#txtExciseDuty').val('');
|
||
return false;
|
||
} else if ($('#txtAfterPackaging').val() == '') {
|
||
alert('Please Enter the Packaging value');
|
||
$('#PackagingType').focus();
|
||
$('#txtExciseDuty').val('');
|
||
return false;
|
||
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
||
var AfterPackaging = parseFloat($('#txtAfterPackaging').val());
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT_PACKAGING; ?>;
|
||
}
|
||
} else {
|
||
if ($('#txtAfterPackaging').val() == '') {
|
||
alert('Please Enter the Packaging value');
|
||
$('#PackagingType').focus();
|
||
$('#txtExciseDuty').val('');
|
||
return false;
|
||
} else {
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_PACKAGING; ?>;
|
||
var AfterPackaging = parseFloat($('#txtAfterPackaging').val());
|
||
}
|
||
}
|
||
var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2);
|
||
|
||
$('#txtAfterExciseDuty').val(ExciseVal);
|
||
} else {
|
||
$('#txtAfterExciseDuty').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateTotalValue();
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
|
||
|
||
|
||
if ($('#txtEditExciseDuty').val() != '' && $('#txtEditExciseDuty').val() != '0') {
|
||
var AfterExciseDuty = 0.0;
|
||
var ExciseDuty = parseFloat($('#txtEditExciseDuty').val());
|
||
if (ExciseCalculation == '0') {
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASICVALUE; ?>;
|
||
} else if (ExciseCalculation == '1') {
|
||
if ($('#txtEditAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#EditDiscountType').focus();
|
||
$('#txtEditExciseDuty').val('');
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT; ?>;
|
||
}
|
||
} else if (ExciseCalculation == '2') {
|
||
if ($('#txtEditAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#EditDiscountType').focus();
|
||
$('#txtEditExciseDuty').val('');
|
||
return false;
|
||
} else if ($('#txtEditAfterPackaging').val() == '') {
|
||
alert('Please Enter the Packaging value');
|
||
$('#EditPackagingType').focus();
|
||
$('#txtEditExciseDuty').val('');
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
||
var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val());
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT_PACKAGING; ?>;
|
||
}
|
||
} else {
|
||
if ($('#txtEditAfterPackaging').val() == '') {
|
||
alert('Please Enter the Packaging value');
|
||
$('#EditPackagingType').focus();
|
||
$('#txtEditExciseDuty').val('');
|
||
return false;
|
||
} else {
|
||
var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val());
|
||
AfterExciseDuty = <?php echo EXCISE_ONBASIC_PACKAGING; ?>;
|
||
}
|
||
}
|
||
var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2);
|
||
|
||
$('#txtEditAfterExciseDuty').val(ExciseVal);
|
||
} else {
|
||
$('#txtEditAfterExciseDuty').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateEditTotalValue();
|
||
}
|
||
|
||
}
|
||
|
||
function calculateVat(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
var AfterVat = 0.0;
|
||
if (VatCalculation != 0 && $('#txtVat').val() != '') {
|
||
|
||
if ($('#txtAfterExciseDuty').val() == '') {
|
||
alert('Please Enter the Excise value');
|
||
$('#txtExciseDuty').focus();
|
||
$('#txtVat').val('');
|
||
return false;
|
||
} else {
|
||
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
||
vatValue = parseFloat($('#txtVat').val());
|
||
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
||
var Vatval = parseFloat(AfterVat).toFixed(2);
|
||
|
||
$('#txtAfterVat').val(Vatval);
|
||
}
|
||
} else if (VatCalculation == 0 && $('#txtVat').val() != '') {
|
||
vatValue = parseFloat($('#txtVat').val());
|
||
AfterVat = <?php echo VAT_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterVat).toFixed(2);
|
||
|
||
$('#txtAfterVat').val(Vatval);
|
||
} else {
|
||
$('#txtAfterVat').val("0.00");
|
||
}
|
||
calculateTotalValue();
|
||
}
|
||
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
||
var AfterVat = 0.0;
|
||
if (VatCalculation != 0 && $('#txtEditVat').val() != '') {
|
||
|
||
if ($('#txtEditAfterExciseDuty').val() == '') {
|
||
alert('Please Enter the Excise value');
|
||
$('#txtEditAfterExciseDuty').focus();
|
||
$('#txtEditVat').val('');
|
||
return false;
|
||
} else {
|
||
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
||
vatValue = parseFloat($('#txtEditVat').val());
|
||
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
||
var Vatval = parseFloat(AfterVat).toFixed(2);
|
||
|
||
$('#txtEditAfterVat').val(Vatval);
|
||
}
|
||
} else if (VatCalculation == 0 && $('#txtEditVat').val() != '') {
|
||
vatValue = parseFloat($('#txtEditVat').val());
|
||
AfterVat = <?php echo VAT_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterVat).toFixed(2);
|
||
|
||
$('#txtEditAfterVat').val(Vatval);
|
||
} else {
|
||
$('#txtEditAfterVat').val("0.00");
|
||
}
|
||
|
||
calculateEditTotalValue();
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
function calculateCST(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
var AfterCST = 0.0;
|
||
if (CSTCalculation != 0 && $('#txtCST').val() != '') {
|
||
|
||
if ($('#txtAfterExciseDuty').val() == '') {
|
||
alert('Please Enter the Excise value');
|
||
$('#txtExciseDuty').focus();
|
||
$('#txtAfterCST').val('');
|
||
return false;
|
||
} else {
|
||
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
||
var CSTValue = parseFloat($('#txtCST').val());
|
||
AfterCST = <?php echo CST_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterCST).toFixed(2);
|
||
|
||
$('#txtAfterCST').val(Vatval);
|
||
}
|
||
} else if (CSTCalculation == 0 && $('#txtCST').val() != '') {
|
||
var CSTValue = parseFloat($('#txtCST').val());
|
||
AfterCST = <?php echo CST_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterCST).toFixed(2);
|
||
|
||
$('#txtAfterCST').val(Vatval);
|
||
} else {
|
||
$('#txtAfterCST').val("0.00");
|
||
}
|
||
calculateTotalValue();
|
||
}
|
||
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
var AfterCST = 0.0;
|
||
if (CSTCalculation != 0 && $('#txtEditCST').val() != '') {
|
||
|
||
if ($('#txtEditAfterExciseDuty').val() == '') {
|
||
alert('Please Enter the Excise value');
|
||
$('#txtEditAfterExciseDuty').focus();
|
||
$('#txtEditCST').val('');
|
||
return false;
|
||
} else {
|
||
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
||
var CSTValue = parseFloat($('#txtEditCST').val());
|
||
AfterCST = <?php echo CST_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterCST).toFixed(2);
|
||
|
||
$('#txtEditAfterCST').val(Vatval);
|
||
}
|
||
} else if (CSTCalculation == 0 && $('#txtEditCST').val() != '') {
|
||
var CSTValue = parseFloat($('#txtEditCST').val());
|
||
AfterCST = <?php echo CST_ONBASICVALUE; ?>;
|
||
var Vatval = parseFloat(AfterCST).toFixed(2);
|
||
|
||
$('#txtEditAfterCST').val(Vatval);
|
||
RevenueChangeEditSgst();
|
||
|
||
} else {
|
||
$('#txtEditAfterCST').val("0.00");
|
||
}
|
||
|
||
calculateEditTotalValue();
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
function calculateGST(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
|
||
if ($('#txtGST').val() != "0" && $('#txtGST').val() != '') {
|
||
var GSTValue = parseFloat($('#txtGST').val());
|
||
|
||
var AfterGST = 0.0;
|
||
AfterGST = <?php echo GSTTAX; ?>;
|
||
|
||
var GSTval = parseFloat(AfterGST).toFixed(2);
|
||
|
||
$('#txtAfterGST').val(GSTval);
|
||
} else {
|
||
$('#txtAfterGST').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateTotalValue();
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
|
||
if ($('#txtEditGST').val() != "0" && $('#txtEditGST').val() != '') {
|
||
var GSTValue = parseFloat($('#txtEditGST').val());
|
||
|
||
var AfterGST = 0.0;
|
||
AfterGST = <?php echo GSTTAX; ?>;
|
||
|
||
var GSTval = parseFloat(AfterGST).toFixed(2);
|
||
|
||
$('#txtEditAfterGST').val(GSTval);
|
||
} else {
|
||
$('#txtEditAfterGST').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateEditTotalValue();
|
||
|
||
}
|
||
}
|
||
|
||
function calculateOtherTaxes(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
|
||
|
||
if ($('#txtOtherTax').val() != "0" && $('#txtOtherTax').val() != '') {
|
||
var OtherTaxValue = parseFloat($('#txtOtherTax').val());
|
||
|
||
var AfterOtherTaxes = 0.0;
|
||
AfterOtherTaxes = <?php echo OTHERTAX; ?>;
|
||
|
||
var Otherval = parseFloat(AfterOtherTaxes).toFixed(2);
|
||
|
||
$('#txtAfterOtherTax').val(Otherval);
|
||
} else {
|
||
$('#txtAfterOtherTax').val("0.00");
|
||
}
|
||
calculateTotalValue();
|
||
|
||
}
|
||
} else {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
|
||
|
||
if ($('#txtEditOtherTax').val() != "0" && $('#txtEditOtherTax').val() != '') {
|
||
var OtherTaxValue = parseFloat($('#txtEditOtherTax').val());
|
||
|
||
var AfterOtherTaxes = 0.0;
|
||
AfterOtherTaxes = <?php echo OTHERTAX; ?>;
|
||
|
||
var Otherval = parseFloat(AfterOtherTaxes).toFixed(2);
|
||
|
||
$('#txtEditAfterOtherTax').val(Otherval);
|
||
} else {
|
||
$('#txtEditAfterOtherTax').val("0.00");
|
||
}
|
||
calculateEditTotalValue();
|
||
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
function calculateFreight(isEdit) {
|
||
if (isEdit == '0') {
|
||
if ($('#MaterialCode').val() == "0") {
|
||
alert('Please Select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
var FreightType = $("#drpFreight").val();
|
||
if (FreightType == "0") {
|
||
alert('Please select Freight Type');
|
||
$('#txtFreight').val('');
|
||
$("#drpFreight").focus();
|
||
} else if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
|
||
var FreightValue = parseFloat($('#txtFreight').val());
|
||
var UOM = parseFloat($('#UOM').val());
|
||
var Quantity = parseFloat($('#Quantity').val());
|
||
//alert(FreightType);
|
||
var AfterFreight = 0.0;
|
||
|
||
if (FreightType == PercentageType) {
|
||
if ($(FreightCalculation != 0 && '#txtAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#txtFreight').val('');
|
||
$('#DiscountType').focus();
|
||
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
||
AfterFreight = FreightCalculation == 0 ? <?php echo FREIGHT_PERCENTAGE; ?> : <?php echo FREIGHT_PERCENTAGE_AFTER; ?>;
|
||
}
|
||
|
||
} else if (FreightType == NilType) {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#NOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#NOOfTrips").focus();
|
||
$('#txtFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#txtAfterFreight').val("0.00");
|
||
return false;
|
||
} else {
|
||
var noOftrip = $("#NOOfTrips").val();
|
||
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
||
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
||
}
|
||
|
||
|
||
} else {
|
||
AfterFreight = $("#txtFreight").val();
|
||
}
|
||
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
||
|
||
$('#txtAfterFreight').val(AfterFreightval);
|
||
//RevenueChangeSgst();
|
||
} else {
|
||
$('#txtAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateTotalValue();
|
||
} else if (isEdit == '1') {
|
||
if ($('#EditMaterialCode').val() == "0") {
|
||
// alert('Please Select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
var FreightType = $("#drpEditFreight").val();
|
||
if (FreightType == "0") {
|
||
alert('Please select Freight Type');
|
||
$('#txtEditFreight').val('');
|
||
$("#drpEditFreight").focus();
|
||
} else if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
|
||
var FreightValue = parseFloat($('#txtEditFreight').val());
|
||
var UOM = parseFloat($('#EditUOM').val());
|
||
var Quantity = parseFloat($('#EditQuantity').val());
|
||
//alert(FreightType);
|
||
var AfterFreight = 0.0;
|
||
// if(FreightType == PercentageType)
|
||
// {
|
||
// AfterFreight =
|
||
// }
|
||
if (FreightType == PercentageType) {
|
||
if ($(FreightCalculation != 0 && '#txtEditAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#txtEditFreight').val('');
|
||
$('#DiscountType').focus();
|
||
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
||
let freightCalculationOnValue = $(`input[type='radio'][name='optFreight']:checked`).val();
|
||
FreightCalculation=freightCalculationOnValue;
|
||
AfterFreight = FreightCalculation == 0 ? <?php echo FREIGHT_PERCENTAGE; ?> : <?php echo FREIGHT_PERCENTAGE_AFTER; ?>;
|
||
console.log(AfterDiscount);
|
||
}
|
||
|
||
} else if (FreightType == NilType) {
|
||
AfterFreight = 0.0;
|
||
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
||
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
||
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
||
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
||
if ($('#EditNOOfTrips').val() == '') {
|
||
alert('Please Enter No of Trip');
|
||
|
||
$("#EditNOOfTrips").focus();
|
||
$('#txtEditFreight').val(0)
|
||
AfterFreight = 0;
|
||
$('#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);
|
||
//RevenueChangeEditSgst();
|
||
} else {
|
||
$('#txtEditAfterFreight').val("0.00");
|
||
}
|
||
|
||
}
|
||
calculateEditTotalValue();
|
||
} else if (isEdit == '2') // for view model freight calculation
|
||
{
|
||
|
||
//alert("view Frieght");
|
||
if ($('#ViewMaterialCode').val() == "0") {
|
||
// alert('Please Select the Material Code');
|
||
$('#ViewMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#ViewRate').val() == '') {
|
||
alert('Please Enter the Rate value');
|
||
$('#ViewRate').focus();
|
||
return false;
|
||
} else {
|
||
var basicValue = parseFloat($('#txtViewBasicValue').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 UOM = parseFloat($('#ViewUOM').val());
|
||
var Quantity = parseFloat($('#ViewQuantity').val());
|
||
//alert(FreightType);
|
||
var AfterFreight = 0.0;
|
||
// if(FreightType == PercentageType)
|
||
// {
|
||
// AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
||
// }
|
||
if (FreightType == PercentageType) {
|
||
if ($(FreightCalculation != 0 && '#txtViewAfterDiscount').val() == '') {
|
||
alert('Please Enter the Discount value');
|
||
$('#txtViewFreight').val('');
|
||
$('#DiscountType').focus();
|
||
|
||
return false;
|
||
} else {
|
||
var AfterDiscount = parseFloat($('#txtViewAfterDiscount').val());
|
||
AfterFreight = FreightCalculation == 0 ? <?php echo FREIGHT_PERCENTAGE; ?> : <?php echo FREIGHT_PERCENTAGE_AFTER; ?>;
|
||
}
|
||
|
||
} else if (FreightType == NilType) {
|
||
AfterFreight = 0.0;
|
||
$('#txtViewFreight').val("0.00");
|
||
} 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);
|
||
//RevenueChangeviewSgst();
|
||
} else {
|
||
$('#txtViewAfterFreight').val("0.00");
|
||
}
|
||
//$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$('#Cgst').val(),$('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(),$("#txtAfterPackaging").val()== '' ? "0.00" : $('#txtAfterPackaging').val(),$("#txtAfterFreight").val()== '' ? "0.00" : $('#txtAfterFreight').val()));
|
||
|
||
basicvalue = $('#txtViewBasicValue').val();
|
||
cgst = $('#ViewCGST').val();
|
||
sgst = $('#ViewSGST').val();
|
||
igst = $('#ViewIGST').val();
|
||
//alert(igst);
|
||
afterdiscount = $('#txtViewAfterDiscount').val();
|
||
//alert(afterdiscount);
|
||
packaging12 = $('#txtViewAfterPackaging').val();
|
||
//alert( packaging12);
|
||
freight12 = $('#txtViewAfterFreight').val(); //ViewAfterCGST
|
||
//alert(freight12);
|
||
calculateCgstTax(basicvalue, cgst, afterdiscount, packaging12, freight12);
|
||
calculateSgstTax(basicvalue, sgst, afterdiscount, packaging12, freight12);
|
||
calculateIgstTax(basicvalue, igst, afterdiscount, packaging12, freight12)
|
||
}
|
||
calculateViewTotalValue();
|
||
}
|
||
|
||
}
|
||
|
||
/* Set the Packaging calculation option for calculating Packaging */
|
||
function SetPackagingOption() {
|
||
PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
|
||
$('#packagingcalmodel').modal('hide');
|
||
calculatePackaging($('#isEdit').val());
|
||
}
|
||
/* Set the Freight calculation option for calculating Packaging */
|
||
function SetfreightOption() {
|
||
FreightCalculation = $("input:radio[name='optfreight']:checked").val();
|
||
|
||
$('#freightcalmodel').modal('hide');
|
||
calculateFreight($('#isEdit').val());
|
||
}
|
||
/* Set the Packaging calculation option for calculating Packaging */
|
||
function SetExciseCalculation() {
|
||
ExciseCalculation = $("input:radio[name='optExcise']:checked").val();
|
||
$('#ExciseDutyCalModel').modal('hide');
|
||
calculateExcise($('#isEdit').val());
|
||
}
|
||
/* Set the Packaging calculation option for calculating Packaging */
|
||
function SetVatorCST() {
|
||
StateTaxCheck = $("input:radio[name='Range']:checked").val();
|
||
$('#txtPoRange').val(StateTaxCheck);
|
||
//alert('Radio clicke:'+StateTaxCheck);
|
||
if (StateTaxCheck == "0") {
|
||
// style="display:none;"
|
||
$('#Vat').removeAttr("style");
|
||
$('#TotSCST').removeAttr("style");
|
||
$('#CST').attr("style", "display:none;");
|
||
$('#TotICST').attr("style", "display:none;");
|
||
$('#cgstContainerEdit').attr("style", "");
|
||
$('#cgstContainerView').attr("style", "");
|
||
$('#cgstContainerAdd').attr("style", "");
|
||
$('#IGSTEditModel').attr("style", "display:none;");
|
||
$('#SGSTEditModel').removeAttr("style");
|
||
$('#IGSTViewModel').attr("style", "display:none;");
|
||
$('#SGSTViewModel').removeAttr("style");
|
||
$('#IGSTAddModel').attr("style", "display:none;");
|
||
$('#SGSTAddModel').removeAttr("style");
|
||
$('#RevenueIgst').val(0);
|
||
$('#RevenueAfterIgst').val(0);
|
||
$('#txttaxcheck').val(0);
|
||
} else {
|
||
$('#EditSgst').val(0);
|
||
$('#EditAfterSgst').val(0);
|
||
$('#EditCgst').val(0);
|
||
$('#EditAfterCgst').val(0);
|
||
$('#CST').removeAttr("style");
|
||
$('#TotICST').removeAttr("style");
|
||
$('#Vat').attr("style", "display:none;");
|
||
$('#TotSCST').attr("style", "display:none;");
|
||
$('#cgstContainerEdit').attr("style", "display:none");
|
||
$('#cgstContainerView').attr("style", "display:none");
|
||
$('#cgstContainerAdd').attr("style", "display:none");
|
||
$('#IGSTEditModel').removeAttr("style");
|
||
$('#SGSTEditModel').attr("style", "display:none;");
|
||
$('#IGSTViewModel').removeAttr("style");
|
||
$('#SGSTViewModel').attr("style", "display:none;");
|
||
$('#IGSTAddModel').removeAttr("style");
|
||
$('#SGSTAddModel').attr("style", "display:none;");
|
||
$('#RevenueCgst').val(0);
|
||
$('#RevenueAfterCgst').val(0);
|
||
$('#RevenueSgst').val(0);
|
||
$('#RevenueAfterIgst').val(0);
|
||
$('#txttaxcheck').val(1);
|
||
}
|
||
}
|
||
$(document).ready(function () {
|
||
$("#PaymentTerms").select2();
|
||
|
||
$('#Date').click(function () {
|
||
//for Date range selection
|
||
$('#Schedulediv').attr("style", "display:none;");
|
||
$('#Deliverydtdiv').removeAttr("style");
|
||
});
|
||
$('#Schedule').click(function () {
|
||
//for schedule range selection
|
||
$('#Deliverydtdiv').attr("style", "display:none;");
|
||
$('#Schedulediv').removeAttr("style");
|
||
});
|
||
SetVatorCST();
|
||
});
|
||
|
||
function SetVatCalculation() {
|
||
VatCalculation = $("input:radio[name='optVat']:checked").val();
|
||
$('#VatCalModel').modal('hide');
|
||
calculateVat($('#isEdit').val());
|
||
}
|
||
|
||
function SetCSTCalculation() {
|
||
CSTCalculation = $("input:radio[name='optCST']:checked").val();
|
||
$('#CSTCalModel').modal('hide');
|
||
calculateCST($('#isEdit').val());
|
||
}
|
||
|
||
function ExceedQuantityCheck() {
|
||
// RequistQuantity
|
||
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
||
var ReqQuantity = parseFloat(RequistQuantity);
|
||
//if(EnterQuantity > ReqQuantity)
|
||
// {
|
||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
||
// //$('#Quantity').val(RequistQuantity);
|
||
// $('#Quantity').focus();
|
||
// return false;
|
||
// }
|
||
//else
|
||
// {
|
||
return true;
|
||
//}
|
||
}
|
||
|
||
function ExceedEditQuantityCheck() {
|
||
// RequistQuantity
|
||
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||
var ReqQuantity = parseFloat(RequistQuantity);
|
||
//if(EnterQuantity != ReqQuantity)
|
||
// {
|
||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
||
// $('#EditQuantity').focus();
|
||
// return false;
|
||
// }
|
||
//else
|
||
// {
|
||
return true;
|
||
// }
|
||
}
|
||
// To Reset the Tax calculation
|
||
function resetTaxField() {
|
||
$("#ItemName").val('');
|
||
$("#UOM").val('');
|
||
$("#Quantity").val('');
|
||
$("#Rate").val('');
|
||
$("#DiscountType").val("0");
|
||
$("#txtDiscount").val('');
|
||
$('#txtAfterDiscount').val('');
|
||
$("#PackagingType").val("0")
|
||
$("#txtPackaging").val('');
|
||
$('#txtAfterPackaging').val('');
|
||
$("#txtExciseDuty").val('');
|
||
$('#txtAfterExciseDuty').val('');
|
||
$("#txtVat").val('');
|
||
$('#txtAfterVat').val('');
|
||
$("#txtCST").val('');
|
||
$('#txtAfterCST').val('');
|
||
$("#txtGST").val('');
|
||
$('#txtAfterGST').val('');
|
||
$("#txtOtherTax").val('');
|
||
$('#txtAfterOtherTax').val('');
|
||
$("#drpFreight").val("0")
|
||
$("#txtFreight").val('');
|
||
$('#txtAfterFreight').val('');
|
||
$('#txtInsurance').val('');
|
||
$('#txtTotalOrderValue').val('');
|
||
ExciseCalculation = '';
|
||
PackagingCalculation = '';
|
||
VatCalculation = '';
|
||
CSTCalculation = '';
|
||
}
|
||
|
||
function Editchange() {
|
||
//alert('hi');
|
||
//ExceedEditQuantityCheck();
|
||
if ($('#EditQuantity').val() != '' && $('#EditRate').val() != '') {
|
||
var txtQuantity = parseFloat($('#EditQuantity').val());
|
||
var txtUnitPrice = parseFloat($('#EditRate').val());
|
||
var Tot = txtQuantity * txtUnitPrice
|
||
$('#txtEditBasicValue').val(parseFloat(Tot).toFixed(2));
|
||
if ($("#EditDiscountType").val() != 0) {
|
||
calculateDiscount(1);
|
||
}
|
||
|
||
|
||
if ($("#EditPackagingType").val() != 0) {
|
||
calculatePackaging(1);
|
||
}
|
||
if ($("#drpEditFreight").val() != 0) {
|
||
calculateFreight(1);
|
||
|
||
}
|
||
if ($("#EditCgst").val() != '') {
|
||
|
||
$('#EditAfterCgst').val(calculateSgstTax($('#txtEditBasicValue').val(), $('#EditCgst').val(), $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(), $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(), $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
|
||
|
||
}
|
||
if ($("#EditSgst").val() != '') {
|
||
|
||
$('#EditAfterSgst').val(calculateSgstTax($('#txtEditBasicValue').val(), $('#EditSgst').val(), $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(), $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(), $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
|
||
}
|
||
|
||
if ($("#EditIgst").val() != '') {
|
||
|
||
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(), $('#EditIgst').val(), $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(), $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(), $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterFreight').val()));
|
||
}
|
||
calculateEditTotalValue($('#isEdit').val());
|
||
|
||
}
|
||
}
|
||
|
||
function validateEditExceedLimit() {
|
||
var avalbudAmt = parseFloat($('#EditAvlBudAmt').val());
|
||
var basicAmountRate = parseFloat($('#txtEditBasicValue').val());
|
||
var totalAmount = parseFloat($('#txtEditTotalOrderValue').val());
|
||
|
||
// if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt)
|
||
// {
|
||
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
// $('#EditRate').focus();
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
|
||
}
|
||
|
||
function calculateEditTotalValue() {
|
||
var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
||
var AfterCgst = $("#EditAfterCgst").val();
|
||
|
||
var AfterSgst = $("#EditAfterSgst").val();
|
||
|
||
var AfterIgst = $("#EditAfterIgst").val();
|
||
// alert(AfterIgst);
|
||
// alert(AfterSgst);
|
||
// alert(AfterCgst);
|
||
var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val();
|
||
var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val();
|
||
var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
||
var BasicVal = $('#txtEditBasicValue').val() == '' ? '0.00' : $('#txtEditBasicValue').val();
|
||
var getrange = $("input:radio[name='Range']:checked").val();
|
||
if (getrange == 1) {
|
||
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(AfterCgst) + parseFloat(AfterIgst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
||
} else {
|
||
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
||
}
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
|
||
$('#txtEditTotalOrderValue').val(tot);
|
||
//validateEditExceedLimit();
|
||
//ExceedEditQuantityCheck();
|
||
}
|
||
|
||
function calculateViewTotalValue() {
|
||
var Packaging = $('#txtViewAfterPackaging').val() == '' ? '0.00' : $('#txtViewAfterPackaging').val();
|
||
var AfterCgst = $("#ViewAfterCGST").val();
|
||
var AfterSgst = $("#ViewAfterSGST").val();
|
||
var AfterIgst = $("#ViewAfterIGST").val();
|
||
// alert(AfterIgst);
|
||
// alert(AfterSgst);
|
||
// alert(AfterCgst);
|
||
var Freight = $('#txtViewAfterFreight').val() == '' ? '0.00' : $('#txtViewAfterFreight').val();
|
||
var Insurance = $('#txtViewInsurance').val() == '' ? '0.00' : $('#txtViewInsurance').val();
|
||
var Discount = $('#txtViewAfterDiscount').val() == '' ? '0.00' : $('#txtViewAfterDiscount').val();
|
||
var BasicVal = $('#txtViewBasicValue').val() == '' ? '0.00' : $('#txtViewBasicValue').val();
|
||
var getrange = $("input:radio[name='Range']:checked").val();
|
||
if (getrange == 1) {
|
||
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(AfterCgst) + parseFloat(AfterIgst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
||
} else {
|
||
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
||
}
|
||
|
||
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
|
||
$('#txtViewTotalOrderValue').val(tot);
|
||
//validateEditExceedLimit();
|
||
//ExceedEditQuantityCheck();
|
||
}
|
||
|
||
function calculateEditTaxValue() {
|
||
var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
||
var AfterCgst = $("#EditAfterCgst").val();
|
||
|
||
var AfterSgst = $("#EditAfterSgst").val();
|
||
|
||
var AfterIgst = $("#EditAfterIgst").val();
|
||
var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val();
|
||
var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val();
|
||
var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
||
|
||
|
||
var totvalue = parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst);
|
||
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
//alert('tot:'+tot);
|
||
return tot;
|
||
}
|
||
</script>
|
||
<style>
|
||
.num {
|
||
text-align: right;
|
||
}
|
||
|
||
.centered {
|
||
display: flex;
|
||
/* justify-content: center; */
|
||
align-items: center;
|
||
height: 10vh;
|
||
}
|
||
|
||
.centered label,
|
||
.centered input {
|
||
margin: 0 5px;
|
||
}
|
||
</style>
|
||
<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 ($parentPO == '') { ?>
|
||
<h4><?= "Edit Revenue Purchase Order - $PONO "; ?></h4>
|
||
<?php } else { ?>
|
||
<h4><?= "Amended Revenue Purchase Order - $PONO "; ?></h4>
|
||
<?php } ?>
|
||
<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-md-12">
|
||
<div class="card">
|
||
<div class="card-body p-4">
|
||
<?php
|
||
$attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO');
|
||
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;
|
||
//$ReqType = $SID->ReqType;
|
||
endforeach;
|
||
}
|
||
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"', 'height="400px"');
|
||
?>
|
||
</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', REVENUE), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Select Supplier<span class="text-danger">*</span></label>
|
||
<?php
|
||
$options = array("0" => 'Select Supplier');
|
||
//print_r( $options);
|
||
|
||
if (!empty($Suplist)) {
|
||
foreach ($Suplist as $SID):
|
||
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier', $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>Supplier Address</label>
|
||
<div class="form-group">
|
||
<?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>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<div id="div1" style="display:block;">
|
||
|
||
<b><u>Select Tax Range</u></b><br />
|
||
<div class="centered">
|
||
|
||
<?php echo form_label('Local', 'Local') . " " . form_radio(array('name' => 'Range', 'value' => '0', 'checked' => ('0' == $CapitalRange) ? TRUE : FALSE, 'id' => 'Local', 'onchange' => 'SetVatorCST();')); ?>
|
||
|
||
<?php echo form_label('Inter state', 'Inter state') . " " . form_radio(array('name' => 'Range', 'value' => '1', 'checked' => ('1' == $CapitalRange) ? TRUE : FALSE, 'id' => 'Inter_state', 'onchange' => 'SetVatorCST();')); ?>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<b><u>Select Delivery By<span class="text-danger">*</span></u></b><br />
|
||
<div class="centered">
|
||
|
||
<?php echo form_label('Date', 'Date') . " " . form_radio(array('name' => 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?>
|
||
|
||
<?php echo form_label('Schedule', 'Schedule') . form_radio(array('name' => 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="Deliverydtdiv">
|
||
<label>Delivery Date<span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</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', $DeliverSchedule), '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">
|
||
<label>Delivery Address</label>
|
||
<div class="form-group">
|
||
<?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);
|
||
?> <input type="hidden" name="txtDeliveryAddress" id="txtDeliveryAddress"
|
||
value="<?php echo $DeliveryAddress; ?>">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Purchase Order Date</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>">
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<label>Mode Of Shipment</label>
|
||
<div class="form-group">
|
||
|
||
<?php
|
||
$data = array('name' => 'editmodeofshipment', 'value' => set_value('editmodeofshipment', $modeofshipment), 'id' => 'editmodeofshipment', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Contact Reference</label>
|
||
<div class="form-group">
|
||
|
||
<?php
|
||
$data = array('name' => 'editsupplierreference', 'value' => set_value('editsupplierreference', $supplierref), 'id' => 'editsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Supplier's Offer No</label>
|
||
<div class="form-group">
|
||
|
||
<?php
|
||
$data = array('name' => 'editsupplierofferno', 'value' => set_value('editsupplierofferno', $suppofferno), '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', $otherref), 'id' => 'editotherreference', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Revenue Type Options<span class="text-danger">*</span></label>
|
||
|
||
<?php
|
||
//$optionsWork = array("0"=>'Select Work Status');
|
||
|
||
|
||
if (!empty($PoTypeOptions)) {
|
||
|
||
foreach ($PoTypeOptions as $POpt):
|
||
|
||
if ($revenuesubtype == $POpt->ConfigValue) {
|
||
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
|
||
}
|
||
|
||
endforeach;
|
||
foreach ($PoTypeOptions as $POpt1):
|
||
|
||
if ($revenuesubtype != $POpt1->ConfigValue) {
|
||
$optionsPO[$POpt1->ConfigValue] = $POpt1->ConfigValue;
|
||
}
|
||
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions" required="true" class="form-control"');
|
||
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Payment Terms<span class="text-danger">*</span></label>
|
||
|
||
<?php
|
||
|
||
|
||
|
||
if (!empty($Payment)) {
|
||
|
||
foreach ($Payment as $pay):
|
||
|
||
|
||
$options6[$pay->PaymentID] = $pay->PaymentTerms;
|
||
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('PaymentTerms', $options6, set_value('PaymentTerms', $Terms), 'id="PaymentTerms"', 'required="true"', 'class="form-control"');
|
||
?>
|
||
|
||
|
||
|
||
</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 for="insurance">Insurance Options<span class="text-danger">*</span></label>
|
||
<?php
|
||
$optionsnew = array('1' => 'Yes', '0' => 'No');
|
||
echo form_dropdown('insurancestatus', $optionsnew, set_value('insurancestatus'), 'id="insurancestatus" required="true" class="form-control"');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3" id="InsuranceNumberdiv" style="display:block;">
|
||
<label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'InsuranceNumber', 'InsuranceNumber' => set_value('InsuranceNumber', $insurenceno), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
|
||
<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="form-group col-md-12" align="right">
|
||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
|
||
|
||
<?php } ?>
|
||
<!-- <a data-toggle="modal" onclick="showmodel();" class=" btn btn-success"> Select Line Item </a> -->
|
||
<a data-toggle="modal"><button type="submit" onclick="myFunction();"
|
||
class="btn btn-success" id="abcd">Select Line Item</button> </a>
|
||
<?php } ?>
|
||
</div>
|
||
</div>
|
||
<br>
|
||
<div class="form-row">
|
||
<div class="table-responsive" style="padding-bottom:30px;">
|
||
<table id="revenueTax" class="table table-bordered table-hover"
|
||
style="font-size:12px;">
|
||
<thead>
|
||
|
||
<tr>
|
||
<th style="text-align:center !important">SNo</th>
|
||
<th style="text-align:center !important">Requisition No</th>
|
||
<th style="text-align:center !important">Item Code</th>
|
||
<th style="text-align:left !important">Item Description</th>
|
||
<th style="text-align:center !important">Quantity</th>
|
||
<th style="text-align:center !important">UOM</th>
|
||
<th style="text-align:right !important">Rate <?php echo "($INRSYM)" ?>
|
||
</th>
|
||
<th style="text-align:right !important">Basic Amount
|
||
<?php echo "($INRSYM)" ?>
|
||
</th>
|
||
<th style="text-align:right !important">Tax Amount
|
||
<?php echo "($INRSYM)" ?>
|
||
</th>
|
||
<th style="text-align:right !important">Total Order Amount
|
||
<?php echo "($INRSYM)" ?>
|
||
</th>
|
||
<!-- <th>Actual Quantity</th>
|
||
<th>Received Quantity</th>
|
||
<th>Pending Quantity</th> -->
|
||
<th style="text-align:center !important">Action</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id='RevenueAppend'>
|
||
<?php
|
||
if (!empty($POItem)) {
|
||
$index = 0;
|
||
|
||
foreach ($POItem as $record) {
|
||
$index = $index + 1;
|
||
?>
|
||
<tr id="<?php echo $index; ?>">
|
||
<td align="center"><?php echo $index; ?></td>
|
||
<td align="center"><?php echo $record->ReqNo ?></td>
|
||
<td align="center"><?php echo $record->MaterialCode ?></td>
|
||
<td align="left"><?php echo $record->MaterialName ?></td>
|
||
<td align="center"><?php echo $record->Quantity ?></td>
|
||
<td align="center"><?php echo $record->UOM ?></td>
|
||
<td align="right"><?php echo $record->Rate ?></td>
|
||
|
||
<td align="right">
|
||
<?php echo number_format($record->BasicValue, 2, '.', ''); ?>
|
||
</td>
|
||
|
||
<td align="right"><?php echo $record->Taxamount ?></td>
|
||
<td align="right"><?php echo $record->TotalValue ?></td>
|
||
<!-- <td align="right"><?php echo $record->Quantity ?></td>
|
||
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
|
||
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
|
||
<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 'costCode' . $index ?>"
|
||
id="<?php echo 'costCode' . $index ?>"
|
||
value="<?php echo $record->CostCenterCode; ?>" />
|
||
<input type="hidden" name="<?php echo 'materialCode' . $index ?>"
|
||
id="<?php echo 'materialCode' . $index ?>"
|
||
value="<?php echo $record->MaterialCode; ?>" />
|
||
<input type="hidden" name="<?php echo 'materialName' . $index ?>"
|
||
id="<?php echo 'materialName' . $index ?>"
|
||
value="<?php echo htmlentities($record->MaterialName); ?>" />
|
||
<input type="hidden" name="<?php echo 'uom' . $index ?>"
|
||
id="<?php echo 'uom' . $index ?>"
|
||
value="<?php echo $record->UOM; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'quantity' . $index ?>"
|
||
id="<?php echo 'quantity' . $index ?>"
|
||
value="<?php echo $record->Quantity; ?>" />
|
||
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>"
|
||
id="<?php echo 'b4qty' . $index ?>"
|
||
value="<?php echo $record->Quantity; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'itemRate' . $index ?>"
|
||
id="<?php echo 'itemRate' . $index ?>"
|
||
value="<?php echo $record->Rate; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'b4rate' . $index ?>"
|
||
id="<?php echo 'b4rate' . $index ?>"
|
||
value="<?php echo $record->Rate; ?>" />
|
||
<input align="right" type="hidden" name="<?php echo 'per' . $index ?>"
|
||
id="<?php echo 'per' . $index ?>"
|
||
value="<?php echo $record->Per; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'service_description' . $index ?>"
|
||
id="<?php echo 'service_description' . $index ?>"
|
||
value="<?php echo $record->ServiceMaterialDescription; ?>" />
|
||
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'DisType' . $index ?>"
|
||
id="<?php echo 'DisType' . $index ?>"
|
||
value="<?php echo $record->DiscountType; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'DisVal' . $index ?>"
|
||
id="<?php echo 'DisVal' . $index ?>"
|
||
value="<?php echo $record->DiscountValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'AfterDisVal' . $index ?>"
|
||
id="<?php echo 'AfterDisVal' . $index ?>"
|
||
value="<?php echo $record->AfterDiscount; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'PackOption' . $index ?>"
|
||
id="<?php echo 'PackOption' . $index ?>"
|
||
value="<?php echo $record->PackagingCalulatedOn; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'PackType' . $index ?>"
|
||
id="<?php echo 'PackType' . $index ?>"
|
||
value="<?php echo $record->PackagingType; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'PackVal' . $index ?>"
|
||
id="<?php echo 'PackVal' . $index ?>"
|
||
value="<?php echo $record->PackagingValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'AfterPackVal' . $index ?>"
|
||
id="<?php echo 'AfterPackVal' . $index ?>"
|
||
value="<?php echo $record->AfterPackagingValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueCgst' . $index ?>"
|
||
id="<?php echo 'RevenueCgst' . $index ?>"
|
||
value="<?php echo $record->CGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueAfterCgst' . $index ?>"
|
||
id="<?php echo 'RevenueAfterCgst' . $index ?>"
|
||
value="<?php echo $record->AfterCGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueSgst' . $index ?>"
|
||
id="<?php echo 'RevenueSgst' . $index ?>"
|
||
value="<?php echo $record->SGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueAfterSgst' . $index ?>"
|
||
id="<?php echo 'RevenueAfterSgst' . $index ?>"
|
||
value="<?php echo $record->AfterSGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueIgst' . $index ?>"
|
||
id="<?php echo 'RevenueIgst' . $index ?>"
|
||
value="<?php echo $record->IGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'RevenueAfterIgst' . $index ?>"
|
||
id="<?php echo 'RevenueAfterIgst' . $index ?>"
|
||
value="<?php echo $record->AfterIGST; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'FreightType' . $index ?>"
|
||
id="<?php echo 'FreightType' . $index ?>"
|
||
value="<?php echo $record->FreightType; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'NoOfTrip' . $index ?>"
|
||
id="<?php echo 'NoOfTrip' . $index ?>"
|
||
value="<?php echo $record->NoOfTrip; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'FreightVal' . $index ?>"
|
||
id="<?php echo 'FreightVal' . $index ?>"
|
||
value="<?php echo $record->FreightValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'AfterFreightVal' . $index ?>"
|
||
id="<?php echo 'AfterFreightVal' . $index ?>"
|
||
value="<?php echo $record->AfterFreightValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'basicval' . $index ?>"
|
||
id="<?php echo 'basicval' . $index ?>"
|
||
value="<?php echo $record->BasicValue; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'Insval' . $index ?>"
|
||
id="<?php echo 'Insval' . $index ?>"
|
||
value="<?php echo $record->Insurance; ?>" />
|
||
<input align="right" type="hidden"
|
||
name="<?php echo 'TotalOrderValue' . $index ?>"
|
||
id="<?php echo 'TotalOrderValue' . $index ?>"
|
||
value="<?php echo $record->TotalValue; ?>" />
|
||
<?php
|
||
|
||
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
|
||
<td align="center"> <a data-target='#EDITREVENUE'
|
||
data-id="<?php echo $index; ?>"
|
||
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
||
href="#EDITREVENUE"><i class="ri-pencil-fill"></i></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>
|
||
</td>
|
||
<?php
|
||
} else { ?>
|
||
<td align="center"> <a data-target='#VIEWREVENUE'
|
||
data-id="<?php echo $index; ?>"
|
||
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
||
href="#VIEWREVENUE"><i class="fa fa-eye"
|
||
title="Click here to view the <?php echo $record->ReqNo; ?> Requisition details"></i> </a>
|
||
</td>
|
||
|
||
<?php
|
||
} ?>
|
||
</tr>
|
||
<?php
|
||
|
||
|
||
$totBasicAmt = $totBasicAmt + $record->BasicValue;
|
||
$totDiscountAmt = $totDiscountAmt + $record->AfterDiscount;
|
||
$totPackagingAmt = $totPackagingAmt + $record->AfterPackagingValue;
|
||
$totCgst = $totCgst + $record->AfterCGST;
|
||
$totSgst = $totSgst + $record->AfterSGST;
|
||
$totIgst = $totIgst + $record->AfterIGST;
|
||
|
||
$totFreightAmt = $totFreightAmt + $record->AfterFreightValue;
|
||
$totInsuranceAmt = $totInsuranceAmt + $record->Insurance;
|
||
$totOrderSummaryAmt = $totOrderSummaryAmt + $record->TotalValue;
|
||
}
|
||
?>
|
||
<?php
|
||
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Basic Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotBasicAmount', 'value' => set_value('txtTotBasicAmount', number_format($totBasicAmt, 2, '.', '')), 'id' => 'txtTotBasicAmount', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Discount Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalDiscount', 'value' => set_value('txtTotalDiscount', number_format($totDiscountAmt, 2, '.', '')), 'id' => 'txtTotalDiscount', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="TotSCST">
|
||
<label>Total SGST Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalSGST', 'value' => set_value('txtTotalSGST', number_format($totSgst, 2, '.', '')), 'id' => 'txtTotalSGST', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="TotICST" style="display:none;">
|
||
<label>Total IGST Amount <?php echo "($INRSYM)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalIGST', 'value' => set_value('txtTotalIGST', number_format($totIgst, 2, '.', '')), 'id' => 'txtTotalIGST', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="cgstContainerView">
|
||
<label>Total CGST Amount <?php echo "($INRSYM)" ?> </label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalCGST', 'value' => set_value('txtTotalCGST', number_format($totCgst, 2, '.', '')), 'id' => 'txtTotalCGST', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Total Packaging Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalPackaing', 'value' => set_value('txtTotalPackaing', number_format($totPackagingAmt, 2, '.', '')), 'id' => 'txtTotalPackaing', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Insurance Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalInsurance', 'value' => set_value('txtTotalInsurance', number_format($totInsuranceAmt, 2, '.', '')), 'id' => 'txtTotalInsurance', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Freight Amount <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight', number_format($totFreightAmt, 2, '.', '')), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Total Order Amount <?php echo "($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotalOrderValueSummary', 'value' => set_value('txtTotalOrderValueSummary', number_format($totOrderSummaryAmt, 2, '.', '')), 'id' => 'txtTotalOrderValueSummary', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<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');
|
||
echo form_textarea($data);
|
||
?>
|
||
<input type="hidden" name="SpcialInstruction" id="SpcialInstruction" value="">
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<div class="form-row" id="splpodiv" style="display:none;">
|
||
<div class="form-group col-md-12"><label>Special po Table List</label>
|
||
|
||
<table id="table2" class="table table-hover table-bordered"
|
||
style="background-color:#fff;font-size:12px;">
|
||
<thead style="background-color: #ddd;">
|
||
<tr>
|
||
<!-- <th>Bill No </th> -->
|
||
<!-- <th>Materials</th> -->
|
||
<th>Delivery Challan No</th>
|
||
<th>Delivery Challan Date</th>
|
||
<th>MaterialReceived Date </th>
|
||
<th>Vehicle No</th>
|
||
<th>Courier No</th>
|
||
<!-- <th>IGRNO</th> -->
|
||
<!-- <th>File</th> -->
|
||
<th>Action</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="spl">
|
||
<?php
|
||
if (!empty($getdata)) {
|
||
foreach ($getdata as $row => $gd) {
|
||
|
||
?>
|
||
<tr id="lastvalue">
|
||
|
||
<td><?php echo $gd->DeliveryChellanOrInvoiceNo ?></td>
|
||
<td><?php $date = new DateTime($gd->DeliveryChellanDate);
|
||
echo $date->format('d-m-Y'); ?></td>
|
||
<td><?php $date = new DateTime($gd->MaterialRcvdDate);
|
||
echo $date->format('d-m-Y'); ?></td>
|
||
<td><?php echo $gd->VehicleNo ?></td>
|
||
<td><?php echo $gd->CourierNo ?></td>
|
||
|
||
<input type="hidden" id="igrno" value="<?= $gd->IGRNO ?>">
|
||
<input type="hidden" id="billnos<?= $row ?>"
|
||
value="<?= isset($gd->BillNo) ? $gd->BillNo : "" ?>">
|
||
<input type="hidden" id="file<?= $row ?>"
|
||
value="<?= isset($gd->FilePath) ? $gd->FilePath : "" ?>">
|
||
<input type="hidden" id="deliveryinvoiceno<?= $row ?>"
|
||
value="<?= $gd->DeliveryChellanOrInvoiceNo ?>">
|
||
<input type="hidden" id="deliverydate<?= $row ?>"
|
||
value="<?= $gd->DeliveryChellanDate ?>">
|
||
<input type="hidden" id="vehicleno<?= $row ?>"
|
||
value="<?= $gd->VehicleNo ?>">
|
||
<input type="hidden" id="courierno<?= $row ?>"
|
||
value="<?= $gd->CourierNo ?>">
|
||
<input type="hidden" id="MaterialRcvdDate<?= $row ?>"
|
||
value="<?= $gd->MaterialRcvdDate ?>">
|
||
|
||
<td style="cursor:pointer;"><span onclick="openmodel(<?= $row ?>);"><i
|
||
class="ri-pencil-fill"></i></span>
|
||
|
||
</td>
|
||
</tr>
|
||
<?php
|
||
}
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="form-row"><!-- <label>Special po Table List</label> -->
|
||
<p> </p>
|
||
<table id="table3" class="table table-hover table-bordered"
|
||
style="background-color:#fff;font-size:12px;">
|
||
<div class="form-row" style="padding-bottom: 10px;">
|
||
|
||
<div class=" col-md-8 px-2">
|
||
<label>Upload IGR Bill </label>
|
||
<input type="button" class="btn btn-success" id="addmorebutton"
|
||
value=" ADD FILES "><br>
|
||
|
||
</div>
|
||
|
||
<div id="newdiv"></div>
|
||
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||
<input type="hidden" name="hiddenIGRNO" id="hiddenIGRNO"
|
||
value="<?php echo $IGRNO; ?>" />
|
||
|
||
|
||
</div>
|
||
<thead>
|
||
<tr>
|
||
<th>Bill No </th>
|
||
|
||
<th>File</th>
|
||
<th>Action</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="splPoBillTbId">
|
||
<?php
|
||
if (!empty($billfile)) {
|
||
|
||
foreach ($billfile as $row => $gd) {
|
||
if (!empty($gd->BillNo)) {
|
||
$index = $row + 1;
|
||
?>
|
||
<tr id="lastvalue">
|
||
<td><?php echo $gd->BillNo ?></td>
|
||
|
||
<td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?>
|
||
</td>
|
||
<!-- <input type="hidden" id="hiddenigrno" value="<?php $gd->IGRNO ?>"> -->
|
||
<input type="hidden" id="billnos<?= $index ?>"
|
||
value="<?= $gd->BillNo ?>">
|
||
<input type="hidden" id="file<?= $index ?>" name='file'
|
||
value="<?= $gd->FilePath ?>">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<td style="cursor:pointer"><span
|
||
onclick="openbillmodel(<?php echo $index ?>);"><i
|
||
class="ri-pencil-fill"></i></span>
|
||
<?php if (!empty($gd->FilePath)) { ?>
|
||
|
||
<a target="_blank"
|
||
href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i
|
||
class="fa fa-download"></i></a>
|
||
<?php } ?>
|
||
</td>
|
||
</tr>
|
||
<?php
|
||
}
|
||
}
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<!--################################################################## -->
|
||
<?php if (!empty($update)) { ?>
|
||
<div class="form-row" 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 style="background-color: #ddd;">
|
||
<tr>
|
||
<th>Sno</th>
|
||
<th>PONO</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)) {
|
||
|
||
$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>
|
||
|
||
|
||
<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>Select Purchase Order File</label><br>
|
||
<input type="file" name="POFile" id="POFile">
|
||
</div>
|
||
</div>
|
||
|
||
<?php if (!empty($PrePOFile)) {
|
||
$PrePOFilePath = FCPATH . 'public/uploads/POfiles/' . $PrePOFile;
|
||
if (file_exists($PrePOFilePath)) { ?>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12" id="deletePreviousPurchaseOrderFileDiv" align="left">
|
||
<br />
|
||
|
||
<label><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>
|
||
|
||
<button class="btn btn-danger btn-sm " id="deletePreviousPurchaseOrderFile">Delete
|
||
</button>
|
||
|
||
<input type="hidden" id="PrePOFile" name="PrePOFile"
|
||
value="<?php echo $PrePOFile; ?>" /><br>
|
||
</div>
|
||
</div>
|
||
|
||
<?php } ?>
|
||
|
||
|
||
<?php } ?>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12" align="left"><br />
|
||
<div>
|
||
|
||
|
||
</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="txtRowCount" id="txtRowCount" value="<?php if (isset($index)) {
|
||
echo $index;
|
||
} ?>">
|
||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>" />
|
||
<input type="hidden" name="txttaxcheck" id="txttaxcheck" value="" />
|
||
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
|
||
<div class="btn-container" style="text-align: right;">
|
||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<a class="btn btn-success Save" ID="Cancel"
|
||
href="<?php echo base_url() . 'purchaseorderListing'; ?>"> <span
|
||
class="bold">Cancel</span></a>
|
||
<?php if ($PONOStatus == PO_DRAFT) { ?>
|
||
<a class="btn btn-success Save" ID="Save" onclick="Save(0)"> <span
|
||
class="bold">Save as Draft</span></a>
|
||
<?php } ?>
|
||
<a class="btn btn-success Save" ID="Submit" onclick="Save(1)"> <span
|
||
class="bold">Submit</span></a>
|
||
<a class="btn btn-soft-primary waves-effect waves-light Save" ID="Submit"
|
||
onclick="Save(4)"> <span class="bold">Approve</span></a>
|
||
<?php } else if ($PONOStatus == SPECIAL_PO) { ?>
|
||
<a class="btn btn-success" ID="Viewsave" onclick="Save(2)"> <span
|
||
class="bold">Submit</span></a>
|
||
<?php } else { ?>
|
||
<a class="btn btn-success" ID="OK"
|
||
href="<?php echo base_url() . 'purchaseorderListing'; ?>"> <span
|
||
class="bold">OK</span></a>
|
||
<?php } ?>
|
||
</div>
|
||
|
||
|
||
|
||
</div><br />
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
|
||
<label>Request On : </label><?php echo $Reqon; ?><br />
|
||
<?php if ($RequesterName != '' || $RequesterName != null) { ?>
|
||
<label>Request By : </label><?php echo $RequesterName; ?><br />
|
||
<?php } ?>
|
||
<label>Status : </label><?php
|
||
$statusMappings = [
|
||
'PO APPROVED' => 'AWAITING APPROVE',
|
||
'AWAITING RELEASE' => 'AWAITING APPROVE',
|
||
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
|
||
'PO RELEASED' => 'PO APPROVED',
|
||
];
|
||
|
||
if (isset($StatusName) && !empty($StatusName)) {
|
||
if (isset($statusMappings[$StatusName])) {
|
||
echo $statusMappings[$StatusName];
|
||
} else {
|
||
echo $StatusName;
|
||
}
|
||
} else {
|
||
echo "Status not provided";
|
||
}
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div> <!-- end card body-->
|
||
</div> <!-- end card -->
|
||
</div><!-- end col-->
|
||
</div>
|
||
</div> <!-- container -->
|
||
</div> <!-- content -->
|
||
</div>
|
||
<!-- Add Model for revenue po -->
|
||
<div id="REVENUE" 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">Select Revenue Purchase Order Line 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">
|
||
<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('ReqNo', $RL, set_value('ReqNo'), 'id="ReqNo" class="form-control"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'deptName', 'value' => set_value('deptName'), 'id' => 'deptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div class="form-group">
|
||
<?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>Avl Bud Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'AvlBudAmt', 'value' => set_value('AvlBudAmt'), 'id' => 'AvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="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"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ItemName', 'value' => set_value('ItemName'), 'id' => 'ItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
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><?php echo "Basic Amt ($INRSYM)"; ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Type </label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Discount Type');
|
||
//print_r( $options);
|
||
if (!empty($TaxType)) {
|
||
foreach ($TaxType as $SID):
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType" class="form-control"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discount Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtDiscount', 'value' => set_value('txtDiscount'), 'id' => 'txtDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();calculateDiscount(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discounted Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtAfterDiscount', 'value' => set_value('txtAfterDiscount'), 'id' => 'txtAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" style="text-align:left;">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Type </label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Packaging Type');
|
||
//print_r( $options);
|
||
if (!empty($TaxType)) {
|
||
foreach ($TaxType as $SID):
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('PackagingType', $options, set_value('PackagingType'), 'id="PackagingType" class="form-control "');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtPackaging', 'value' => set_value('txtPackaging'), 'id' => 'txtPackaging', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtAfterPackaging', 'value' => set_value('txtAfterPackaging'), 'id' => 'txtAfterPackaging', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Type </label>
|
||
<?php
|
||
$options = array("0" => 'Select Freight Type');
|
||
//print_r( $options);
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID):
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight" class="form-control "');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtFreight', 'value' => set_value('txtFreight'), 'id' => 'txtFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtAfterFreight', 'value' => set_value('txtAfterFreight'), 'id' => 'txtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3" id="TripsValue" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'NOOfTrips', 'value' => set_value('NOOfTrips'), 'id' => 'NOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(0);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="cgstContainerAdd">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label for="Cgst">CGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Cgst', 'value' => set_value('Cgst', 0), 'id' => 'Cgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();RevenueChangeSgst();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'AfterCgst', 'value' => set_value('AfterCgst', 0), 'id' => 'AfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="SGSTAddModel">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Sgst', 'value' => set_value('Sgst', 0), 'id' => 'Sgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst', 0), 'id' => 'AfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="IGSTAddModel" style="display:none;">
|
||
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'Igst', 'value' => set_value('Igst', 0), 'id' => 'Igst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst', 0), 'id' => 'AfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3">
|
||
<label> Insurance <?php echo "($INRSYM)" ?> (if Any)</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtInsurance', 'value' => set_value('txtInsurance'), 'id' => 'txtInsurance', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateTotalValue(0);');
|
||
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">
|
||
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue'), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label><?php echo "Revenue Description"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'Add_Service_Description', 'value' => set_value('Add_Service_Description'), 'id' => 'Add_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
|
||
echo form_textarea($data);
|
||
;
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" data-dismiss="modal"
|
||
value="Cancel">Cancel</a>
|
||
<a class="btn btn-info waves-effect waves-light font AddRevenue" ID="AddRevenue"> <span
|
||
class="bold">Add Revenue</span></a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Edit Model for revenue po -->
|
||
<div id="EDITREVENUE" 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;">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Edit Revenue Purchase Order Line 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">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
|
||
$data = array('name' => 'EditReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditdeptName', 'value' => set_value('EditdeptName'), 'id' => 'EditdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div class="form-group">
|
||
<?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>Avl Bud Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditAvlBudAmt', 'value' => set_value('EditAvlBudAmt'), 'id' => 'EditAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="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('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditItemName', 'value' => set_value('EditItemName'), 'id' => 'EditItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', '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><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label> <?php
|
||
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditBasicValue', '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>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' => 'Editchange();calculateDiscount(1);', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Discounted Amt <?php echo "($INRSYM)" ?> </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>
|
||
<div class="form-row" style="text-align:left;">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Type </label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Select Packaging Type');
|
||
//print_r( $options);
|
||
|
||
if (!empty($TaxType)) {
|
||
foreach ($TaxType as $SID):
|
||
|
||
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType" class="form-control"');
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditPackaging', 'value' => set_value('txtEditPackaging'), 'id' => 'txtEditPackaging', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Amt <?php echo "($INRSYM)" ?> </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditAfterPackaging', 'value' => set_value('txtEditAfterPackaging'), 'id' => 'txtEditAfterPackaging', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Type </label>
|
||
<?php $options = array("0" => 'Select Freight Type');
|
||
if (!empty($FreightType)) {
|
||
foreach ($FreightType as $SID):
|
||
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight" class="form-control"'); ?>
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditFreight', 'value' => set_value('txtEditFreight'), 'id' => 'txtEditFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Freight Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditAfterFreight', 'value' => set_value('txtEditAfterFreight'), 'id' => 'txtEditAfterFreight', '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-9"></div>
|
||
<div class="form-group col-md-3" id="EditTripsValue" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditNOOfTrips', 'value' => set_value('EditNOOfTrips'), 'id' => 'EditNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(1);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-row" id="cgstContainerEdit">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label for="EditCgst">CGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditCgst', 'value' => set_value('EditCgst', 0), 'id' => 'EditCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();RevenueChangeEditSgst();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="EditAfterCgst"> CGST Amt <?php echo "($INRSYM)" ?> </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditAfterCgst', 'value' => set_value('EditAfterCgst', 0), 'id' => 'EditAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="SGSTEditModel">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditSgst', 'value' => set_value('EditSgst', 0), 'id' => 'EditSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => ' Editchange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditAfterSgst', 'value' => set_value('EditAfterSgst', 0), 'id' => 'EditAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="IGSTEditModel" style="display:none;">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditIgst', 'value' => set_value('EditIgst', 0), 'id' => 'EditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => ' Editchange();');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst', 0), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9"></div>
|
||
<div class="form-group col-md-3">
|
||
<label> Insurance Amt <?php echo "($INRSYM)" ?> (if Any)</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditInsurance', 'value' => set_value('txtEditInsurance'), 'id' => 'txtEditInsurance', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateEditTotalValue(1);', 'style' => 'text-align:right;');
|
||
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">
|
||
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtEditTotalOrderValue', 'value' => set_value('txtEditTotalOrderValue'), 'id' => 'txtEditTotalOrderValue', '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-12">
|
||
<label><?php echo "Revenue Description"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'Edit_Service_Description', 'value' => set_value('Edit_Service_Description'), 'id' => 'Edit_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
|
||
echo form_textarea($data);
|
||
;
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" data-dismiss="modal"
|
||
value="Cancel">Cancel</a>
|
||
<a class="btn btn-info waves-effect waves-light EditRevenue" ID="EditRevenue"> <span
|
||
class="bold">Edit Revenue</span></a>
|
||
</div>
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- View Model for revenue po -->
|
||
<div id="VIEWREVENUE" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
|
||
style="display: none;">
|
||
<div class="modal-dialog modal-xl ">
|
||
<div class="modal-content px-2">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">View Revenue Purchase Order Line Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<form class="">
|
||
<div class="modal-body">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
|
||
<?php
|
||
|
||
$data = array('name' => 'ViewReqNo', 'value' => set_value('ViewReqNo'), 'id' => 'ViewReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
|
||
<?php
|
||
$data = array('name' => 'ViewdeptName', 'value' => set_value('ViewdeptName'), 'id' => 'ViewdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
|
||
<?php
|
||
$data = array('name' => 'ViewCostCenter', 'value' => set_value('ViewCostCenter'), 'id' => 'ViewCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Avl Bud Amt <?php echo "($INRSYM)" ?></label>
|
||
|
||
<?php
|
||
$data = array('name' => 'ViewAvlBudAmt', 'value' => set_value('ViewAvlBudAmt'), 'id' => 'ViewAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<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 num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewItemName', 'value' => set_value('ViewItemName'), 'id' => 'ViewItemName', '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' => 'ViewUOM', 'value' => set_value('ViewUOM'), 'id' => 'ViewUOM', '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' => 'ViewQuantity', 'value' => set_value('ViewQuantity'), 'id' => 'ViewQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'style' => 'text-align:right;', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"> </div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewRate', 'value' => set_value('ViewRate'), 'id' => 'ViewRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<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>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtViewBasicValue', 'value' => set_value('txtViewBasicValue'), 'id' => 'txtViewBasicValue', '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>Discount Type </label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'ViewDiscountType', 'value' => set_value('ViewDiscountType'), 'id' => 'ViewDiscountType', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
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);', 'style' => 'text-align:right;', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Discounted Amt In ($INRSYM)"; ?></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;', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Type </label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewPackagingType', 'value' => set_value('ViewPackagingType'), 'id' => 'ViewPackagingType', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Packaging Rate </label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtViewPackaging', 'value' => set_value('txtViewPackaging'), 'id' => 'txtViewPackaging', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'style' => 'text-align:right;', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Packaging Amt ($INRSYM)"; ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtViewAfterPackaging', 'value' => set_value('txtViewAfterPackaging'), 'id' => 'txtViewAfterPackaging', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3"></div>
|
||
<div class="form-group col-md-3">
|
||
<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('drpViewFreight', $options, set_value('drpViewFreight'), 'id="drpViewFreight" class="form-control" disabled');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3" id="ViewTripsValue" style="display:none;">
|
||
<label>NO Of Trips</label>
|
||
<?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">
|
||
<label>Freight Rate </label>
|
||
<?php
|
||
$data = array('name' => 'txtViewFreight', 'value' => set_value('txtViewFreight'), 'id' => 'txtViewFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'style' => 'text-align:right;', 'onchange' => 'calculateFreight(2);', 'readonly' => 'readonly');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Freight Amt ($INRSYM)"; ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtViewAfterFreight', 'value' => set_value('txtViewAfterFreight'), 'id' => 'txtViewAfterFreight', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label for="ViewCGST">CGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewCGST', 'value' => set_value('tViewCGST'), 'id' => 'ViewCGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateCST(0);', 'readonly' => 'true', );
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewAfterCGST', 'value' => set_value('ViewAfterCGST'), 'id' => 'ViewAfterCGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="SGSTViewModel">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewSGST', 'value' => set_value('ViewSGST'), 'id' => 'ViewSGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateGST(0);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewAfterSGST', 'value' => set_value('ViewAfterSGST'), 'id' => 'ViewAfterSGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="IGSTViewModel" style="display:none;">
|
||
<div class="form-group col-md-6"></div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST In %</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewIGST', 'value' => set_value('tViewIGST'), 'id' => 'ViewIGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => ' calculateGST(0);', 'readonly' => 'true', );
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'ViewAfterIGST', 'value' => set_value('ViewAfterIGST'), 'id' => 'ViewAfterIGST', '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">
|
||
<label> Insurance <?php echo "($INRSYM)" ?> (if Any)</label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtViewInsurance', 'value' => set_value('txtViewInsurance'), 'id' => 'txtViewInsurance', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'style' => 'text-align:right;', '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"> <label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||
<div class="form-group">
|
||
<?php
|
||
$data = array('name' => 'txtViewTotalOrderValue', 'value' => set_value('txtViewTotalOrderValue'), 'id' => 'txtViewTotalOrderValue', '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-12">
|
||
<label><?php echo "Revenue Description"; ?></label>
|
||
<?php
|
||
$data = array('name' => 'View_Service_Description', 'value' => set_value('View_Service_Description'), 'id' => 'View_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100', 'readonly' => 'true');
|
||
echo form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal for Excise Duty Calculation-->
|
||
<div id="ExciseDutyCalModel" 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">Excise Duty Calculation On</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
<div class="radio">
|
||
<label><input type="radio" name="optExcise" checked="checked" value="0" id="optExcise">From
|
||
Basic Amount</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label><input type="radio" name="optExcise" value="1" id="optExcise">Basic Amount - Discount
|
||
Amount</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label><input type="radio" name="optExcise" value="2" id="optExcise">(Basic Amount - Discount
|
||
Amount ) + Packing Cost</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label><input type="radio" name="optExcise" value="3" id="optExcise">Basic Amount + Packing
|
||
Cost</label>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" ID="ExciseOption"
|
||
onclick="SetExciseCalculation();"> <span class="bold">Ok</span></a>
|
||
<a class="btn btn-info waves-effect waves-light" data-dismiss="modal" value="Cancel">Cancel</a>
|
||
</div>
|
||
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal for Vat Calculation -->
|
||
<div id="VatCalModel" 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">Vat Calculation On</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="radio">
|
||
<label><input type="radio" name="optVat" checked="checked" value="0" id="optVat">Basic
|
||
Amount</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label><input type="radio" name="optVat" value="1" id="optVat">Excise Duty</label>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" ID="ExciseOption" onclick="SetExciseCalculation();"
|
||
style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
||
<a class="btn btn-info waves-effect waves-light" data-dismiss="modal" style="margin-top: -24px;"
|
||
value="Cancel">Cancel</a>
|
||
</div>
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal for CST Calculation -->
|
||
<div id="CSTCalModel" 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">CST Calculation On</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="radio">
|
||
<label><input type="radio" name="optCST" checked="checked" value="0" id="optCST">Basic
|
||
Amount</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label><input type="radio" name="optCST" value="1" id="optCST">Excise Duty</label>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" ID="CSTOption" onclick="SetCSTCalculation();"
|
||
style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
||
<a class="btn btn-info waves-effect waves-light" data-dismiss="modal" style="margin-top: -24px;"
|
||
value="Cancel">Cancel</a>
|
||
</div>
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<!-- Revenue Special PO Modal Starts Here -->
|
||
<div id="EditRevenueSplPOModel" 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">Update <?php echo isset($getdata[0]->BillNo) ? $getdata[0]->BillNo : "" ?> Bill
|
||
Details</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<?php
|
||
$date = isset($getdata[0]->DeliveryChellanDate) ? format_date($getdata[0]->DeliveryChellanDate, 0, 'd-m-Y') : null;
|
||
$mrcdate = isset($getdata[0]->MaterialRcvdDate) ? format_date($getdata[0]->MaterialRcvdDate, 0, 'd-m-Y') : null;
|
||
?>
|
||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="form-row">
|
||
<div class="col-md-4 pad"><label>Delivery Challan /Inv No</label>
|
||
<input type="text" name="ChallanInvNo" id="ChallanInvNo" maxlength="12" class="form-control"
|
||
value="<?php echo isset($getdata[0]->DeliveryChellanOrInvoiceNo) ? $getdata[0]->DeliveryChellanOrInvoiceNo : null ?>"
|
||
onkeypress="return isNumberKey(event)">
|
||
</div>
|
||
<div class="col-md-4 pad"><label>Delivery Challan /Inv Date</label>
|
||
|
||
<?php
|
||
$data = array('name' => 'InvDate', 'value' => set_value('InvDate', $date), 'id' => 'InvDate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => '');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="col-md-4 pad"> <label>Material Received Date</label>
|
||
<?php
|
||
$data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate', $mrcdate), 'id' => 'MaterialRcvdDate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => '');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row">
|
||
|
||
<div class="col-md-4 pad"><label>Vehicle No</label>
|
||
<input type="text" name="VehicleNo" id="VehicleNo" maxlength="13" class="form-control"
|
||
value="<?php echo isset($getdata[0]->VehicleNo) ? $getdata[0]->VehicleNo : null; ?>">
|
||
</div>
|
||
<div class="col-md-4 pad"><label>Courier No</label>
|
||
<input type="text" name="CourierNo" id="CourierNo" maxlength="12" class="form-control"
|
||
value="<?php echo isset($getdata[0]->CourierNo) ? $getdata[0]->CourierNo : null; ?>">
|
||
</div>
|
||
<div class="form-group col-md-4" id="QualityChecked">
|
||
<label>Is Quality Check Required</label>
|
||
<br>
|
||
<input type="radio" name="Quality" checked="checked" value='0'
|
||
id="Quality"> <label>Yes</label>
|
||
|
||
|
||
<input type="radio" name="Quality" id="Quality" value='1'>
|
||
<label>No</label>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" onclick="splupdate()"> <span
|
||
class="bold">Update</span>
|
||
</a>
|
||
<a class="btn btn-info waves-effect waves-light" data-dismiss="modal"
|
||
onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
|
||
</div>
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal for freight Calculation-->
|
||
<div id="freightcalmodel" 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="optFreight" checked="checked" value='0' id="optFreight">
|
||
Basic
|
||
Amount</label>
|
||
</div>
|
||
<div>
|
||
<label><input type="radio" name="optFreight" id="optFreight" value='1'> After Discount
|
||
Amount</label>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer" style="border:none;">
|
||
|
||
<a class="btn btn-secondary waves-effect" data-dismiss="modal" style="margin-top: -24px;"
|
||
value="Cancel">Cancel</a>
|
||
<a class="btn btn-info waves-effect waves-light" ID="FreightOption" onclick="SetfreightOption();"
|
||
style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<div id="packagingcalmodel" class="modal fade" 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">Packing 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 waves-effect" data-dismiss="modal" style="margin-top: -24px;"
|
||
value="Cancel">Cancel</a>
|
||
<a class="btn btn-info waves-effect waves-light" ID="PackagingOption" onclick="SetPackagingOption();"
|
||
style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<!-- Revenue Special PO Modal Ends Here -->
|
||
<!-- Revenue bill Modal Starts Here -->
|
||
<div id="billModel" 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">Update Bill Details - <span id="showBillNoId"> </span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<?php
|
||
$date = isset($getdata[0]->DeliveryChellanDate) ? format_date($getdata[0]->DeliveryChellanDate, 0, 'd-m-Y') : null;
|
||
$mrcdate = isset($getdata[0]->MaterialRcvdDate) ? format_date($getdata[0]->MaterialRcvdDate, 0, 'd-m-Y') : null;
|
||
?>
|
||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-5">
|
||
|
||
<label for="images">Select New PO Bill file <br /><small>(only
|
||
.pdf,.excel,.doc,.png,.jpg)</small></label>
|
||
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="billimag"
|
||
name="images" onChange="filecheck();" />
|
||
<br><br>
|
||
<p><b>Previously Uploaded PO Bill <span class="text-danger"
|
||
id="showPreviousPoBill"></span></b> </p>
|
||
</div>
|
||
</div>
|
||
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
||
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-secondary waves-effect" onclick="splpoupdate()"> <span
|
||
class="bold">Update</span>
|
||
<a class="btn btn-info waves-effect waves-light" data-dismiss="modal"
|
||
onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<!-- Revenue Special PO Modal Ends Here -->
|
||
<!-- <script type="text/html" id="RevenueList">
|
||
<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="right"><%=Quantity%></td>
|
||
<td align="left"><%=UOM%></td>
|
||
<td align="right"><%=Rate%></td>
|
||
<td align="right"><%=BasicAmount%></td>
|
||
<td align="right"><%=Taxvalue%></td>
|
||
<td align="right"><%=TotalValue%></td>
|
||
<td align="right"><%=ActualQuantity%></td>
|
||
<td align="right"><%=ReceivedQuantity%></td>
|
||
<td align="right"><%=PendingQuantity%></td>
|
||
<td>
|
||
<a data-target='#EDITREVENUE' 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> </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> -->
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</script>
|
||
<script>
|
||
var index = <?php if (isset($index)) {
|
||
echo $index;
|
||
} ?>;
|
||
var userid = '';
|
||
var taxcheck = 0;
|
||
$("#BudgetType").change(function () {
|
||
var aa = $("#BudgetType option:selected").text();
|
||
$('#Budget').val(aa);
|
||
});
|
||
|
||
function openmodel(i) {
|
||
|
||
var deliveryinvoiceno = $("#deliveryinvoiceno" + i).val();
|
||
var deliverydate = $("#deliverydate" + i).val();
|
||
var vehicleno = $("#vehicleno" + i).val();
|
||
var courierno = $("#courierno" + i).val();
|
||
var MaterialRcvdDate = $("#MaterialRcvdDate" + i).val();
|
||
|
||
|
||
$("#EditRevenueSplPOModel").modal("show");
|
||
|
||
}
|
||
|
||
function openbillmodel(i) {
|
||
|
||
//alert(i);
|
||
var file = $("#file" + i).val();
|
||
//alert(file);
|
||
var Billno = $("#billnos" + i).val();
|
||
//alert(Billno);
|
||
|
||
$("#hideoldfile").val(file);
|
||
$("#hidebillno").val(Billno);
|
||
$('#showBillNoId').text(Billno);
|
||
$('#showPreviousPoBill').text(file);
|
||
$("#billModel").modal("show");
|
||
|
||
|
||
$("#bill").text(Billno);
|
||
}
|
||
$("#REVENUE").on("shown.bs.modal", function (e) {
|
||
|
||
$('#isEdit').val(0);
|
||
});
|
||
$('.AddRevenue').click(function () {
|
||
tinyMCE.triggerSave();
|
||
if (validateRevenueTax() && ExceedQuantityCheck()) {
|
||
var temp = parseInt(index) + 1;
|
||
var Reqnumber = $('#ReqNo').val();
|
||
var departmentName = $('#deptName').val();
|
||
var AvilBudget = $('#AvlBudAmt').val();
|
||
var costCode = $('#CostCenter').val();
|
||
var materialCode = $('#MaterialCode').val();
|
||
var materialName = $("#ItemName").val();
|
||
var uom = $("#UOM").val();
|
||
var quantity = parseFloat($("#Quantity").val()).toFixed(2);
|
||
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
|
||
var PER = $("#AddPer").val();
|
||
//alert(PER);
|
||
if (PER == '') {
|
||
PER = $("#UOM").val();
|
||
}
|
||
var DisType = $("#DiscountType").val();
|
||
var DisVal = $("#txtDiscount").val();
|
||
var AfterDisVal = $("#txtAfterDiscount").val();
|
||
|
||
var PackOption = PackagingCalculation;
|
||
var PackType = $("#PackagingType").val();
|
||
var PackVal = $("#txtPackaging").val();
|
||
var AfterPackVal = $("#txtAfterPackaging").val();
|
||
|
||
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 FreightType = $("#drpFreight").val();
|
||
var FreightVal = $("#txtFreight").val();
|
||
var AfterFreightVal = $("#txtAfterFreight").val();
|
||
var NoOfTrip = $("#NOOfTrips").val();
|
||
var basicval = $("#txtBasicValue").val();
|
||
var Insval = $("#txtInsurance").val();
|
||
var TotalOrderValue = $("#txtTotalOrderValue").val();
|
||
var service_description = $("#Add_Service_Description").val();
|
||
// alert(service_description);
|
||
var TotalTaxValue = calculateTaxValue();
|
||
|
||
|
||
// $('#ReqNo').val(Reqnumber).remove();
|
||
// $('#ReqNo option[value='+Reqnumber+']').remove();
|
||
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
||
SelectedMaterialCode[CollIndex] = materialCode;
|
||
CollIndex = CollIndex + 1;
|
||
SelectedMaterialList.Mat.push({
|
||
"materialCode": materialCode,
|
||
"ReqNo": Reqnumber,
|
||
|
||
});
|
||
index = parseInt(index) + 1;
|
||
|
||
// var template = jQuery("#RevenueList").html();
|
||
|
||
|
||
// $('#RevenueAppend').append(_.template(template, {
|
||
// index: temp,
|
||
// ReqNo: Reqnumber,
|
||
// MaterialCode: materialCode,
|
||
// MaterialName: materialName,
|
||
// Quantity: quantity,
|
||
// UOM: uom,
|
||
// Rate: itemRate,
|
||
// AddPer: PER,
|
||
// Add_Service_Description: service_description,
|
||
// BasicAmount: basicval,
|
||
// Taxvalue: TotalTaxValue,
|
||
// TotalValue: TotalOrderValue,
|
||
// ActualQuantity: quantity,
|
||
// ReceivedQuantity: 0,
|
||
// PendingQuantity: quantity
|
||
// }));
|
||
var rowHtml = `
|
||
<tr id="${temp}">
|
||
<td align="left">${temp}</td>
|
||
<td align="left">${Reqnumber}</td>
|
||
<td align="left">${materialCode}</td>
|
||
<td align="left">${materialName}</td>
|
||
<td align="left">${quantity}</td>
|
||
<td align="left">${uom}</td>
|
||
<td align="right">${itemRate}</td>
|
||
<td align="right">${basicval}</td>
|
||
<td align="right">${TotalTaxValue}</td>
|
||
<td align="right">${TotalOrderValue}</td>
|
||
<td>
|
||
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||
<i class="ri-pencil-fill"></i>
|
||
</a>
|
||
|
||
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||
<span class="ri-delete-bin-7-fill"></span>
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
`;
|
||
$('#RevenueAppend').append(rowHtml);
|
||
|
||
|
||
|
||
var theForm = $(".CreatePO");
|
||
|
||
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
|
||
addHidden(theForm, "departmentName" + temp, departmentName);
|
||
addHidden(theForm, "AvilBudget" + temp, AvilBudget);
|
||
addHidden(theForm, "costCode" + temp, costCode);
|
||
addHidden(theForm, "materialCode" + temp, materialCode);
|
||
addHidden(theForm, "materialName" + temp, materialName);
|
||
addHidden(theForm, "uom" + temp, uom);
|
||
addHidden(theForm, "quantity" + temp, quantity);
|
||
addHidden(theForm, "itemRate" + temp, itemRate);
|
||
addHidden(theForm, "DisType" + temp, DisType);
|
||
addHidden(theForm, "DisVal" + temp, DisVal);
|
||
addHidden(theForm, "AfterDisVal" + temp, AfterDisVal);
|
||
addHidden(theForm, "PackOption" + temp, PackOption);
|
||
addHidden(theForm, "PackType" + temp, PackType);
|
||
addHidden(theForm, "PackVal" + temp, PackVal);
|
||
addHidden(theForm, "AfterPackVal" + temp, AfterPackVal);
|
||
|
||
addHidden(theForm, "FreightType" + temp, FreightType);
|
||
addHidden(theForm, "FreightVal" + temp, FreightVal);
|
||
addHidden(theForm, "AfterFreightVal" + temp, AfterFreightVal);
|
||
addHidden(theForm, "NoOfTrip" + temp, NoOfTrip);
|
||
addHidden(theForm, "basicval" + temp, basicval);
|
||
addHidden(theForm, "Insval" + temp, Insval);
|
||
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
||
addHidden(theForm, "RevenueCgst" + temp, Cgst);
|
||
addHidden(theForm, "RevenueAfterCgst" + temp, AfterCgst);
|
||
addHidden(theForm, "RevenueSgst" + temp, Sgst);
|
||
addHidden(theForm, "RevenueAfterSgst" + temp, AfterSgst);
|
||
addHidden(theForm, "RevenueIgst" + temp, Igst);
|
||
addHidden(theForm, "RevenueAfterIgst" + temp, AfterIgst);
|
||
addHidden(theForm, "LineItemNo" + temp, '');
|
||
addHidden(theForm, "per" + temp, PER);
|
||
addHidden(theForm, "service_description" + temp, service_description);
|
||
$('#txtRowCount').val(temp);
|
||
populateValueMainFormForRevenue();
|
||
clearRevenueModalFields();
|
||
$('#REVENUE').modal('hide');
|
||
}
|
||
|
||
});
|
||
|
||
|
||
$('.EditRevenue').click(function () {
|
||
|
||
tinyMCE.triggerSave();
|
||
if (validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck()) {
|
||
//alert('inside Add');
|
||
var CostCode = $("#EditCostCenter").val();
|
||
var AvilBudget = $('#EditAvlBudAmt').val();
|
||
var editMaterialCode = $("#EditMaterialCode").val();
|
||
var editDescription = $("#EditItemName").val();
|
||
var editUOM = $('#EditUOM').val();
|
||
var editQuantity = $('#EditQuantity').val();
|
||
|
||
var itemRate = $("#EditRate").val();
|
||
var per = $("#EditPer").val();
|
||
if (per == '') {
|
||
per = $('#EditUOM').val();
|
||
}
|
||
|
||
var DisType = $("#EditDiscountType").val();
|
||
var DisVal = $("#txtEditDiscount").val();
|
||
var AfterDisVal = $("#txtEditAfterDiscount").val();
|
||
|
||
var PackOption = PackagingCalculation;
|
||
var PackType = $("#EditPackagingType").val();
|
||
var PackVal = $("#txtEditPackaging").val();
|
||
var AfterPackVal = $("#txtEditAfterPackaging").val();
|
||
|
||
var Cgst = $("#EditCgst").val();
|
||
var AfterCgst = $("#EditAfterCgst").val();
|
||
var Sgst = $("#EditSgst").val();
|
||
var AfterSgst = $("#EditAfterSgst").val();
|
||
var Igst = $("#EditIgst").val();
|
||
var AfterIgst = $("#EditAfterIgst").val();
|
||
// console.log("cgst"+Cgst);
|
||
// console.log("after cgst"+AfterCgst);
|
||
// console.log('sgst'+Sgst);
|
||
// console.log("After Sgst"+AfterSgst);
|
||
|
||
var FreightType = $("#drpEditFreight").val();
|
||
var FreightVal = $("#txtEditFreight").val();
|
||
var AfterFreightVal = $("#txtEditAfterFreight").val();
|
||
var NoOfTrip = $("#EditNOOfTrips").val();
|
||
var basicval = $("#txtEditBasicValue").val();
|
||
var Insval = $("#txtEditInsurance").val();
|
||
var TotalOrderValue = $("#txtEditTotalOrderValue").val();
|
||
var Service_Description = $("#Edit_Service_Description").val();
|
||
var TotalTaxValue = calculateEditTaxValue();
|
||
|
||
|
||
|
||
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
|
||
cellval[2].innerHTML = editMaterialCode;
|
||
cellval[3].innerHTML = editDescription;
|
||
cellval[4].innerHTML = editQuantity;
|
||
cellval[5].innerHTML = editUOM;
|
||
cellval[6].innerHTML = itemRate;
|
||
cellval[7].innerHTML = basicval;
|
||
cellval[8].innerHTML = TotalTaxValue;
|
||
cellval[9].innerHTML = TotalOrderValue;
|
||
|
||
|
||
$('#materialCode' + userid).val(editMaterialCode);
|
||
$('#materialName' + userid).val(editDescription);
|
||
$('#uom' + userid).val(editUOM);
|
||
$('#per' + userid).val(per);
|
||
$('#quantity' + userid).val(editQuantity);
|
||
$('#itemRate' + userid).val(itemRate);
|
||
$('#DisType' + userid).val(DisType);
|
||
$('#DisVal' + userid).val(DisVal);
|
||
$('#AfterDisVal' + userid).val(AfterDisVal);
|
||
$('#PackOption' + userid).val(PackOption);
|
||
$('#PackType' + userid).val(PackType);
|
||
$('#PackVal' + userid).val(PackVal);
|
||
$('#AfterPackVal' + userid).val(AfterPackVal);
|
||
$('#RevenueCgst' + userid).val(Cgst);
|
||
var taxvaluecheck = $('#txttaxcheck').val();
|
||
if (taxvaluecheck == 1) {
|
||
$('#RevenueAfterSgst' + userid).val(0);
|
||
$('#RevenueSgst' + userid).val(0);
|
||
}
|
||
$('#RevenueAfterCgst' + userid).val(AfterCgst);
|
||
$('#RevenueAfterSgst' + userid).val(AfterSgst);
|
||
$('#RevenueSgst' + userid).val(Sgst);
|
||
$('#RevenueIgst' + userid).val(Igst);
|
||
$('#RevenueAfterIgst' + userid).val(AfterIgst);
|
||
$('#FreightType' + userid).val(FreightType);
|
||
$('#FreightVal' + userid).val(FreightVal);
|
||
$('#AfterFreightVal' + userid).val(AfterFreightVal);
|
||
$('#NoOfTrip' + userid).val(NoOfTrip);
|
||
$('#basicval' + userid).val(basicval);
|
||
$('#Insval' + userid).val(Insval);
|
||
$('#AvilBudget' + userid).val(AvilBudget);
|
||
$('#costCode' + userid).val(CostCode);
|
||
$('#TotalOrderValue' + userid).val(TotalOrderValue);
|
||
$('#service_description' + userid).val(Service_Description);
|
||
|
||
populateValueMainFormForEditRevenueTax();
|
||
setTimeout(() => {
|
||
$('#EDITREVENUE').modal('hide');
|
||
}, 1000);
|
||
}
|
||
|
||
});
|
||
$('.ViewRevenue').click(function () {
|
||
//alert("Working");
|
||
|
||
|
||
var FreightType = $("#drpViewFreight").val();
|
||
var FreightVal = $("#txtViewFreight").val();
|
||
var AfterFreightVal = $("#txtViewAfterFreight").val();
|
||
var NoOfTrip = $("#ViewNOOfTrips").val();
|
||
var Cgst = $("#ViewAfterCGST").val();
|
||
//alert(Cgst);
|
||
var Sgst = $("#ViewAfterSGST").val();
|
||
var Igst = $("#ViewAfterIGST").val();
|
||
// alert(Igst);
|
||
if (FreightType != 'PER TRIP') {
|
||
NoOfTrip = 0;
|
||
}
|
||
|
||
|
||
var TotalOrderValue = $("#txtViewTotalOrderValue").val();
|
||
|
||
//alert(FreightType+'-'+FreightVal+'-'+AfterFreightVal+'-'+NoOfTrip+'-'+TotalOrderValue);
|
||
|
||
|
||
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
|
||
|
||
cellval[9].innerHTML = TotalOrderValue;
|
||
|
||
|
||
|
||
$('#FreightType' + userid).val(FreightType);
|
||
$('#FreightVal' + userid).val(FreightVal);
|
||
$('#AfterFreightVal' + userid).val(AfterFreightVal);
|
||
$('#NoOfTrip' + userid).val(NoOfTrip);
|
||
$('#RevenueAfterCgst' + userid).val(Cgst);
|
||
$('#RevenueAfterSgst' + userid).val(Sgst);
|
||
$('#RevenueAfterIgst' + userid).val(Igst);
|
||
$('#TotalOrderValue' + userid).val(TotalOrderValue);
|
||
|
||
|
||
populateValueMainFormForEditRevenueTax();
|
||
// }
|
||
|
||
});
|
||
|
||
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 populateValueMainFormForRevenue() {
|
||
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
||
var Cgst = $('#AfterCgst').val() == '' ? '0.00' : $("#AfterCgst").val();
|
||
var Sgst = $('#AfterSgst').val() == '' ? '0.00' : $("#AfterSgst").val();
|
||
var Igst = $('#AfterIgst').val() == '' ? '0.00' : $("#AfterIgst").val();
|
||
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
||
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
||
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
||
var TotalVal = $('#txtTotalOrderValue').val() == '' ? '0.00' : $('#txtTotalOrderValue').val();
|
||
|
||
var TotalOrderValueSummary = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
|
||
|
||
var totBasicAmt = $('#txtTotBasicAmount').val() == '' ? '0.00' : $('#txtTotBasicAmount').val();
|
||
var totDiscountAmt = $('#txtTotalDiscount').val() == '' ? '0.00' : $('#txtTotalDiscount').val();
|
||
var totPackagingAmt = $('#txtTotalPackaing').val() == '' ? '0.00' : $('#txtTotalPackaing').val();
|
||
var txtTotalCGST = $('#txtTotalCGST').val() == '' ? '0.00' : $('#txtTotalCGST').val();
|
||
|
||
var txtTotalSGST = $('#txtTotalSGST').val() == '' ? '0.00' : $('#txtTotalSGST').val();
|
||
var txtTotalIGST = $('#txtTotalIGST').val() == '' ? '0.00' : $('#txtTotalIGST').val();
|
||
var totFreightAmt = $('#txtTotalFreight').val() == '' ? '0.00' : $('#txtTotalFreight').val();
|
||
var totInsuranceAmt = $('#totInsuranceAmt').val() == '' ? '0.00' : $('#totInsuranceAmt').val();
|
||
var totOrderSummaryAmt = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
|
||
|
||
$('#txtTotBasicAmount').val((parseFloat(totBasicAmt) + parseFloat(BasicVal)).toFixed(2));
|
||
$('#txtTotalDiscount').val((parseFloat(totDiscountAmt) + parseFloat(Discount)).toFixed(2));
|
||
$('#txtTotalPackaing').val((parseFloat(totPackagingAmt) + parseFloat(Packaging)).toFixed(2));
|
||
$('#txtTotalCGST').val((parseFloat(txtTotalCGST) + parseFloat(Cgst)).toFixed(2));
|
||
$('#txtTotalSGST').val((parseFloat(txtTotalSGST) + parseFloat(Sgst)).toFixed(2));
|
||
$('#txtTotalIGST').val((parseFloat(txtTotalIGST) + parseFloat(Igst)).toFixed(2));
|
||
$('#txtTotalFreight').val((parseFloat(totFreightAmt) + parseFloat(Freight)).toFixed(2));
|
||
$('#totInsuranceAmt').val((parseFloat(totInsuranceAmt) + parseFloat(Insurance)).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val((parseFloat(totOrderSummaryAmt) + parseFloat(TotalVal)).toFixed(2));
|
||
|
||
}
|
||
|
||
function populateValueMainFormForEditRevenueTax() {
|
||
|
||
var rows = document.getElementById('revenueTax').rows.length;
|
||
//alert(rows);
|
||
var editrow = parseFloat(rows) - 1;
|
||
//alert(editrow);
|
||
var totBasicAmt = 0;
|
||
var totDiscountAmt = 0;
|
||
var totPackagingAmt = 0;
|
||
var totCgst = 0;
|
||
var totSgst = 0;
|
||
var totIgst = 0;
|
||
var totFreightAmt = 0;
|
||
var totInsuranceAmt = 0;
|
||
var totOrderSummaryAmt = 0;
|
||
var i = 0;
|
||
do {
|
||
i += 1;
|
||
|
||
// alert(i);
|
||
var tr = document.getElementById(i);
|
||
//alert(tr);
|
||
if (tr != null) {
|
||
cells = tr.getElementsByTagName('td');
|
||
|
||
|
||
var rowid = cells[0].innerHTML;
|
||
// alert(rowid);
|
||
var Packaging = $('#AfterPackVal' + rowid).val() == '' ? '0.00' : $('#AfterPackVal' + rowid).val();
|
||
var Cgst = $('#RevenueAfterCgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst' + rowid).val();
|
||
var Sgst = $('#RevenueAfterSgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst' + rowid).val();
|
||
var Igst = $('#RevenueAfterIgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst' + rowid).val();
|
||
var Freight = $('#AfterFreightVal' + rowid).val() == '' ? '0.00' : $('#AfterFreightVal' + rowid).val();
|
||
var Insurance = $('#Insval' + rowid).val() == '' ? '0.00' : $('#Insval' + rowid).val();
|
||
var Discount = $('#AfterDisVal' + rowid).val() == '' ? '0.00' : $('#AfterDisVal' + rowid).val();
|
||
var BasicVal = $('#basicval' + rowid).val() == '' ? '0.00' : $('#basicval' + rowid).val();
|
||
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
||
//alert(TotalVal);
|
||
|
||
|
||
totBasicAmt = parseFloat(totBasicAmt) + parseFloat(BasicVal);
|
||
totDiscountAmt = parseFloat(totDiscountAmt) + parseFloat(Discount);
|
||
totPackagingAmt = parseFloat(totPackagingAmt) + parseFloat(Packaging);
|
||
totCgst = parseFloat(totCgst) + parseFloat(Cgst);
|
||
totSgst = parseFloat(totSgst) + parseFloat(Sgst);
|
||
totIgst = parseFloat(totIgst) + parseFloat(Igst);
|
||
totFreightAmt = parseFloat(totFreightAmt) + parseFloat(Freight);
|
||
totInsuranceAmt = parseFloat(totInsuranceAmt) + parseFloat(Insurance);
|
||
totOrderSummaryAmt = parseFloat(totOrderSummaryAmt) + parseFloat(TotalVal);
|
||
}
|
||
|
||
} while (i < editrow);
|
||
|
||
|
||
$('#txtTotBasicAmount').val(parseFloat(totBasicAmt).toFixed(2));
|
||
$('#txtTotalDiscount').val(parseFloat(totDiscountAmt).toFixed(2));
|
||
$('#txtTotalPackaing').val(parseFloat(totPackagingAmt).toFixed(2));
|
||
$('#txtTotalCGST').val(parseFloat(totCgst).toFixed(2));
|
||
$('#txtTotalSGST').val(parseFloat(totSgst).toFixed(2));
|
||
$('#txtTotalIGST').val(parseFloat(totIgst).toFixed(2));
|
||
$('#txtTotalFreight').val(parseFloat(totFreightAmt).toFixed(2));
|
||
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2));
|
||
|
||
}
|
||
|
||
function clearRevenueModalFields() {
|
||
// To reset the Modal controls
|
||
$('#ReqNo').val('0');
|
||
$('#deptName').val('');
|
||
$('#CostCenter').val("0");
|
||
$('#AvlBudAmt').val('');
|
||
$('#MaterialCode').val("0");
|
||
$("#ItemName").val('');
|
||
$('#UOM').val('');
|
||
$('#AddPer').val('');
|
||
$('#Quantity').val('');
|
||
$("#Rate").val('');
|
||
$("#DiscountType").val('0');
|
||
$("#txtDiscount").val('');
|
||
$("#txtAfterDiscount").val('');
|
||
$("#PackagingType").val('0');
|
||
$("#txtPackaging").val('');
|
||
$("#txtAfterPackaging").val('');
|
||
$("input:radio[name='optPackaging'][value='0']").prop('checked', 'checked');
|
||
$("input:radio[name='optExcise'][value='0']").prop('checked', 'checked');
|
||
$("input:radio[name='optVat'][value='0']").prop('checked', 'checked');
|
||
$("input:radio[name='optCST'][value='0']").prop('checked', 'checked');
|
||
$("#Cgst").val('0');
|
||
$("#Sgst").val('0');
|
||
$("#Igst").val('0');
|
||
$("#AfterCgst").val('0');
|
||
$("#AfterSgst").val('0');
|
||
$("#AfterIgst").val('0');
|
||
$("#drpFreight").val('0');
|
||
$("#txtFreight").val('');
|
||
$("#txtAfterFreight").val('');
|
||
$("#NOOfTrips").val('');
|
||
$("#txtBasicValue").val('');
|
||
$("#txtInsurance").val('');
|
||
$("#txtTotalOrderValue").val('');
|
||
tinyMCE.activeEditor.setContent('');
|
||
}
|
||
|
||
function validateEditRevenueTax() {
|
||
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 ($('#EditQuantity').val() == '') {
|
||
alert('Please Enter the Quantity value');
|
||
$('#EditQuantity').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate of the Item');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function calculateCgstTax(varBasicValue, Cgst, discount, pack, freight) {
|
||
|
||
//alert("Working");
|
||
var discount1 = discount;
|
||
//alert('dis'+discount1);
|
||
var basicValue1 = parseFloat(varBasicValue - discount1);
|
||
//alert('basicValue1'+basicValue1);
|
||
var packaging = parseFloat(pack);
|
||
//alert('packaging'+packaging);
|
||
var freight1 = parseFloat(freight);
|
||
//alert('freight1'+freight1);
|
||
var packfreight = parseFloat(packaging) + parseFloat(freight1);
|
||
//alert('packfreight'+packfreight);
|
||
var basicValue = parseFloat(basicValue1 + packfreight)
|
||
var Cgst = parseFloat(Cgst);
|
||
//alert(basicValue+'-'+Cgst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>; //((Cgst/100) * basicValue)
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
//alert('FInal' + TAXval);
|
||
|
||
$('#ViewAfterCGST').val(TAXval);
|
||
$('#ViewAfterSGST').val(TAXval);
|
||
return TAXval;
|
||
}
|
||
|
||
function calculateSgstTax(varBasicValue, Sgst, discount, pack, freight) {
|
||
var discount1 = discount;
|
||
var basicValue1 = parseFloat(varBasicValue - discount1);
|
||
var packaging = parseFloat(pack);
|
||
//alert('f'+packaging);
|
||
var freight1 = parseFloat(freight);
|
||
|
||
var packfreight = parseFloat(packaging) + parseFloat(freight1);
|
||
|
||
var basicValue = parseFloat(basicValue1 + packfreight)
|
||
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, discount, pack1, freight1) {
|
||
var discount = discount;
|
||
var packaging = parseFloat(pack1);
|
||
var freight = parseFloat(freight1);
|
||
var packfreight = parseFloat(packaging) + parseFloat(freight);
|
||
var basicValue1 = parseFloat(varBasicValue - discount);
|
||
var basicValue = parseFloat(basicValue1 + packfreight)
|
||
//alert(basicValue);
|
||
var Igst = parseFloat(Igst);
|
||
//alert(Igst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
$('#ViewAfterIGST').val(TAXval);
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
}
|
||
|
||
function validateBudgetExceedLimit() {
|
||
var rows = document.getElementById('revenueTax').rows.length;
|
||
var ReqType = '<?php echo REVENUE ?>';
|
||
|
||
for (i = 1; i < rows; i++) {
|
||
var costcode = $('#costCode' + i).val();
|
||
var basicAmountRate = parseFloat($('#basicval' + i).val());
|
||
var totalAmount = parseFloat($('#TotalOrderValue' + i).val());
|
||
var avalbudAmt = '';
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: {
|
||
id: costcode,
|
||
type: ReqType
|
||
},
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
||
success: function (data) {
|
||
$('#loader').show();
|
||
if (data) {
|
||
//alert(data);
|
||
avalbudAmt = parseFloat(data);
|
||
// if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
|
||
// {
|
||
// alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
// $('#Rate').focus();
|
||
// return false;
|
||
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
|
||
}
|
||
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
}
|
||
|
||
function DeleteRow(rowid) {
|
||
var id = [];
|
||
var DelRows = $('#txtDeletedRow').val();
|
||
//alertMaterialListrowid);
|
||
var tr = document.getElementById(rowid);
|
||
// var cellval = tr.cells;
|
||
var MaterialCode = $('#materialCode' + rowid).val();
|
||
var LineItemNo = $('#LineItemNo' + rowid).val();
|
||
var ReqNo = $('#Reqnumber' + rowid).val();
|
||
var POType = '<?php echo REVENUE ?>';
|
||
id[0] = LineItemNo;
|
||
id[1] = ReqNo;
|
||
id[2] = MaterialCode;
|
||
id[3] = POType;
|
||
|
||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||
if (answer) {
|
||
populateValueMainFormForDeleteItem(rowid);
|
||
tr.parentNode.removeChild(tr);
|
||
|
||
var removeItem = $('#materialCode' + rowid).val();
|
||
|
||
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
|
||
$.each(SelectedMaterialList.Mat, function (i, el) {
|
||
|
||
if (this.materialCode == removeItem) { //Type = '';
|
||
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;
|
||
}
|
||
|
||
});
|
||
|
||
|
||
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();
|
||
if (data) {
|
||
alert(data);
|
||
|
||
} else {
|
||
alert("Error");
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
//populateValueMainFormForDeleteItem(rowid);
|
||
|
||
}
|
||
|
||
}
|
||
|
||
function populateValueMainFormForDeleteItem(rowid) {
|
||
|
||
var totBasicAmt = $('#txtTotBasicAmount').val();
|
||
var totDiscountAmt = $('#txtTotalDiscount').val();
|
||
var totPackagingAmt = $('#txtTotalPackaing').val();
|
||
var totCgst = $('#txtTotalCGST').val();
|
||
var totSgst = $('#txtTotalSGST').val();
|
||
var totIgst = $('#txtTotalIGST').val();
|
||
var totFreightAmt = $('#txtTotalFreight').val();
|
||
var totInsuranceAmt = $('#totInsuranceAmt').val();
|
||
var totOrderSummaryAmt = $('#txtTotalOrderValueSummary').val();
|
||
|
||
|
||
|
||
var Packaging = $('#AfterPackVal' + rowid).val() == '' ? '0.00' : $('#AfterPackVal' + rowid).val();
|
||
|
||
var Freight = $('#AfterFreightVal' + rowid).val() == '' ? '0.00' : $('#AfterFreightVal' + rowid).val();
|
||
var Insurance = $('#Insval' + rowid).val() == '' ? '0.00' : $('#Insval' + rowid).val();
|
||
var Discount = $('#AfterDisVal' + rowid).val() == '' ? '0.00' : $('#AfterDisVal' + rowid).val();
|
||
var BasicVal = $('#basicval' + rowid).val() == '' ? '0.00' : $('#basicval' + rowid).val();
|
||
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
||
//alert(TotalVal);
|
||
var Cgst = $('#RevenueAfterCgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst' + rowid).val();
|
||
var Sgst = $('#RevenueAfterSgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst' + rowid).val();
|
||
var Igst = $('#RevenueAfterIgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst' + rowid).val();
|
||
|
||
totBasicAmt = parseFloat(totBasicAmt) - parseFloat(BasicVal);
|
||
totDiscountAmt = parseFloat(totDiscountAmt) - parseFloat(Discount);
|
||
totPackagingAmt = parseFloat(totPackagingAmt) - parseFloat(Packaging);
|
||
|
||
totFreightAmt = parseFloat(totFreightAmt) - parseFloat(Freight);
|
||
totInsuranceAmt = parseFloat(totInsuranceAmt) - parseFloat(Insurance);
|
||
totOrderSummaryAmt = parseFloat(totOrderSummaryAmt) - parseFloat(TotalVal);
|
||
totCgst = parseFloat(totCgst) - parseFloat(Cgst);
|
||
totSgst = parseFloat(totSgst) - parseFloat(Sgst);
|
||
totIgst = parseFloat(totIgst) - parseFloat(Igst);
|
||
|
||
|
||
$('#txtTotBasicAmount').val((parseFloat(totBasicAmt)).toFixed(2));
|
||
$('#txtTotalDiscount').val((parseFloat(totDiscountAmt)).toFixed(2));
|
||
$('#txtTotalPackaing').val((parseFloat(totPackagingAmt)).toFixed(2));
|
||
$('#txtTotalCGST').val((parseFloat(totCgst)).toFixed(2));
|
||
$('#txtTotalSGST').val((parseFloat(totSgst)).toFixed(2));
|
||
$('#txtTotalIGST').val((parseFloat(totIgst)).toFixed(2));
|
||
$('#txtTotalFreight').val((parseFloat(totFreightAmt)).toFixed(2));
|
||
$('#totInsuranceAmt').val((parseFloat(totInsuranceAmt)).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val((parseFloat(totOrderSummaryAmt)).toFixed(2));
|
||
|
||
}
|
||
|
||
// this function is used to clear data changing schedule option
|
||
$('#Scheduleby').change(function () {
|
||
|
||
$("#Deliverydt").datepicker({
|
||
minDate: 'now',
|
||
dateFormat: 'mm/dd/yy',
|
||
changeMonth: true,
|
||
changeYear: true
|
||
}); //,yearRange: '0:+10's
|
||
|
||
});
|
||
$('#Deliverydt').change(function () {
|
||
|
||
$('#Scheduleby').val('');
|
||
|
||
});
|
||
|
||
function RevenueChangeSgst() {
|
||
var getTypeOfTax = $("input:radio[name='Range']:checked").val();
|
||
if (getTypeOfTax == 0) {
|
||
$('#Sgst').val($('#Cgst').val());
|
||
change();
|
||
}
|
||
}
|
||
|
||
function RevenueChangeEditSgst() {
|
||
var getEditTypeOfTax = $("input:radio[name='Range']:checked").val();
|
||
if (getEditTypeOfTax == 0) {
|
||
$('#EditSgst').val($('#EditCgst').val());
|
||
Editchange();
|
||
}
|
||
}
|
||
|
||
function RevenueChangeviewSgst() {
|
||
var getTypeOfTax = $("input:radio[name='Range']:checked").val();
|
||
if (getTypeOfTax == 0) {
|
||
$('#ViewSGST').val($('#ViewCGST').val());
|
||
change();
|
||
}
|
||
}
|
||
|
||
function change() {
|
||
ExceedQuantityCheck();
|
||
if ($('#Quantity').val() != '' && $('#Rate').val() != '') {
|
||
var txtQuantity = parseFloat($('#Quantity').val());
|
||
var txtUnitPrice = parseFloat($('#Rate').val());
|
||
var Tot = txtQuantity * txtUnitPrice
|
||
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
||
if ($("#DiscountType").val() != 0) {
|
||
calculateDiscount(0);
|
||
}
|
||
|
||
|
||
if ($("#PackagingType").val() != 0) {
|
||
calculatePackaging(0);
|
||
}
|
||
if ($("#drpFreight").val() != 0) {
|
||
calculateFreight(0);
|
||
|
||
}
|
||
if ($("#Cgst").val() != '') {
|
||
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(), $('#Cgst').val(), $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(), $("#txtAfterPackaging").val() == '' ? "0.00" : $('#txtAfterPackaging').val(), $("#txtAfterFreight").val() == '' ? "0.00" : $('#txtAfterFreight').val()));
|
||
}
|
||
if ($("#Sgst").val() != '') {
|
||
|
||
$('#AfterSgst').val(calculateSgstTax($('#txtBasicValue').val(), $('#Sgst').val(), $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(), $("#txtAfterPackaging").val() == '' ? "0.00" : $('#txtAfterPackaging').val(), $("#txtAfterFreight").val() == '' ? "0.00" : $('#txtAfterFreight').val()));
|
||
}
|
||
|
||
if ($("#Igst").val() != '') {
|
||
|
||
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(), $('#Igst').val(), $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val(), $("#txtAfterPackaging").val() == '' ? "0.00" : $('#txtAfterPackaging').val(), $("#txtAfterFreight").val() == '' ? "0.00" : $('#txtAfterFreight').val()));
|
||
}
|
||
calculateTotalValue();
|
||
|
||
}
|
||
|
||
}
|
||
|
||
function calculateTotalValue() {
|
||
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
||
var Cgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
||
var Sgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
||
var Igst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
||
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
||
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
||
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
||
|
||
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
||
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
|
||
$('#txtTotalOrderValue').val(tot);
|
||
|
||
//validateExceedLimit();
|
||
// ExceedQuantityCheck();
|
||
}
|
||
|
||
function calculateTaxValue() {
|
||
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
||
|
||
var AfterCgst = $("#AfterCgst").val();
|
||
|
||
var AfterSgst = $("#AfterSgst").val();
|
||
|
||
var AfterIgst = $("#AfterIgst").val();
|
||
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
||
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
||
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
||
var txtEditAfterPackaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
||
|
||
var totvalue = parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst);
|
||
|
||
var tot = parseFloat(totvalue).toFixed(2);
|
||
// alert('tot:'+tot);
|
||
return tot;
|
||
}
|
||
//If others is the payment terms to display mandatory field
|
||
$("#PaymentTerms").change(function () {
|
||
if ($('#PaymentTerms').val().trim() == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
} else {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
}
|
||
});
|
||
$('#ReqNo').change(function () {
|
||
|
||
var id = $('#ReqNo').val();
|
||
$("#deptName").val('');
|
||
$("#CostCenter").val('');
|
||
$("#MaterialCode").empty();
|
||
$("#ItemName").val('');
|
||
$("#UOM").val('');
|
||
$("#Quantity").val(0);
|
||
$("#ItemName").val('');
|
||
$("#Rate").val('');
|
||
$("#txtBasicValue").val('');
|
||
$("#AvlBudAmt").val('');
|
||
resetTaxField();
|
||
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 ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
|
||
// For Binding DepartmentName
|
||
$.each(y, function (idx, obj) {
|
||
if (obj.ReqNo === id) {
|
||
$("#deptName").val(obj.DepartmentName);
|
||
$("#CostCenter").val(obj.CostCenterCode);
|
||
}
|
||
});
|
||
$("#AvlBudAmt").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 = '';
|
||
|
||
});
|
||
|
||
function Save(status) {
|
||
// console.log("status");
|
||
// console.log(status);
|
||
|
||
if (status == '0') {
|
||
stat = '<?php echo PO_DRAFT; ?>';
|
||
} else if (status == '1') {
|
||
stat = '<?php echo PO_CREATED; ?>';
|
||
} else if (status == '4') {
|
||
stat = '<?php echo PO_RELEASED; ?>';
|
||
} else {
|
||
stat = '<?php echo $PONOStatus; ?>';
|
||
}
|
||
var deladd = $('#DeliveryAddr').val();
|
||
$('#txtStatus').val(stat);
|
||
tinyMCE.triggerSave();
|
||
var splinstr = $('#txtSpcialInstruction').val();
|
||
$('#SpcialInstruction').val(splinstr);
|
||
$('#txtDeliveryAddress').val(deladd);
|
||
var AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
|
||
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
|
||
var totaldiscount = $('#txtTotalDiscount').val();
|
||
//alert(txtTotalbasicamount+'-'+totaldiscount);
|
||
//alert(txtTotalbasicamount-totaldiscount);
|
||
if (validate()) {
|
||
if (document.getElementById('revenueTax').rows.length < 2) {
|
||
alert('Please Select Line item to Create PO');
|
||
$('#Deliverydt').focus();
|
||
return false;
|
||
}
|
||
//else if(validateBudgetExceedLimit())
|
||
//{
|
||
// return false;
|
||
//}
|
||
// else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){
|
||
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||
|
||
// return false;
|
||
// }
|
||
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||
alert('Please Enter Payable Terms Description');
|
||
$('#Otherpayment').focus();
|
||
return false;
|
||
} else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
|
||
alert('Please Enter Insurance No / Insurance Details..!');
|
||
$('#insurance').focus();
|
||
return false;
|
||
} else {
|
||
var formData = new FormData($('.CreatePO')[0]);
|
||
$('#loader').show();
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
|
||
data: formData,
|
||
processData: false,
|
||
contentType: false,
|
||
success: function (data) {
|
||
// console.log(data);
|
||
$('#loader').hide();
|
||
if (data) {
|
||
alert(data);
|
||
$('#txtRowCount').val('');
|
||
$('#txtDeletedRow').val('');
|
||
$('#txtStatus').val('');
|
||
$('#SpcialInstruction').val('');
|
||
$('#txtDeliveryAddress').val('')
|
||
window.location = "purchaseorderListing";
|
||
|
||
} else {
|
||
alert("Something went wrong");
|
||
}
|
||
|
||
},
|
||
error: function (jqXHR, textStatus, errorThrown) {
|
||
// Handle errors here
|
||
$('#loader').hide();
|
||
console.error("AJAX Error: ", textStatus, errorThrown);
|
||
alert("An error occurred: " + textStatus + " - " + errorThrown);
|
||
|
||
},
|
||
|
||
// complete: function() {
|
||
// // Actions that should always happen regardless of success or error
|
||
// console.log("AJAX request completed.");
|
||
// $('#loader').hide(); // Hide the loader in any case
|
||
// }
|
||
|
||
});
|
||
}
|
||
}
|
||
}
|
||
$(document).ready(function () {
|
||
$("#EDITREVENUE").on("shown.bs.modal", function (e) {
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
|
||
userid = $(e.relatedTarget).data('userid');
|
||
$('#isEdit').val(1);
|
||
// alert(userid);
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
var id = $('#Reqnumber' + userid).val();
|
||
|
||
$('#EditReqNo').val($('#Reqnumber' + userid).val());
|
||
$('#EditdeptName').val($('#departmentName' + userid).val());
|
||
$("#EditCostCenter").val($('#costCode' + userid).val());
|
||
$('#EditAvlBudAmt').val(AvlBudAmt);
|
||
//
|
||
|
||
$('#EditItemName').val($('#materialName' + userid).val());
|
||
$('#EditUOM').val($('#uom' + userid).val());
|
||
$('#EditQuantity').val($('#quantity' + userid).val());
|
||
tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val());
|
||
$('#EditRate').val($('#itemRate' + userid).val());
|
||
var per = $('#per' + userid).val()
|
||
if (per == '') {
|
||
$('#EditPer').val($('#uom' + userid).val());
|
||
} else {
|
||
$('#EditPer').val($('#per' + userid).val());
|
||
}
|
||
$('#txtEditBasicValue').val(cellval[7].innerHTML);
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
$('#txtEditDiscount').val($('#DisVal' + userid).val());
|
||
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
|
||
|
||
$('#txtEditPackaging').val($('#PackVal' + userid).val());
|
||
$('#txtEditAfterPackaging').val($('#AfterPackVal' + userid).val());
|
||
|
||
$('#txtEditFreight').val($('#FreightVal' + userid).val());
|
||
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
|
||
var FreightType = $('#FreightType' + userid).val();
|
||
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
|
||
if (FreightType == "PER TRIP") {
|
||
$('#EditTripsValue').show();
|
||
} else {
|
||
$('#EditTripsValue').hide();
|
||
}
|
||
$('#txtEditInsurance').val($('#Insval' + userid).val());
|
||
|
||
$('#txtEditTotalOrderValue').val($('#TotalOrderValue' + userid).val());
|
||
var x = $("input:radio[name='Range']:checked").val();
|
||
|
||
$('#EditAfterCgst').val($('#RevenueAfterCgst' + userid).val());
|
||
$('#EditAfterSgst').val($('#RevenueAfterSgst' + userid).val());
|
||
$('#EditAfterIgst').val($('#RevenueAfterIgst' + userid).val());
|
||
$('#EditCgst').val($('#RevenueCgst' + userid).val());
|
||
$('#EditSgst').val($('#RevenueSgst' + userid).val());
|
||
$('#EditIgst').val($('#RevenueIgst' + userid).val());
|
||
|
||
|
||
|
||
$("#EditMaterialCode").empty();
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
// For Binding Material list center for the selected Requistion Number
|
||
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||
var isAdded = "0";
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function (idx, obj) {
|
||
|
||
if (obj.ReqNo === id) {
|
||
|
||
$.each(SelectedMaterialList.Mat, function (idx1, el) {
|
||
if (id == el.ReqNo) {
|
||
|
||
if (el.materialCode == obj.MaterialCode) {
|
||
|
||
isAdded = "1";
|
||
return false;
|
||
} else {
|
||
isAdded = "0";
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
|
||
if (isAdded == "0") {
|
||
|
||
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
}
|
||
|
||
$("#EditDiscountType").val($('#DisType' + userid).val());
|
||
$("#drpEditFreight").val($('#FreightType' + userid).val());
|
||
$("#EditPackagingType").val($('#PackType' + userid).val())
|
||
|
||
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
|
||
|
||
|
||
});
|
||
$("#VIEWREVENUE").on("shown.bs.modal", function (e) {
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $totBasicAmt - $totDiscountAmt, 2, '.', '') ?>';
|
||
userid = $(e.relatedTarget).data('userid');
|
||
$('#isEdit').val(1);
|
||
//alert(userid);
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
var id = $('#Reqnumber' + userid).val();
|
||
|
||
$('#ViewReqNo').val($('#Reqnumber' + userid).val());
|
||
$('#ViewdeptName').val($('#departmentName' + userid).val());
|
||
$("#ViewCostCenter").val($('#costCode' + userid).val());
|
||
$('#ViewAvlBudAmt').val(AvlBudAmt);
|
||
//
|
||
|
||
$('#ViewItemName').val($('#materialName' + userid).val());
|
||
$('#ViewUOM').val($('#uom' + userid).val());
|
||
$('#ViewQuantity').val($('#quantity' + userid).val());
|
||
$('#ViewRate').val($('#itemRate' + userid).val());
|
||
$('#ViewPer').val($('#per' + userid).val());
|
||
$('#txtViewBasicValue').val(cellval[7].innerHTML);
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
$('#txtViewDiscount').val($('#DisVal' + userid).val());
|
||
$('#txtViewAfterDiscount').val($('#AfterDisVal' + userid).val());
|
||
|
||
tinyMCE.get('View_Service_Description').setContent($('#service_description' + userid).val());
|
||
$('#txtViewPackaging').val($('#PackVal' + userid).val());
|
||
$('#txtViewAfterPackaging').val($('#AfterPackVal' + userid).val());
|
||
|
||
$('#txtViewFreight').val($('#FreightVal' + userid).val());
|
||
$('#txtViewAfterFreight').val($('#AfterFreightVal' + userid).val());
|
||
$('#txtViewInsurance').val($('#Insval' + userid).val());
|
||
var FreightType = $('#FreightType' + userid).val();
|
||
$('#ViewNOOfTrips').val($('#NoOfTrip' + userid).val());
|
||
if (FreightType == "PER TRIP") {
|
||
$('#ViewTripsValue').show();
|
||
} else {
|
||
$('#ViewTripsValue').hide();
|
||
}
|
||
$('#txtViewTotalOrderValue').val($('#TotalOrderValue' + userid).val());
|
||
$('#ViewAfterCGST').val($('#RevenueAfterCgst' + userid).val());
|
||
$('#ViewAfterSGST').val($('#RevenueAfterSgst' + userid).val());
|
||
$('#ViewAfterIGST').val($('#RevenueAfterIgst' + userid).val());
|
||
$('#ViewCGST').val($('#RevenueCgst' + userid).val());
|
||
$('#ViewSGST').val($('#RevenueSgst' + userid).val());
|
||
$('#ViewIGST').val($('#RevenueIgst' + userid).val());
|
||
|
||
|
||
|
||
$("#ViewMaterialCode").empty();
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
// For Binding Material list center for the selected Requistion Number
|
||
$("#ViewMaterialCode").val($('#materialCode' + userid).val());
|
||
|
||
|
||
$("#ViewDiscountType").val($('#DisType' + userid).val());
|
||
$("#drpViewFreight").val($('#FreightType' + userid).val());
|
||
$("#ViewPackagingType").val($('#PackType' + userid).val())
|
||
|
||
$("input:radio[name='optPackaging'][value='" + $('#PackOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optExcise'][value='" + $('#ExciseOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optVat'][value='" + $('#VatOption' + userid).val() + "']").prop('checked', 'checked');
|
||
$("input:radio[name='optCST'][value='" + $('#CSTOption' + userid).val() + "']").prop('checked', 'checked');
|
||
|
||
|
||
});
|
||
});
|
||
</script>
|
||
<script>
|
||
$('#insurancestatus').change(function () {
|
||
var ans = $("#insurancestatus").val();
|
||
//alert(ans);
|
||
if (ans == 0) {
|
||
$("#InsuranceNumberdiv").hide();
|
||
//$("#InsuranceNumber").val("");
|
||
} else {
|
||
$("#InsuranceNumberdiv").show();
|
||
$("#InsuranceNumber").val("Yes");
|
||
}
|
||
|
||
});
|
||
// $("#Date").datepicker();
|
||
|
||
function splpoupdate() {
|
||
var formData = new FormData();
|
||
var file = $("#billimag").prop('files')[0];
|
||
var param1 = $('#hidebillno').val();
|
||
var param2 = $('#hideoldfile').val();
|
||
|
||
formData.append('file', file);
|
||
formData.append('param1', param1);
|
||
formData.append('param2', param2);
|
||
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
type: "POST",
|
||
url: "<?php echo base_url(); ?>purchaseorder/uploadfile",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
|
||
success: function (response) {
|
||
if (response) {
|
||
$('#loader').hide();
|
||
updateRowToTable(response.data, response.data.BillNo);
|
||
console.log(response.data);
|
||
$('#billModel').modal('hide');
|
||
|
||
}
|
||
},
|
||
|
||
error: function (xhr, status, error) {
|
||
$('#loader').hide();
|
||
let errorMessage = '';
|
||
|
||
// Custom error messages based on status codes
|
||
switch (xhr.status) {
|
||
case 404:
|
||
errorMessage = "Error 404: File upload URL not found.";
|
||
break;
|
||
case 500:
|
||
errorMessage = "Error 500:" + xhr.status + ": " + xhr.responseJSON.message;
|
||
break;
|
||
case 0:
|
||
errorMessage = "Error: Network issue or request aborted.";
|
||
break;
|
||
default:
|
||
errorMessage = "Error " + xhr.status + ": " + xhr.responseJSON.message;
|
||
}
|
||
|
||
// Show an alert with a specific error message
|
||
alert(errorMessage);
|
||
console.error("Error details:", xhr, status, error); // For debugging in the console
|
||
},
|
||
|
||
complete: function (xhr, status) { // This function runs after success or error
|
||
$('#loader').hide(); // Hide loader no matter what happens (success/error)
|
||
console.log("Request completed with status:", status); // Log completion status (success/error)
|
||
console.log("Request completed with xhr:", xhr)
|
||
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
function splupdate() {
|
||
var formData = new FormData();
|
||
|
||
|
||
var param1 = $('#ChallanInvNo').val();
|
||
var param2 = $('#InvDate').val();
|
||
var param3 = $('#VehicleNo').val();
|
||
var param4 = $('#CourierNo').val();
|
||
var param5 = $('#MaterialRcvdDate').val();
|
||
var param6 = $('#txtPONO').val();
|
||
var param7 = $('#igrno').val();
|
||
|
||
|
||
|
||
|
||
formData.append('param1', param1);
|
||
formData.append('param2', param2);
|
||
formData.append('param3', param3);
|
||
formData.append('param4', param4);
|
||
formData.append('param5', param5);
|
||
formData.append('param6', param6);
|
||
formData.append('param7', param7);
|
||
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>purchaseorder/splpodata",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (data) {
|
||
if (data) {
|
||
$('#loader').hide();
|
||
alert(data);
|
||
window.location.reload();
|
||
// $('#spl').find('td').eq(5).text(filename[2]);
|
||
$('#EditRevenueSplPOModel').modal('hide');
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
function fileupload(counter) {
|
||
var formData = new FormData();
|
||
var file = $("#images" + counter).prop('files')[0];
|
||
|
||
var PONO = $('#txtPONO').val();
|
||
var igr = $('#hiddenIGRNO').val();
|
||
|
||
formData.append('file', file);
|
||
formData.append('PONO', PONO);
|
||
formData.append('count', counter);
|
||
formData.append('igr', igr);
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>purchaseorder/addloadfile",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (response) {
|
||
if (response.data) {
|
||
$('#loader').hide();
|
||
alert(response.message);
|
||
console.log(response);
|
||
console.log(response.data.BillNo);
|
||
console.log(response.data.FilePath);
|
||
addRowToTable(response.data);
|
||
$('#billModel').modal('hide');
|
||
} else {
|
||
alert(response.message);
|
||
$('#billModel').modal('hide');
|
||
}
|
||
},
|
||
error: function (jqXHR, textStatus, errorThrown) {
|
||
// Handle errors here
|
||
$('#loader').hide();
|
||
console.error("AJAX Error: ", textStatus, errorThrown);
|
||
alert("An error occurred: " + textStatus + " - " + errorThrown);
|
||
},
|
||
complete: function () {
|
||
// Actions that should always happen regardless of success or error
|
||
console.log("AJAX request completed.");
|
||
$('#loader').hide(); // Hide the loader in any case
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
function filecheck() {
|
||
var sizef = document.getElementById('billimag').files[0].size;
|
||
var file = $('#billimag').val();
|
||
|
||
if (file != '' && sizef < 2100000) { // alert('Your file added successfully');
|
||
} else {
|
||
alert('Sorry Your File is Large To 2MB');
|
||
$('#billimag').val('');
|
||
}
|
||
}
|
||
|
||
let counter = 0;
|
||
let uploadCounter = 0; // Tracks actual uploads
|
||
|
||
//var counterConstant = 0;
|
||
|
||
$("#addmorebutton").click(function () {
|
||
|
||
|
||
|
||
if (uploadCounter >= 5) {
|
||
alert("You can upload only five files.");
|
||
return false;
|
||
}
|
||
|
||
counter++;
|
||
|
||
|
||
var bill = <?php echo json_encode($billfile) ?>;
|
||
//alert(bill.length);
|
||
if (bill.length >= 5) {
|
||
|
||
alert("You have already uploaded maximum files "); //this allows only 5 files;
|
||
return false;
|
||
} else {
|
||
var div = document.createElement('div');
|
||
div.id = `divid${counter}`;
|
||
div.className = "row";
|
||
div.innerHTML = `<div class="form-row px-4">
|
||
<div class="form-group col-md-4">
|
||
<br>
|
||
<input type="file" name="browseFiles" id="images${counter}" onchange="Copyfilename(${this.name}); ">
|
||
<br>
|
||
<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow(${counter},${bill.length})">ADD</button>
|
||
</div>
|
||
|
||
</div>
|
||
</div>`;
|
||
|
||
$('#newdiv').append(div);
|
||
$('#hidecounter').val(counter);
|
||
|
||
if (counter > 1) {
|
||
alert("Add button click here"); //this allows only 5 files;
|
||
return false;
|
||
} else {
|
||
$('#addmorebutton').hide();
|
||
}
|
||
}
|
||
|
||
});
|
||
|
||
function addRow(counter, billLength) {
|
||
|
||
console.log("counter");
|
||
console.log(counter); //1
|
||
console.log("billLength");
|
||
console.log(billLength);
|
||
var file = $(`#images${counter}`).val();
|
||
|
||
if (file == '') {
|
||
alert('Please Select File..!!');
|
||
return false;
|
||
|
||
}
|
||
else if (billLength >= 5) { // Check upload limit here
|
||
alert('You can only upload a maximum of five files!');
|
||
return false;
|
||
} else {
|
||
// Increment uploadCounter and call file upload function
|
||
billLength++;
|
||
fileupload(counter);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
function Copyfilename(id) {
|
||
var size = $('input[name=' + id + ']')[0].files[0].size;
|
||
|
||
var number = id.replace(/[^0-9]+/ig, "");
|
||
if (size > 2100000) {
|
||
//alert(id);
|
||
alert('Sorry Your File is Large To 2MB');
|
||
removeRow(id);
|
||
//$('input[name = browseFiles'+number+']').val(' ');
|
||
} else {
|
||
var name = $('input[name=' + id + ']')[0].files[0].name;
|
||
//alert(name);
|
||
$("#maint_filename" + number).val(name);
|
||
}
|
||
}
|
||
|
||
function removeRow(input) {
|
||
|
||
var number = input.replace(/[^0-9]+/ig, "");
|
||
if (counter >= 1) {
|
||
counter--;
|
||
|
||
$("#divid" + number).remove();
|
||
$('#hidecounter').val(counter);
|
||
}
|
||
|
||
}
|
||
</script>
|
||
<script>
|
||
$('#IsOpenOrder').change(function () {
|
||
|
||
// alert("IsOpenOrder");
|
||
if (this.checked) {
|
||
$('#Quantity').val(0);
|
||
$('#Quantity').removeAttr('required');
|
||
$('#Quantity').attr('readonly', true);
|
||
} else {
|
||
$('#Quantity').val('');
|
||
$('#Quantity').removeAttr('readonly');
|
||
$('#Quantity').attr('required', true);
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
// This function adds a new row to the table
|
||
function addRowToTable(data) {
|
||
|
||
var currentRowCount = $('#splPoBillTbId tr').length;
|
||
|
||
var newIndex = currentRowCount + 1;
|
||
|
||
var newRow = `
|
||
<tr id="lastvalue">
|
||
<td>${data.BillNo}</td>
|
||
<td>${data.FilePath ? data.FilePath : "No File"}</td>
|
||
<input type="hidden" id="billnos${newIndex}" value="${data.BillNo}">
|
||
<input type="hidden" id="file${newIndex}" name="file" value="${data.FilePath}">
|
||
<td style="cursor:pointer">
|
||
<span onclick="openbillmodel(${newIndex});">
|
||
<i class="ri-pencil-fill"></i>
|
||
</span>
|
||
|
||
<a target="_blank" href="<?= base_url('public/uploads/BillFiles/') ?>${data.FilePath}">
|
||
<i class="fa fa-download"></i>
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
`;
|
||
|
||
$('#splPoBillTbId').append(newRow);
|
||
}
|
||
|
||
|
||
function updateRowToTable(updatedData, billNo) {
|
||
// Find the row using the provided BillNo
|
||
$('#splPoBillTbId tr').each(function (index) {
|
||
// Check if the BillNo of the current row matches the provided billNo
|
||
var currentBillNo = $(this).find('td:first').text(); // Assuming BillNo is in the first cell
|
||
if (currentBillNo === billNo) {
|
||
// Update the relevant cells of the row with the new values from updatedData
|
||
$(this).find('td:nth-child(1)').text(updatedData.BillNo); // Update BillNo
|
||
$(this).find('td:nth-child(2)').text(updatedData.FilePath || 'No File'); // Update FilePath
|
||
|
||
// Also update the hidden inputs if necessary
|
||
$(this).find('input[id^="billnos"]').val(updatedData.BillNo); // Update BillNo hidden input
|
||
$(this).find('input[id^="file"]').val(updatedData.FilePath); // Update FilePath hidden input
|
||
|
||
// Exit the loop once the correct row is found and updated
|
||
return false; // Stops the iteration as we've found the row to update
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
</script>
|