stock changes 04-04-2025
This commit is contained in:
parent
0b35bb343d
commit
87fc519aa9
@ -1390,36 +1390,99 @@ $builder = $this->db->table('t_igr_history')
|
|||||||
//Mcat -materialCategory
|
//Mcat -materialCategory
|
||||||
public function getIgrDetailsListByMcatGas($gasMaterialCodes,$gas_status){
|
public function getIgrDetailsListByMcatGas($gasMaterialCodes,$gas_status){
|
||||||
|
|
||||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
|
||||||
->select("
|
|
||||||
t_igrd.IGRNO as IGRNO-,
|
|
||||||
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
|
||||||
t_sd.SupplierName,
|
|
||||||
t_igrm.*,
|
|
||||||
t_mm.MaterialName,
|
|
||||||
t_gsd.*
|
|
||||||
")
|
|
||||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
|
||||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
|
||||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
|
||||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrd.IGRNO', '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' ");
|
|
||||||
|
|
||||||
|
|
||||||
switch ($gas_status) {
|
switch ($gas_status) {
|
||||||
|
|
||||||
|
|
||||||
case "gas_entered":
|
case "gas_entered":
|
||||||
$builder->where('t_gsd.gas_cylinder_status IS NULL');
|
|
||||||
|
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||||
|
->select("
|
||||||
|
t_igrd.IGRNO as IGRNO-,
|
||||||
|
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||||
|
t_sd.SupplierName,
|
||||||
|
t_igrm.*,
|
||||||
|
t_mm.MaterialName,
|
||||||
|
t_gsd.*
|
||||||
|
")
|
||||||
|
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||||
|
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||||
|
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||||
|
|
||||||
|
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', '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 IS NULL');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "gas_pending":
|
case "gas_pending":
|
||||||
$builder->where('t_gsd.gas_cylinder_status','gas_pending');
|
|
||||||
|
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||||
|
->select("
|
||||||
|
t_igrd.IGRNO as IGRNO-,
|
||||||
|
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||||
|
t_sd.SupplierName,
|
||||||
|
t_igrm.*,
|
||||||
|
t_mm.MaterialName,
|
||||||
|
t_gsd.*
|
||||||
|
")
|
||||||
|
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||||
|
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||||
|
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||||
|
|
||||||
|
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', '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');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case "gas_returned":
|
case "gas_returned":
|
||||||
$builder->where('t_gsd.gas_cylinder_status','gas_returned');
|
|
||||||
|
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||||
|
->select("
|
||||||
|
t_igrd.IGRNO as IGRNO-,
|
||||||
|
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||||
|
t_sd.SupplierName,
|
||||||
|
t_igrm.*,
|
||||||
|
t_mm.MaterialName,
|
||||||
|
t_gsd.*,
|
||||||
|
SUM(t_gsd.grossWeight) as grossWeight,
|
||||||
|
SUM(t_gsd.tareWeight) as tareWeight,
|
||||||
|
SUM(t_gsd.netWeight) as netWeight,
|
||||||
|
SUM(t_gsd.actualWeight) as actualWeight,
|
||||||
|
SUM(t_gsd.shortage) as shortage,
|
||||||
|
Count(t_gsd.gas_cylinder_status) as gasCylinderCompletedCount,
|
||||||
|
(t_igrd.QuantityAsPerInvoice - Count(t_gsd.gas_cylinder_status)) as gasCylinderPendingCount
|
||||||
|
")
|
||||||
|
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||||
|
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||||
|
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||||
|
|
||||||
|
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', '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')
|
||||||
|
|
||||||
|
->groupBy('t_igrd.IGRNO');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
$builder->where('t_gsd.gas_cylinder_status IS NULL');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -711,6 +711,7 @@ $(document).ready(function () {
|
|||||||
if (response.status === "success") {
|
if (response.status === "success") {
|
||||||
alert("Gas Shortage Data Saved Successfully!");
|
alert("Gas Shortage Data Saved Successfully!");
|
||||||
$('#gasEnteredDetails').modal('hide'); // Close modal
|
$('#gasEnteredDetails').modal('hide'); // Close modal
|
||||||
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
alert("Error: " + response.message);
|
alert("Error: " + response.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -777,6 +777,7 @@ $(document).ready(function () {
|
|||||||
if (response.status === "success") {
|
if (response.status === "success") {
|
||||||
alert("Gas Shortage Data Updated Successfully!");
|
alert("Gas Shortage Data Updated Successfully!");
|
||||||
$('#gasPendingDetails').modal('hide'); // Close modal
|
$('#gasPendingDetails').modal('hide'); // Close modal
|
||||||
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
alert("Error: " + response.message);
|
alert("Error: " + response.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,13 +212,13 @@
|
|||||||
|
|
||||||
<!-- cylinderdetails -->
|
<!-- cylinderdetails -->
|
||||||
|
|
||||||
<th>Cylinder No</th>
|
|
||||||
<th>Gross Weight</th>
|
<th>Gross Weight</th>
|
||||||
<th>Empty Cylinder Date</th>
|
<th>Empty Cylinder Date</th>
|
||||||
<th>Tare Weight</th>
|
<th>Tare Weight</th>
|
||||||
<th>Net Weight</th>
|
<th>Net Weight</th>
|
||||||
<th>Actual Weight</th>
|
<th>Actual Weight</th>
|
||||||
<th>Shortage</th>
|
<th>Shortage</th>
|
||||||
|
<th>Cylinder Pending</th>
|
||||||
|
|
||||||
|
|
||||||
<!-- least details -->
|
<!-- least details -->
|
||||||
@ -249,13 +249,13 @@
|
|||||||
<td><?=$gasCylinder['MaterialName']?></td>
|
<td><?=$gasCylinder['MaterialName']?></td>
|
||||||
|
|
||||||
<!-- cylinderdetails -->
|
<!-- cylinderdetails -->
|
||||||
<td><?=$gasCylinder['cylinderNo']?></td>
|
|
||||||
<td><?=$gasCylinder['grossWeight']?></td>
|
<td><?=$gasCylinder['grossWeight']?></td>
|
||||||
<td><?=$gasCylinder['emptyCylinderDate']?></td>
|
<td><?=$gasCylinder['emptyCylinderDate']?></td>
|
||||||
<td><?=$gasCylinder['tareWeight']?></td>
|
<td><?=$gasCylinder['tareWeight']?></td>
|
||||||
<td><?=$gasCylinder['netWeight']?></td>
|
<td><?=$gasCylinder['netWeight']?></td>
|
||||||
<td><?=$gasCylinder['actualWeight']?></td>
|
<td><?=$gasCylinder['actualWeight']?></td>
|
||||||
<td><?=$gasCylinder['shortage']?></td>
|
<td><?=$gasCylinder['shortage']?></td>
|
||||||
|
<td><?=$gasCylinder['gasCylinderPendingCount']?></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user