stock changes 06-04-2025
This commit is contained in:
parent
40ea479b73
commit
0289595c86
@ -21,7 +21,8 @@ class Inwardgateregister_model extends Model
|
||||
$afftectedRows = $this->db->affectedRows();
|
||||
return $afftectedRows;
|
||||
}
|
||||
function getAdditionalIGRFile($igr){
|
||||
function getAdditionalIGRFile($igr)
|
||||
{
|
||||
$builder = $this->db->table('t_inwardgateregister_fileupload')->select('*')
|
||||
->where('IGRNO', $igr);
|
||||
$query = $builder->get();
|
||||
@ -86,7 +87,7 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_inwardgateregister_fileupload fileup', ' igr.IGRNO = fileup.IGRNO', 'left')
|
||||
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->orderBy('igr.IGRID','desc')
|
||||
->orderBy('igr.IGRID', 'desc')
|
||||
->groupBy('igr.IGRNO', 'desc');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
@ -136,10 +137,10 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_ogr_master OGM ', 'POM.PONO = OGM.PONO_INV', 'left')
|
||||
// ->where('POM.POType !=', SERVICE) // due to client requirements - he wants to remove the conidition.
|
||||
->where('POM.Status', PO_RELEASED)
|
||||
->orWhere('POM.Status',REQITEM_Emergency_PO_CREATED)
|
||||
->orWhere('POM.Status',IGR_CREATED)
|
||||
->orWhere('POM.Status', IGR_DRAFT )
|
||||
->where( 'POM.IsOpenOrder', 1)
|
||||
->orWhere('POM.Status', REQITEM_Emergency_PO_CREATED)
|
||||
->orWhere('POM.Status', IGR_CREATED)
|
||||
->orWhere('POM.Status', IGR_DRAFT)
|
||||
->where('POM.IsOpenOrder', 1)
|
||||
->orWhere('POM.Status', MRIR_CREATED)
|
||||
->orWhere('POM.Status', MRIR_APPROVED)
|
||||
->orWhere('POM.Status', OGR_COMPLETE)
|
||||
@ -169,12 +170,13 @@ class Inwardgateregister_model extends Model
|
||||
return $temp;
|
||||
}
|
||||
|
||||
public function checkdriverMobile($mobile,$driverName) {
|
||||
public function checkdriverMobile($mobile, $driverName)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_master')
|
||||
->distinct()
|
||||
->select('DriverMobileNumber')
|
||||
->like('DriverMobileNumber', $mobile);
|
||||
if($driverName){
|
||||
if ($driverName) {
|
||||
$builder->where('DriverName', $driverName);
|
||||
}
|
||||
|
||||
@ -220,9 +222,10 @@ class Inwardgateregister_model extends Model
|
||||
return $result; */
|
||||
}
|
||||
|
||||
public function igr_history($hsty_arr) {
|
||||
public function igr_history($hsty_arr)
|
||||
{
|
||||
|
||||
$keysToRemove = ["UpdateBY","UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||
$keysToRemove = ["UpdateBY", "UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||
|
||||
foreach ($keysToRemove as $key) {
|
||||
if (isset($hsty_arr[$key])) {
|
||||
@ -235,7 +238,7 @@ class Inwardgateregister_model extends Model
|
||||
return $this->db->insertID();
|
||||
}
|
||||
|
||||
function get_igr_history($col,$IGR,$IGRITEM = null)
|
||||
function get_igr_history($col, $IGR, $IGRITEM = null)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_history Hist')
|
||||
@ -257,11 +260,13 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_igr_master_for_history($igr_no) {
|
||||
function get_igr_master_for_history($igr_no)
|
||||
{
|
||||
return $this->db->table('t_igr_master Master')->where('Master.IGRNO', $igr_no)->get()->getRow();
|
||||
}
|
||||
|
||||
function get_igr_child_for_history($igr_no, $igr_item_no) {
|
||||
function get_igr_child_for_history($igr_no, $igr_item_no)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details Child'); // Select only the required field
|
||||
if ($igr_no) {
|
||||
$builder->where('Child.IGRNO', $igr_no);
|
||||
@ -386,8 +391,8 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter` trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left')
|
||||
->join('t_transporter` trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
@ -399,7 +404,7 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function ViewigrListing($fromDate,$toDate)
|
||||
function ViewigrListing($fromDate, $toDate)
|
||||
{
|
||||
$subQuery1 = $this->db->table('t_igr_remarkes')
|
||||
->select('COUNT(id)')
|
||||
@ -453,16 +458,15 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->groupBy('IGRD.IGRNo');
|
||||
if(session()->get('roleText') == 'Auditor'){
|
||||
if (session()->get('roleText') == 'Auditor') {
|
||||
|
||||
$builder->where('Date(igr.DeliveryChellanDate) >=', "$fromDate")
|
||||
->where('Date(igr.DeliveryChellanDate) <=', "$toDate")
|
||||
->orderBy('igr.DeliveryChellanDate', 'desc');
|
||||
}else{
|
||||
} else {
|
||||
$builder->where('Date(igr.CreatedDate) >=', "$fromDate")
|
||||
->where('Date(igr.CreatedDate) <=', "$toDate")
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -509,18 +513,18 @@ class Inwardgateregister_model extends Model
|
||||
// $query2 = $builder2->get();
|
||||
// $result2 = $query2->getResult();
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
return [$result,[]];
|
||||
return [$result, []];
|
||||
}
|
||||
|
||||
|
||||
function customViewigrListing($fromDate,$toDate)
|
||||
function customViewigrListing($fromDate, $toDate)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_master igr')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->groupStart()
|
||||
@ -541,14 +545,14 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
$query2 = $builder2->get();
|
||||
$result2 = $query2->getResult();
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
return [$result,$result2];
|
||||
return [$result, $result2];
|
||||
}
|
||||
|
||||
|
||||
@ -579,10 +583,10 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ')
|
||||
->join('t_supplierdetailsn sup', 'sup.SupplierID = POM.SupplierID')
|
||||
->join('t_materialmaster MM', 'MM.MaterialCode = igrd.MaterialCode')
|
||||
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_configdetails cd','cd.key = MM.Category','left')
|
||||
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_configdetails cd', 'cd.key = MM.Category', 'left')
|
||||
->where('igr.IGRNO', $IGRNO);
|
||||
|
||||
$query = $builder->get();
|
||||
@ -637,7 +641,7 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
}
|
||||
|
||||
function UpdatePOMaster($PONO, $updatedBy,$IGRStatus)
|
||||
function UpdatePOMaster($PONO, $updatedBy, $IGRStatus)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem')->select('*')
|
||||
@ -1073,7 +1077,8 @@ class Inwardgateregister_model extends Model
|
||||
$r = $this->db->affectedRows();
|
||||
return $r;
|
||||
}
|
||||
function updateIGRLineItem($igrlineitemarr, $IGRitemNo){
|
||||
function updateIGRLineItem($igrlineitemarr, $IGRitemNo)
|
||||
{
|
||||
$this->db->table('t_igr_details')
|
||||
->where('IGRItemNo', $IGRitemNo)
|
||||
->update($igrlineitemarr);
|
||||
@ -1127,7 +1132,6 @@ class Inwardgateregister_model extends Model
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
}
|
||||
public function isFileExistsInIGRmaster($filename)
|
||||
{
|
||||
@ -1154,8 +1158,6 @@ class Inwardgateregister_model extends Model
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getAllIgrFileDetails($igrno)
|
||||
@ -1199,10 +1201,12 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month ,$remark)
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select(
|
||||
$builder = $this->db->table('t_igr_details');
|
||||
|
||||
// 1. Select the necessary columns
|
||||
$builder->select(
|
||||
't_igr_details.IGRNO,
|
||||
t_igr_details.MaterialCode,
|
||||
igrMast.DeliveryChellanOrInvoiceNo as invoiceNo,
|
||||
@ -1210,34 +1214,49 @@ class Inwardgateregister_model extends Model
|
||||
igrMast.MaterialRcvdDate as materialRecievedDate,
|
||||
igrMast.VehicleNo,
|
||||
supplierDetails.SupplierName,
|
||||
cd.ConfigValue as sandType ,
|
||||
cd.ConfigValue as sandType,
|
||||
t_igr_details.QuantityAsPerInvoice as Qty,
|
||||
issd.*')
|
||||
->whereIn('t_igr_details.MaterialCode', $materialCodes)
|
||||
->where('t_igr_details.QuantityAsPerInvoice <>', 0)
|
||||
->like('t_igr_details.CreatedDate', $month, 'after');
|
||||
issd.*'
|
||||
);
|
||||
|
||||
// remark needed for those who selected any remark.
|
||||
// 2. Apply the most selective WHERE clause(s) first - in this case, the date range
|
||||
$nowIST = new \DateTime('now', new \DateTimeZone('Asia/Kolkata'));
|
||||
|
||||
$builder->where('Date(t_igr_details.CreatedDate) >=', $nowIST->format('Y-m-01 00:00:00'));
|
||||
$builder->where('Date(t_igr_details.CreatedDate) <=', $nowIST->format('Y-m-t 23:59:59'));
|
||||
|
||||
// 3. Apply other WHERE clause conditions
|
||||
$builder->whereIn('t_igr_details.MaterialCode', $materialCodes);
|
||||
$builder->where('t_igr_details.QuantityAsPerInvoice <>', 0);
|
||||
|
||||
// Conditional WHERE clause for remark
|
||||
if ($remark != "noRemark") {
|
||||
$builder->where('issd.remark', $remark);
|
||||
}
|
||||
|
||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
|
||||
->join('t_incomingsilicasanddetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
|
||||
->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode')
|
||||
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
|
||||
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
|
||||
->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left')
|
||||
->orderBy('t_igr_details.CreatedDate', 'asc ');
|
||||
// 4. Apply JOIN clauses
|
||||
$builder->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO');
|
||||
$builder->join('t_incomingsilicasanddetails issd', 'issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode', 'left');
|
||||
$builder->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode');
|
||||
$builder->join('t_configdetails cd', 'cd.key = materialMaster.Category', 'left');
|
||||
$builder->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left');
|
||||
$builder->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left');
|
||||
|
||||
// 5. Apply GROUP BY clause
|
||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode');
|
||||
|
||||
// 6. Apply ORDER BY clause
|
||||
$builder->orderBy('t_igr_details.CreatedDate', 'asc ');
|
||||
|
||||
// 7. Get the query results
|
||||
$query = $builder->get();
|
||||
$result = $query->getResultArray();
|
||||
|
||||
return $result;
|
||||
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
public function getHistoryDetailsforEmail($igr){
|
||||
public function getHistoryDetailsforEmail($igr)
|
||||
{
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds'));
|
||||
$from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds'));
|
||||
@ -1247,12 +1266,12 @@ class Inwardgateregister_model extends Model
|
||||
from t_igr_history
|
||||
LEFT JOIN tbl_users ON tbl_users.userId = t_igr_history.by
|
||||
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
|
||||
where is_add = 1 and IGR_No = '".$igr."'");
|
||||
where is_add = 1 and IGR_No = '" . $igr . "'");
|
||||
$first_line = $query3->getRow();
|
||||
|
||||
// 392 po
|
||||
|
||||
$builder = $this->db->table('t_igr_history')
|
||||
$builder = $this->db->table('t_igr_history')
|
||||
->select('
|
||||
t_igr_history.id,
|
||||
t_igr_history.field,
|
||||
@ -1290,13 +1309,13 @@ $builder = $this->db->table('t_igr_history')
|
||||
')
|
||||
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
|
||||
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
|
||||
->join('tbl_users', 'tbl_users.userId = t_igr_history.by','left')
|
||||
->join('t_employee_details','tbl_users.EmpID = t_employee_details.EmpID','left')
|
||||
->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left')
|
||||
->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left')
|
||||
->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left')
|
||||
->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left')
|
||||
->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr)
|
||||
->where('t_igr_history.is_edit', 1)
|
||||
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"');
|
||||
->where('t_igr_history.history_dated BETWEEN "' . $from . '" AND "' . $to . '"');
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
@ -1304,34 +1323,38 @@ $builder = $this->db->table('t_igr_history')
|
||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||
return [
|
||||
'history' => $result,
|
||||
'first_line' => $first_line ? $first_line->IGR_No ." was Created by ". $first_line->history_by ." on ". $first_line->indian_date ." at ". $first_line->indian_time : null,
|
||||
'first_line' => $first_line ? $first_line->IGR_No . " was Created by " . $first_line->history_by . " on " . $first_line->indian_date . " at " . $first_line->indian_time : null,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDetailsforEmail($userId,$roleId)
|
||||
public function getDetailsforEmail($userId, $roleId)
|
||||
{
|
||||
$query0 = $this->db->query("
|
||||
SELECT CompanyName,EmailAddress
|
||||
FROM t_company_details");
|
||||
$company = $query0->getRow();
|
||||
|
||||
$query1 = $this->db->query("
|
||||
$query1 = $this->db->query(
|
||||
"
|
||||
SELECT CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName
|
||||
FROM tbl_users
|
||||
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
|
||||
WHERE tbl_users.userId = ?", [$userId]
|
||||
WHERE tbl_users.userId = ?",
|
||||
[$userId]
|
||||
);
|
||||
$fullName = $query1->getRow();
|
||||
|
||||
$query2 = $this->db->query("
|
||||
$query2 = $this->db->query(
|
||||
"
|
||||
SELECT email FROM tbl_users
|
||||
WHERE isDeleted = 0 AND roleId =".$roleId
|
||||
WHERE isDeleted = 0 AND roleId =" . $roleId
|
||||
);
|
||||
$to_mails = $query2->getResult();
|
||||
|
||||
$query3 = $this->db->query("
|
||||
$query3 = $this->db->query(
|
||||
"
|
||||
SELECT email FROM tbl_users
|
||||
WHERE isDeleted = 0 AND userId =".$userId
|
||||
WHERE isDeleted = 0 AND userId =" . $userId
|
||||
);
|
||||
$from_mails = $query3->getRow();
|
||||
|
||||
@ -1339,7 +1362,7 @@ $builder = $this->db->table('t_igr_history')
|
||||
'company' => $company ? $company->CompanyName : null,
|
||||
'company_mail' => $company ? $company->EmailAddress : null,
|
||||
'full_name' => $fullName ? $fullName->FullName : null,
|
||||
'from_mails' => $from_mails ? $from_mails->email : null ,
|
||||
'from_mails' => $from_mails ? $from_mails->email : null,
|
||||
'to_mails' => $to_mails,
|
||||
];
|
||||
}
|
||||
@ -1355,17 +1378,19 @@ $builder = $this->db->table('t_igr_history')
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getigrstatus($IGRNo){
|
||||
public function getigrstatus($IGRNo)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_master')
|
||||
->select('IGRStatus')
|
||||
->where('IGRNO',$IGRNo)
|
||||
->where('IGRNO', $IGRNo)
|
||||
->get();
|
||||
$result = $builder->getRow();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function get_status($value){
|
||||
public function get_status($value)
|
||||
{
|
||||
$builder = $this->db->table('t_status')
|
||||
->select('StatusCode,StatusName')
|
||||
->where('StatusCode', $value);
|
||||
@ -1376,7 +1401,8 @@ $builder = $this->db->table('t_igr_history')
|
||||
return $StatusName;
|
||||
}
|
||||
|
||||
public function get_TransporterId($value){
|
||||
public function get_TransporterId($value)
|
||||
{
|
||||
$builder = $this->db->table('t_transporter')
|
||||
->select('id,name')
|
||||
->where('id', $value);
|
||||
@ -1388,7 +1414,8 @@ $builder = $this->db->table('t_igr_history')
|
||||
}
|
||||
|
||||
//Mcat -materialCategory
|
||||
public function getIgrDetailsListByMcatGas($gasMaterialCodes,$gas_status){
|
||||
public function getIgrDetailsListByMcatGas($gasMaterialCodes, $gas_status)
|
||||
{
|
||||
|
||||
|
||||
|
||||
@ -1413,7 +1440,7 @@ $builder = $this->db->table('t_igr_history')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
@ -1439,11 +1466,11 @@ $builder = $this->db->table('t_igr_history')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
->where('t_gsd.gas_cylinder_status','gas_pending');
|
||||
->where('t_gsd.gas_cylinder_status', 'gas_pending');
|
||||
|
||||
break;
|
||||
|
||||
@ -1473,16 +1500,15 @@ $builder = $this->db->table('t_igr_history')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
->where('t_gsd.gas_cylinder_status','gas_returned')
|
||||
->where('t_gsd.gas_cylinder_status', 'gas_returned')
|
||||
|
||||
->groupBy('t_igrd.IGRNO');
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1491,10 +1517,5 @@ $builder = $this->db->table('t_igr_history')
|
||||
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user