diff --git a/app/Config/App.php b/app/Config/App.php
old mode 100644
new mode 100755
index 942f7a27..35533b2b
--- a/app/Config/App.php
+++ b/app/Config/App.php
@@ -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.
diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php
old mode 100644
new mode 100755
index 0d9f65bf..a984bf7d
--- a/app/Controllers/Inwardgateregister.php
+++ b/app/Controllers/Inwardgateregister.php
@@ -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++) {
diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php
old mode 100644
new mode 100755
diff --git a/app/Views/inwardgateregister.php b/app/Views/inwardgateregister.php
old mode 100644
new mode 100755
index d8cb0e2c..129881c2
--- a/app/Views/inwardgateregister.php
+++ b/app/Views/inwardgateregister.php
@@ -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"');
+
+
?>
-
+
@@ -424,6 +426,7 @@ function validate()
$('#content').loader('show');
var y = ;
+ 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 == '' || status == '' || status == ''))
+ if((status == '' || status == '' || status == '') && ((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;
+ }
}