diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index fb60b7ad..f3ea3138 100755
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -327,7 +327,9 @@ $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituplo
$routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks');
$routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks');
$routes->post('updateGasShortage','Inwardgateregister::updateGasShortage');
-$routes->post('gasShortageList','Inwardgateregister::gasShortageList');
+$routes->get('gasCylinderEntered','Inwardgateregister::gasCylinderEntered');
+$routes->get('gasCylinderPending','Inwardgateregister::gasCylinderPending');
+$routes->get('gasCylinderReturned','Inwardgateregister::gasCylinderReturned');
$routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail");
diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php
index 3b241b69..83d65b46 100755
--- a/app/Controllers/Inwardgateregister.php
+++ b/app/Controllers/Inwardgateregister.php
@@ -10,6 +10,7 @@ use App\Models\Inwardgateregister_model;
use App\Models\IGRRemarks_model;
use App\Models\GasShortageModel;
use App\Helpers\Notification;
+use App\Models\Rawmaterialdetails_model;
use DateTime;
use ZipArchive;
@@ -27,6 +28,8 @@ class Inwardgateregister extends BaseController
protected $inwardgateregister_model;
protected $IGRRemarks_model;
protected $gasShortage_model;
+
+ protected $rawMaterialDetails_model;
protected $session;
protected $logger;
@@ -40,6 +43,7 @@ class Inwardgateregister extends BaseController
$this->inwardgateregister_model = new Inwardgateregister_model();
$this->IGRRemarks_model = new IGRRemarks_model();
$this->gasShortage_model = new GasShortageModel();
+ $this->rawMaterialDetails_model = new Rawmaterialdetails_model();
$this->session = session();
helper('form'); //$this->load->library('form_validation');
@@ -1526,13 +1530,41 @@ function updateIGRWeight(){
- public function gasShortageList(){
+ public function gasCylinderEntered(){
- $postData = $this->request->getPost();
+ $this->global['pageTitle'] = 'Gas Cylinder Entered';
- $allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll();
+ $gasMaterialCodes = $this->rawMaterialDetails_model->getAllGasMaterialCode();
- return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]);
+ $gasMaterialCodes = array_column($gasMaterialCodes,'MaterialCode');
+
+ $igrDetailsListByMcatGas = $this->inwardgateregister_model->getIgrDetailsListByMcatGas($gasMaterialCodes);
+
+ $data['gasCylinderEnteredList'] = $igrDetailsListByMcatGas;
+
+ $this->loadViews("gasCylinderEntered", $this->global, $data, NULL);
+
+
+ }
+
+ public function gasCylinderPending(){
+
+ $this->global['pageTitle'] = 'Gas Shortage List';
+
+ $data['gasShortageList'] = $this->gasShortage_model->findAll();
+
+ $this->loadViews("gasCylinderPending", $this->global, $data, NULL);
+
+
+ }
+
+ public function gasCylinderReturned(){
+
+ $this->global['pageTitle'] = 'Gas Shortage List';
+
+ $data['gasShortageList'] = $this->gasShortage_model->findAll();
+
+ $this->loadViews("gasCylinderReturned", $this->global, $data, NULL);
}
diff --git a/app/Models/GasShortageModel.php b/app/Models/GasShortageModel.php
index 4b8f5be9..e7519acf 100644
--- a/app/Models/GasShortageModel.php
+++ b/app/Models/GasShortageModel.php
@@ -6,7 +6,7 @@ use CodeIgniter\Model;
class GasShortageModel extends Model
{
- protected $table = 't_gasShortageDetails';
+ protected $table = 't_gasshortagedetails';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php
index 6ebb17a2..385114a6 100755
--- a/app/Models/Inwardgateregister_model.php
+++ b/app/Models/Inwardgateregister_model.php
@@ -1387,5 +1387,35 @@ $builder = $this->db->table('t_igr_history')
return $transportername;
}
+ //Mcat -materialCategory
+ public function getIgrDetailsListByMcatGas($gasMaterialCodes){
+
+ $result = $this->db->table('t_igr_details as t_igrd')
+ ->select("
+ t_igrd.IGRNO,
+ SUM(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
+ t_sd.SupplierName,
+ t_igrm.*,
+ 'gas entered' AS status
+ ")
+ ->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')
+ ->whereIn('MaterialCode', $gasMaterialCodes)
+ ->where("DATE(t_igrd.CreatedDate) BETWEEN '2025-01-01' AND '2025-01-31' ")
+ ->where('t_gsd.IGRNO IS NULL')
+ ->groupBy('t_igrd.IGRNO')
+ ->get()
+ ->getResultArray();
+
+
+
+ return $result;
+
+ }
+
+
+
}
\ No newline at end of file
diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php
index 22b261bb..51e60c69 100755
--- a/app/Models/Rawmaterialdetails_model.php
+++ b/app/Models/Rawmaterialdetails_model.php
@@ -232,6 +232,18 @@ class Rawmaterialdetails_model extends Model
}
+ function getAllGasMaterialCode(){
+
+ $builder = $this->db->table('t_materialmaster')
+ ->select('MaterialCode')
+ ->where('Category', '334')
+ ->orderBy('MaterialCode', 'asc');
+ $query = $builder->get();
+ $materialResults = $query->getResultArray();
+
+ return $materialResults;
+ }
+
function getMaterialstock($MaterialCode, $currentdate)
diff --git a/app/Views/gasCylinderEntered.php b/app/Views/gasCylinderEntered.php
new file mode 100644
index 00000000..47961925
--- /dev/null
+++ b/app/Views/gasCylinderEntered.php
@@ -0,0 +1,702 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inward
+ -
+
Gas Cylinder Entered
+
+
+
+
+
+
+
+ getFlashdata('message')): ?>
+
+ = esc(session()->getFlashdata('message')); ?>
+
+
+
+
+
+
+
+
+
+
+
+ | Full Cylinder Date |
+ IGR No |
+ Supplier |
+ Bill/Invoice No |
+ Bill Date |
+ Driver Name |
+ Vehicle No |
+ Cylinder Count |
+ Status |
+ Gas Details |
+
+
+
+
+
+ No Gas Cylinder Entered in the Given Dates..!!
+
+
+ $gasCylinder):
+ $gasCylinder['MaterialRcvdDate'] = date('d-m-Y',strtotime($gasCylinder['MaterialRcvdDate']));
+ $gasCylinder['DeliveryChellanDate'] = date('d-m-Y',strtotime($gasCylinder['DeliveryChellanDate']));
+ ?>
+
+
+
+ | =$gasCylinder['MaterialRcvdDate']?> |
+ =$gasCylinder['IGRNO']?> |
+ =$gasCylinder['SupplierName']?> |
+ =$gasCylinder['DeliveryChellanOrInvoiceNo']?> |
+ =$gasCylinder['DeliveryChellanDate']?> |
+ =$gasCylinder['DriverName']?> |
+ =$gasCylinder['VehicleNo']?> |
+ =$gasCylinder['gasCylinderCount']?> |
+ =$gasCylinder['status']?> |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/Views/gasCylinderPending.php b/app/Views/gasCylinderPending.php
new file mode 100644
index 00000000..51bbf798
--- /dev/null
+++ b/app/Views/gasCylinderPending.php
@@ -0,0 +1,1103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inward
+ -
+
Gas Cylinder Pending
+
+
+
+
+
+
+
+ getFlashdata('message')): ?>
+
+ = esc(session()->getFlashdata('message')); ?>
+
+
+
+
+
+
+
+
+
+
+
+ | Full Cylinder Date |
+ IGR No |
+ Supplier |
+
+ Cylinder No |
+ Gross Weight |
+ Actual Weight |
+
+ Bill/Invoice No |
+ Bill Date |
+ Driver Name |
+ Vehicle No |
+
+ Status |
+ Action |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Full Cylinder Date |
+ Empty Cylinder Date |
+ Invoice No |
+ Cylinder No |
+ Gross Weight |
+ Tare Weight |
+ Net Weight |
+ Actual Weight |
+ Shortage |
+ ID |
+ Action |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/Views/gasCylinderReturned.php b/app/Views/gasCylinderReturned.php
new file mode 100644
index 00000000..50a7d53e
--- /dev/null
+++ b/app/Views/gasCylinderReturned.php
@@ -0,0 +1,1109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inward
+ -
+
Gas Cylinder Returned
+
+
+
+
+
+
+
+ getFlashdata('message')): ?>
+
+ = esc(session()->getFlashdata('message')); ?>
+
+
+
+
+
+
+
+
+
+
+
+ | Full Cylinder Date |
+ IGR No |
+ Supplier |
+
+ Cylinder No |
+ Gross Weight |
+ Empty Cylinder Date |
+ Tare Weight |
+ Net Weight |
+ Actual Weight |
+ shortage |
+
+ Bill/Invoice No |
+ Bill Date |
+ Driver Name |
+ Vehicle No |
+
+ Status |
+ Action |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Full Cylinder Date |
+ Empty Cylinder Date |
+ Invoice No |
+ Cylinder No |
+ Gross Weight |
+ Tare Weight |
+ Net Weight |
+ Actual Weight |
+ Shortage |
+ ID |
+ Action |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php
index 2b66ce48..3549eee3 100755
--- a/app/Views/includes/new_header.php
+++ b/app/Views/includes/new_header.php
@@ -746,6 +746,22 @@
Non IGR / Expense
+
+
+
diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php
index 1999e936..08e5781a 100644
--- a/app/Views/stock/dieselStockDetails.php
+++ b/app/Views/stock/dieselStockDetails.php
@@ -574,11 +574,11 @@ foreach ($period as $day) {
- $dieselStockDetails) {
+ foreach ($groupedDieselMachineStockDetails as $rowIndex => $dieselStockDetails) {
?>
format('d-m-Y');
+ $startDate = DateTime::createFromFormat('Y-m-d', $totalDiesel[$rowIndex]['date'])->format('d-m-Y');
?>
|
@@ -603,37 +603,37 @@ foreach ($period as $day) {
|
+
oninput="openingTDStockChange(this)"
contenteditable="true"
- >= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?> |
+ >= $totalDiesel[$rowIndex]['opening_stock'] ?? ' ' ?>
- = $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] ?? ' ' ?>
+ = $totalDiesel[$rowIndex]['purchase_diesel'] ?? ' ' ?>
|
+ data-id="= $totalDiesel[$rowIndex]['date'] ?>">
- = $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] ?? ' ' ?>
+ = $totalDiesel[$rowIndex]['total_filling_diesel'] ?? ' ' ?>
|
+ data-id="= $totalDiesel[$rowIndex]['date'] ?>">
- = $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?>
+ = $totalDiesel[$rowIndex]['balance_stock'] ?? ' ' ?>
|
@@ -643,15 +643,15 @@ foreach ($period as $day) {
//before closing outer loop
if (!isset($summary['totalPurchaseDiesel'])) {
- $summary['opening_diesel'] = '-';
+ $summary['openingStock'] = '-';
$summary['totalPurchaseDiesel'] = 0;
$summary['totalFillingDiesel'] = 0;
$summary['balanceStock'] = 0;
}
-
- $summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] : 0;
- $summary['totalFillingDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] : 0;
- $summary['balanceStock'] = is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] : 0;
+ $summary['openingStock'] = is_numeric($totalDiesel[$rowIndex]['opening_stock']) ? $totalDiesel[$rowIndex]['opening_stock'] : 0;
+ $summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$rowIndex]['purchase_diesel']) ? $totalDiesel[$rowIndex]['purchase_diesel'] : 0;
+ $summary['totalFillingDiesel'] += is_numeric($totalDiesel[$rowIndex]['total_filling_diesel']) ? $totalDiesel[$rowIndex]['total_filling_diesel'] : 0;
+ $summary['balanceStock'] = is_numeric($totalDiesel[$rowIndex]['balance_stock']) ? $totalDiesel[$rowIndex]['balance_stock'] : 0;
?>
@@ -675,7 +675,7 @@ foreach ($period as $day) {
+
oninput="openingReadingChange(this)"
contenteditable="true"
>
@@ -781,7 +781,7 @@ foreach ($period as $day) {
|
- = $summary['opening_diesel'] ?> |
+ = $summary['openingStock'] ?> |
= $summary['totalPurchaseDiesel'] ?> |
= $summary['totalFillingDiesel'] ?> |
= $summary['balanceStock'] ?> |
@@ -836,41 +836,115 @@ foreach ($period as $day) {
-
-
- oninput="openingTDStockChange(this)"
- contenteditable="true"
-
- >= !empty($previousMonthTotalDieselMachineStockDetails)
- ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
- : " ";
- ?> |
-
-
-
- |
-
- |
-
- = !empty($previousMonthTotalDieselMachineStockDetails)
- ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
- : " ";
- ?>
- |
-
-
-
+
+
+
+
+
+
+ oninput="openingTDStockChange(this)"
+ contenteditable="true"
+ >= $totalDiesel[$datesInMonthIndex]['opening_stock'] ?? ' ' ?> |
+
+
+
+
+ = $totalDiesel[$datesInMonthIndex]['purchase_diesel'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalDiesel[$datesInMonthIndex]['total_filling_diesel'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalDiesel[$datesInMonthIndex]['balance_stock'] ?? ' ' ?>
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ oninput="openingTDStockChange(this)"
+ contenteditable="true"
+
+ >
+
+ = !empty($previousMonthTotalDieselMachineStockDetails)
+ ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
+ : " ";
+ ?>
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+ = !empty($previousMonthTotalDieselMachineStockDetails)
+ ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
+ : " ";
+ ?>
+
+ |
+
+
+
+
+
+
+
+
+
+ $dieselMachine) {
?>
@@ -1566,8 +1640,7 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
- return offset < 0 && offset > closest.offset ?
- {
+ return offset < 0 && offset > closest.offset ? {
offset,
element: child
} :