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
|
# Step 4.3 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||||
# : updated the polineitem Qty
|
# : updated the polineitem Qty
|
||||||
if(!$IsThisOpenOrderPO){
|
if(!$IsThisOpenOrderPO && $PreIGRStatus){
|
||||||
$OldQuantityAsPerInvoice = $this->inwardgateregister_model->getOldIgrReceivedQty($IGRNo, $igrItemNo,$MaterialCode);
|
|
||||||
|
$quantitiesReceived = $this->inwardgateregister_model->getOldIgrReceivedQty($MaterialCode,$PONo);
|
||||||
|
|
||||||
|
$newQuantitiesReceived = $quantityAsPerInvoice;
|
||||||
|
|
||||||
|
$changeInQuantities = $newQuantitiesReceived - $quantitiesReceived;
|
||||||
|
|
||||||
|
$quantityToBeUpdated = $quantitiesReceived + $changeInQuantities;
|
||||||
|
|
||||||
if ($MaterialCode != '' && ((int)$quantityAsPerInvoice != (int)$OldQuantityAsPerInvoice)) {
|
$totalReceivedqty = $quantityToBeUpdated;
|
||||||
|
|
||||||
$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;
|
|
||||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
$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,
|
$sql = "select po.PONO as po,
|
||||||
date_format(po.PODate,'%d-%m-%Y') as pdate,
|
date_format(po.PODate,'%d-%m-%Y') as pdate,
|
||||||
sup.SupplierName as supplier,
|
sup.SupplierName as supplier,
|
||||||
mm.MaterialName as material,
|
mm.MaterialName as material,
|
||||||
cd.ConfigValue as category,
|
cd.ConfigValue as category,
|
||||||
pl.Quantity as quantity,
|
pl.Quantity as quantity,
|
||||||
pl.ReceivedQuantity as received,
|
pl.ReceivedQuantity as received,
|
||||||
(pl.Quantity - pl.ReceivedQuantity) as pending,po.PODate AS raw_date
|
(pl.Quantity - pl.ReceivedQuantity) as pending,po.PODate AS raw_date
|
||||||
from t_purchaseorder_lineitem pl
|
from t_purchaseorder_lineitem pl
|
||||||
join t_purchaseorder_master po on po.PONO = pl.PONO
|
join t_purchaseorder_master po on po.PONO = pl.PONO
|
||||||
join t_supplierdetailsn sup on sup.SupplierID=po.SupplierID
|
join t_supplierdetailsn sup on sup.SupplierID=po.SupplierID
|
||||||
join t_materialmaster mm on mm.MaterialCode=pl.MaterialCode
|
join t_materialmaster mm on mm.MaterialCode=pl.MaterialCode
|
||||||
join t_configdetails cd on cd.key = mm.Category
|
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)
|
where po.Status != 'ST030' and po.Status = 'ST026' and (po.IsOpenOrder IS NULL OR po.IsOpenOrder = 0)
|
||||||
";
|
";
|
||||||
if ($cname != '') {
|
if ($cname != '') {
|
||||||
|
|
||||||
|
|||||||
@ -721,20 +721,22 @@ class Inwardgateregister_model extends Model
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOldIgrReceivedQty($IGRitemNo,$IGR,$MaterialCode){
|
function getOldIgrReceivedQty( $MaterialCode, $PONO) {
|
||||||
$builder = $this->db->table('t_igr_details')
|
|
||||||
->select('QuantityAsPerInvoice')
|
|
||||||
->where('IGRItemNo', $IGRitemNo)
|
|
||||||
->where('MaterialCode', $MaterialCode)
|
|
||||||
->where('IGRNO', $IGR);
|
|
||||||
|
|
||||||
$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;
|
$query = $builder->get()->getRow();
|
||||||
return $QuantityAsPerInvoice;
|
|
||||||
|
return $query ? $query->QuantityAsPerInvoice : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function GetMRIROutQty($MRIRNO, $MaterialCode)
|
function GetMRIROutQty($MRIRNO, $MaterialCode)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user