diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 78d2f04a..5460b7a1 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -618,25 +618,17 @@ class Inwardgateregister extends BaseController $currentPoRecievedQuantity = $this->inwardgateregister_model->getCurrentPOreceivedQty($MaterialCode,$PONO); - - $currentIgrPreviousQty = 0 ; - - $currentIgrCurrentQty = $QuantityAsPerInvoice; - - $changeInQty = $currentIgrCurrentQty - $currentIgrPreviousQty; - - $quantityToBeUpdated = $changeInQty; $totalReceivedqty = $currentPoRecievedQuantity + $quantityToBeUpdated; - ; + $POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt); @@ -994,28 +986,18 @@ function viewIGRDetails() $currentPoRecievedQuantity = $this->inwardgateregister_model->getCurrentPOreceivedQty($MaterialCode,$PONo); - - $currentIgrPreviousQty = $previousIgrStatus == "ST074" ? 0 : $this->inwardgateregister_model->currentIgrPreviousQty($IGRNo , $MaterialCode); - - $currentIgrCurrentQty = $quantityAsPerInvoice; - - $changeInQty = $currentIgrCurrentQty - $currentIgrPreviousQty; - - $quantityToBeUpdated = $changeInQty; $totalReceivedqty = $currentPoRecievedQuantity + $quantityToBeUpdated; - ; - $POLineItem = array('ReceivedQuantity' => $totalReceivedqty); $this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode); diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 41b4e92b..51764621 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -3340,12 +3340,11 @@ if (!empty($INRSYMBOL)) { /* This is used add capital po line item */ $('.AddCapital').click(function() { - alert("clicked capital po..!!"); - let CPRate = $('#CPRate').val(); + let CPRate = $('#CPRate').val().trim(); - if (parseFloat(CPRate) === 0 || CPRate.trim() === "") { + if (CPRate === "" || CPRate === "0" || CPRate === "0.00" || parseFloat(CPRate) === 0) { alert("Rate Cannot be Empty Or Zero ..!!") return false; } @@ -4776,6 +4775,15 @@ if (!empty($INRSYMBOL)) { * This function is used for Edit Capital */ $('.EditCapital').click(function() { + + let rate = $('#EditCPRate').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } + + tinyMCE.triggerSave(); if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) { diff --git a/app/Views/importpo.php b/app/Views/importpo.php index 845fcb26..19d8d44f 100755 --- a/app/Views/importpo.php +++ b/app/Views/importpo.php @@ -3440,7 +3440,12 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { $('.AddImport').click(function() { - alert("clicked import po..!!") + let rate = $('#Rate').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } // alert('out'); if (validateImport() && ExceedQuantityCheck() && validateExceedLimit() && QtyZerocheck()) { @@ -3846,6 +3851,14 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { } $('.EditImport').click(function() { + + let rate = $('#EditRate').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } + if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) { var CostCode = $("#EditCostCenter").val(); var AvilBudget = $('#EditAvlBudAmt').val(); diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index 7cf6eb95..d1765285 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -3409,9 +3409,12 @@ if (!empty($INRSYMBOL)) { }); $('.AddRevenue').click(function() { - alert("clicked revenue po..!!"); + let rate = $('#Rate').val().trim(); - $('') + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } tinyMCE.triggerSave(); if (validateRevenueTax() && ExceedQuantityCheck()) { @@ -3585,6 +3588,14 @@ if (!empty($INRSYMBOL)) { }); $('.EditRevenue').click(function() { + + let rate = $('#EditRate').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } + tinyMCE.triggerSave(); if (validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck()) { var CostCode = $("#EditCostCenter").val(); diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 86606b5c..ad31cd5c 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -677,10 +677,14 @@ if (!empty($INRSYMBOL)) { clearTotalItemValues(); $('.EditService').click(function(){ - console.log("1111111111111111111"); + - // tinyMCE.triggerSave(); - console.log("2222222222222222"); + let rate = $('#Edit').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } if (validateEditServiceTax()) { var CostCode = $("#EditCostCenter").val(); @@ -1925,7 +1929,12 @@ console.log($('#ItemDescription' + userid).val()); $('.AddService').click(function() { - alert("clicked service po..!!"); + let rate = $('#Rate').val().trim(); + + if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) { + alert("Rate cannot be empty or zero..!!"); + return false; + } tinyMCE.triggerSave(); if (validateServiceTax()) {