latest commit 20-05-2025
This commit is contained in:
parent
815914982c
commit
2ad54ee7d7
@ -945,23 +945,21 @@ function viewIGRDetails()
|
||||
|
||||
# Step 4.3 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||
# : updated the polineitem Qty
|
||||
if(!$IsThisOpenOrderPO){
|
||||
$OldQuantityAsPerInvoice = $this->inwardgateregister_model->getOldIgrReceivedQty($IGRNo, $igrItemNo,$MaterialCode);
|
||||
if(!$IsThisOpenOrderPO && $PreIGRStatus){
|
||||
|
||||
$quantitiesReceived = $this->inwardgateregister_model->getOldIgrReceivedQty($MaterialCode,$PONo);
|
||||
|
||||
$newQuantitiesReceived = $quantityAsPerInvoice;
|
||||
|
||||
$changeInQuantities = $newQuantitiesReceived - $quantitiesReceived;
|
||||
|
||||
$quantityToBeUpdated = $quantitiesReceived + $changeInQuantities;
|
||||
|
||||
if ($MaterialCode != '' && ((int)$quantityAsPerInvoice != (int)$OldQuantityAsPerInvoice)) {
|
||||
|
||||
$PolineitemQty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONo, $MaterialCode);
|
||||
$POReceivedQuantity = 0.00;
|
||||
if (count($PolineitemQty) > 0) {
|
||||
foreach ($PolineitemQty as $key) {
|
||||
$POReceivedQuantity = $key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
|
||||
$totalReceivedqty = ($POReceivedQuantity - $OldQuantityAsPerInvoice) + $quantityAsPerInvoice;
|
||||
$totalReceivedqty = $quantityToBeUpdated;
|
||||
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2288,19 +2288,19 @@ where po.Status != 'ST030' and po.Status = 'ST026' and po.IsOpenOrder = 1";
|
||||
{
|
||||
|
||||
$sql = "select po.PONO as po,
|
||||
date_format(po.PODate,'%d-%m-%Y') as pdate,
|
||||
sup.SupplierName as supplier,
|
||||
mm.MaterialName as material,
|
||||
cd.ConfigValue as category,
|
||||
pl.Quantity as quantity,
|
||||
pl.ReceivedQuantity as received,
|
||||
(pl.Quantity - pl.ReceivedQuantity) as pending,po.PODate AS raw_date
|
||||
from t_purchaseorder_lineitem pl
|
||||
join t_purchaseorder_master po on po.PONO = pl.PONO
|
||||
join t_supplierdetailsn sup on sup.SupplierID=po.SupplierID
|
||||
join t_materialmaster mm on mm.MaterialCode=pl.MaterialCode
|
||||
join t_configdetails cd on cd.key = mm.Category
|
||||
where po.Status != 'ST030' and po.Status = 'ST026' and (po.IsOpenOrder IS NULL OR po.IsOpenOrder = 0)
|
||||
date_format(po.PODate,'%d-%m-%Y') as pdate,
|
||||
sup.SupplierName as supplier,
|
||||
mm.MaterialName as material,
|
||||
cd.ConfigValue as category,
|
||||
pl.Quantity as quantity,
|
||||
pl.ReceivedQuantity as received,
|
||||
(pl.Quantity - pl.ReceivedQuantity) as pending,po.PODate AS raw_date
|
||||
from t_purchaseorder_lineitem pl
|
||||
join t_purchaseorder_master po on po.PONO = pl.PONO
|
||||
join t_supplierdetailsn sup on sup.SupplierID=po.SupplierID
|
||||
join t_materialmaster mm on mm.MaterialCode=pl.MaterialCode
|
||||
join t_configdetails cd on cd.key = mm.Category
|
||||
where po.Status != 'ST030' and po.Status = 'ST026' and (po.IsOpenOrder IS NULL OR po.IsOpenOrder = 0)
|
||||
";
|
||||
if ($cname != '') {
|
||||
|
||||
|
||||
@ -721,20 +721,22 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getOldIgrReceivedQty($IGRitemNo,$IGR,$MaterialCode){
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select('QuantityAsPerInvoice')
|
||||
->where('IGRItemNo', $IGRitemNo)
|
||||
->where('MaterialCode', $MaterialCode)
|
||||
->where('IGRNO', $IGR);
|
||||
function getOldIgrReceivedQty( $MaterialCode, $PONO) {
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
$builder = $this->db->table('t_igr_details tigrd')
|
||||
->selectSum('tigrd.QuantityAsPerInvoice')
|
||||
->join('t_igr_master tigrm','tigrm.IGRNO = tigrd.IGRNO AND tigrm.PONO = ' . $this->db->escape($PONO),'inner')
|
||||
->where('tigrm.IGRStatus', 'ST027')
|
||||
->where('tigrd.MaterialCode', $MaterialCode)
|
||||
->groupBy('tigrd.MaterialCode');
|
||||
|
||||
$QuantityAsPerInvoice = $query ? $query->QuantityAsPerInvoice : 0;
|
||||
return $QuantityAsPerInvoice;
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
return $query ? $query->QuantityAsPerInvoice : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GetMRIROutQty($MRIRNO, $MaterialCode)
|
||||
{
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user