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.

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

@ -61,9 +61,11 @@ 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

61
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,10 +534,9 @@ 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
@ -568,32 +571,34 @@ function validateReceivedQuantity(Rowid){
var OrderedQty =parseFloat($("#Quantity_1"+Rowid).text()); var OrderedQty =parseFloat($("#Quantity_1"+Rowid).text());
var r =$("#Remark"+Rowid).val(); var r =$("#Remark"+Rowid).val();
if (parseInt(OrderedQty) !== 0) {
if((InvoiceQty+RecQty) > OrderedQty){
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
$("#QuantityAsPerInvoice"+Rowid).focus();
$("#QuantityAsPerInvoice"+Rowid).val('');
return false;
} else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
alert("Order is completed.")
$("#QuantityAsPerInvoice"+Rowid).focus();
$('#QuantityAsPerInvoice'+Rowid).val('');
return false;
} else {
// alert(RecQty); // alert(RecQty);
//alert(InvoiceQty); $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
// if((InvoiceQty+RecQty) > OrderedQty){ $('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
// alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ") $("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
// $("#QuantityAsPerInvoice"+Rowid).focus(); $("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
// $("#QuantityAsPerInvoice"+Rowid).val(''); // InvoiceQty
// return false; return true;
// } }
// else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){ } else {
// alert("Order is completed.") $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
// $("#QuantityAsPerInvoice"+Rowid).focus(); $('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
// $('#QuantityAsPerInvoice'+Rowid).val(''); $("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
// return false; $("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
// } return true;
// else { }
// // alert(RecQty);
// $('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
// $('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
// $("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
// $("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
// // InvoiceQty
// return true;
// }
} }
</script> </script>