Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
vadivelJ96 2025-04-25 09:39:33 +05:30
commit ff3a85de2a
13 changed files with 202 additions and 49 deletions

View File

@ -689,7 +689,6 @@ class Inwardgateregister extends BaseController
// Escape newlines and quotes for the JavaScript alert // Escape newlines and quotes for the JavaScript alert
$finalstatement = json_encode($finalstatement); $finalstatement = json_encode($finalstatement);
echo "<script> echo "<script>
alert('$finalstatement'); alert('$finalstatement');
window.location.href = 'ViewIGR'; window.location.href = 'ViewIGR';

View File

@ -195,7 +195,7 @@ class Inwardgateregister_model extends Model
function viewpurchaseorder($PO) function viewpurchaseorder($PO)
{ {
$subQuery = 'SELECT distinct POM.PONO, POL.MaterialCode, POL.Quantity, POL.ReceivedQuantity, (POL.Quantity - POL.ReceivedQuantity) as PendingQty, QuantityRejected, POL.PONO, MM.MaterialName, MM.UOM,MM.HSNCODE,POL.Rate $subQuery = 'SELECT distinct POM.PONO, POL.LineItemNo,POL.MaterialCode, POL.Quantity, POL.ReceivedQuantity, (POL.Quantity - POL.ReceivedQuantity) as PendingQty, QuantityRejected, POL.PONO, MM.MaterialName, MM.UOM,MM.HSNCODE,POL.Rate
FROM t_purchaseorder_master POM FROM t_purchaseorder_master POM
LEFT JOIN t_purchaseorder_lineitem POL ON POL.PONO = POM.PONO LEFT JOIN t_purchaseorder_lineitem POL ON POL.PONO = POM.PONO
LEFT JOIN t_igr_master IGM ON IGM.PONO = POL.PONO LEFT JOIN t_igr_master IGM ON IGM.PONO = POL.PONO

View File

@ -334,7 +334,7 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Invoice Number <span class="text-danger">*</span></label> <label class="col-form-label">Invoice Number <span class="text-danger">*</span></label>
<?php $data = array('name' => 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required=>"true"'); <?php $data = array('name' => 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required' =>true);
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -343,7 +343,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Invoice Date <span class="text-danger">*</span></label> <label class="col-form-label">Invoice Date <span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'InvoiceDate', 'value' => set_value('InvoiceDate'), 'id' => 'Invoice_Date', 'class' => 'form-control', 'required=>"true"'); $data = array('name' => 'InvoiceDate', 'value' => set_value('InvoiceDate'), 'id' => 'Invoice_Date', 'class' => 'form-control', 'required' =>true);
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -352,7 +352,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Material Received Date <span class="text-danger">*</span></label> <label class="col-form-label">Material Received Date <span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control'); $data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control' ,'required' =>true);
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -408,9 +408,9 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Remark</label> <label class="col-form-label">Remark<span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3); $data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3,'required' =>true);
echo form_textarea($data); echo form_textarea($data);
?> ?>
</div> </div>
@ -972,6 +972,16 @@
}); });
}); });
$('#draftIGR').click(function() { $('#draftIGR').click(function() {
let remarks = $('#MasterRemarks').val().trim();
let rcvdDate = $('#MaterialRcvdDate').val().trim();
let invoiceDate = $('#InvoiceDate').val().trim();
let invoiceNo = $('#Invoice_No').val().trim();
// any are empty
if (!remarks || !rcvdDate || !invoiceDate || !invoiceNo) {
alert("Please fill all the required fields");
return; // Stop
}
// $('#content').loader('show'); // $('#content').loader('show');
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
@ -1035,7 +1045,16 @@
}); });
}); });
$('#generateIGR').click(function() { $('#generateIGR').click(function() {
let remarks = $('#MasterRemarks').val().trim();
let rcvdDate = $('#MaterialRcvdDate').val().trim();
let invoiceDate = $('#InvoiceDate').val().trim();
let invoiceNo = $('#Invoice_No').val().trim();
// any are empty
if (!remarks || !rcvdDate || !invoiceDate || !invoiceNo) {
alert("Please fill all the required fields");
return; // Stop
}
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
var status = 1; var status = 1;

View File

@ -172,7 +172,7 @@
<td><?= $record->isActive == 1 ? 'Active' : 'InActive'; ?></td> <td><?= $record->isActive == 1 ? 'Active' : 'InActive'; ?></td>
<td> <td>
<a <a class="edit-btn"
onclick="editConfig(event)" onclick="editConfig(event)"
href="<?php echo base_url() . 'configurationctrl/editconfig?ConfigID=' . $record->Config_ID; ?>" href="<?php echo base_url() . 'configurationctrl/editconfig?ConfigID=' . $record->Config_ID; ?>"
data-toggle="tooltip" data-toggle="tooltip"
@ -231,6 +231,18 @@
} }
}); });
$('#config_list_table').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
// Ensure the saved page is a valid number // Ensure the saved page is a valid number
let savedPage =<?= $page ?? 0 ?>; // Default to 1 if not set let savedPage =<?= $page ?? 0 ?>; // Default to 1 if not set

