FIX_IGR Model Preview : ps
This commit is contained in:
parent
3c5d4e2ce0
commit
0cd99ce38e
2
app/Config/App.php
Normal file → Executable file
2
app/Config/App.php
Normal file → Executable file
@ -17,7 +17,7 @@ class App extends BaseConfig
|
||||
*
|
||||
* 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.
|
||||
* If you want to accept multiple Hostnames, set this.
|
||||
|
||||
10
app/Controllers/Inwardgateregister.php
Normal file → Executable file
10
app/Controllers/Inwardgateregister.php
Normal file → Executable file
@ -61,11 +61,13 @@ class Inwardgateregister extends BaseController
|
||||
$this->inwardgateregister_model = new inwardgateregister_model();
|
||||
$this->global['pageTitle'] = 'Add Inward Gate Register';
|
||||
|
||||
$result = $this->inwardgateregister_model->getpurchaseorder();
|
||||
|
||||
$data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder();
|
||||
// print_r($data['PO_NO']);
|
||||
|
||||
$data['PO_NO'] = array_filter($result, function($item) {
|
||||
return !($item->status === 'ST027' && $item->VaildUpto === null);
|
||||
});
|
||||
|
||||
|
||||
$this->loadViews("inwardgateregister", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
@ -287,7 +289,6 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
function addNewigr()
|
||||
{
|
||||
// print_r($this->request->getPost());
|
||||
$PONO = $this->request->getPost('PONO');
|
||||
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
|
||||
$DeliveryChellan = $this->request->getPost('InvoiceDate');
|
||||
@ -312,6 +313,7 @@ class Inwardgateregister extends BaseController
|
||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||
|
||||
$IGRNO = !empty($igrM) ? $igrM : '';
|
||||
// $IGRNO = "IGRNO02695";
|
||||
|
||||
for ($i = 1; $i <= $constant; $i++) {
|
||||
|
||||
|
||||
0
app/Models/Inwardgateregister_model.php
Normal file → Executable file
0
app/Models/Inwardgateregister_model.php
Normal file → Executable file
71
app/Views/inwardgateregister.php
Normal file → Executable file
71
app/Views/inwardgateregister.php
Normal file → Executable 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"');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<input type="hidden" name="hiddenVaildUpto" id="hiddenVaildUpto"/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -424,6 +426,7 @@ function validate()
|
||||
|
||||
$('#content').loader('show');
|
||||
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
||||
console.log("427");
|
||||
console.log(y);
|
||||
|
||||
|
||||
@ -434,6 +437,7 @@ function validate()
|
||||
{
|
||||
$("#po").val(obj.PONO);
|
||||
$("#Sup").val(obj.SupplierName);
|
||||
$("#hiddenVaildUpto").val(obj.VaildUpto);
|
||||
//$("#Add").val(obj.Address);
|
||||
$("#del").val(obj.DeliveryDate);
|
||||
//$("#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!!');
|
||||
|
||||
$("#IGRLink").hide();
|
||||
alert('The Order is completed!!');
|
||||
$("#IGRLink").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -561,39 +564,41 @@ function validateReceivedQuantity(Rowid){
|
||||
|
||||
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 r =$("#Remark"+Rowid).val();
|
||||
// alert(RecQty);
|
||||
//alert(InvoiceQty);
|
||||
// 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);
|
||||
// $('#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;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
$('#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;
|
||||
}
|
||||
} 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>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user