diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 80cd15e5..fd4f21e9 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -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 " \ No newline at end of file diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index a3545514..4b752a24 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -170,7 +170,7 @@ - @@ -241,6 +241,18 @@ e.preventDefault(); 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"); + } }); diff --git a/app/Views/inwardgateregister.php b/app/Views/inwardgateregister.php index e4ce954d..5b91579b 100755 --- a/app/Views/inwardgateregister.php +++ b/app/Views/inwardgateregister.php @@ -145,7 +145,7 @@ ?>
- + 'MasterRemarks', 'value' => set_value('MasterRemarks'), 'id' => 'MasterRemarks', 'class' => 'form-control', 'autocomplete' => 'off','rows' => 3); echo form_textarea($data); @@ -167,7 +167,7 @@ Received Quantity Balance Quantity Invoice Quantity* - Remarks* + Remarks @@ -307,6 +307,19 @@ } $('#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(); const $btn = $(this); const strMsg = $btn.is('#IGRLink') @@ -517,7 +530,12 @@ value: item.MaterialCode, name: 'MaterialCode' + i }).appendTo('form'); - + $('').attr({ + type: 'hidden', + id: 'LineItemNo' + i, + value: item.LineItemNo, + name: 'LineItemNo' + i + }).appendTo('form'); $('').attr({ type: 'hidden', id: 'txtQuantityAsPerInvoice' + i, @@ -639,17 +657,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) { diff --git a/app/Views/supplierListing.php b/app/Views/supplierListing.php index 7500691f..e0df865e 100755 --- a/app/Views/supplierListing.php +++ b/app/Views/supplierListing.php @@ -155,7 +155,7 @@ -     -    + class="fa fa-edit edit-btn">       @@ -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 $.fn.dataTable.ext.search.push( function (settings, data, dataIndex) { diff --git a/app/Views/userListing.php b/app/Views/userListing.php index 1150bddd..77693d12 100755 --- a/app/Views/userListing.php +++ b/app/Views/userListing.php @@ -151,7 +151,7 @@ isDeleted == 1) { ?> - @@ -160,7 +160,7 @@ - + @@ -207,6 +207,8 @@ var answer = confirm(" Do you want to delete the user from the List?") if (answer) {return;}else{event.preventDefault();} } + + @@ -303,4 +318,6 @@ console.log("Checkbox changed, submitting form..."); $("#archiveFormId").submit(); }); - \ No newline at end of file + + + diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index cc91d186..77bf9669 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -412,7 +412,7 @@
- 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required=>"true"'); + 'InvoiceNO', 'value' => set_value('InvoiceNO'), 'id' => 'Invoice_No', 'class' => 'form-control', 'required' =>true); echo form_input($data); ?>
@@ -485,9 +485,9 @@
- + '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); ?>
@@ -512,7 +512,7 @@ Tax (%) Taxable Amt Total Amt - Remarks * + Remarks Net Weight @@ -1450,6 +1450,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(); @@ -1508,12 +1519,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; @@ -1964,9 +1986,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) { @@ -1977,18 +1999,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 { @@ -1996,9 +2018,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; } }