65 Commits

Author SHA1 Message Date
549142c27b Merge pull request 'added code and plant in production order' (#962) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #962
2026-08-28 10:38:42 +00:00
dhanabalan
cb8740d048 added code and plant in production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Larastan / larastan (pull_request) Failing after 7m20s
Laravel Pint / pint (pull_request) Successful in 7m54s
2026-08-28 16:08:28 +05:30
de2e7a76e6 Merge pull request 'Updated discharge label on PumpTestingResultExporter' (#961) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #961
2026-08-28 09:01:19 +00:00
dhanabalan
5c826e8c3d Updated discharge label on PumpTestingResultExporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Larastan / larastan (pull_request) Failing after 7m13s
Laravel Pint / pint (pull_request) Successful in 8m21s
2026-08-28 14:30:50 +05:30
fa10a64188 Merge pull request 'ranjith-dev' (#960) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #960
2026-08-28 08:49:39 +00:00
dhanabalan
02a435e93d Updated pump testing result post api function success and failure response description
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 5m36s
Laravel Larastan / larastan (pull_request) Failing after 9m10s
2026-08-28 14:18:54 +05:30
dhanabalan
ce0bfa72ca Updated unique query table name and exportAction label
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-08-28 14:15:07 +05:30
dhanabalan
bc60690872 Added pump testing entry / result post api function with validations and Updated pump testing master / entry / result get api function validations,
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-08-28 13:01:24 +05:30
dhanabalan
f4d416bea2 Added pump testing result resource and exporter files and Updated pump testing entry report filter functionality
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-28 12:54:53 +05:30
dhanabalan
5279b016d1 Added pump testing result model files for hasMany relations
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-08-28 12:48:51 +05:30
dhanabalan
2fb143c1f2 Added pump testing result policies and model file
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-28 12:42:59 +05:30
dhanabalan
eac712aaac Added pump testing result migration file
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-28 12:39:19 +05:30
8689893088 Merge pull request 'Added remove stopped related fields on get api getClassChar function for manual laser' (#959) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #959
2026-08-28 05:48:03 +00:00
dhanabalan
44b2a19270 Added remove stopped related fields on get api getClassChar function for manual laser
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 5m49s
Laravel Larastan / larastan (pull_request) Failing after 9m1s
2026-08-28 11:17:17 +05:30
4ea2cafb40 Merge pull request 'ranjith-dev' (#958) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #958
2026-08-28 05:09:31 +00:00
dhanabalan
bb5e088b02 removed panel box checklst rework logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 7m40s
Laravel Larastan / larastan (pull_request) Failing after 9m39s
2026-08-28 10:39:19 +05:30
dhanabalan
393ea6a4bd removed rework logic in panel box
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-08-28 10:38:33 +05:30
5da6cb5132 Merge pull request 'ranjith-dev' (#957) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #957
2026-08-28 05:03:57 +00:00
dhanabalan
0c189f695c Added rework logic in panel box check list
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Larastan / larastan (pull_request) Failing after 8m50s
Laravel Pint / pint (pull_request) Successful in 9m19s
2026-08-28 10:33:40 +05:30
dhanabalan
95d70fbdca Added rework logic in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
2026-08-28 10:32:49 +05:30
2efe50f422 Merge pull request 'ranjith-dev' (#956) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 32s
Reviewed-on: #956
2026-08-27 11:04:37 +00:00
dhanabalan
88e6b83487 removed rework logic in panel check list
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Larastan / larastan (pull_request) Failing after 9m22s
Laravel Pint / pint (pull_request) Successful in 9m32s
2026-08-27 16:34:09 +05:30
dhanabalan
8061953062 removed rework logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-08-27 16:33:39 +05:30
94b5bd8904 Merge pull request 'Removed unwanted warning message on material invoice number scanning' (#955) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #955
2026-08-27 10:50:43 +00:00
dhanabalan
3270a744e9 Removed unwanted warning message on material invoice number scanning
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Larastan / larastan (pull_request) Failing after 8m3s
Laravel Pint / pint (pull_request) Successful in 8m2s
2026-08-27 16:20:17 +05:30
f9e362784f Merge pull request 'Added rework logic in panel check list' (#954) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #954
2026-08-27 10:49:55 +00:00
dhanabalan
a411cf1051 Added rework logic in panel check list
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 5m38s
Laravel Larastan / larastan (pull_request) Failing after 11m9s
2026-08-27 16:19:39 +05:30
c8d012ebe6 Merge pull request 'added rework logic in panel box validation page' (#953) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #953
2026-08-27 10:27:55 +00:00
dhanabalan
0544a6aa51 added rework logic in panel box validation page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 25s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 47s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 7m50s
Laravel Larastan / larastan (pull_request) Failing after 8m25s
2026-08-27 15:57:37 +05:30
e619d4adae Merge pull request 'Updated total_quantity and scanned_quantity display query logic against material invoice for various types' (#952) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #952
2026-08-27 10:26:34 +00:00
dhanabalan
09e6075a52 Updated total_quantity and scanned_quantity display query logic against material invoice for various types
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 10m33s
Laravel Larastan / larastan (pull_request) Failing after 12m24s
2026-08-27 15:56:05 +05:30
b9786220d0 Merge pull request 'Removed unwanted warning message on material invoice number scanning' (#951) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #951
2026-08-27 08:04:03 +00:00
dhanabalan
a97d347e0b Removed unwanted warning message on material invoice number scanning
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Larastan / larastan (pull_request) Failing after 9m6s
Laravel Pint / pint (pull_request) Successful in 6m9s
2026-08-27 13:33:45 +05:30
3d39bfc8b3 Merge pull request 'Updated total_quantity and scanned_quantity display query logic against material invoice' (#950) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #950
2026-08-27 08:02:24 +00:00
dhanabalan
240e87db11 Updated total_quantity and scanned_quantity display query logic against material invoice
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 10m11s
Laravel Larastan / larastan (pull_request) Failing after 14m40s
2026-08-27 13:32:02 +05:30
a702bb8f12 Merge pull request 'ranjith-dev' (#949) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #949
2026-08-27 07:09:25 +00:00
dhanabalan
7e6a517b75 Updated total_quantity and scanned_quantity display logic against material invoice
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 13m8s
Laravel Larastan / larastan (pull_request) Failing after 14m5s
2026-08-27 12:37:56 +05:30
dhanabalan
d48f45eff6 Updated class characteristics store api validations to ensure is valid zmm_heading and jobNo
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-26 19:26:13 +05:30
3d2b7c9cde Merge pull request 'added unique constraint in table panel box validation to avoid duplicates' (#948) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #948
2026-08-26 12:18:21 +00:00
dhanabalan
9ea709a67b added unique constraint in table panel box validation to avoid duplicates
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Larastan / larastan (pull_request) Failing after 4m55s
Laravel Pint / pint (pull_request) Successful in 5m29s
2026-08-26 17:47:58 +05:30
3665b6e2c4 Merge pull request 'ranjith-dev' (#947) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #947
2026-08-26 11:54:03 +00:00
dhanabalan
955c4b97e7 commented quality inspection notification in invoice data table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 3m2s
Laravel Larastan / larastan (pull_request) Failing after 6m17s
2026-08-26 17:23:10 +05:30
dhanabalan
bbcb2ba020 bug solved in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-26 17:22:14 +05:30
1ecfa4eda3 Merge pull request 'added logic in of panel inspection' (#946) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #946
2026-08-26 10:50:54 +00:00
dhanabalan
d8364b368e added logic in of panel inspection
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 4m21s
Laravel Larastan / larastan (pull_request) Failing after 5m5s
2026-08-26 16:20:40 +05:30
d6038d97bd Merge pull request 'removed logic for inspection failed in invoice data table' (#945) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #945
2026-08-26 10:49:26 +00:00
dhanabalan
6856c1ab01 removed logic for inspection failed in invoice data table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 3m46s
Laravel Larastan / larastan (pull_request) Failing after 3m50s
2026-08-26 16:19:13 +05:30
c2cfcea8a2 Merge pull request 'removed logic for duplicate in panel check list' (#944) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #944
2026-08-26 10:20:07 +00:00
dhanabalan
8ff3800e40 removed logic for duplicate in panel check list
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 3m40s
Laravel Larastan / larastan (pull_request) Failing after 7m1s
2026-08-26 15:49:53 +05:30
35d1fc25dd Merge pull request 'added duplicate logic in panel box validation' (#943) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #943
2026-08-26 10:13:00 +00:00
dhanabalan
9e8a98ffd7 added duplicate logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 4m50s
Laravel Larastan / larastan (pull_request) Failing after 6m53s
2026-08-26 15:42:43 +05:30
04ff49f544 Merge pull request 'solved bug issue in panel box validation' (#942) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #942
2026-08-26 10:05:22 +00:00
dhanabalan
3710f964c4 solved bug issue in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 4m5s
Laravel Larastan / larastan (pull_request) Failing after 7m25s
2026-08-26 15:35:07 +05:30
bd6f57e786 Merge pull request 'Added panel box validation in invoice data table' (#941) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #941
2026-08-26 09:16:18 +00:00
dhanabalan
621312f5c9 Added panel box validation in invoice data table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 4m36s
Laravel Larastan / larastan (pull_request) Failing after 5m36s
2026-08-26 14:44:55 +05:30
085005ead1 Merge pull request 'ranjith-dev' (#940) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #940
2026-08-26 06:45:37 +00:00
dhanabalan
3aaf821040 Added rework logic in panel check list livewire page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 3m34s
Laravel Larastan / larastan (pull_request) Failing after 7m16s
2026-08-26 12:15:18 +05:30
dhanabalan
d676e2f659 Added hiding logic of create button in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
2026-08-26 12:13:41 +05:30
dhanabalan
2f45355b26 Added rework validation logic updation in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-26 12:12:47 +05:30
dhanabalan
b7008f1f55 Added rework count column in model file of panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-08-26 12:11:42 +05:30
dhanabalan
b2618b31c7 Added rework count column in panel box validations table
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-08-26 12:11:05 +05:30
dhanabalan
c5727c78c1 removed unique constriant in panel box validation table
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-26 12:10:23 +05:30
a14395385d Merge pull request 'ranjith-dev' (#939) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #939
2026-08-26 04:07:08 +00:00
dhanabalan
0677d09558 solved bug for throwing item id null exception in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 4m41s
Laravel Larastan / larastan (pull_request) Failing after 5m4s
2026-08-26 09:36:51 +05:30
dhanabalan
4c97a80b44 Removed strict comparison on authorization token
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
2026-08-25 16:11:29 +05:30
25 changed files with 2688 additions and 295 deletions

View File

@@ -22,9 +22,9 @@ class ProductionOrderExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant_id')
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item_id')
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('quantity')
->label('QUANTITY'),

View File

@@ -0,0 +1,93 @@
<?php
namespace App\Filament\Exports;
use App\Models\PumpTestingResult;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class PumpTestingResultExporter extends Exporter
{
protected static ?string $model = PumpTestingResult::class;
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('tested_date')
->label('TESTED DATE'),
ExportColumn::make('tested_type')
->label('TESTED TYPE'),
ExportColumn::make('pumpTestingMaster.item.code')
->label('PUMP CODE'),
ExportColumn::make('pumpTestingMaster.item.category')
->label('PUMP CATEGORY')
->enabledByDefault(false),
ExportColumn::make('pumpTestingMaster.item.description')
->label('PUMP TYPE'),
ExportColumn::make('pumpTestingMaster.item.uom')
->label('UNIT OF MEASURE')
->enabledByDefault(false),
ExportColumn::make('pump_serial_number')
->label('PUMP SERIAL NUMBER'),
ExportColumn::make('correction_head')
->label('CORRECTION HEAD'),
ExportColumn::make('sl_no')
->label('SL. NO.'),
ExportColumn::make('voltage')
->label('VOLTAGE'),
ExportColumn::make('current')
->label('CURRENT'),
ExportColumn::make('watt')
->label('WATT'),
ExportColumn::make('frequency')
->label('FREQUENCY'),
ExportColumn::make('speed')
->label('SPEED'),
ExportColumn::make('discharge')
->label('DISCHARGE'),
ExportColumn::make('head')
->label('HEAD'),
ExportColumn::make('pump_output')
->label('PUMP OUTPUT'),
ExportColumn::make('power_p2')
->label('PUMP P2'),
ExportColumn::make('overall_efficiency')
->label('OVERALL EFFICIENCY'),
ExportColumn::make('pump_efficiency')
->label('PUMP EFFICIENCY'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your pump testing result export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;
}
}

View File

@@ -211,16 +211,26 @@ class CreateInvoiceValidation extends CreateRecord
} else {
$totQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scanSQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
$totMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $plantId)->count(); // ->where('quantity', '!=', '')
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
if ($totMQuan > 0) {
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totMQuan;
$scanMatQuan = $scanMQuan;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'scanned_quantity' => $scanMQuan,
'total_quantity' => $totMatQuan,
'scanned_quantity' => $scanMatQuan,
]);
if ($totQuan == $scanMQuan) {
@@ -829,12 +839,22 @@ class CreateInvoiceValidation extends CreateRecord
// Update total quantity in the form
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totalQuantity;
$scanMatQuan = $scannedQuantity;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totalQuantity,
'scanned_quantity' => $scannedQuantity,
'total_quantity' => $totMatQuan,
'scanned_quantity' => $scanMatQuan,
]);
if ($totalQuantity == $scannedQuantity) {
@@ -861,12 +881,22 @@ class CreateInvoiceValidation extends CreateRecord
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totalQuantity;
$scanMatQuan = $scannedQuantity;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totalQuantity,
'scanned_quantity' => $scannedQuantity,
'total_quantity' => $totMatQuan,
'scanned_quantity' => $scanMatQuan,
]);
// if ($disk->exists($filePath)) {
@@ -1918,12 +1948,22 @@ class CreateInvoiceValidation extends CreateRecord
// Update total quantity in the form
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totalQuantity;
$scanMatQuan = $scannedQuantity;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totalQuantity,
'scanned_quantity' => $scannedQuantity,
'total_quantity' => $totMatQuan,
'scanned_quantity' => $scanMatQuan,
]);
if ($totalQuantity == $scannedQuantity) {
@@ -1951,12 +1991,22 @@ class CreateInvoiceValidation extends CreateRecord
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totalQuantity;
$scanMatQuan = $scannedQuantity;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totalQuantity,
'scanned_quantity' => $scannedQuantity,
'total_quantity' => $totMatQuan,
'scanned_quantity' => $scanMatQuan,
]);
// if ($disk->exists($filePath)) {
@@ -2448,6 +2498,15 @@ class CreateInvoiceValidation extends CreateRecord
return;
} else {
if ($totMQuan > 0) {
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totQuan;
$scanMatQuan = $scanMQuan;
}
if ($totQuan == $scanMQuan) {
Notification::make()
->title('Completed: Material Invoice')
@@ -2484,9 +2543,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
@@ -2524,9 +2583,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2543,9 +2602,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2586,9 +2645,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2620,9 +2679,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2655,9 +2714,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2698,9 +2757,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2731,9 +2790,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2763,9 +2822,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2805,9 +2864,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2838,9 +2897,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -2914,7 +2973,6 @@ class CreateInvoiceValidation extends CreateRecord
$duplicateSerial = [];
$weightExceeded = [];
$processedItems = [];
$invalidMaterialItems = [];
$wireItems1 = WireMasterPacking::join('items', 'items.id', '=', 'wire_master_packings.item_id')
@@ -2933,8 +2991,6 @@ class CreateInvoiceValidation extends CreateRecord
$palletWeight = $wireItem->pallet_weight;
$itemCode = $wireItem->item_code;
$processedItems[] = $itemCode;
$duplicate = InvoiceValidation::where('plant_id', $this->plantId)
->where('invoice_number', $this->invoiceNumber)
->where('serial_number', $processOrder)
@@ -3120,16 +3176,24 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$totQuan = InvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count();
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totQuan;
$scanMatQuan = $scanMQuan;
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3168,9 +3232,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3206,9 +3270,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3243,9 +3307,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3266,9 +3330,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3301,9 +3365,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3329,9 +3393,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3351,9 +3415,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3373,9 +3437,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3439,9 +3503,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3467,9 +3531,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
'scanned_quantity' => $scanMatQuan,
]);
return;
@@ -3492,9 +3556,17 @@ class CreateInvoiceValidation extends CreateRecord
// ->send();
$totQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$scannedMQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
} else {
$totMatQuan = $totQuan;
$scanMatQuan = $scannedMQuantity;
}
if ($totQuan == $scannedMQuantity) {
Notification::make()
->title('Completed: Material Invoice')
@@ -3530,9 +3602,9 @@ class CreateInvoiceValidation extends CreateRecord
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scannedMQuantity,
'scanned_quantity' => $scanMatQuan,
]);
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
}

View File

@@ -5,6 +5,7 @@ namespace App\Filament\Resources;
use App\Filament\Resources\PanelBoxValidationResource\Pages;
use App\Filament\Resources\PanelBoxValidationResource\RelationManagers;
use App\Models\PanelBoxValidation;
use App\Models\ProductionCharacteristic;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
@@ -28,6 +29,8 @@ use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use App\Filament\Exports\PanelBoxValidationExporter;
use App\Filament\Imports\PanelBoxValidationImporter;
use Filament\Forms\Components\Actions;
use Filament\Forms\Components\Actions\Action;
class PanelBoxValidationResource extends Resource
{
@@ -41,6 +44,8 @@ class PanelBoxValidationResource extends Resource
public $data = [];
public bool $showChecklist = false;
public static function form(Form $form): Form
{
return $form
@@ -272,11 +277,12 @@ class PanelBoxValidationResource extends Resource
// Proceed with validation logic for new scanned QR code
if (! $state || trim($state) == '') {
$set('serial_exists', false);
$set('validationError', null);
return;
}
// // Check if QR format contains '|'
// Check if QR format contains '|'
if ($state && str_contains($state, '|'))
{
@@ -560,6 +566,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
@@ -579,6 +586,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
@@ -591,6 +599,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
@@ -603,6 +612,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
else if($existInMaster->supplier_number == '' || $existInMaster->supplier_number == null){
@@ -612,6 +622,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
else if($existInMaster->supplier_number != $supplier){
@@ -621,6 +632,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
else if($existInMaster->inspection_lot_number != $inspecLotNo){
@@ -630,6 +642,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
else if($existInMaster->quantity == '' || $existInMaster->quantity == null){
@@ -639,6 +652,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
else if($existInMaster->invoice_number == '' || $existInMaster->invoice_number == null){
@@ -648,6 +662,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
@@ -660,6 +675,8 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('sticker_master_id', $sticker->id)->count();
@@ -671,6 +688,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
@@ -686,6 +704,7 @@ class PanelBoxValidationResource extends Resource
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
$set('validationError', null);
return;
}
@@ -693,6 +712,7 @@ class PanelBoxValidationResource extends Resource
if (strlen($itemCode) < 6) {
$set('validationError', 'Item code must be at least 6 digits.');
$set('part_validation_type', null);
$set('serial_exists', false);
$set('show_validation_image', false);
$set('part_validation_type_options', []);
$set('validation1_image_url', null);
@@ -701,6 +721,7 @@ class PanelBoxValidationResource extends Resource
} elseif (! ctype_alnum($itemCode)) {
$set('validationError', 'Item Code should contain alpha-numeric values.');
$set('item_id', null);
$set('serial_exists', false);
$set('part_validation_type', null);
$set('show_validation_image', false);
$set('part_validation_type_options', []);
@@ -736,6 +757,7 @@ class PanelBoxValidationResource extends Resource
$set('show_validation_image', false);
$set('part_validation_type_options', []);
$set('validation1_image_url', null);
$set('serial_exists', false);
return;
} else {
@@ -747,6 +769,7 @@ class PanelBoxValidationResource extends Resource
$set('part_validation_type', null);
$set('show_validation_image', false);
$set('validation1_image_url', null);
$set('serial_exists', false);
return;
} elseif (! is_numeric($get('production_order')) || ! preg_match('/^[1-9][0-9]{6,13}$/', $get('production_order'))) {
@@ -759,6 +782,7 @@ class PanelBoxValidationResource extends Resource
$set('show_validation_image', false);
$set('part_validation_type_options', []);
$set('validation1_image_url', null);
$set('serial_exists', false);
return;
}
@@ -784,7 +808,13 @@ class PanelBoxValidationResource extends Resource
}
}
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists();
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
// if ($serialExists) {
// $set('serial_exists', true);
// } else {
// $set('serial_exists', false);
// }
if ($serialExists && ! $get('id')) {
$set('validationError', 'Serial number already exists in panel box validation.');
@@ -908,12 +938,6 @@ class PanelBoxValidationResource extends Resource
$set('part_validation_type_options', $options);
})
// ->extraAttributes(fn ($get) => [
// 'class' => $get('validationError') ? 'border-red-500' : '',
// 'id' => 'item_id',
// 'onkeydown' => "if (event.key === 'Enter') { event.preventDefault(); event.stopPropagation(); return false; }",
// ])
->extraAttributes(fn ($get) => [
'class' => $get('validationError') ? 'border-red-500' : '',
'id' => 'item_id',
@@ -945,6 +969,84 @@ class PanelBoxValidationResource extends Resource
])
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
->hintColor('danger'),
Forms\Components\Hidden::make('serial_exists')
->default(false),
Forms\Components\Actions::make([
Action::make('rework')
->label('Yes, Rework')
->color('warning')
->requiresConfirmation()
->modalHeading('Confirm Rework')
->modalDescription('Have you reworked this serial number?')
->modalSubmitActionLabel('Yes, Continue')
->visible(fn ($get) => $get('serial_exists') == true)
->action(function ($get, $livewire) {
$serialNumber = $get('serial_number');
$plantId = $get('plant_id');
$pOrder = $get('production_order');
$inspecLotNo = $get('inspection_lot_number');
$alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
->where('plant_id', $plantId)
->where('production_order', $pOrder)
->where('inspection_lot_number', $inspecLotNo)
->first();
if ($alreadyExists) {
Notification::make()
->title('Invalid Rework')
->body(
'This document number and inspection lot number have already been used for this serial number. Please provide a new document number and inspection lot number for rework..'
)
->danger()
->send();
$livewire->showChecklist = false;
return;
}
$data = $get();
$hasCharacteristics = $livewire->checkIfHasCharacteristics($data);
\Log::info('CHARACTERISTICS RESULT', [
'hasCharacteristics' => $hasCharacteristics,
]);
if ($hasCharacteristics) {
\Log::info('SETTING SHOW CHECKLIST TRUE');
$livewire->showChecklist = true;
$livewire->dispatch('close-modal');
return;
}
else{
Notification::make()
->title('Not Found Characteristics')
->body('item characteristics not found')
->danger()
->send();
$livewire->showChecklist = false;
return;
}
// else
// {
// // $livewire->showChecklist = true;
// // $data = $livewire->data;
// $data = $get();
// if ($livewire->checkIfHasCharacteristics($data)) {
// $livewire->showChecklist = true;
// $livewire->dispatch('close-modal');
// return;
// }
// }
}),
]),
Forms\Components\Hidden::make('part_validation_type_options')
->default([])
->reactive()
@@ -1752,6 +1854,11 @@ class PanelBoxValidationResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('rework_count')
->label('Rework Count')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()
@@ -1863,6 +1970,13 @@ class PanelBoxValidationResource extends Resource
->label('Panel Box Code')
->reactive()
->placeholder('Enter Panel Box Code'),
Select::make('rework_count')
->label('Rework')
->options([
1 => 'Yes',
0 => 'No',
])
->reactive(),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder('Select From DateTime')
@@ -1876,7 +1990,7 @@ class PanelBoxValidationResource extends Resource
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['production_order']) && empty($data['serial_number']) && empty($data['inspection_lot_number']) && empty($data['panel_box_code']) && empty($data['created_from']) && empty($data['created_to'])) {
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['production_order']) && empty($data['serial_number']) && empty($data['inspection_lot_number']) && empty($data['panel_box_code']) && empty($data['rework_count']) && empty($data['created_from']) && empty($data['created_to'])) {
return $query->whereRaw('1 = 0');
}
@@ -1920,6 +2034,15 @@ class PanelBoxValidationResource extends Resource
$query->where('panel_box_code', 'like', '%'.$data['panel_box_code'].'%');
}
if (! empty($data['rework_count'])) {
if ($data['rework_count'] == 1) {
$query->where('rework_count', '>', 0);
}
else if ($data['rework_count'] == 0) {
$query->where('rework_count', '=', '0');
}
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}

View File

@@ -7,6 +7,7 @@ use App\Models\ProductCharacteristicsMaster;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Validation\ValidationException;
use Filament\Actions\Action;
class CreatePanelBoxValidation extends CreateRecord {
@@ -37,6 +38,17 @@ class CreatePanelBoxValidation extends CreateRecord {
{
$this->create();
}
public function getCreateFormAction(): Action
{
return parent::getCreateFormAction()
->visible(fn () => $this->data['serial_exists'] != true);
}
protected function getCreateAnotherFormAction(): Action
{
return parent::getCreateAnotherFormAction()
->visible(fn () => ($this->data['serial_exists'] ?? false) != true);
}
public function mount(): void
{
@@ -75,7 +87,7 @@ class CreatePanelBoxValidation extends CreateRecord {
}
}
protected function checkIfHasCharacteristics(array $data)
public function checkIfHasCharacteristics(array $data)
{
$plantId = $data['plant_id'] ?? null;
$itemCode = $data['item_id'] ?? null;

View File

@@ -464,7 +464,7 @@ class PumpTestingEntryResource extends Resource
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Item', null);
$set('isi_type', null);
$set('tested_type', null);
$set('created_by', null);
$set('updated_by', null);
}),
@@ -479,7 +479,7 @@ class PumpTestingEntryResource extends Resource
->reactive()
->native(false),
Select::make('tested_type')
->label('Tested Type')
->label('Search by Tested Type')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
@@ -592,13 +592,13 @@ class PumpTestingEntryResource extends Resource
}
if (! empty($data['Item']) && ! empty($data['Plant'])) {
$itemIds = Item::where('id', $data['Item'])
$pumpMasterIds = PumpTestingMaster::where('item_id', $data['Item'])
->where('plant_id', $data['Plant'])
->pluck('id')
->toArray();
if (! empty($itemIds)) {
$query->whereIn('item_id', $itemIds);
if (! empty($pumpMasterIds)) {
$query->whereIn('pump_testing_master_id', $pumpMasterIds);
}
}
@@ -611,7 +611,14 @@ class PumpTestingEntryResource extends Resource
})->pluck('id')->toArray();
if (! empty($descIds)) {
$query->whereIn('item_id', $descIds);
$pumpMasterIds = PumpTestingMaster::whereIn('item_id', $descIds)
->where('plant_id', $data['Plant'])
->pluck('id')
->toArray();
if (! empty($pumpMasterIds)) {
$query->whereIn('pump_testing_master_id', $pumpMasterIds);
}
}
}

View File

@@ -0,0 +1,808 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\PumpTestingResultExporter;
use App\Filament\Resources\PumpTestingResultResource\Pages;
use App\Models\Configuration;
use App\Models\Item;
use App\Models\Plant;
use App\Models\PumpTestingMaster;
use App\Models\PumpTestingResult;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Forms\Get;
use Filament\Forms\Set;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Validation\Rule;
class PumpTestingResultResource extends Resource
{
protected static ?string $model = PumpTestingResult::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Pump Testing Panel';
protected static ?int $navigationSort = 3;
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('')
->schema([
Forms\Components\Select::make('plant_id')
->label('Plant Name')
->relationship('plant', 'name')
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->columnSpan(1) // (['default' => 1, 'sm' => 2])
->required()
->searchable()
->reactive()
->default(function () {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(PumpTestingResult::latest()->first())->plant_id ?? null;
})
->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id');
$set('pump_testing_master_id', null);
$set('pump_master_id', null);
// $set('pump_type', null);
if (! $plantId) {
$set('pTeError', 'Please select a plant first.');
return;
} else {
$set('pTeError', null);
}
$set('updated_by', Filament::auth()->user()?->name);
})
->extraAttributes(fn ($get) => [
'class' => $get('pTeError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('pTeError') ? $get('pTeError') : null)
->hintColor('danger'),
Forms\Components\Select::make('tested_type')
->label('Tested Type')
->selectablePlaceholder(false)
->options(function (callable $get) {
$plantId = $get('plant_id');
if ($plantId) {
return Configuration::where('plant_id', $plantId)
->where('c_name', 'PUMP_DISPLAY_TEST_TYPE')
->whereNot('c_value', 'Routine Test')
->orderBy('created_at')
->pluck('c_value', 'c_value')
->toArray();
} else {
return Configuration::where('c_name', 'PUMP_DISPLAY_TEST_TYPE')
->whereNot('c_value', 'Routine Test')
->orderBy('created_at')
->pluck('c_value', 'c_value')
->toArray();
}
})
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->default('Pump Performance Test')
->reactive(),
Forms\Components\DatePicker::make('tested_date')
->label('Tested Date')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->default(now())
->required()
->reactive(),
Forms\Components\TextInput::make('correction_head')
->label('Correction Head')
->placeholder('Scan the correction head')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\Hidden::make('pump_testing_master_id')
// ->relationship('pumpTestingMasters', 'id')
->required(),
Forms\Components\Select::make('pump_master_id')
->label('Pump Code')
// ->relationship('pumpTestingMasters', 'id')
->options(function (callable $get) {
$plantId = $get('plant_id');
if (! $plantId) {
return [];
}
return Item::where('plant_id', $plantId)->whereHas('pumpTestingMasters')->orderBy('code')->pluck('code', 'code');
})
->columnSpan(1)
->required()
->searchable()
->reactive()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$plantId = $get('plant_id'); // Get selected plant
$set('pump_testing_master_id', null);
// $set('pump_type', null);
if (! $plantId) {
$set('pump_master_id', null);
} elseif ($state) {
// $pumpMaster = PumpTestingMaster::where('plant_id', $plantId)->where('item_id', $state)->first();
$pumpMaster = PumpTestingMaster::where('plant_id', $plantId)->whereHas('item', function ($query) use ($state) {
$query->where('code', $state);
})->first();
if (! $pumpMaster) {
$set('pump_master_id', null);
} else {
$set('pump_testing_master_id', $pumpMaster->id);
// $set('pump_type', $pumpMaster->item->description ?? null);
}
}
$set('updated_by', Filament::auth()->user()?->name);
})
->afterStateHydrated(function ($component, $state, Get $get, Set $set) {
if ($get('id')) {
$itemId = PumpTestingMaster::where('id', $get('pump_testing_master_id'))->first()?->item_id;
if ($itemId) {
$item = Item::where('id', $itemId)->first()?->code;
if ($item) {
$set('pump_master_id', $item);
} else {
$set('pump_master_id', null);
}
} else {
$set('pump_master_id', null);
}
}
}),
// Forms\Components\TextInput::make('pump_type')
// ->label('Pump Type]')
// ->placeholder('Choose the pump code first')
// ->readOnly()
// ->afterStateUpdated(function ($state, callable $set) {
// $set('updated_by', Filament::auth()->user()?->name);
// })
// ->columnSpan(1)
// ->required()
// ->reactive(),
Forms\Components\TextInput::make('pump_serial_number')
->label('Pump Serial Number')
->placeholder('Scan the pump serial number')
->rule(function (callable $get) {
return Rule::unique('pump_testing_results', 'pump_serial_number')
->where('plant_id', $get('plant_id'))
->where('pump_testing_master_id', $get('pump_testing_master_id'))
->where('tested_type', $get('tested_type'))
->where('sl_no', $get('sl_no'))
->ignore($get('id'));
})
->afterStateUpdated(function ($state, callable $set) {
if (strpos($state, '|') != false) {
$parts = explode('|', $state);
$set('pump_serial_number', $parts[1]);
}
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('sl_no')
->label('Sl. No.')
->placeholder('Scan the sl. no.')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('voltage')
->label('Voltage')
->placeholder('Scan the voltage')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('current')
->label('Current')
->placeholder('Scan the current')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('watt')
->label('Watt')
->placeholder('Scan the watt')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('frequency')
->label('Frequency')
->placeholder('Scan the frequency')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('speed')
->label('Speed')
->placeholder('Scan the speed')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('discharge')
->label('Discharge')
->placeholder('Scan the discharge')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('head')
->label('Head')
->placeholder('Scan the head')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('pump_output')
->label('Pump Output')
->placeholder('Scan the pump output')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('power_p2')
->label('Power P2')
->placeholder('Scan the power p2')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('overall_efficiency')
->label('Overall Efficiency')
->placeholder('Scan the overall efficiency')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\TextInput::make('pump_efficiency')
->label('Pump Efficiency')
->placeholder('Scan the pump efficiency')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->columnSpan(1)
->required()
->reactive(),
Forms\Components\Hidden::make('created_by')
->default(fn () => Filament::auth()->user()?->name)
->columnSpan(1)
->required(),
Forms\Components\Hidden::make('updated_by')
->default(fn () => Filament::auth()->user()?->name)
->columnSpan(1)
->required(),
Forms\Components\TextInput::make('id')
->hidden()
->columnSpan(1)
->readOnly(),
])
->columns(['default' => 1, 'sm' => 2]),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
// Tables\Columns\TextColumn::make('id')
// ->label('ID')
// ->numeric()
// ->sortable(),
Tables\Columns\TextColumn::make('No.')
->label('No.')
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
Tables\Columns\TextColumn::make('plant.name')
->label('Plant Name')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('tested_date')
->label('Tested Date')
->date() // 'F d, Y'
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('tested_type')
->label('Tested Type')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('pumpTestingMasters.item.code')
->label('Pump Code')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('pumpTestingMasters.item.category')
->label('Pump Category')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('pumpTestingMasters.item.description')
->label('Pump Type')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('pumpTestingMasters.item.uom')
->label('Unit Of Measure')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('pump_serial_number')
->label('Pump Serial Number')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('correction_head')
->label('Correction Head')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('sl_no')
->label('Sl. No.')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('voltage')
->label('Voltage')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('current')
->label('Current')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('watt')
->label('Watt')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('frequency')
->label('Frequency')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('speed')
->label('Speed')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('discharge')
->label('Discharge')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('head')
->label('Head')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('pump_output')
->label('Pump Output')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('power_p2')
->label('Power P2')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('overall_efficiency')
->label('Overall Efficiency')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('pump_efficiency')
->label('Pump Efficiency')
->searchable()
->alignCenter(),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->dateTime()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->dateTime()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->dateTime()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->searchable()
// ->options(function () {
// return Plant::pluck('name', 'id');
// })
->reactive()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
} else {
return Plant::whereHas('pumpTestingResults', function ($query) {
$query->whereNotNull('id');
})->orderBy('code')->pluck('name', 'id');
}
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Item', null);
$set('tested_type', null);
$set('created_by', null);
$set('updated_by', null);
}),
DatePicker::make('tested_from')
->label('Tested From')
->placeholder('Select From Date')
->reactive()
->native(false),
DatePicker::make('tested_to')
->label('Tested To')
->placeholder('Select To Date')
->reactive()
->native(false),
Select::make('tested_type')
->label('Search by Tested Type')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return PumpTestingResult::whereNotNull('tested_type')->select('tested_type')->distinct()->pluck('tested_type', 'tested_type');
} else {
return PumpTestingResult::where('plant_id', $plantId)->whereNotNull('tested_type')->select('tested_type')->distinct()->pluck('tested_type', 'tested_type');
}
})
->searchable()
->reactive(),
Select::make('Item')
->label('Search by Pump Code')
->nullable()
->options(function (callable $get) {
$pId = $get('Plant');
if (! $pId) {
return [];
} else {
return Item::whereHas('pumpTestingMasters', function ($query) use ($pId) {
if ($pId) {
$query->where('plant_id', $pId);
}
$query->whereHas('pumpTestingResults');
})->pluck('code', 'id');
}
})
->searchable()
->reactive(),
TextInput::make('description')
->label('Pump Type')
->placeholder('Enter the Pump Type'),
TextInput::make('pump_serial_number')
->label('Pump Serial Number')
->placeholder('Enter the Pump Serial Number'),
Select::make('created_by')
->label('Search by Created By')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return PumpTestingResult::whereNotNull('created_by')->select('created_by')->distinct()->pluck('created_by', 'created_by');
} else {
return PumpTestingResult::where('plant_id', $plantId)->whereNotNull('created_by')->select('created_by')->distinct()->pluck('created_by', 'created_by');
}
})
->searchable()
->reactive(),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder(placeholder: 'Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
Select::make('updated_by')
->label('Search by Updated By')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return PumpTestingResult::whereNotNull('updated_by')->select('updated_by')->distinct()->pluck('updated_by', 'updated_by');
} else {
return PumpTestingResult::where('plant_id', $plantId)->whereNotNull('updated_by')->select('updated_by')->distinct()->pluck('updated_by', 'updated_by');
}
})
->searchable()
->reactive(),
DateTimePicker::make(name: 'updated_from')
->label('Updated From')
->placeholder(placeholder: 'Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('updated_to')
->label('Updated To')
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['tested_from']) && empty($data['tested_to']) && empty($data['tested_type']) && empty($data['Item']) && empty($data['description']) && empty($data['pump_serial_number']) && empty($data['created_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {
return $query->whereRaw('1 = 0');
}
if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (! empty($data['tested_from'])) {
$query->where('tested_date', '>=', $data['tested_from']);
}
if (! empty($data['tested_to'])) {
$query->where('tested_date', '<=', $data['tested_to']);
}
if (! empty($data['tested_type'])) {
$query->where('tested_type', $data['tested_type']);
}
if (! empty($data['Item']) && ! empty($data['Plant'])) {
$pumpMasterIds = PumpTestingMaster::where('item_id', $data['Item'])
->where('plant_id', $data['Plant'])
->pluck('id')
->toArray();
if (! empty($pumpMasterIds)) {
$query->whereIn('pump_testing_master_id', $pumpMasterIds);
}
}
if (! empty($data['description'])) {
$pId = $data['Plant'] ?? null;
$descIds = Item::where('description', 'like', '%'.$data['description'].'%')->whereHas('pumpTestingMasters', function ($query) use ($pId) {
if ($pId) {
$query->where('plant_id', $pId);
}
})->pluck('id')->toArray();
if (! empty($descIds)) {
$pumpMasterIds = PumpTestingMaster::whereIn('item_id', $descIds)
->where('plant_id', $data['Plant'])
->pluck('id')
->toArray();
if (! empty($pumpMasterIds)) {
$query->whereIn('pump_testing_master_id', $pumpMasterIds);
}
}
}
if (! empty($data['pump_serial_number'])) {
$query->where('pump_serial_number', 'like', '%'.$data['pump_serial_number'].'%');
}
if (! empty($data['created_by'])) {
$query->where('created_by', $data['created_by']);
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
if (! empty($data['updated_by'])) {
$query->where('updated_by', $data['updated_by']);
}
if (! empty($data['updated_from'])) {
$query->where('updated_at', '>=', $data['updated_from']);
}
if (! empty($data['updated_to'])) {
$query->where('updated_at', '<=', $data['updated_to']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['Plant'])) {
$indicators[] = 'Plant Name: '.Plant::where('id', $data['Plant'])->value('name');
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return 'Plant: Choose plant to filter records.';
}
}
if (! empty($data['tested_from'])) {
$indicators[] = 'Tested From: '.$data['tested_from'];
}
if (! empty($data['tested_to'])) {
$indicators[] = 'Tested To: '.$data['tested_to'];
}
if (! empty($data['tested_type'])) {
$indicators[] = 'Tested Type: '.$data['tested_type'];
}
if (! empty($data['Item']) && ! empty($data['Plant'])) {
$itemCode = Item::find($data['Item'])->code ?? 'Unknown';
$indicators[] = 'Pump Code: '.$itemCode;
}
if (! empty($data['description'])) {
$indicators[] = 'Pump Type: '.$data['description'];
}
if (! empty($data['pump_serial_number'])) {
$indicators[] = 'Pump Serial Number: '.$data['pump_serial_number'];
}
if (! empty($data['created_by'])) {
$indicators[] = 'Created By: '.$data['created_by'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'Created From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'Created To: '.$data['created_to'];
}
if (! empty($data['updated_by'])) {
$indicators[] = 'Updated By: '.$data['updated_by'];
}
if (! empty($data['updated_from'])) {
$indicators[] = 'Updated From: '.$data['updated_from'];
}
if (! empty($data['updated_to'])) {
$indicators[] = 'Updated To: '.$data['updated_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->headerActions([
ExportAction::make()
->label('Export Pump Testing Results')
->color('warning')
->exporter(PumpTestingResultExporter::class)
->visible(function () {
return Filament::auth()->user()->can('view export pump testing results');
}),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListPumpTestingResults::route('/'),
'create' => Pages\CreatePumpTestingResult::route('/create'),
'view' => Pages\ViewPumpTestingResult::route('/{record}'),
'edit' => Pages\EditPumpTestingResult::route('/{record}/edit'),
];
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\Resources\PumpTestingResultResource\Pages;
use App\Filament\Resources\PumpTestingResultResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreatePumpTestingResult extends CreateRecord
{
protected static string $resource = PumpTestingResultResource::class;
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Filament\Resources\PumpTestingResultResource\Pages;
use App\Filament\Resources\PumpTestingResultResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditPumpTestingResult extends EditRecord
{
protected static string $resource = PumpTestingResultResource::class;
protected function getHeaderActions(): array
{
return [
Actions\ViewAction::make(),
Actions\DeleteAction::make(),
Actions\ForceDeleteAction::make(),
Actions\RestoreAction::make(),
];
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Filament\Resources\PumpTestingResultResource\Pages;
use App\Filament\Resources\PumpTestingResultResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListPumpTestingResults extends ListRecords
{
protected static string $resource = PumpTestingResultResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Filament\Resources\PumpTestingResultResource\Pages;
use App\Filament\Resources\PumpTestingResultResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;
class ViewPumpTestingResult extends ViewRecord
{
protected static string $resource = PumpTestingResultResource::class;
protected function getHeaderActions(): array
{
return [
Actions\EditAction::make(),
];
}
}

View File

@@ -2045,7 +2045,26 @@ class CharacteristicsController extends Controller
], 404);
}
$machineId = $machine->id; //
$machineId = $machine->id;
if ($jobNo != null && $jobNo != '' && $jobNo) {
if (Str::length($jobNo) < 7) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Job number '{$jobNo}' should contain minimum 7 digits!",
], 404);
} elseif (! is_numeric($jobNo)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Job number '{$jobNo}' should contain only numeric values!",
], 404);
} elseif (! preg_match('/^[1-9]\d{6,}$/', $jobNo)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Job number '{$jobNo}' should not begin with '0'!",
], 404);
}
}
$availFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_datetime', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_datetime', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_datetime', 'name_plate_marked_by', 'winded_serial_number', 'winded_rework_status', 'part_validation_1', 'part_validation_2', 'samlight_logged_name'
@@ -2140,7 +2159,12 @@ class CharacteristicsController extends Controller
$missingUsersRight = [];
foreach ($characteristics as $ch) {
$curHead = $ch['zmm_heading'] ?? null;
if (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
if ($curHead == '' || $curHead == null) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "ZMM_HEADING - characteristics doesn't have value to proceed!",
], 404);
} elseif (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$stick = StickerMaster::where('item_id', $itemId)->first();
if (! $stick) {
@@ -2437,7 +2461,12 @@ class CharacteristicsController extends Controller
// ], 404);
foreach ($characteristics as $ch) {
$curHead = $ch['zmm_heading'] ?? null;
if (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
if ($curHead == '' || $curHead == null) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "ZMM_HEADING - characteristics doesn't have value to proceed!",
], 404);
} elseif (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$stick = StickerMaster::where('item_id', $itemId)->first();
if (! $stick) {
@@ -2479,7 +2508,12 @@ class CharacteristicsController extends Controller
$missingUsersRight = [];
foreach ($characteristics as $ch) {
$curHead = $ch['zmm_heading'] ?? null;
if (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
if ($curHead == '' || $curHead == null) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "ZMM_HEADING - characteristics doesn't have value to proceed!",
], 404);
} elseif (Str::contains($curHead, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$stick = StickerMaster::where('item_id', $itemId)->first();
if (! $stick) {
@@ -3207,7 +3241,7 @@ class CharacteristicsController extends Controller
$characteristicsData = ClassCharacteristic::where('gernr', $serialNumber)->where('item_id', $itemId)->where('machine_id', $machineId)->where('plant_id', $plantId)->get();
$remFields = ['id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at'];
$remFields = ['id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at', 'is_stopped', 'stopped_datetime', 'stopped_by'];
$filteredData = $characteristicsData->map(function ($char) use ($remFields) {
$charArray = $char->toArray();
@@ -3982,7 +4016,7 @@ class CharacteristicsController extends Controller
$headerAuth = $request->header('Authorization');
$expectedToken = 'Bearer '.$expectedUser.':'.$expectedPw;
if ($headerAuth !== $expectedToken) {
if ($headerAuth != $expectedToken) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',
@@ -4236,7 +4270,7 @@ class CharacteristicsController extends Controller
$headerAuth = $request->header('Authorization');
$expectedToken = 'Bearer '.$expectedUser.':'.$expectedPw;
if ($headerAuth !== $expectedToken) {
if ($headerAuth != $expectedToken) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',
@@ -5315,7 +5349,7 @@ class CharacteristicsController extends Controller
$headerAuth = $request->header('Authorization');
$expectedToken = 'Bearer '.$expectedUser.':'.$expectedPw;
if ($headerAuth !== $expectedToken) {
if ($headerAuth != $expectedToken) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,8 @@
namespace App\Livewire;
use App\Models\InvoiceValidation;
use App\Models\Item;
use App\Models\PanelBoxValidation;
use App\Models\StickerMaster;
use Filament\Facades\Filament;
use Filament\Notifications\Notification;
@@ -844,6 +846,25 @@ class InvoiceDataTable extends Component
return;
}
// $categoryExist = Item::where('code', $itemCode)->first();
// if($categoryExist?->category == 'Panel Box'){
// $panelExist = PanelBoxValidation::where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first();
// if(!$panelExist){
// Notification::make()
// ->title('Panel Not Verified')
// ->body("Panel Quality Inspection failed.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.</br>")
// ->danger()
// ->seconds(2)
// ->send();
// $this->capacitorInput = '';
// return;
// }
// }
$this->package = InvoiceValidation::with('stickerMasterRelation')
->where('invoice_number', $this->invoiceNumber)
->where('plant_id', $this->plantId)

View File

@@ -113,14 +113,14 @@ public $records = [];
$plan = Plant::find($this->data['plant_id']);
if ($exists) {
Notification::make()
->title('Duplicate Serial Number')
->body("serial number {$this->data['serial_number']} already exists for the selected plant $plan->code.")
->danger()
->send();
return;
}
// if ($exists) {
// Notification::make()
// ->title('Duplicate Serial Number')
// ->body("serial number {$this->data['serial_number']} already exists for the selected plant $plan->code.")
// ->danger()
// ->send();
// return;
// }
if(!$this->selectForNotOk){
@@ -177,28 +177,82 @@ public $records = [];
}
}
// $latestReworkRecord = PanelBoxValidation::where('plant_id', $this->data['plant_id'] ?? null)->where('serial_number', $this->data['serial_number'] ?? null)->latest()->first();
// if($latestReworkRecord){
// $qualityValidation = PanelBoxValidation::create([
// 'plant_id' => $this->data['plant_id'] ?? null,
// 'line_id' => $this->data['line_id'] ?? null,
// 'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
// 'production_order' => $this->data['production_order'] ?? null,
// 'serial_number' => $this->data['serial_number'] ?? null,
// 'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
// 'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
// 'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
// 'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
// 'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
// 'part_validation1' => $this->data['part_validation1'] ?? null,
// 'part_validation2' => $this->data['part_validation2'] ?? null,
// 'part_validation3' => $this->data['part_validation3'] ?? null,
// 'part_validation4' => $this->data['part_validation4'] ?? null,
// 'part_validation5' => $this->data['part_validation5'] ?? null,
// 'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
// 'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
// 'panel_box_code' => $this->data['panel_box_code'] ?? null,
// 'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
// 'rework_count' => $latestReworkRecord ? ((int) $latestReworkRecord->rework_count + 1) : 0,
// 'created_by' => $this->data['created_by'] ?? null,
// 'updated_by' => $this->data['updated_by'] ?? null,
// ]);
// }
// else{
// $qualityValidation = PanelBoxValidation::create([
// 'plant_id' => $this->data['plant_id'] ?? null,
// 'line_id' => $this->data['line_id'] ?? null,
// 'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
// 'production_order' => $this->data['production_order'] ?? null,
// 'serial_number' => $this->data['serial_number'] ?? null,
// 'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
// 'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
// 'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
// 'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
// 'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
// 'part_validation1' => $this->data['part_validation1'] ?? null,
// 'part_validation2' => $this->data['part_validation2'] ?? null,
// 'part_validation3' => $this->data['part_validation3'] ?? null,
// 'part_validation4' => $this->data['part_validation4'] ?? null,
// 'part_validation5' => $this->data['part_validation5'] ?? null,
// 'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
// 'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
// 'panel_box_code' => $this->data['panel_box_code'] ?? null,
// 'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
// 'created_by' => $this->data['created_by'] ?? null,
// 'updated_by' => $this->data['updated_by'] ?? null,
// ]);
// }
$qualityValidation = PanelBoxValidation::create([
'plant_id' => $this->data['plant_id'] ?? null,
'line_id' => $this->data['line_id'] ?? null,
'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
'production_order' => $this->data['production_order'] ?? null,
'serial_number' => $this->data['serial_number'] ?? null,
'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
'part_validation1' => $this->data['part_validation1'] ?? null,
'part_validation2' => $this->data['part_validation2'] ?? null,
'part_validation3' => $this->data['part_validation3'] ?? null,
'part_validation4' => $this->data['part_validation4'] ?? null,
'part_validation5' => $this->data['part_validation5'] ?? null,
'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
'panel_box_code' => $this->data['panel_box_code'] ?? null,
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
'created_by' => $this->data['created_by'] ?? null,
'updated_by' => $this->data['updated_by'] ?? null,
'plant_id' => $this->data['plant_id'] ?? null,
'line_id' => $this->data['line_id'] ?? null,
'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
'production_order' => $this->data['production_order'] ?? null,
'serial_number' => $this->data['serial_number'] ?? null,
'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
'part_validation1' => $this->data['part_validation1'] ?? null,
'part_validation2' => $this->data['part_validation2'] ?? null,
'part_validation3' => $this->data['part_validation3'] ?? null,
'part_validation4' => $this->data['part_validation4'] ?? null,
'part_validation5' => $this->data['part_validation5'] ?? null,
'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
'panel_box_code' => $this->data['panel_box_code'] ?? null,
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
'created_by' => $this->data['created_by'] ?? null,
'updated_by' => $this->data['updated_by'] ?? null,
]);
if (! $qualityValidation || ! $qualityValidation->exists) {

View File

@@ -30,6 +30,7 @@ class PanelBoxValidation extends Model
'panel_box_serial_number',
'panel_box_code',
'inspection_lot_number',
'rework_count',
'created_by',
'updated_by'
];

View File

@@ -94,6 +94,11 @@ class Plant extends Model
return $this->hasMany(PumpTestingEntry::class, 'plant_id', 'id');
}
public function pumpTestingResults()
{
return $this->hasMany(PumpTestingResult::class, 'plant_id', 'id');
}
public function guardNames()
{
return $this->hasMany(GuardName::class, 'plant_id', 'id');

View File

@@ -59,4 +59,9 @@ class PumpTestingMaster extends Model
{
return $this->hasMany(PumpTestingEntry::class, 'pump_testing_master_id', 'id');
}
public function pumpTestingResults()
{
return $this->hasMany(PumpTestingResult::class, 'pump_testing_master_id', 'id');
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class PumpTestingResult extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'pump_testing_master_id',
'tested_date',
'tested_type',
'pump_serial_number',
'correction_head',
'sl_no',
'voltage',
'current',
'watt',
'frequency',
'speed',
'discharge',
'head',
'pump_output',
'power_p2',
'overall_efficiency',
'pump_efficiency',
'created_at',
'created_by',
'updated_at',
'updated_by',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
public function pumpTestingMasters(): BelongsTo
{
return $this->belongsTo(PumpTestingMaster::class, 'pump_testing_master_id', 'id');
}
}

View File

@@ -0,0 +1,105 @@
<?php
namespace App\Policies;
use App\Models\PumpTestingResult;
use App\Models\User;
class PumpTestingResultPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any PumpTestingResult');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('view PumpTestingResult');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create PumpTestingResult');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('update PumpTestingResult');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('delete PumpTestingResult');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any PumpTestingResult');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('restore PumpTestingResult');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any PumpTestingResult');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('replicate PumpTestingResult');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder PumpTestingResult');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, PumpTestingResult $pumptestingresult): bool
{
return $user->checkPermissionTo('force-delete PumpTestingResult');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any PumpTestingResult');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE panel_box_validations
DROP CONSTRAINT panel_box_validations_plant_id_serial_number_key
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('panel_box_validations', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE panel_box_validations
ADD COLUMN rework_count TEXT DEFAULT '0'
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('panel_box_validations', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql = <<<'SQL'
CREATE TABLE pump_testing_results (
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
plant_id BIGINT NOT NULL,
pump_testing_master_id BIGINT NOT NULL,
tested_date DATE NOT NULL DEFAULT CURRENT_DATE,
tested_type TEXT DEFAULT NULL,
pump_serial_number TEXT DEFAULT NULL,
correction_head TEXT DEFAULT NULL,
sl_no TEXT DEFAULT NULL,
voltage TEXT DEFAULT NULL,
current TEXT DEFAULT NULL,
watt TEXT DEFAULT NULL,
frequency TEXT DEFAULT NULL,
speed TEXT DEFAULT NULL,
discharge TEXT DEFAULT NULL,
head TEXT DEFAULT NULL,
pump_output TEXT DEFAULT NULL,
power_p2 TEXT DEFAULT NULL,
overall_efficiency TEXT DEFAULT NULL,
pump_efficiency TEXT DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP,
created_by TEXT NOT NULL,
updated_by TEXT NOT NULL,
UNIQUE (plant_id, pump_testing_master_id, tested_type, pump_serial_number, sl_no),
FOREIGN KEY (pump_testing_master_id) REFERENCES pump_testing_masters (id),
FOREIGN KEY (plant_id) REFERENCES plants (id)
);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('pump_testing_results');
}
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE panel_box_validations
ADD CONSTRAINT panel_box_validations_plant_id_production_order_serial_number_inspection_lot_number_key
UNIQUE (plant_id, production_order, serial_number, inspection_lot_number)
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('panel_box_validations', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -158,8 +158,12 @@ Route::get('testing/pump-master/get', [TestingPanelController::class, 'get_pump_
Route::get('testing/pump-entry/get', [TestingPanelController::class, 'get_pump_entry']);
Route::post('testing/pump-entry/store-data', [TestingPanelController::class, 'storePumpEntry']);
Route::get('testing/pump-result/get', [TestingPanelController::class, 'get_pump_result']);
Route::post('testing/pump-result/store-data', [TestingPanelController::class, 'storePumpResult']);
// Testing panel Controller
Route::get('testing/user/get-data', [UserController::class, 'get_user_data']);