View File

@ -134,7 +134,7 @@
<i class="fa fa-key" style="color:#02a8b5;"></i>&nbsp;&nbsp;&nbsp; <i class="fa fa-key" style="color:#02a8b5;"></i>&nbsp;&nbsp;&nbsp;
</a> </a>
<?php } else { ?> <?php } else { ?>
<a data-toggle="modal" href="#ccwizard" data-id="<?php echo $record->id; ?>" <a data-toggle="modal" class="edit-btn" href="#ccwizard" data-id="<?php echo $record->id; ?>"
data-name="<?php echo $record->CostCenterName; ?>"><i data-name="<?php echo $record->CostCenterName; ?>"><i
class="fas fa-edit"></i>&nbsp;&nbsp;</a> class="fas fa-edit"></i>&nbsp;&nbsp;</a>
<a onclick="confirmDelete(event)" style="cursor:pointer;" class="auditor-restricted-btn" <a onclick="confirmDelete(event)" style="cursor:pointer;" class="auditor-restricted-btn"
@ -314,6 +314,18 @@
} }
}); });
$('#cost_listing').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
// Date range filter function // Date range filter function
$.fn.dataTable.ext.search.push( $.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) { function (settings, data, dataIndex) {

View File

@ -168,7 +168,7 @@
<?php } else { ?> <?php } else { ?>
<a <a class="edit-btn"
href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>" href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>"
data-toggle="tooltip" data-toggle="tooltip"
title="<?php echo $record->DEPCode ?> - Click here to View Department Details"><i title="<?php echo $record->DEPCode ?> - Click here to View Department Details"><i
@ -236,6 +236,19 @@
} }
}); });
$('#department_list_table').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
// Date range filter function // Date range filter function
$.fn.dataTable.ext.search.push( $.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) { function (settings, data, dataIndex) {

View File

@ -196,7 +196,7 @@ if (!empty($master)) {
<!-- edit section --> <!-- edit section -->
<a <a
class="editConfigurationBtn" class="editConfigurationBtn edit-btn"
data-id="<?php echo $index; ?>" data-id="<?php echo $index; ?>"
data-key="<?php echo $con->Key; ?>" data-key="<?php echo $con->Key; ?>"
@ -840,10 +840,22 @@ if (!empty($master)) {
<!-- data table added for the config value table --> <!-- data table added for the config value table -->
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
new DataTable("#configtable", { var table = new DataTable("#configtable", {
paging: true, // Enable Pagination paging: true, // Enable Pagination
ordering: true, // Enable Sorting ordering: true, // Enable Sorting
searching: true // Enable Search searching: true // Enable Search
}); });
// $('#datatable').on('click', '.edit-btn', function () {
// const pageInfo = table.page.info(); // Now this works
// sessionStorage.setItem("datatablePage", pageInfo.page);
// });
// // Restore page
// let startPage = sessionStorage.getItem("datatablePage");
// if (startPage !== null) {
// table.page(parseInt(startPage)).draw('page');
// sessionStorage.removeItem("datatablePage");
// }
}); });
</script> </script>

