FIX_IGR Model Preview : ps

This commit is contained in:
VE10-Sanjeev 2024-05-07 10:06:30 +00:00
parent 3c5d4e2ce0
commit 0cd99ce38e
4 changed files with 45 additions and 38 deletions

2
app/Config/App.php Normal file → Executable file
View File

@ -17,7 +17,7 @@ class App extends BaseConfig
* *
* E.g., http://example.com/ * E.g., http://example.com/
*/ */
public string $baseURL = 'http://localhost/ria/'; public string $baseURL = '';
/** /**
* Allowed Hostnames in the Site URL other than the hostname in the baseURL. * Allowed Hostnames in the Site URL other than the hostname in the baseURL.
* If you want to accept multiple Hostnames, set this. * If you want to accept multiple Hostnames, set this.

10
app/Controllers/Inwardgateregister.php Normal file → Executable file
View File

@ -61,11 +61,13 @@ class Inwardgateregister extends BaseController
$this->inwardgateregister_model = new inwardgateregister_model(); $this->inwardgateregister_model = new inwardgateregister_model();
$this->global['pageTitle'] = 'Add Inward Gate Register'; $this->global['pageTitle'] = 'Add Inward Gate Register';
$result = $this->inwardgateregister_model->getpurchaseorder();
$data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder(); $data['PO_NO'] = array_filter($result, function($item) {
// print_r($data['PO_NO']); return !($item->status === 'ST027' && $item->VaildUpto === null);
});
$this->loadViews("inwardgateregister", $this->global, $data, NULL); $this->loadViews("inwardgateregister", $this->global, $data, NULL);
} }
@ -287,7 +289,6 @@ class Inwardgateregister extends BaseController
function addNewigr() function addNewigr()
{ {
// print_r($this->request->getPost());
$PONO = $this->request->getPost('PONO'); $PONO = $this->request->getPost('PONO');
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo'); $DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
$DeliveryChellan = $this->request->getPost('InvoiceDate'); $DeliveryChellan = $this->request->getPost('InvoiceDate');
@ -312,6 +313,7 @@ class Inwardgateregister extends BaseController
$igrM = $this->inwardgateregister_model->addigrM($igr); $igrM = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = !empty($igrM) ? $igrM : ''; $IGRNO = !empty($igrM) ? $igrM : '';
// $IGRNO = "IGRNO02695";
for ($i = 1; $i <= $constant; $i++) { for ($i = 1; $i <= $constant; $i++) {

0
app/Models/Inwardgateregister_model.php Normal file → Executable file
View File

71
app/Views/inwardgateregister.php Normal file → Executable file
View File

@ -92,8 +92,10 @@ Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));
} }
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"'); echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
?> ?>
<input type="hidden" name="hiddenVaildUpto" id="hiddenVaildUpto"/>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -424,6 +426,7 @@ function validate()
$('#content').loader('show'); $('#content').loader('show');
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>; var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
console.log("427");
console.log(y); console.log(y);
@ -434,6 +437,7 @@ function validate()
{ {
$("#po").val(obj.PONO); $("#po").val(obj.PONO);
$("#Sup").val(obj.SupplierName); $("#Sup").val(obj.SupplierName);
$("#hiddenVaildUpto").val(obj.VaildUpto);
//$("#Add").val(obj.Address); //$("#Add").val(obj.Address);
$("#del").val(obj.DeliveryDate); $("#del").val(obj.DeliveryDate);
//$("#ser").val(obj.ServiceDescription); //$("#ser").val(obj.ServiceDescription);
@ -530,11 +534,10 @@ function validate()
}); });
if((status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>')) if((status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>') && ((hiddenVaildUpto === null || hiddenVaildUpto === "")) )
{ {
alert('The Order is completed!!'); alert('The Order is completed!!');
$("#IGRLink").hide();
$("#IGRLink").hide();
} }
else else
{ {
@ -561,39 +564,41 @@ function validateReceivedQuantity(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(); var r =$("#Remark"+Rowid).val();
// alert(RecQty);
//alert(InvoiceQty); if (parseInt(OrderedQty) !== 0) {
// if((InvoiceQty+RecQty) > OrderedQty){ if((InvoiceQty+RecQty) > OrderedQty){
// alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ") alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
// $("#QuantityAsPerInvoice"+Rowid).focus(); $("#QuantityAsPerInvoice"+Rowid).focus();
// $("#QuantityAsPerInvoice"+Rowid).val(''); $("#QuantityAsPerInvoice"+Rowid).val('');
// return false; return false;
// } } else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
// else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){ alert("Order is completed.")
// alert("Order is completed.") $("#QuantityAsPerInvoice"+Rowid).focus();
// $("#QuantityAsPerInvoice"+Rowid).focus(); $('#QuantityAsPerInvoice'+Rowid).val('');
// $('#QuantityAsPerInvoice'+Rowid).val(''); return false;
// return false; } else {
// } // alert(RecQty);
// else { $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
// // alert(RecQty); $('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
// $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2)); $("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
// $('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty)); $("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
// $("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty); // InvoiceQty
// $("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty); return true;
// // InvoiceQty }
// return true; } else {
// } $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
$('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
$("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
$("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
return true;
}
} }
</script> </script>