1578,1598 - (raised - live issues)

This commit is contained in:
VE10-Sanjeev 2025-04-24 07:25:37 +00:00
parent c5daf0b6d8
commit 7bad283470
5 changed files with 74 additions and 36 deletions

View File

@ -460,7 +460,7 @@ class Inwardgateregister extends BaseController
$igr = array('IGRNO'=>$newIGRNO,'PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'TransporterId'=>$TransporterId,'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus, 'Remark'=>$MasterRemarks);
$igr['MasterFile'] = $requestMasterFileName;
#Step 4 Calling DB to Save IGR Master
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
if($IGRNO){
@ -689,7 +689,6 @@ class Inwardgateregister extends BaseController
// Escape newlines and quotes for the JavaScript alert
$finalstatement = json_encode($finalstatement);
echo "<script>
alert('$finalstatement');
window.location.href = 'ViewIGR';

View File

@ -195,7 +195,7 @@ class Inwardgateregister_model extends Model
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
LEFT JOIN t_purchaseorder_lineitem POL ON POL.PONO = POM.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="form-group">
<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);
?>
</div>
@ -343,7 +343,7 @@
<div class="form-group">
<label class="col-form-label">Invoice Date <span class="text-danger">*</span></label>
<?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);
?>
</div>
@ -352,7 +352,7 @@
<div class="form-group">
<label class="col-form-label">Material Received Date <span class="text-danger">*</span></label>
<?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);
?>
</div>
@ -408,9 +408,9 @@
</div>
<div class="col-md-3">
<div class="form-group">
<label class="col-form-label">Remark</label>
<label class="col-form-label">Remark<span class="text-danger">*</span></label>
<?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);
?>
</div>
@ -972,6 +972,16 @@
});
});
$('#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');
var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val();
@ -1035,7 +1045,16 @@
});
});
$('#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 pono = $("#PONO1").val();
var status = 1;

View File

@ -167,7 +167,7 @@
<th>Received Quantity</th>
<th>Balance Quantity</th>
<th>Invoice Quantity<span class="text-danger">*</span></th>
<th>Remarks<span class="text-danger">*</span></th>
<th>Remarks</th>
<th> </th>
</tr>
</thead>
@ -517,7 +517,12 @@
value: item.MaterialCode,
name: 'MaterialCode' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'LineItemNo' + i,
value: item.LineItemNo,
name: 'LineItemNo' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtQuantityAsPerInvoice' + i,
@ -639,17 +644,10 @@
}
function validateReceivedQuantity(Rowid) {
//alert(Rowid);
var InvoiceQty = parseFloat($('#QuantityAsPerInvoice' + Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice' + Rowid).val());
var PendingQty = parseFloat($('#PendingQuantity' + Rowid).text() == '' ? '0.00' : $('#PendingQuantity' + Rowid).text());
var RecQty = parseFloat($('#txtReceivedQuantity' + Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity' + Rowid).val());
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 formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1;
if (formatted_IsOpenOrder == 0) {

View File

@ -410,7 +410,7 @@
<div class="col-md-3">
<div class="form-group">
<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);
?>
</div>
@ -483,9 +483,9 @@
</div>
<div class="col-md-3">
<div class="form-group">
<label class="col-form-label">Remark</label>
<label class="col-form-label">Remark<span class="text-danger">*</span></label>
<?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);
?>
</div>
@ -510,7 +510,7 @@
<th style="width: 50px;">Tax (%)</th>
<th style="width: 50px;">Taxable 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; display:none" id="gasShortageHeader">Add Gas Shortage</th>
<th style="width: 25px; display:none" id="gasShortageListHeader">Gas Shortage list</th>
@ -1495,6 +1495,17 @@
});
});
$('#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');
var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val();
@ -1553,12 +1564,23 @@
success: function(data) {
alert(data);
// location.reload();
location.reload();
}
});
});
$('#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 pono = $("#PONO1").val();
var status = 1;
@ -2009,9 +2031,9 @@
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount);
$('#tax_amount' + Rowid).text(tax_amount);
$('#grand_total_amount' + Rowid).text(grand_total_amount);
$('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true;
} else {
if (parseInt(OrderedQty) !== 0) {
@ -2022,18 +2044,18 @@
} else if ((InvoiceQty) - OrderedQty > 0.00) {
alert("Order is completed.");
$("#QuantityAsPerInvoice" + Rowid).focus().val('');
$('#amount' + Rowid).text(amount);
$('#tax_amount' + Rowid).text(tax_amount);
$('#grand_total_amount' + Rowid).text(grand_total_amount);
$('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return false;
} else {
var PendingQty = OrderedQty - (InvoiceQty);
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount);
$('#tax_amount' + Rowid).text(tax_amount);
$('#grand_total_amount' + Rowid).text(grand_total_amount);
$('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true;
}
} else {
@ -2041,9 +2063,9 @@
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
$('#amount' + Rowid).text(amount);
$('#tax_amount' + Rowid).text(tax_amount);
$('#grand_total_amount' + Rowid).text(grand_total_amount);
$('#amount' + Rowid).text(amount.toFixed(2));
$('#tax_amount' + Rowid).text(tax_amount.toFixed(2));
$('#grand_total_amount' + Rowid).text(grand_total_amount.toFixed(2));
return true;
}
}