View File

@ -170,7 +170,7 @@
<?php } else { ?> <?php } else { ?>
<a data-toggle="tooltip" <a data-toggle="tooltip" class="edit-btn"
href="<?php echo base_url() ?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>"> href="<?php echo base_url() ?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>">
<i class="fa fa-edit" data-toggle="tooltip" <i class="fa fa-edit" data-toggle="tooltip"
title="Click here to Edit machine detail "></i> title="Click here to Edit machine detail "></i>
@ -241,6 +241,18 @@
e.preventDefault(); e.preventDefault();
table.draw(); table.draw();
}); });
$('#datatable').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
}); });
</script> </script>

View File

@ -145,7 +145,7 @@
?> ?>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label class="col-form-label">Remark</label> <label class="col-form-label">Remark<span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3); $data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3);
echo form_textarea($data); echo form_textarea($data);
@ -167,7 +167,7 @@
<th>Received Quantity</th> <th>Received Quantity</th>
<th>Balance Quantity</th> <th>Balance Quantity</th>
<th>Invoice Quantity<span class="text-danger">*</span></th> <th>Invoice Quantity<span class="text-danger">*</span></th>
<th>Remarks<span class="text-danger">*</span></th> <th>Remarks</th>
<th> </th> <th> </th>
</tr> </tr>
</thead> </thead>
@ -307,6 +307,19 @@
} }
$('#IGRLink, #IGRDraftLink').on('click', function(e) { $('#IGRLink, #IGRDraftLink').on('click', function(e) {
let remarks = $('#MasterRemarks').val().trim();
let rcvdDate = $('#MaterialRcvdDate').val().trim();
let invoiceDate = $('#InvoiceDate').val().trim();
let invoiceNo = $('#InvoiceNo').val().trim();
let pono = $('#PONO').val().trim();
// any are empty
if (!pono || !remarks || !rcvdDate || !invoiceDate || !invoiceNo) {
alert("Please fill all the required fields");
return; // Stop
}
console.log("All fields filled. Proceeding...");
e.preventDefault(); e.preventDefault();
const $btn = $(this); const $btn = $(this);
const strMsg = $btn.is('#IGRLink') const strMsg = $btn.is('#IGRLink')
@ -517,7 +530,12 @@
value: item.MaterialCode, value: item.MaterialCode,
name: 'MaterialCode' + i name: 'MaterialCode' + i
}).appendTo('form'); }).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'LineItemNo' + i,
value: item.LineItemNo,
name: 'LineItemNo' + i
}).appendTo('form');
$('<input>').attr({ $('<input>').attr({
type: 'hidden', type: 'hidden',
id: 'txtQuantityAsPerInvoice' + i, id: 'txtQuantityAsPerInvoice' + i,
@ -639,17 +657,10 @@
} }
function validateReceivedQuantity(Rowid) { function validateReceivedQuantity(Rowid) {
//alert(Rowid);
var InvoiceQty = parseFloat($('#QuantityAsPerInvoice' + Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice' + Rowid).val()); var InvoiceQty = parseFloat($('#QuantityAsPerInvoice' + Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice' + Rowid).val());
var PendingQty = parseFloat($('#PendingQuantity' + Rowid).text() == '' ? '0.00' : $('#PendingQuantity' + Rowid).text()); var PendingQty = parseFloat($('#PendingQuantity' + Rowid).text() == '' ? '0.00' : $('#PendingQuantity' + Rowid).text());
var RecQty = parseFloat($('#txtReceivedQuantity' + Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity' + Rowid).val()); var RecQty = parseFloat($('#txtReceivedQuantity' + Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity' + Rowid).val());
var OrderedQty = parseFloat($("#Quantity_1" + Rowid).text()); var OrderedQty = parseFloat($("#Quantity_1" + Rowid).text());
var r = $("#Remark" + Rowid).val();
if (r == '') {
alert("Please Enter the Remark")
$("#Remark" + Rowid).focus();
return false;
}
var isOpenOrder = parseInt($("#hiddenIsOpenOrder").val(), 2); var isOpenOrder = parseInt($("#hiddenIsOpenOrder").val(), 2);
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1; var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1;
if (formatted_IsOpenOrder == 0) { if (formatted_IsOpenOrder == 0) {

View File

@ -155,7 +155,7 @@
<?php } else { ?> <?php } else { ?>
<a class="a-tag-link" <a class="a-tag-link edit-btn"
href="<?= base_url() ?>viewsupplier?SID=<?= $record->SupplierID ?>&Payment=<?= $record->PaymentTerms ?>" href="<?= base_url() ?>viewsupplier?SID=<?= $record->SupplierID ?>&Payment=<?= $record->PaymentTerms ?>"
data-toggle="tooltip" data-toggle="tooltip"
title="<?= $record->SupplierID ?> - Click here to edit Supplier details"><i title="<?= $record->SupplierID ?> - Click here to edit Supplier details"><i
@ -428,6 +428,18 @@ function formatNumberToIndianCurrency(number) {
} }
}); });
$('#datatable').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
// Date range filter function // Date range filter function
$.fn.dataTable.ext.search.push( $.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) { function (settings, data, dataIndex) {

View File

@ -177,7 +177,7 @@
<a data-toggle="modal" href="#transporterwizard" <a data-toggle="modal" href="#transporterwizard"
data-id="<?php echo $record->id; ?>" data-id="<?php echo $record->id; ?>"
data-name="<?php echo $record->name; ?>"><i data-name="<?php echo $record->name; ?>"><i
class="fa fa-edit"></i>&nbsp;&nbsp;</a> class="fa fa-edit edit-btn"></i>&nbsp;&nbsp;</a>
<a onclick="confirmDelete(event)" <a onclick="confirmDelete(event)"
href="<?php echo base_url() . 'deleteTransporter?id=' . $record->id; ?>"><i href="<?php echo base_url() . 'deleteTransporter?id=' . $record->id; ?>"><i
class="fa fa-trash auditor-restricted-btn"></i>&nbsp;&nbsp;&nbsp;</a> class="fa fa-trash auditor-restricted-btn"></i>&nbsp;&nbsp;&nbsp;</a>
@ -351,6 +351,18 @@
} }
}); });
$('#transporter_list').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
// Date range filter function // Date range filter function
$.fn.dataTable.ext.search.push( $.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) { function (settings, data, dataIndex) {

View File

@ -151,7 +151,7 @@
<td> <td>
<?php if ($record->isDeleted == 1) { ?> <?php if ($record->isDeleted == 1) { ?>
<span class="auditor-restricted"> <span class="auditor-restricted">
<a class="auditor-restricted-btn" onclick="confirmReActivateUser(event)" <a class="auditor-restricted-btn" onclick="confirmReActivateUser(event)"
href="<?php echo base_url() . 'user/reActivateUser?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>"> href="<?php echo base_url() . 'user/reActivateUser?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>">
<i class="fas fa-key"></i> <i class="fas fa-key"></i>
</a> </a>
@ -160,7 +160,7 @@
<?php } else { ?> <?php } else { ?>
<a href="<?php echo base_url() . 'user/editOld?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>"> <a class="edit-btn" href="<?php echo base_url() . 'user/editOld?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
@ -207,6 +207,8 @@
var answer = confirm(" Do you want to delete the user from the List?") var answer = confirm(" Do you want to delete the user from the List?")
if (answer) {return;}else{event.preventDefault();} if (answer) {return;}else{event.preventDefault();}
} }
</script> </script>
<script> <script>
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) { $.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
@ -294,6 +296,19 @@
toDateInput.value = fromDate; toDateInput.value = fromDate;
} }
}); });
$('#user_list_table').on('click', '.edit-btn', function () {
const pageInfo = table.page.info(); // Now this works
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
}
}); });
</script> </script>
@ -304,3 +319,5 @@
$("#archiveFormId").submit(); $("#archiveFormId").submit();
}); });
</script> </script>

