latest commit 20-05-2025
This commit is contained in:
parent
2ad54ee7d7
commit
215e4c4652
@ -604,29 +604,44 @@ class Inwardgateregister extends BaseController
|
||||
$currentav_qty = (int)$QuantityAsPerInvoice + (int)$av_qty;
|
||||
$current_qty = array('Current_stock' => $currentav_qty);
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty, $MaterialCode);
|
||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO, $MaterialCode);
|
||||
$ReceivedQuantity = 0.00;
|
||||
if (count($Recqty) > 0) {
|
||||
foreach ($Recqty as $key) {
|
||||
$ReceivedQuantity = $key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : (int)$ReceivedQuantity + (int)$QuantityAsPerInvoice ;
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
|
||||
|
||||
$totalReceivedqty = 0 ;
|
||||
|
||||
|
||||
if(!$IsThisOpenOrderPO && $PreIGRStatus == 1){
|
||||
|
||||
$quantitiesReceived = $this->inwardgateregister_model->getOldIgrReceivedQty($MaterialCode,$PONO);
|
||||
|
||||
$newQuantitiesReceived = $QuantityAsPerInvoice;
|
||||
|
||||
$changeInQuantities = $newQuantitiesReceived - $quantitiesReceived;
|
||||
|
||||
$quantityToBeUpdated = $quantitiesReceived + $changeInQuantities;
|
||||
|
||||
$totalReceivedqty = $quantityToBeUpdated;
|
||||
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
|
||||
|
||||
#Step 9 Updating Pending Quantity IN PO Master amd Line Item Details.
|
||||
if ((int)$IsThisOpenOrderPO != 1) {
|
||||
if ($TotalPendingQty == 0.00) {
|
||||
$Newstatus = array('Status' => $IGRStatus);
|
||||
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
||||
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
||||
} else {
|
||||
/*echo 'Open Order PO' ;*/
|
||||
}}
|
||||
if ($TotalPendingQty == 0.00) {
|
||||
$Newstatus = array('Status' => $IGRStatus);
|
||||
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
||||
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
||||
}
|
||||
|
||||
}
|
||||
#finally
|
||||
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
||||
|
||||
|
||||
@ -732,6 +732,8 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
log_message('info', 'getOldIgrReceivedQty Query: ' . $this->db->getLastQuery()->getQuery());
|
||||
|
||||
return $query ? $query->QuantityAsPerInvoice : 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user