View File

@ -412,7 +412,7 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Invoice Number <span class="text-danger">*</span></label> <label class="col-form-label">Invoice Number <span class="text-danger">*</span></label>
<?php $data = array('name' => 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required=>"true"'); <?php $data = array('name' => 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required' =>true);
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -485,9 +485,9 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label class="col-form-label">Remark</label> <label class="col-form-label">Remark<span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3); $data = array('name' => 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3,'required' =>true);
echo form_textarea($data); echo form_textarea($data);
?> ?>
</div> </div>
@ -512,7 +512,7 @@
<th style="width: 50px;">Tax (%)</th> <th style="width: 50px;">Tax (%)</th>
<th style="width: 50px;">Taxable Amt</th> <th style="width: 50px;">Taxable Amt</th>
<th style="width: 50px;">Total Amt</th> <th style="width: 50px;">Total Amt</th>
<th style="width: 150px;">Remarks <span class="text-danger">*</span></th> <th style="width: 150px;">Remarks </th>
<th style="width: 25px;">Net Weight</th> <th style="width: 25px;">Net Weight</th>
</tr> </tr>
</thead> </thead>
@ -1450,6 +1450,17 @@
}); });
}); });
$('#draftIGR').click(function() { $('#draftIGR').click(function() {
let remarks = $('#MasterRemarks').val().trim();
let rcvdDate = $('#MaterialRcvdDate').val().trim();
let invoiceDate = $('#InvoiceDate').val().trim();
let invoiceNo = $('#Invoice_No').val().trim();
// any are empty
if (!remarks || !rcvdDate || !invoiceDate || !invoiceNo) {
alert("Please fill all the required fields");
return; // Stop
}
console.log("All fields filled. Proceeding...");
// $('#content').loader('show'); // $('#content').loader('show');
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
@ -1508,11 +1519,22 @@
success: function(data) { success: function(data) {
alert(data); alert(data);
// location.reload(); location.reload();
} }
}); });
}); });
$('#generateIGR').click(function() { $('#generateIGR').click(function() {
let remarks = $('#MasterRemarks').val().trim();
let rcvdDate = $('#MaterialRcvdDate').val().trim();
let invoiceDate = $('#InvoiceDate').val().trim();
let invoiceNo = $('#Invoice_No').val().trim();
// any are empty
if (!remarks || !rcvdDate || !invoiceDate || !invoiceNo) {
alert("Please fill all the required fields");
return; // Stop
}
console.log("All fields filled. Proceeding...");
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
@ -1964,9 +1986,9 @@
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0)); $('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0)); $('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2)); $('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount); $('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount); $('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount); $('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true; return true;
} else { } else {
if (parseInt(OrderedQty) !== 0) { if (parseInt(OrderedQty) !== 0) {
@ -1977,18 +1999,18 @@
} else if ((InvoiceQty) - OrderedQty > 0.00) { } else if ((InvoiceQty) - OrderedQty > 0.00) {
alert("Order is completed."); alert("Order is completed.");
$("#QuantityAsPerInvoice" + Rowid).focus().val(''); $("#QuantityAsPerInvoice" + Rowid).focus().val('');
$('#amount' + Rowid).text(amount); $('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount); $('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount); $('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return false; return false;
} else { } else {
var PendingQty = OrderedQty - (InvoiceQty); var PendingQty = OrderedQty - (InvoiceQty);
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0)); $('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0)); $('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2)); $('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount); $('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount); $('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount); $('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true; return true;
} }
} else { } else {
@ -1996,9 +2018,9 @@
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0)); $('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0)); $('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2)); $('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount); $('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount); $('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount); $('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true; return true;
} }
} }