291 Commits

Author SHA1 Message Date
3bbf6d9e2f Merge pull request 'Updated filter validation logic and added new filter options' (#718) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #718
2026-06-06 18:06:41 +00:00
dhanabalan
337d16f120 Updated filter validation logic and added new filter options
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 7m11s
Laravel Larastan / larastan (pull_request) Failing after 8m52s
2026-06-06 23:35:59 +05:30
ed17645a6e Merge pull request 'ranjith-dev' (#717) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #717
2026-06-06 16:28:33 +00:00
dhanabalan
4de4f35220 Removed unnecessary columns removed for import transit mail report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Larastan / larastan (pull_request) Failing after 14m13s
Laravel Pint / pint (pull_request) Failing after 14m14s
2026-06-06 21:58:12 +05:30
dhanabalan
688674aa40 Added label, placeholder, default value and subassembly_code filter logic
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
2026-06-06 19:49:44 +05:30
5383bc5d15 Merge pull request 'ranjith-dev' (#716) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 30s
Reviewed-on: #716
2026-06-06 14:04:48 +00:00
dhanabalan
aafdfe3148 Added order by for department for visitor page
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 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 10m6s
Laravel Larastan / larastan (pull_request) Failing after 11m29s
2026-06-06 19:34:30 +05:30
dhanabalan
4fe5793c1b Updated Subassembly Code label on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
2026-06-06 19:13:25 +05:30
b94fed9f51 Merge pull request 'ranjith-dev' (#715) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #715
2026-06-06 13:39:27 +00:00
dhanabalan
9b10ff0069 Added logic to load options against department in visitor page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 46s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 8m56s
Laravel Larastan / larastan (pull_request) Failing after 10m59s
2026-06-06 19:08:59 +05:30
dhanabalan
6bc14a347a Updated sub-assembly code validation logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-06 19:05:20 +05:30
8697f72e15 Merge pull request 'Added mail logic for visitor entry create page' (#714) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #714
2026-06-06 13:33:37 +00:00
dhanabalan
03826e4168 Added mail logic for visitor entry create page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 8m10s
Laravel Larastan / larastan (pull_request) Failing after 9m46s
2026-06-06 19:03:22 +05:30
4e228fe2d5 Merge pull request 'Updated isi_model column value validation logic' (#713) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #713
2026-06-06 12:52:00 +00:00
dhanabalan
32c5e7bec6 Updated isi_model column value validation logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Larastan / larastan (pull_request) Failing after 4m14s
Laravel Pint / pint (pull_request) Failing after 4m21s
2026-06-06 18:21:25 +05:30
254ae49cfd Merge pull request 'ranjith-dev' (#712) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #712
2026-06-06 11:18:01 +00:00
dhanabalan
3bce7a1b0a Solved line and work group master load issue
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Larastan / larastan (pull_request) Failing after 8m38s
Laravel Pint / pint (pull_request) Successful in 11m18s
2026-06-06 16:47:09 +05:30
dhanabalan
f082587ef4 Updated created_by and updated_by column value passing logic
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-06 16:36:02 +05:30
964d857b12 Merge pull request 'Added logic to remove time frmat in dates column of import transit' (#711) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #711
2026-06-06 06:57:03 +00:00
dhanabalan
37bfc4ae7e Added logic to remove time frmat in dates column of import transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Larastan / larastan (pull_request) Failing after 5m47s
Laravel Pint / pint (pull_request) Successful in 4m29s
2026-06-06 12:26:48 +05:30
a1a0ca2da9 Merge pull request 'ranjith-dev' (#710) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #710
2026-06-06 06:34:24 +00:00
dhanabalan
051cfc39ee Added import transit importer file
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 9s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Larastan / larastan (pull_request) Failing after 5m32s
Laravel Pint / pint (pull_request) Failing after 27m45s
2026-06-06 12:03:56 +05:30
dhanabalan
db428a93e3 Added filament import to import transit
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-06 12:03:32 +05:30
dhanabalan
f8cf15ba6e Added three columns in model file of import transit
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-06 12:02:23 +05:30
dhanabalan
b6c7b6e68d Added three columns in import transit table
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-06 12:01:44 +05:30
00d7275e26 Merge pull request 'Changed logic for print panel for production order' (#709) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 25s
Reviewed-on: #709
2026-06-06 06:21:39 +00:00
dhanabalan
330edeccaa Changed logic for print panel for production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 7m49s
Laravel Larastan / larastan (pull_request) Failing after 9m22s
2026-06-06 11:51:25 +05:30
4b33ef5323 Merge pull request 'Added page number options in serial livewire' (#708) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #708
2026-06-05 05:52:54 +00:00
dhanabalan
dae87a6fba Added page number options in serial livewire
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 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 9m24s
Laravel Larastan / larastan (pull_request) Failing after 10m59s
2026-06-05 11:21:17 +05:30
76fd4461f9 Merge pull request 'Changed dimension of wire pallet pdf' (#707) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #707
2026-06-05 05:10:51 +00:00
dhanabalan
d10bf9d4af Changed dimension of wire pallet pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 8m3s
Laravel Larastan / larastan (pull_request) Failing after 9m36s
2026-06-05 10:40:37 +05:30
8cd0a310b3 Merge pull request 'Added updated_by column in serial validation' (#706) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #706
2026-06-05 03:53:54 +00:00
dhanabalan
b582a18a14 Added updated_by column in serial validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 29s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 11m55s
Laravel Larastan / larastan (pull_request) Failing after 12m44s
2026-06-05 09:23:41 +05:30
0abdf02e9d Merge pull request 'ranjith-dev' (#705) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #705
2026-06-05 03:48:59 +00:00
dhanabalan
9337865501 Added three columns in serial validation resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 8m44s
Laravel Larastan / larastan (pull_request) Failing after 10m11s
2026-06-05 09:18:40 +05:30
dhanabalan
8afafb52cd Added three column sin serial validation model file
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
2026-06-05 09:15:26 +05:30
dhanabalan
7984207dfc Added panel box code column and created by and updated by in serial validation migration file
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-05 09:14:33 +05:30
935c3ab120 Merge pull request 'Updated to post api from get api and its responses' (#704) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #704
2026-06-04 19:51:04 +00:00
dhanabalan
cdcbcc62b1 Updated to post api from get api and its responses
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 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Larastan / larastan (pull_request) Failing after 7m59s
Laravel Pint / pint (pull_request) Successful in 11m12s
2026-06-05 01:20:19 +05:30
2dea2ddf9b Merge pull request 'Removed updated by column from serial validation' (#703) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #703
2026-06-04 12:22:07 +00:00
dhanabalan
f9ac2e19dc Removed updated by column from serial validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 7m14s
Laravel Larastan / larastan (pull_request) Failing after 15m45s
2026-06-04 17:51:55 +05:30
ccf6ca6aef Merge pull request 'Added import serial invoice logic in serial validation' (#702) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #702
2026-06-04 07:13:04 +00:00
dhanabalan
3f0e286f8a Added import serial invoice logic in serial validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 26s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 9m47s
Laravel Larastan / larastan (pull_request) Failing after 11m2s
2026-06-04 12:42:49 +05:30
474fced913 Merge pull request 'Changed logic of invoice number in serial validation' (#701) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #701
2026-06-04 07:03:45 +00:00
dhanabalan
dc0eed1bac Changed logic of invoice number in serial validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 7m41s
Laravel Larastan / larastan (pull_request) Failing after 9m45s
2026-06-04 12:33:30 +05:30
24f5c220ba Merge pull request 'Added item code column in axn exporter' (#700) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 29s
Reviewed-on: #700
2026-06-04 06:32:17 +00:00
dhanabalan
e749b5dca4 Added item code column in axn exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 2m32s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 1m40s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 4m7s
Laravel Pint / pint (pull_request) Successful in 12m31s
Laravel Larastan / larastan (pull_request) Failing after 14m5s
2026-06-04 12:02:04 +05:30
6ca6ae501a Merge pull request 'Added remark and identified logic in import transit mail' (#699) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #699
2026-06-02 10:54:33 +00:00
dhanabalan
f8777db5c7 Added remark and identified logic in import transit mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 16:24:13 +05:30
3fc6fb8d5b Merge pull request 'ranjith-dev' (#698) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #698
2026-06-02 06:12:33 +00:00
dhanabalan
2ae495473a Added two columns in import transit resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 11:42:18 +05:30
dhanabalan
472d2e6943 Added columns in import transit model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-02 11:41:32 +05:30
dhanabalan
095e010dea Added remark column in import transits table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-02 11:41:01 +05:30
0541e7ca92 Merge pull request 'Added other type option in filter' (#697) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #697
2026-06-02 03:56:35 +00:00
dhanabalan
b83f005512 Added other type option in filter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:26:22 +05:30
d00f5d8681 Merge pull request 'Added options in filter logic' (#696) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #696
2026-06-02 03:48:39 +00:00
dhanabalan
207d52a443 Added options in filter logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:18:25 +05:30
e2acfdc53e Merge pull request 'ranjith-dev' (#695) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #695
2026-06-02 03:45:11 +00:00
dhanabalan
82e5c43a23 Added visitor arrival mail blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:14:41 +05:30
dhanabalan
b323ad0e3d Added filter logic and added type options in visitor resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-02 09:13:57 +05:30
4f73605f10 Merge pull request 'removed designation in employee master resource page' (#694) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #694
2026-06-02 03:34:06 +00:00
dhanabalan
9799a391a4 removed designation in employee master resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:03:51 +05:30
16d7689642 Merge pull request 'removed designation column in export of employee master' (#693) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #693
2026-06-02 03:32:14 +00:00
dhanabalan
02352aeb32 removed designation column in export of employee master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:02:02 +05:30
49e8cd646a Merge pull request 'removed designation column import employee master' (#692) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #692
2026-06-02 03:30:21 +00:00
dhanabalan
7d40f50821 removed designation column import employee master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-02 09:00:07 +05:30
b7aca6808e Merge pull request 'Added zmm_operating_temperature column on every api related to laser marking' (#691) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #691
2026-06-01 13:26:11 +00:00
dhanabalan
5531160860 Added zmm_operating_temperature column on every api related to laser marking
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 18:55:44 +05:30
823b6e87dc Merge pull request 'ranjith-dev' (#690) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #690
2026-06-01 13:19:12 +00:00
dhanabalan
0a635f129d Added zmm operating temperature column temp class characteristic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 17:46:12 +05:30
dhanabalan
79e0c00e4b Added column zmm operating temperature in class characteristics
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-01 17:42:57 +05:30
8d03793d43 Merge pull request 'Added group name of employee master resource page' (#689) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #689
2026-06-01 09:38:41 +00:00
dhanabalan
4ecef99002 Added group name of employee master resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 15:08:24 +05:30
87c73495a8 Merge pull request 'ranjith-dev' (#688) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #688
2026-06-01 09:34:11 +00:00
dhanabalan
d9f0201710 Added import and export action for visitor
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 15:03:55 +05:30
dhanabalan
72b90abb66 Added visitor entry importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-06-01 15:02:52 +05:30
5f9cc4f207 Merge pull request 'changed qr size in badge' (#687) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #687
2026-06-01 06:55:34 +00:00
dhanabalan
d12faa7e4d changed qr size in badge
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 12:25:19 +05:30
0606346685 Merge pull request 'changed logic in badge blade file' (#686) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #686
2026-06-01 06:41:16 +00:00
dhanabalan
66329fad13 changed logic in badge blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 12:11:00 +05:30
99d0b394ef Merge pull request 'Added logic in create visitor page' (#685) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #685
2026-06-01 06:12:16 +00:00
dhanabalan
f44ffecb62 Added logic in create visitor page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 11:41:58 +05:30
52ac03b2a4 Merge pull request 'removed logic in asrs' (#684) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #684
2026-06-01 04:14:52 +00:00
dhanabalan
c6c0fec823 removed logic in asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 09:44:37 +05:30
1e7a27a99a Merge pull request 'Added logic in asrs for visible edit' (#683) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #683
2026-06-01 04:11:42 +00:00
dhanabalan
184f458b75 Added logic in asrs for visible edit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 09:41:29 +05:30
8134c89bd7 Merge pull request 'Changed logic in asrs' (#682) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #682
2026-06-01 04:07:55 +00:00
dhanabalan
234ad1431a Changed logic in asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 09:37:43 +05:30
0829e70fb0 Merge pull request 'changed logic in asrs item validations' (#681) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #681
2026-06-01 04:04:25 +00:00
dhanabalan
8e6859fca2 changed logic in asrs item validations
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-06-01 09:33:58 +05:30
925712a752 Merge pull request 'Added GET API method with logic to receive LeakTestStatus' (#680) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #680
2026-05-30 15:29:48 +00:00
dhanabalan
95ff0fd1a2 Added GET API method with logic to receive LeakTestStatus
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-30 20:58:44 +05:30
37e840cd56 Merge pull request 'commented logic for asrs' (#679) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #679
2026-05-30 11:49:42 +00:00
dhanabalan
ddad5de505 commented logic for asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-30 17:19:29 +05:30
9b0eb9ada3 Merge pull request 'removed plant indicator logic in asrs' (#678) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #678
2026-05-30 11:42:47 +00:00
dhanabalan
3b44cce762 removed plant indicator logic in asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-30 17:12:34 +05:30
cbf262e03f Merge pull request 'ranjith-dev' (#677) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #677
2026-05-30 11:13:38 +00:00
dhanabalan
693c203001 Added logic for item code filteration in table section
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-30 16:43:18 +05:30
dhanabalan
968a564109 Updated validation logic on edit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-30 13:44:43 +05:30
dhanabalan
028d985e9f Added crud admin rights to particular users and edit email permission to particular user
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-30 11:56:57 +05:30
cb66e3a644 Merge pull request 'Added leakTestReadings hasMany relationship on Plant model file' (#676) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #676
2026-05-29 15:07:45 +00:00
dhanabalan
531c627e72 Added leakTestReadings hasMany relationship on Plant model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 20:37:28 +05:30
da3b769b33 Merge pull request 'ranjith-dev' (#675) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #675
2026-05-29 15:04:42 +00:00
dhanabalan
17030f2c7f Updated alignment and resource file order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 20:33:56 +05:30
dhanabalan
3f31425e4b Added resource file into Testing Panel group
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:32:38 +05:30
9b4380ac53 Merge pull request 'ranjith-dev' (#674) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #674
2026-05-29 14:57:35 +00:00
dhanabalan
65f8c8cfc9 Added exporter file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 20:21:45 +05:30
dhanabalan
5dde6f6d9a Added create, edit, list, view pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:18:36 +05:30
dhanabalan
d128d48bde Added resource file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:17:33 +05:30
dhanabalan
b520c02e12 Added Post API for storing LeakTestStatus
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:13:27 +05:30
dhanabalan
9fc79624fb Added policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:07:31 +05:30
dhanabalan
ba0c6b18d7 Added Model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 20:07:10 +05:30
396b25b79e Merge pull request 'ranjith-dev' (#673) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #673
2026-05-29 14:36:28 +00:00
dhanabalan
a4370aa492 Updated 5/4 split type pump package count issue solved
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 20:05:45 +05:30
dhanabalan
fc77e63c70 Added leak test readings migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 18:05:32 +05:30
e39e275fc4 Merge pull request 'Added created by and updated by column in vehicle entry' (#672) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #672
2026-05-29 11:43:38 +00:00
dhanabalan
07589520f1 Added created by and updated by column in vehicle entry
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 17:13:25 +05:30
bfa942eb4f Merge pull request 'removed uuid column from vehicle exporter' (#671) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #671
2026-05-29 11:40:37 +00:00
dhanabalan
b5a3fe123e removed uuid column from vehicle exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 17:10:19 +05:30
0393b941cf Merge pull request 'Chnaged logic 1 num items in wire pallet pdf' (#670) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #670
2026-05-29 11:18:22 +00:00
dhanabalan
4fbb9246e6 Chnaged logic 1 num items in wire pallet pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 16:48:07 +05:30
7535f83c83 Merge pull request 'Changed logic in wire pallet pdf' (#669) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #669
2026-05-29 11:11:31 +00:00
dhanabalan
ca5c19d7f9 Changed logic in wire pallet pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 16:41:17 +05:30
e90bcec468 Merge pull request 'ranjith-dev' (#668) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #668
2026-05-29 11:05:50 +00:00
dhanabalan
280b62d27d Added logic for checking wthehere same customer name or not
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 15:47:33 +05:30
dhanabalan
8c362bd83f Updated error logic on plant change
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 15:39:51 +05:30
dhanabalan
e27326258e Modified logic for adjustment of 2 rows of items in wire pallet pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 15:37:17 +05:30
dhanabalan
29b4775af2 Simplified code logic on set property null while plant change
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 15:35:05 +05:30
dhanabalan
58629f4cbb Removed unwanted set property
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 15:32:50 +05:30
dhanabalan
ef6443b68a Added searchable() function on select controls
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 15:28:23 +05:30
d313b83039 Merge pull request 'ranjith-dev' (#667) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #667
2026-05-29 08:09:32 +00:00
dhanabalan
c8b978984a Changed logic in quality validation for based on count displying text boxes
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-29 13:38:21 +05:30
dhanabalan
773948ec75 Updated belongsTo relationship against Line
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-29 13:10:01 +05:30
dede007758 Merge pull request 'Added searchable for receipient employee' (#666) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #666
2026-05-28 06:19:02 +00:00
dhanabalan
a8ebb2086e Added searchable for receipient employee
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-28 11:48:46 +05:30
74b15c9fbe Merge pull request 'Changed logic in bade blade file' (#665) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #665
2026-05-28 05:33:49 +00:00
dhanabalan
5350be85bb Changed logic in bade blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-28 11:03:37 +05:30
a215915700 Merge pull request 'ranjith-dev' (#664) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #664
2026-05-28 05:27:55 +00:00
dhanabalan
6f9928a989 Added valid upto and register id in badge blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-28 10:57:12 +05:30
dhanabalan
75ccd36acd Added two columns in visitor entry resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-28 10:56:29 +05:30
dhanabalan
48a7926448 Added two columns in visitor entry
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-28 10:55:33 +05:30
dhanabalan
6162b1026c Added register_id and valid_upto column in table visitor entries
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-28 10:55:01 +05:30
cb93805b16 Merge pull request 'ranjith-dev' (#663) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #663
2026-05-28 05:21:34 +00:00
dhanabalan
e044e8f39d Added view gate entry permission
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-28 10:51:05 +05:30
dhanabalan
f14dfb137e Added gate entry page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-28 10:49:53 +05:30
cb826f628d Merge pull request 'Updated validation logic to allow greater than or equal to 1 on sticker types' (#662) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #662
2026-05-28 04:25:56 +00:00
dhanabalan
70213143f8 Updated validation logic to allow greater than or equal to 1 on sticker types
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-28 09:22:48 +05:30
dfe6dfb995 Merge pull request 'ranjith-dev' (#661) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #661
2026-05-27 11:19:22 +00:00
dhanabalan
e4a763db1c Added import and export in vehicle page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 16:48:51 +05:30
dhanabalan
e0937b21dd Added vehicle entry importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 16:48:10 +05:30
aafa083d88 Merge pull request 'Added qr code logic for badge' (#660) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #660
2026-05-27 09:33:17 +00:00
dhanabalan
3622bbde00 Added qr code logic for badge
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 15:03:01 +05:30
c1fe8308cd Merge pull request 'Added we cam field blade file' (#659) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #659
2026-05-27 06:15:29 +00:00
dhanabalan
583c5ffe59 Added we cam field blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 11:45:16 +05:30
5ac9561215 Merge pull request 'ranjith-dev' (#658) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #658
2026-05-27 06:12:59 +00:00
dhanabalan
c9ac1b82fb Added visitor entry policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 11:42:39 +05:30
dhanabalan
6181b25065 Added visitor controller page and badge blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 11:41:14 +05:30
dhanabalan
bf2cbbe00a Added webcam livewire pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:39:33 +05:30
dhanabalan
52af54dbd0 Added visitor entry resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:37:50 +05:30
dhanabalan
173a9e40a9 Added visitor entries model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:36:43 +05:30
dhanabalan
d556525e36 Added visitor entries migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:36:12 +05:30
fe1c4bda9e Merge pull request 'ranjith-dev' (#657) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #657
2026-05-27 06:02:56 +00:00
dhanabalan
938514fe0d Added employee master policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 11:32:16 +05:30
dhanabalan
de3acf0f6c Added employee master importer and exporter pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:30:56 +05:30
dhanabalan
9b15dd6c11 Added employee master resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:30:01 +05:30
dhanabalan
b58e419e86 Added employee master model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:28:47 +05:30
dhanabalan
1c3dfef558 Added employee master migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-27 11:27:55 +05:30
d42d58f708 Merge pull request 'Modified logic in vehicle controller for calculation of duration time' (#656) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #656
2026-05-27 03:38:25 +00:00
dhanabalan
bf0c65c9c5 Modified logic in vehicle controller for calculation of duration time
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 09:07:18 +05:30
74b741609e Merge pull request 'changed to actual time to trigger of invoice report' (#655) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #655
2026-05-27 02:48:21 +00:00
dhanabalan
6aad1ab2f1 changed to actual time to trigger of invoice report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 08:18:06 +05:30
a425d2b770 Merge pull request 'Changed time of the invoice report' (#654) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #654
2026-05-27 02:42:15 +00:00
dhanabalan
0fa1c5f34b Changed time of the invoice report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-27 08:11:59 +05:30
a468fce94e Merge pull request 'Changed whole logic for invoice report' (#653) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #653
2026-05-26 12:28:25 +00:00
dhanabalan
b7ac7da6ec Changed whole logic for invoice report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 17:58:06 +05:30
eeb614c201 Merge pull request 'issue solved for not updated records' (#652) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #652
2026-05-26 07:02:41 +00:00
dhanabalan
dca5d499be issue solved for not updated records
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 12:32:23 +05:30
ada0fedf4a Merge pull request 'Added naviagte table screen logic for asrs' (#651) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #651
2026-05-26 06:47:00 +00:00
dhanabalan
d2f4d417ba Added naviagte table screen logic for asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 12:16:44 +05:30
ae4a80735f Merge pull request 'ranjith-dev' (#650) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #650
2026-05-26 06:28:46 +00:00
dhanabalan
737f062cd4 Changed logic in print panel narrow font
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 11:58:30 +05:30
dhanabalan
ddc3e2a093 Modified logic for print panel
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-26 11:10:25 +05:30
13d2ac89ae Merge pull request 'Added Updated logic in asrs resource pages' (#649) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #649
2026-05-26 04:49:09 +00:00
dhanabalan
d4766a73e9 Added Updated logic in asrs resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 10:18:46 +05:30
511b06e91f Merge pull request 'Added filter logic in asrs item validations resource page' (#648) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #648
2026-05-26 04:34:32 +00:00
dhanabalan
da526c7c0d Added filter logic in asrs item validations resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 10:04:17 +05:30
faae647393 Merge pull request 'Added asrs relation in plant model file' (#647) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #647
2026-05-26 04:19:26 +00:00
dhanabalan
1f3d697b57 Added asrs relation in plant model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 09:49:09 +05:30
c0279ce6a7 Merge pull request 'Added two columns in asrs item importer and exporter' (#646) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #646
2026-05-26 04:13:34 +00:00
dhanabalan
4a4cf17732 Added two columns in asrs item importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 09:43:19 +05:30
c6b3912e94 Merge pull request 'ranjith-dev' (#645) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #645
2026-05-26 04:06:45 +00:00
dhanabalan
fc85f64fbc Added two columns in asrs item validation resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 09:36:20 +05:30
dhanabalan
3d0089c3b2 Added two columns in asrs item model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-26 09:35:45 +05:30
dhanabalan
800cfbd960 Added columns in asrs item validations
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-26 09:35:15 +05:30
979a5e633c Merge pull request 'ranjith-dev' (#644) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #644
2026-05-26 03:33:42 +00:00
dhanabalan
4378f3adbd Added material type 4 (Bundle Individual) on livewire, blade, exporter, resource and create page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-26 09:01:52 +05:30
dhanabalan
68ee079529 Updated alignments on resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 17:10:45 +05:30
97f8088a52 Merge pull request 'ranjith-dev' (#643) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #643
2026-05-25 11:31:23 +00:00
dhanabalan
be85c85e06 Changed logic for send invoice report for mail trigger
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-25 17:00:57 +05:30
dhanabalan
5ebbf491f6 Added material type 4 (Bundle Individual) on resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 16:55:55 +05:30
dhanabalan
dee8246320 Added material type 4 on importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 16:37:48 +05:30
536a4988d7 Merge pull request 'ranjith-dev' (#642) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #642
2026-05-25 09:34:46 +00:00
dhanabalan
9d02be360e Added asrs permissions in seeder page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-25 15:04:24 +05:30
dhanabalan
dd037e7f8a Added asrs item validation policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 15:03:36 +05:30
dhanabalan
f599fdc05b Added asrs item validation importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 15:02:55 +05:30
dhanabalan
0f6276fd76 Added asrs item validation resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 15:02:19 +05:30
dhanabalan
ee898b935b Added asrs item validation model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 15:01:17 +05:30
dhanabalan
6fd005acf9 Added asrs item validation migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-25 15:00:45 +05:30
6c9a8d5edd Merge pull request 'Added logic fpor removing space for vehicle number in vehicle controller' (#641) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #641
2026-05-22 13:11:57 +00:00
dhanabalan
6a1fb39068 Added logic fpor removing space for vehicle number in vehicle controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 18:41:42 +05:30
4b35e7836c Merge pull request 'Added boom opened in vehicle entry mail' (#640) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #640
2026-05-22 11:51:58 +00:00
dhanabalan
33635fd9af Added boom opened in vehicle entry mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 17:21:37 +05:30
ce036a177c Merge pull request 'Modified logic for panel alignment' (#639) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #639
2026-05-22 11:45:15 +00:00
dhanabalan
10e493ca51 Modified logic for panel alignment
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 17:15:01 +05:30
a18010a7f2 Merge pull request 'ranjith-dev' (#638) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #638
2026-05-22 11:37:12 +00:00
dhanabalan
85f1a84321 Added boom opened in post api of vehicle entry
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 17:06:59 +05:30
dhanabalan
994591da54 Added boom opened in vehicle entry resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-22 17:06:21 +05:30
dhanabalan
7aaca611dc Added boom opened in model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-22 17:05:44 +05:30
dhanabalan
251ef26c41 Added boom opened column in migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-22 17:05:13 +05:30
a231413671 Merge pull request 'modified panel sticker size' (#637) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #637
2026-05-22 10:15:31 +00:00
dhanabalan
ebf5e60a00 modified panel sticker size
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 15:45:19 +05:30
e18cf14e1f Merge pull request 'Changed alignment for panel sticker' (#636) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #636
2026-05-22 09:57:52 +00:00
dhanabalan
37eed0640f Changed alignment for panel sticker
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 15:27:13 +05:30
a45bfbc2dc Merge pull request 'Changed logic and converted to mm and changed alignment of panel sticker' (#635) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #635
2026-05-22 06:17:45 +00:00
dhanabalan
143fe85b2e Changed logic and converted to mm and changed alignment of panel sticker
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-22 11:47:28 +05:30
2a5ecb9eb9 Merge pull request 'Converted vehicle number to upper case for mail report' (#634) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #634
2026-05-21 17:03:20 +00:00
dhanabalan
bb8000d177 Converted vehicle number to upper case for mail report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 22:33:06 +05:30
44b13cd850 Merge pull request 'ranjith-dev' (#633) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #633
2026-05-21 16:54:30 +00:00
dhanabalan
2d4f6d8069 Added scheduler logic for vehicle report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 22:24:11 +05:30
dhanabalan
219279c641 Added vehicle report mail pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-21 22:21:19 +05:30
fc9ef1f8dc Merge pull request 'Added vehicle report option in module and rule select box' (#632) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #632
2026-05-21 16:43:21 +00:00
dhanabalan
2fb7ed7895 Added vehicle report option in module and rule select box
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 22:13:07 +05:30
01a810fcb3 Merge pull request 'Added str to upper for vehicle number in post api of vehicle entry' (#631) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #631
2026-05-21 14:14:15 +00:00
dhanabalan
b4ef782067 Added str to upper for vehicle number in post api of vehicle entry
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 19:43:57 +05:30
550ffd8af3 Merge pull request 'ranjith-dev' (#630) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #630
2026-05-21 14:09:17 +00:00
dhanabalan
dc028c91bb Added vehicle number to upper case in vehicle entry resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 19:38:57 +05:30
dhanabalan
a42f7c1fae Added category in product characteristics master importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-21 15:53:15 +05:30
dhanabalan
ec0fe66874 Added category in product characteristics master exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-21 15:52:14 +05:30
f2118cbd3e Merge pull request 'Added category logic in create quality validation page' (#629) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #629
2026-05-21 09:35:26 +00:00
dhanabalan
a6ec37fd3d Added category logic in create quality validation page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 15:04:51 +05:30
085ede673e Merge pull request 'ranjith-dev' (#628) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #628
2026-05-21 09:30:59 +00:00
dhanabalan
f4bfc5c4dc Added category in product characteristics master resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-21 14:59:41 +05:30
dhanabalan
2a83033541 Added category in product characteristics master model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-21 14:55:53 +05:30
dhanabalan
f8dc95054b Added category column in product characteristics master migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-21 14:55:03 +05:30
664ec2ab9f Merge pull request 'Added logic to prevent empty mails for invoice report' (#627) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #627
2026-05-20 11:38:44 +00:00
dhanabalan
017f57878d Added logic to prevent empty mails for invoice report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 17:08:30 +05:30
b2754a6c83 Merge pull request 'Changed qr code quality to 100 in controller page' (#626) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #626
2026-05-20 10:57:54 +00:00
dhanabalan
561e0b448f Changed qr code quality to 100 in controller page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 16:26:29 +05:30
11f7aca64c Merge pull request 'ranjith-dev' (#625) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #625
2026-05-20 09:44:37 +00:00
dhanabalan
8eb0985128 Reduced qr code quality on generation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 15:08:47 +05:30
dhanabalan
245c9e1782 Updated example plant code as TEST007
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-20 15:02:06 +05:30
159405d1f3 Merge pull request 'Added logic in both edit and view production order page' (#624) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #624
2026-05-20 07:23:27 +00:00
dhanabalan
b8fe29644e Added logic in both edit and view production order page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 12:53:09 +05:30
42be22838a Merge pull request 'Added ware house number logic for item code print logic' (#623) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #623
2026-05-20 07:21:00 +00:00
dhanabalan
e09a362c96 Added ware house number logic for item code print logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 12:50:45 +05:30
bee3462c09 Merge pull request 'Added vehicle entries in plant model' (#622) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #622
2026-05-20 06:35:46 +00:00
dhanabalan
7d84624843 Added vehicle entries in plant model
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 12:05:34 +05:30
258f43c7e7 Merge pull request 'Added filter for vehicle entry resource page' (#621) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #621
2026-05-20 06:33:27 +00:00
dhanabalan
b6519e3bbf Added filter for vehicle entry resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-20 12:03:08 +05:30
795b52dddf Merge pull request 'Added fucntion in both edit and view production order page' (#620) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #620
2026-05-19 09:57:57 +00:00
dhanabalan
bceba8db5f Added fucntion in both edit and view production order page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-19 15:27:45 +05:30
2d050cdb38 Merge pull request 'Added item serial blade file' (#619) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #619
2026-05-19 09:53:49 +00:00
dhanabalan
dd1a884b22 Added item serial blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-19 15:23:31 +05:30
c6522e2d37 Merge pull request 'ranjith-dev' (#618) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #618
2026-05-19 09:50:01 +00:00
dhanabalan
5b333621fe Added print item serial in web php
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-19 15:19:45 +05:30
dhanabalan
b52fd57c23 Added print item in print order controller and create page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-19 15:17:33 +05:30
dhanabalan
6bac832d1f Added print item button in production order screen
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-19 15:14:50 +05:30
8b76c74811 Merge pull request 'removed model type in filter of class characteristics' (#617) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #617
2026-05-18 12:26:57 +00:00
dhanabalan
8dbdcf4f35 removed model type in filter of class characteristics
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-18 17:56:19 +05:30
8b47dcabdd Merge pull request 'Added wiremasterpacking in plant and item model' (#616) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #616
2026-05-16 11:44:42 +00:00
dhanabalan
115cc912c7 Added wiremasterpacking in plant and item model
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-16 17:14:26 +05:30
4fdad929fa Merge pull request 'Added filter in wire master resource page' (#615) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #615
2026-05-16 11:13:29 +00:00
dhanabalan
544e593d19 Added filter in wire master resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-16 16:42:21 +05:30
df2f7c67e1 Merge pull request 'Updated material qr pattern0 to allow space before KG' (#614) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #614
2026-05-16 03:33:34 +00:00
dhanabalan
246b8715ca Updated material qr pattern0 to allow space before KG
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-16 08:56:20 +05:30
92411accff Merge pull request 'Added uom column on report view and export' (#613) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #613
2026-05-15 15:03:37 +00:00
dhanabalan
cd3598d67e Added uom column on report view and export
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 20:32:27 +05:30
2e9938300c Merge pull request 'ranjith-dev' (#612) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #612
2026-05-15 14:54:40 +00:00
dhanabalan
3b9d94552b Added wire master packing qr logic and material qr (with and without kg) logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 20:23:17 +05:30
dhanabalan
ba55567aed Updated label on InvoiceValidation resource file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-15 20:16:34 +05:30
3ffc11bd07 Merge pull request 'Added migration for alter quantity column data type' (#611) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #611
2026-05-15 09:46:50 +00:00
dhanabalan
d32408bebd Added migration for alter quantity column data type
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 15:16:21 +05:30
a610f7f589 Merge pull request 'ranjith-dev' (#610) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #610
2026-05-15 09:16:28 +00:00
dhanabalan
854330caf2 Added slug name as welcome
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 14:45:39 +05:30
dhanabalan
4309003fbd Updated admin credentials in AdminSeeder
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-15 14:42:46 +05:30
dhanabalan
c500759f52 Removed unwanted space in wire master packing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 14:41:20 +05:30
dhanabalan
0a07e4b6e6 Added space for testing in create wire master packing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-05-15 14:40:40 +05:30
17f81deb10 Merge pull request 'Updated warehouse_number logic' (#608) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #608
2026-05-15 09:09:47 +00:00
dhanabalan
21b40b499a Updated warehouse_number logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 14:37:19 +05:30
7a700b8fee Merge pull request 'Changed msg for scanned weight and allowed quantity for wire master packing' (#607) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #607
2026-05-15 07:23:54 +00:00
dhanabalan
447c0a73a0 Changed msg for scanned weight and allowed quantity for wire master packing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
2026-05-15 12:53:27 +05:30
132 changed files with 15397 additions and 4026 deletions

View File

@@ -77,7 +77,7 @@ class Scheduler extends Command
}
}
// --- Invoice Validation Rules ---
// --- Invoice Validation Rules --- (Invoice Mail)
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'InvoiceMail')
->select('plant', 'schedule_type')
@@ -114,6 +114,82 @@ class Scheduler extends Command
}
}
//..SerialInvoice
$invoiceSerialRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'SerialInvoiceMail')
->select('plant', 'schedule_type')
->distinct()
->get();
foreach ($invoiceSerialRules as $rule) {
switch ($rule->schedule_type) {
case 'Live':
// Run every minute
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
break;
case 'Hourly':
if (now()->minute == 0) {
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
case 'Daily':
if (now()->format('H:i') == '07:59') {
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
}
}
//..MaterialInvoice
$invoiceMaterialRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'MaterialInvoiceMail')
->select('plant', 'schedule_type')
->distinct()
->get();
foreach ($invoiceMaterialRules as $rule) {
switch ($rule->schedule_type) {
case 'Live':
// Run every minute
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
break;
case 'Hourly':
if (now()->minute == 0) {
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
case 'Daily':
if (now()->format('H:i') == '07:59') {
\Artisan::call('send:invoice-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
}
}
// foreach ($invoiceRules as $rule) {
// switch ($rule->schedule_type) {
@@ -284,6 +360,40 @@ class Scheduler extends Command
break;
}
}
$vehicleReports = AlertMailRule::where('module', 'VehicleReport')
->where('rule_name', 'VehicleReportMail')
->select('plant', 'schedule_type')
->distinct()
->get();
foreach ($vehicleReports as $rule) {
switch ($rule->schedule_type) {
case 'Live':
// Run every minute
\Artisan::call('send:vehicle-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
break;
case 'Hourly':
if (now()->minute == 0) {
\Artisan::call('send:vehicle-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
case 'Daily':
if (now()->format('H:i') == '07:59') {
\Artisan::call('send:vehicle-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
}
}
}
/**

View File

@@ -84,6 +84,8 @@ class SendImportTransit extends Command
'bill_number',
'bill_received_date',
'vessel_number',
'remark',
'is_transit_identified',
])
->where('status', '!=', 'Delivered')
->get();

View File

@@ -3,6 +3,7 @@
namespace App\Console\Commands;
use App\Mail\test;
use App\Models\AlertMailRule;
use App\Models\InvoiceValidation;
use App\Models\Plant;
use Illuminate\Console\Command;
@@ -31,25 +32,37 @@ class SendInvoiceReport extends Command
public function handle()
{
$schedule = $this->argument('schedule_type');
// $scheduleType = $this->argument('scheduleType');
$plantIdArg = (int) $this->argument('plant'); // can be 0 for all plants
$plantIdArg = (int) $this->argument('plant');
// $mailRules = \App\Models\AlertMailRule::where('module', 'InvoiceValidation')->get()->groupBy('rule_name');
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'InvoiceMail')
->where('plant', $plantIdArg)
->get();
$mailRules = \App\Models\AlertMailRule::where('module', 'InvoiceValidation')->get()->groupBy('rule_name');
$serialRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'SerialInvoiceMail')
->where('plant', $plantIdArg)
->get();
// $startDate = now()->setTime(8, 0, 0);
// $endDate = now()->copy()->addDay()->setTime(8, 0, 0);
$materialRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'MaterialInvoiceMail')
->where('plant', $plantIdArg)
->get();
// $this->info('Invoice Rules: ' . $invoiceRules->toJson());
// $this->info('Serial Rules: ' . $serialRules->toJson());
// $this->info('Material Rules: ' . $materialRules->toJson());
$serialTableData = [];
$materialTableData = [];
$bundleTableData = [];
// Get plant IDs: either one plant or all
$plantIds = $plantIdArg == 0
? InvoiceValidation::select('plant_id')->distinct()->pluck('plant_id')->toArray()
: [$plantIdArg];
$isPlantRun = $plantIdArg != 0;
$no = 1;
if (strtolower($schedule) == 'daily') {
$startDate = now()->subDay()->setTime(8, 0, 0);
@@ -178,71 +191,119 @@ class SendInvoiceReport extends Command
$no++;
}
$mail = new test($serialTableData, $materialTableData, $bundleTableData, $schedule);
$contentVars = $mail->content()->with;
// $mail = new test($serialTableData, $materialTableData, $bundleTableData, $schedule);
// $contentVars = $mail->content()->with;
$this->info($contentVars['greeting'] ?? 'Invoice Report');
// Send to SerialInvoiceMail recipients
if ($mailRules->has('SerialInvoiceMail')) {
// $emails = $mailRules['SerialInvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test($serialTableData, [], [], $schedule));
// }
foreach ($mailRules->get('SerialInvoiceMail') as $rule) {
// if ($mailRules->has('SerialInvoiceMail')) {
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
// foreach ($mailRules->get('SerialInvoiceMail') as $rule) {
$ccEmails = collect(explode(',', $rule->cc_emails ?? ''))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
// $filteredSerialData = [];
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
// $toEmails = collect(explode(',', $rule->email))
// ->map(fn ($e) => trim($e))
// ->filter()
// ->unique()
// ->values()
// ->toArray();
// $ccEmails = collect(explode(',', $rule->cc_emails ?? ''))
// ->map(fn ($e) => trim($e))
// ->filter()
// ->unique()
// ->values()
// ->toArray();
// if (empty($toEmails)) {
// $this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
// continue;
// }
// if ($rule->plant == 0) {
// $filteredSerialData = $serialTableData;
// } else {
// $filteredSerialData = collect($serialTableData)
// ->where('plant_id', $rule->plant)
// ->values()
// ->toArray();
// }
// if (empty($filteredSerialData)) {
// $this->warn("Skipping empty mail for rule {$rule->id}");
// continue;
// }
// // \Mail::to($toEmails)
// // ->cc($ccEmails)
// // ->send(new test(
// // $filteredSerialData,
// // [],
// // [],
// // $schedule
// // ));
// $mail = new test(
// $filteredSerialData,
// [],
// [],
// $schedule
// );
// \Mail::to($toEmails)
// ->cc($ccEmails)
// ->send($mail);
// // \Mail::to($toEmails)->cc($ccEmails)->send(new test($serialTableData, [], [], $schedule));
// $this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
// }
// }
if ($serialRules->isNotEmpty()) {
foreach ($serialRules as $rule) {
if (
$isPlantRun &&
$plantIdArg != 0 &&
$rule->plant != 0 &&
$rule->plant != $plantIdArg
) {
continue;
}
if ($rule->plant == 0) {
$filteredSerialData = $serialTableData;
} else {
$filteredSerialData = collect($serialTableData)
->where('plant_id', $rule->plant)
->values()
->toArray();
if (
$plantIdArg == 0 &&
$rule->plant != 0
) {
continue;
}
\Mail::to($toEmails)
->cc($ccEmails)
->send(new test(
$filteredSerialData,
[],
[],
$schedule
));
$data = collect($serialTableData)
->when($rule->plant != 0, fn ($q) => $q->where('plant_id', $rule->plant))
->values()
->toArray();
// \Mail::to($toEmails)->cc($ccEmails)->send(new test($serialTableData, [], [], $schedule));
if (empty($data)) continue;
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
\Mail::to($rule->email)
->cc($rule->cc_emails ?? [])
->send(new test($data, [], [], $schedule));
}
}
// Send to MaterialInvoiceMail recipients (material + bundle table)
if ($mailRules->has('MaterialInvoiceMail')) {
if ($materialRules->isNotEmpty()) {
// $emails = $mailRules['MaterialInvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test([], $materialTableData, $bundleTableData, $schedule));
// }
foreach ($mailRules->get('MaterialInvoiceMail') as $rule) {
foreach ($materialRules as $rule) {
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
@@ -298,14 +359,27 @@ class SendInvoiceReport extends Command
}
}
// Send to InvoiceMail recipients (all three tables)
if ($mailRules->has('InvoiceMail')) {
//$emails = $mailRules['InvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test($serialTableData, $materialTableData, $bundleTableData, $schedule));
// $this->info("✅ Sent InvoiceMail to: {$email}");
// }
foreach ($mailRules->get('InvoiceMail') as $rule) {
if ($invoiceRules->isNotEmpty()) {
foreach ($invoiceRules as $rule) {
// During global run, only execute plant=0 rule
if ($plantIdArg == 0 && $rule->plant != 0) {
continue;
}
// During plant run, only execute matching rule
if (
$plantIdArg != 0 &&
$rule->plant != 0 &&
$rule->plant != $plantIdArg
) {
continue;
}
$filteredSerialData = [];
$filteredMaterialData = [];
$filteredBundleData = [];
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
@@ -327,7 +401,6 @@ class SendInvoiceReport extends Command
continue;
}
// FILTER DATA
if ($rule->plant == 0) {
$filteredSerialData = $serialTableData;
@@ -352,18 +425,45 @@ class SendInvoiceReport extends Command
->toArray();
}
// Prevent empty mails
if (
empty($filteredSerialData) &&
empty($filteredMaterialData) &&
empty($filteredBundleData)
) {
$this->warn("Skipping empty mail for rule {$rule->id}");
continue;
}
// \Mail::to($toEmails)
// ->cc($ccEmails)
// ->send(new test(
// $filteredSerialData,
// $filteredMaterialData,
// $filteredBundleData,
// $schedule
// ));
$mail = new test(
$filteredSerialData,
$filteredMaterialData,
$filteredBundleData,
$schedule
);
\Mail::to($toEmails)
->cc($ccEmails)
->send(new test(
$filteredSerialData,
$filteredMaterialData,
$filteredBundleData,
$schedule
));
->send($mail);
// \Mail::raw('Test mail', function ($message) use ($toEmails, $ccEmails) {
// $message->to($toEmails)
// ->cc($ccEmails)
// ->subject('Test');
// });
// \Mail::to($toEmails)->cc($ccEmails)->send(new test($serialTableData, $materialTableData, $bundleTableData, $schedule));
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
// $this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}

View File

@@ -0,0 +1,134 @@
<?php
namespace App\Console\Commands;
use App\Mail\VehicleEntryMail;
use App\Models\AlertMailRule;
use App\Models\Plant;
use App\Models\VehicleEntry;
use Illuminate\Console\Command;
use Mail;
class SendVehicleReport extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'send:vehicle-report {schedule_type} {plant}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
$scheduleType = $this->argument('schedule_type');
$plantId = (int) $this->argument('plant');
$mailRules = AlertMailRule::where('module', 'VehicleReport')
->where('rule_name', 'VehicleReportMail')
->where('schedule_type', $scheduleType)
->get();
$plants = ($plantId == 0)
? Plant::all()
: Plant::where('id', $plantId)->get();
if ($plants->isEmpty()) {
$this->error('No valid plant(s) found.');
return;
}
if (strtolower($scheduleType) == 'daily') {
$startDate = now()->subDay()->setTime(8, 0, 0);
$endDate = now()->setTime(8, 0, 0);
} else {
$startDate = now()->setTime(8, 0, 0);
$endDate = now()->copy()->addDay()->setTime(8, 0, 0);
}
foreach ($plants as $plant) {
$vehicleEntries = VehicleEntry::select([
'vehicle_number',
'boom_opened',
'entry_time',
'exit_time',
'duration',
'type',
])
->where('plant_id', $plant->id)
->whereBetween('created_at', [$startDate, $endDate])
->get();
if ($vehicleEntries->isEmpty()) {
$this->warn("No records for {$plant->name}");
continue;
}
$tableData = [];
$no = 1;
foreach ($vehicleEntries as $vehicleEntry) {
$tableData[] = [
'no' => $no++,
'plant' => $plant->name,
'vehicleNumber' => strtoupper($vehicleEntry->vehicle_number),
'entryTime' => $vehicleEntry->entry_time,
'exitTime' => $vehicleEntry->exit_time,
'duration' => $vehicleEntry->duration,
'type' => $vehicleEntry->type,
'boom' => $vehicleEntry->boom_opened,
];
}
if ($plantId == 0) {
$rule = $mailRules->first();
} else {
$rule = $mailRules->where('plant', $plant->id)->first();
}
if (!$rule) {
$this->warn("No mail rule for {$plant->name}");
continue;
}
$toEmails = collect(explode(',', $rule->email))
->map(fn($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails))
->map(fn($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$mail = new VehicleEntryMail(
$scheduleType,
$tableData,
'Daily Vehicle Transit Report'
);
Mail::to($toEmails)->cc($ccEmails)->send($mail);
$this->info("Mail sent for {$plant->name}");
}
}
}

View File

@@ -0,0 +1,70 @@
<?php
namespace App\Filament\Exports;
use App\Models\AsrsItemValidation;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class AsrsItemValidationExporter extends Exporter
{
protected static ?string $model = AsrsItemValidation::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'),
ExportColumn::make('item_code')
->label('ITEM CODE'),
ExportColumn::make('item_description')
->label('ITEM DESCRIPTION'),
ExportColumn::make('uom')
->label('UOM'),
ExportColumn::make('material_type')
->label('MATERIAL TYPE'),
ExportColumn::make('material_group')
->label('MATERIAL GROUP'),
ExportColumn::make('mhe')
->label('MHE'),
ExportColumn::make('bin_quantity')
->label('BIN QUANTITY'),
ExportColumn::make('asrs')
->label('ASRS'),
ExportColumn::make('asrs_category')
->label('ASRS CATEGORY'),
ExportColumn::make('status')
->label('STATUS'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your asrs item validation 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

@@ -51,6 +51,8 @@ class AxnExporter extends Exporter
return substr($sn, $offset);
}),
ExportColumn::make('stickerMaster.item.code')
->label('ITEM CODE'),
];
}

View File

@@ -298,6 +298,8 @@ class ClassCharacteristicExporter extends Exporter
->label('ZMM MOTOR SPEED'),
ExportColumn::make('zqmm_qty')
->label('ZQMM QTY'),
ExportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE'),
ExportColumn::make('mark_status')
->label('MARKED STATUS'),
ExportColumn::make('marked_datetime')

View File

@@ -0,0 +1,63 @@
<?php
namespace App\Filament\Exports;
use App\Models\EmployeeMaster;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class EmployeeMasterExporter extends Exporter
{
protected static ?string $model = EmployeeMaster::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.name')
->label('PLANT'),
ExportColumn::make('name')
->label('NAME'),
ExportColumn::make('code')
->label('CODE'),
ExportColumn::make('department')
->label('DEPARTMENT'),
// ExportColumn::make('designation')
// ->label('DESIGNATION'),
ExportColumn::make('email')
->label('EMAIL'),
ExportColumn::make('mobile_number')
->label('MOBILE NUMBER'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your employee master 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

@@ -34,6 +34,17 @@ class InvoiceValidationExporter extends Exporter
->label('ITEM CODE'),
ExportColumn::make('stickerMaster.item.description')
->label('ITEM DESCRIPTION'),
ExportColumn::make('stickerMaster.item.uom')
->label('UNIT OF MEASURE'),
ExportColumn::make('stickerMaster.material_type')
->label('MATERIAL TYPE')
->formatStateUsing(fn ($state) => match ($state) {
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
default => '-',
}),
ExportColumn::make('motor_scanned_status')
->label('MOTOR SCANNED STATUS'),
ExportColumn::make('pump_scanned_status')

View File

@@ -0,0 +1,64 @@
<?php
namespace App\Filament\Exports;
use App\Models\LeakTestReading;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class LeakTestReadingExporter extends Exporter
{
protected static ?string $model = LeakTestReading::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('item_code')
->label('ITEM CODE'),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
ExportColumn::make('test_status')
->label('TEST STATUS')
->formatStateUsing(function ($state) {
if (! $state || $state == '' || $state == null) {
return '-';
}
return match ($state) {
'P' => 'PASS',
'F' => 'FAIL',
default => '-',
};
}),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your leak test reading 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

@@ -38,6 +38,8 @@ class ProductCharacteristicsMasterExporter extends Exporter
->label('CHARACTERISTICS TYPE'),
ExportColumn::make('name')
->label('CHARACTERISTICS NAME'),
ExportColumn::make('category')
->label('CATEGORY'),
ExportColumn::make('inspection_type')
->label('INSPECTION TYPE'),
ExportColumn::make('lower')

View File

@@ -297,6 +297,8 @@ class TempClassCharacteristicExporter extends Exporter
->label('ZMM MOTOR SPEED'),
ExportColumn::make('zqmm_qty')
->label('ZQMM QTY'),
ExportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE'),
ExportColumn::make('winded_serial_number')
->label('WINDED SERIAL NUMBER'),
ExportColumn::make('model_type')

View File

@@ -0,0 +1,63 @@
<?php
namespace App\Filament\Exports;
use App\Models\VehicleEntry;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class VehicleEntryExporter extends Exporter
{
protected static ?string $model = VehicleEntry::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.name')
->label('PLANT'),
ExportColumn::make('boom_opened')
->label('BOOM OPENED'),
ExportColumn::make('vehicle_number')
->label('VEHICLE NUMBER'),
ExportColumn::make('entry_time')
->label('ENTRY TIME'),
ExportColumn::make('exit_time')
->label('EXIT TIME'),
ExportColumn::make('duration')
->label('DURATION'),
ExportColumn::make('type')
->label('TYPE'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your vehicle entry 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

@@ -0,0 +1,72 @@
<?php
namespace App\Filament\Exports;
use App\Models\VisitorEntry;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class VisitorEntryExporter extends Exporter
{
protected static ?string $model = VisitorEntry::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('register_id')
->label('REGISTER ID'),
ExportColumn::make('employeeMaster.name')
->label('EMPLOYEE NAME'),
ExportColumn::make('mobile_number')
->label('MOBILE NUMBER'),
ExportColumn::make('name')
->label('VISITOR NAME'),
ExportColumn::make('company')
->label('COMPANY'),
ExportColumn::make('purpose_of_visit')
->label('PURPOSE OF VISIT'),
ExportColumn::make('type')
->label('TYPE'),
ExportColumn::make('photo')
->label('PHOTO')
->enabledByDefault(false),
ExportColumn::make('number_of_person')
->label('NUMBER OF PERSON'),
ExportColumn::make('in_time')
->label('IN TIME'),
ExportColumn::make('out_time')
->label('OUT TIME'),
ExportColumn::make('valid_upto')
->label('VALID UPTO'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your visitor entry 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

@@ -0,0 +1,118 @@
<?php
namespace App\Filament\Imports;
use App\Models\AsrsItemValidation;
use App\Models\Plant;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Str;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
class AsrsItemValidationImporter extends Importer
{
protected static ?string $model = AsrsItemValidation::class;
public static function getColumns(): array
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('PLANT CODE')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('item_code')
->exampleHeader('ITEM CODE')
->example('ITEM001')
->label('ITEM CODE')
->rules(['required']),
ImportColumn::make('item_description')
->exampleHeader('ITEM DESCRIPTION')
->example('Item Description')
->label('ITEM DESCRIPTION'),
ImportColumn::make('uom')
->exampleHeader('UOM')
->example('EA')
->label('UOM'),
ImportColumn::make('material_type')
->exampleHeader('MATERIAL TYPE')
->example('Material Type')
->label('MATERIAL TYPE'),
ImportColumn::make('material_group')
->exampleHeader('MATERIAL GROUP')
->example('Material Group')
->label('MATERIAL GROUP'),
];
}
public function resolveRecord(): ?AsrsItemValidation
{
$warnMsg = [];
$plantCod = trim($this->data['plant']) ?? '';
$iCode = trim($this->data['item_code']) ?? '';
$itemDes = trim($this->data['item_description']) ?? '';
$uom = trim($this->data['uom']) ?? '';
$materialType = trim($this->data['material_type']) ?? '';
$materialGroup = trim($this->data['material_group']) ?? '';
$createdBy = Filament::auth()->user()?->name ?? '';
$updatedBy = $createdBy;
$plantId = null;
if ($plantCod == null || $plantCod == '' || ! $plantCod) {
$warnMsg[] = "Plant code can't be empty!";
} elseif (! is_numeric($plantCod)) {
$warnMsg[] = "Plant code '{$plantCod}' should contain only numeric values!";
} elseif (Str::length($plantCod) < 4 || Str::length($plantCod) > 7) {
$warnMsg[] = "Plant code '{$plantCod}' must be between 4 and 7 digits only!";
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCod)) {
$warnMsg[] = "Invalid plant code '{$plantCod}' found!";
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found!';
} else {
$plantId = $plant->id;
}
}
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
}
if (Str::length($itemDes) < 5) {
$warnMsg[] = 'Invalid description found';
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return AsrsItemValidation::updateOrCreate([
'item_code' => $iCode,
'plant_id' => $plant->id,
],
[
'item_description' => $itemDes,
'uom' => trim($this->data['uom']),
'material_type' => $materialType,
'material_group' => $materialGroup,
'created_by' => $createdBy,
'updated_by' => $updatedBy,
]
);
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your asrs item validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -575,6 +575,10 @@ class ClassCharacteristicImporter extends Importer
->label('ZQMM QTY')
->exampleHeader('ZQMM QTY')
->example(''),
ImportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->exampleHeader('ZMM OPERATING TEMPERATURE')
->example(''),
ImportColumn::make('mark_status')
->label('MARKED STATUS')
->exampleHeader('MARKED STATUS')

View File

@@ -17,6 +17,8 @@ class CustomerPoMasterImporter extends Importer
{
protected static ?string $model = CustomerPoMaster::class;
protected array $importedPos = [];
public static function getColumns(): array
{
return [
@@ -67,6 +69,8 @@ class CustomerPoMasterImporter extends Importer
$plantCod = $this->data['plant'];
$plant = null;
$item = null;
$customerPo = trim($this->data['customer_po']);
$customerName = trim($this->data['customer_name']);
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
@@ -90,6 +94,23 @@ class CustomerPoMasterImporter extends Importer
$warnMsg[] = 'Customer PO cannot be empty.';
}
if (isset($this->importedPos[$customerPo])) {
if (strtolower(trim($this->importedPos[$customerPo])) != strtolower($customerName)){
$warnMsg[] = "Customer PO '{$customerPo}' has multiple customer names in the import file.";
}
}
else {
$this->importedPos[$customerPo] = $customerName;
}
$existingPo = CustomerPoMaster::where('plant_id', $plant->id)->where('customer_po', $this->data['customer_po'])->first();
if ($existingPo && trim(strtolower($existingPo->customer_name)) != trim(strtolower($this->data['customer_name'])))
{
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'.";
}
// $user = User::where('name', $this->data['created_by'])->first();
// if (! $user) {
// $warnMsg[] = 'User not found';

View File

@@ -0,0 +1,147 @@
<?php
namespace App\Filament\Imports;
use App\Models\EmployeeMaster;
use App\Models\Plant;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Str;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Carbon\Carbon;
class EmployeeMasterImporter extends Importer
{
protected static ?string $model = EmployeeMaster::class;
public static function getColumns(): array
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('PLANT CODE')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('name')
->exampleHeader('EMPLOYEE NAME')
->example('John Doe')
->label('EMPLOYEE NAME'),
ImportColumn::make('code')
->exampleHeader('EMPLOYEE ID')
->example('EMP001')
->label('EMPLOYEE ID'),
ImportColumn::make('department')
->exampleHeader('DEPARTMENT')
->example('HR')
->label('DEPARTMENT'),
// ImportColumn::make('designation')
// ->exampleHeader('DESIGNATION')
// ->example('Manager')
// ->label('DESIGNATION'),
ImportColumn::make('email')
->exampleHeader('EMAIL')
->example('john.doe@example.com')
->label('EMAIL'),
ImportColumn::make('mobile_number')
->exampleHeader('MOBILE NUMBER')
->example('1234567890')
->label('MOBILE NUMBER'),
];
}
public function resolveRecord(): ?EmployeeMaster
{
$warnMsg = [];
$plantCod = trim($this->data['plant']) ?? '';
$employeeName = trim($this->data['name']) ?? '';
$employeeCode = trim($this->data['code']) ?? '';
$employeeDepartment = trim($this->data['department']) ?? '';
// $employeeDesignation = trim($this->data['designation']) ?? '';
$employeeEmail = trim($this->data['email']) ?? '';
$employeeMobile = trim($this->data['mobile_number']) ?? '';
$createdBy = Filament::auth()->user()?->name ?? '';
$updatedBy = $createdBy;
$plantId = null;
if ($plantCod == null || $plantCod == '' || ! $plantCod) {
$warnMsg[] = "Plant code can't be empty!";
} elseif (! is_numeric($plantCod)) {
$warnMsg[] = "Plant code '{$plantCod}' should contain only numeric values!";
} elseif (Str::length($plantCod) < 4 || Str::length($plantCod) > 7) {
$warnMsg[] = "Plant code '{$plantCod}' must be between 4 and 7 digits only!";
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCod)) {
$warnMsg[] = "Invalid plant code '{$plantCod}' found!";
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found!';
} else {
$plantId = $plant->id;
}
}
if ($employeeCode == null || $employeeCode == '' || ! $employeeCode) {
$warnMsg[] = "Employee ID can't be empty!";
} elseif (Str::length($employeeCode) < 3 || Str::length($employeeCode) > 20) {
$warnMsg[] = "Employee ID '{$employeeCode}' must be between 3 and 20 characters only!";
}
if ($employeeEmail != null && $employeeEmail != '' && ! filter_var($employeeEmail, FILTER_VALIDATE_EMAIL)) {
$warnMsg[] = "Invalid email address '{$employeeEmail}' found!";
}
if ($employeeMobile != null && $employeeMobile != '' && ! is_numeric($employeeMobile)) {
$warnMsg[] = "Mobile number '{$employeeMobile}' should contain only numeric values!";
} elseif (Str::length($employeeMobile) < 10 || Str::length($employeeMobile) > 10) {
$warnMsg[] = "Mobile number '{$employeeMobile}' must be exactly 10 digits!";
}
else
{
$existingMobile = EmployeeMaster::where('mobile_number', $employeeMobile)
->where('code', '!=', $employeeCode)
->first();
if ($existingMobile) {
$warnMsg[] = "Mobile number '{$employeeMobile}' is already assigned to another employee!";
}
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else
{
EmployeeMaster::updateOrCreate(
[
'plant_id' => $plantId ?? null,
'code' => $employeeCode ?? null,
],
[
'name' => $employeeName ?? null,
'email' => $employeeEmail ?? null,
'mobile_number' => $employeeMobile ?? null,
'department' => $employeeDepartment ?? null,
// 'designation' => $employeeDesignation ?? null,
'created_by' => $createdBy ?? null,
'updated_by' => $updatedBy ?? null,
]
);
}
return null;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your employee master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -0,0 +1,264 @@
<?php
namespace App\Filament\Imports;
use App\Models\ImportTransit;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Carbon\Carbon;
use Filament\Facades\Filament;
use Illuminate\Support\Facades\Log;
class ImportTransitImporter extends Importer
{
protected static ?string $model = ImportTransit::class;
public static function getColumns(): array
{
return [
ImportColumn::make('cri_rfq_number')
->requiredMapping()
->exampleHeader('CRI RFQ Number')
->example('RFQ-IMP-C.R.I-2025-A')
->label('CRI RFQ Number')
->rules(['required']),
ImportColumn::make('mail_received_date')
->requiredMapping()
->exampleHeader('Mail Received Date')
->example('2024-01-01')
->label('Mail Received Date'),
ImportColumn::make('pricol_ref_number')
->exampleHeader('Pricol Ref Number')
->example('ENQ-1649')
->label('Pricol Ref Number'),
ImportColumn::make('requester')
->exampleHeader('Requester')
->example('Mr.Sathish.K')
->label('Requester'),
ImportColumn::make('shipper')
->exampleHeader('Shipper')
->example('Zhejiang shenneng technology co.,ltd')
->label('Shipper'),
ImportColumn::make('shipper_location')
->exampleHeader('Shipper Location')
->example('China')
->label('Shipper Location'),
ImportColumn::make('shipper_invoice')
->exampleHeader('Shipper Invoice')
->example('SNINDIA250618')
->label('Shipper Invoice'),
ImportColumn::make('shipper_invoice_date')
->exampleHeader('Shipper Invoice Date')
->example('2024-01-02')
->label('Shipper Invoice Date'),
ImportColumn::make('inv_value')
->exampleHeader('Inv Value')
->example('10000')
->label('Inv Value'),
ImportColumn::make('freight_charge')
->exampleHeader('Freight Charge')
->example('500')
->label('Freight Charge'),
ImportColumn::make('customs_agent_name')
->exampleHeader('Customs Agent Name')
->example('Pricol Logistics')
->label('Customs Agent Name'),
ImportColumn::make('eta_date')
->exampleHeader('ETA Date')
->example('2024-01-10')
->label('ETA Date'),
ImportColumn::make('status')
->exampleHeader('Status')
->example('Receipted')
->label('Status'),
ImportColumn::make('insurance_status')
->exampleHeader('Insurance Status')
->example('Receipted')
->label('Insurance Status'),
ImportColumn::make('delivery_location')
->exampleHeader('Delivery Location')
->example('Arasur Hub')
->label('Delivery Location'),
ImportColumn::make('etd_date')
->exampleHeader('ETD Date')
->example('2024-01-05')
->label('ETD Date'),
ImportColumn::make('mode')
->exampleHeader('Mode')
->example('LCL')
->label('Mode'),
ImportColumn::make('inco_terms')
->exampleHeader('Inco Terms')
->example('FOB')
->label('Inco Terms'),
ImportColumn::make('port_of_loading')
->exampleHeader('Port of Loading')
->example('NINGBO')
->label('Port of Loading'),
ImportColumn::make('port_of_discharge')
->exampleHeader('Port of Discharge')
->example('CHENNAI')
->label('Port of Discharge'),
ImportColumn::make('delivery_city')
->exampleHeader('Delivery City')
->example('COIMBATORE')
->label('Delivery City'),
ImportColumn::make('packages')
->exampleHeader('Packages')
->example('450')
->label('Packages'),
ImportColumn::make('type_of_package')
->exampleHeader('Type of Package')
->example('PKG')
->label('Type of Package'),
ImportColumn::make('gross_weight')
->exampleHeader('Gross Weight')
->example('5000')
->label('Gross Weight'),
ImportColumn::make('volume')
->exampleHeader('Volume')
->example('50')
->label('Volume'),
ImportColumn::make('bill_number')
->exampleHeader('Bill Number')
->example('BL12345')
->label('Bill Number'),
ImportColumn::make('bill_received_date')
->exampleHeader('Bill Received Date')
->example('2024-01-15')
->label('Bill Received Date'),
ImportColumn::make('vessel_number')
->exampleHeader('Vessel Number')
->example('XIN WEN ZHOU')
->label('Vessel Number'),
];
}
public function resolveRecord(): ?ImportTransit
{
$warnMsg = [];
$criRfqNumber = trim($this->data['cri_rfq_number']) ?? '';
$mailRecDate = trim($this->data['mail_received_date']) ?? '';
$pricolRefNumber = trim($this->data['pricol_ref_number']) ?? '';
$requester = trim($this->data['requester']) ?? '';
$shipper = trim($this->data['shipper']) ?? '';
$shipperLocation = trim($this->data['shipper_location']) ?? '';
$shipperInvoice = trim($this->data['shipper_invoice']) ?? '';
$shipperInvoiceDt = trim($this->data['shipper_invoice_date']) ?? '';
$invValue = trim($this->data['inv_value']) ?? '';
$freightCharge = trim($this->data['freight_charge']) ?? '';
$customsAgentname = trim($this->data['customs_agent_name']) ?? '';
$etaDate = trim($this->data['eta_date']) ?? '';
$status = trim($this->data['status']) ?? '';
$deliveryLocation = trim($this->data['delivery_location']) ?? '';
$etdDate = trim($this->data['etd_date']) ?? '';
$mode = trim($this->data['mode']) ?? '';
$incoTerms = trim($this->data['inco_terms']) ?? '';
$portOfLoading = trim($this->data['port_of_loading']) ?? '';
$portOfDischarge = trim($this->data['port_of_discharge']) ?? '';
$deliveryCity = trim($this->data['delivery_city']) ?? '';
$packages = trim($this->data['packages']) ?? '';
$typeOfPackage = trim($this->data['type_of_package']) ?? '';
$grossWeight = trim($this->data['gross_weight']) ?? '';
$volume = trim($this->data['volume']) ?? '';
$billNo = trim($this->data['bill_number']) ?? '';
$billReceivedDate = trim($this->data['bill_received_date']) ?? '';
$vesselNumber = trim($this->data['vessel_number']) ?? '';
$createdBy = Filament::auth()->user()?->name ?? '';
$updatedBy = $createdBy;
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return ImportTransit::updateOrCreate([
'cri_rfq_number' => $criRfqNumber,
],
[
'mail_received_date' => $this->formatDate($mailRecDate),
'shipper_invoice_date' => $this->formatDate($shipperInvoiceDt),
'eta_date' => $this->formatDate($etaDate),
'etd_date' => $this->formatDate($etdDate),
'bill_received_date' => $this->formatDate($billReceivedDate),
'pricol_ref_number' => $pricolRefNumber,
'requester' => $requester,
'shipper' => $shipper,
'shipper_location' => $shipperLocation,
'shipper_invoice' => $shipperInvoice,
'inv_value' => $invValue,
'freight_charge' => $freightCharge,
'custom_agent_name' => $customsAgentname,
'status' => $status,
'delivery_location' => $deliveryLocation,
'mode' => $mode,
'inco_terms' => $incoTerms,
'port_of_loading' => $portOfLoading,
'port_of_discharge' => $portOfDischarge,
'delivery_city' => $deliveryCity,
'packages' => $packages,
'type_of_package' => $typeOfPackage,
'gross_weight' => $grossWeight,
'volume' => $volume,
'bill_number' => $billNo,
'vessel_number' => $vesselNumber,
// 'created_at' => $createdAt ?? null,
// 'updated_at' => $updatedAt ?? null,
'created_by' => $createdBy ?? null,
'updated_by' => $updatedBy ?? null,
]
);
// return new ImportTransit();
}
private function formatDate($date): ?string
{
if (blank($date)) {
return null;
}
if (!preg_match('/\d/', $date)) {
return null;
}
try {
$date = trim($date);
// Excel numeric date (e.g. 46000)
if (is_numeric($date)) {
return Carbon::instance(
\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject((float)$date)
)->format('Y-m-d');
}
// Try common formats explicitly
$formats = ['d-m-Y', 'd/m/Y', 'Y-m-d', 'm/d/Y', 'd.m.Y'];
foreach ($formats as $format) {
try {
return Carbon::createFromFormat($format, $date)->format('Y-m-d');
} catch (\Exception $e) {
continue;
}
}
return null;
} catch (\Exception $e) {
return null;
}
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your import transit import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -30,9 +30,9 @@ class MotorTestingMasterImporter extends Importer
->rules(['required']),
ImportColumn::make('subassembly_code')
->requiredMapping()
->exampleHeader('SubAssembly Code')
->exampleHeader('Subassembly Code')
->example(['123456'])
->label('SubAssembly Code')
->label('Subassembly Code')
->rules(['required']),
ImportColumn::make('isi_model')
->requiredMapping()
@@ -216,18 +216,18 @@ class MotorTestingMasterImporter extends Importer
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('created_by')
->requiredMapping()
->exampleHeader('Created By')
->example([Filament::auth()->user()->name, Filament::auth()->user()->name, Filament::auth()->user()->name])
->label('Created By')
->rules(['required']),
ImportColumn::make('updated_by')
->requiredMapping()
->exampleHeader('Updated By')
->example([Filament::auth()->user()->name, Filament::auth()->user()->name, Filament::auth()->user()->name])
->label('Updated By')
->rules(['required']),
// ImportColumn::make('created_by')
// ->requiredMapping()
// ->exampleHeader('Created By')
// ->example([Filament::auth()->user()->name, Filament::auth()->user()->name, Filament::auth()->user()->name])
// ->label('Created By')
// ->rules(['required']),
// ImportColumn::make('updated_by')
// ->requiredMapping()
// ->exampleHeader('Updated By')
// ->example([Filament::auth()->user()->name, Filament::auth()->user()->name, Filament::auth()->user()->name])
// ->label('Updated By')
// ->rules(['required']),
];
}
@@ -237,7 +237,7 @@ class MotorTestingMasterImporter extends Importer
$plantCod = trim($this->data['plant']);
$iCode = trim($this->data['item']);
$sCode = trim($this->data['subassembly_code']);
$isiModel = (trim($this->data['isi_model']) == '1') ? true : false;
$isiModel = trim($this->data['isi_model']);
$phase = trim($this->data['phase']);
$kw = trim($this->data['kw']);
$hp = trim($this->data['hp']);
@@ -266,15 +266,15 @@ class MotorTestingMasterImporter extends Importer
$noloadPowUl = trim($this->data['noload_pow_ul']);
$noloadSpdLl = trim($this->data['noload_spd_ll']);
$noloadSpdUl = trim($this->data['noload_spd_ul']);
$createdBy = trim($this->data['created_by']);
$updatedBy = trim($this->data['updated_by']);
$createdBy = Filament::auth()->user()->name;
$updatedBy = Filament::auth()->user()->name;
$plant = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} elseif (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} elseif (Str::length($sCode) < 6 || ! ctype_alnum($sCode)) {
} elseif (Str::length($sCode) > 0 && (Str::length($sCode) < 6 || ! ctype_alnum($sCode))) {
$warnMsg[] = 'Invalid sub-assembly code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
@@ -289,13 +289,8 @@ class MotorTestingMasterImporter extends Importer
} elseif (! $iCode) {
$warnMsg[] = 'Item code not found for choosed plant';
} else {
// if (Str::length($isiModel) <= 0 || $isiModel == "0" || $isiModel == "1") {
// $warnMsg[] = "Invalid ISI Model found";
// }
// else
// {
// $isiModel = ($isiModel == "1");
// }
$isiModel = (Str::length($isiModel) == 1 && ctype_alnum($isiModel) && ($isiModel == '1' || $isiModel == 'Y' || $isiModel == 'y')) ? true : false;
if (Str::length($phase) <= 0 || ($phase != 'Single' && $phase != 'Three')) {// !is_string($phase) ||
$warnMsg[] = 'Invalid phase found';
}
@@ -387,19 +382,8 @@ class MotorTestingMasterImporter extends Importer
$created = $oldCode->created_by ? User::where('name', $oldCode->created_by)->first() : null;
if (! $created) {
$warnMsg[] = 'Created by not found on update';
}
$updated = User::where('name', $updatedBy)->first();
if (! $updated) {
$warnMsg[] = 'Updated by not found on update';
}
} else {
$created = User::where('name', $createdBy)->first();
if (! $created) {
$warnMsg[] = 'Created by not found';
}
$updated = User::where('name', $updatedBy)->first();
if (! $updated) {
$warnMsg[] = 'Updated by not found';
} else {
$createdBy = $created->name;
}
}
}
@@ -444,8 +428,8 @@ class MotorTestingMasterImporter extends Importer
'noload_pow_ul' => $noloadPowUl,
'noload_spd_ll' => $noloadSpdLl,
'noload_spd_ul' => $noloadSpdUl,
'created_by' => $created->name,
'updated_by' => $updated->name,
'created_by' => $createdBy,
'updated_by' => $updatedBy,
]
);

View File

@@ -82,7 +82,7 @@ class PlantImporter extends Importer
$warnMsg[] = 'Name should contain at least 5 characters!';
}
if ($wareHouseNo == null || $wareHouseNo == '' || ! $wareHouseNo) {
$warnMsg[] = "Warehouse number can't be empty!";
// $warnMsg[] = "Warehouse number can't be empty!";
} elseif (! is_numeric($wareHouseNo)) {
$warnMsg[] = 'Warehouse number should contain only numeric values!';
} elseif (Str::length($wareHouseNo) == 3) {

View File

@@ -70,6 +70,11 @@ class ProductCharacteristicsMasterImporter extends Importer
->exampleHeader('CHARACTERISTICS NAME')
->example(['TEST01', 'TEST02'])
->rules(['required']),
ImportColumn::make('category')
->label('CATEGORY')
->requiredMapping()
->exampleHeader('CATEGORY')
->example(['Open Pump', 'Submersible Pump']),
ImportColumn::make('inspection_type')
->label('INSPECTION TYPE')
->requiredMapping()
@@ -110,6 +115,7 @@ class ProductCharacteristicsMasterImporter extends Importer
$workCenter = trim($this->data['machine']) ?? null;
$charTyp = trim($this->data['characteristics_type']) ?? null;
$charNam = trim($this->data['name']) ?? null;
$category = trim($this->data['category']) ?? null;
$inspectTyp = trim($this->data['inspection_type']) ?? null;
$lower = trim($this->data['lower']) ?? null;
$middle = trim($this->data['middle']) ?? null;
@@ -295,6 +301,7 @@ class ProductCharacteristicsMasterImporter extends Importer
'name' => $charNam,
],
[
'category' => $category,
'inspection_type' => $inspectTyp,
'lower' => $lower,
'middle' => $middle,

View File

@@ -24,7 +24,7 @@ class ProductionOrderImporter extends Importer
->requiredMapping()
->label('PLANT CODE')
->exampleHeader('PLANT CODE')
->example('1000')
->example('TEST007')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('item')

View File

@@ -179,6 +179,35 @@ class StickerMasterImporter extends Importer
$part5 = trim($this->data['part_validation5']);
$laserPart1 = trim($this->data['laser_part_validation1']);
$laserPart2 = trim($this->data['laser_part_validation2']);
$SerialNumberMotor = trim($this->data['serial_number_motor']) ?? null;
$SerialNumberMotor = ($SerialNumberMotor == '0') ? null : $SerialNumberMotor;
$SerialNumberPump = trim($this->data['serial_number_pump']) ?? null;
$SerialNumberPump = ($SerialNumberPump == '0') ? null : $SerialNumberPump;
$SerialNumberPumpSet = trim($this->data['serial_number_pumpset']) ?? null;
$SerialNumberPumpSet = ($SerialNumberPumpSet == '0') ? null : $SerialNumberPumpSet;
$PackSlipMotor = trim($this->data['pack_slip_motor']) ?? null;
$PackSlipMotor = ($PackSlipMotor == '0') ? null : $PackSlipMotor;
$PackSlipPump = trim($this->data['pack_slip_pump']) ?? null;
$PackSlipPump = ($PackSlipPump == '0') ? null : $PackSlipPump;
$PackSlipPumpSet = trim($this->data['pack_slip_pumpset']) ?? null;
$PackSlipPumpSet = ($PackSlipPumpSet == '0') ? null : $PackSlipPumpSet;
$NamePlateMotor = trim($this->data['name_plate_motor']) ?? null;
$NamePlateMotor = ($NamePlateMotor == '0') ? null : $NamePlateMotor;
$NamePlatePump = trim($this->data['name_plate_pump']) ?? null;
$NamePlatePump = ($NamePlatePump == '0') ? null : $NamePlatePump;
$NamePlatePumpSet = trim($this->data['name_plate_pumpset']) ?? null;
$NamePlatePumpSet = ($NamePlatePumpSet == '0') ? null : $NamePlatePumpSet;
$TubeStickMotor = trim($this->data['tube_sticker_motor']) ?? null;
$TubeStickMotor = ($TubeStickMotor == '0') ? null : $TubeStickMotor;
$TubeStickPump = trim($this->data['tube_sticker_pump']) ?? null;
$TubeStickPump = ($TubeStickPump == '0') ? null : $TubeStickPump;
$TubeStickPumpSet = trim($this->data['tube_sticker_pumpset']) ?? null;
$TubeStickPumpSet = ($TubeStickPumpSet == '0') ? null : $TubeStickPumpSet;
$WarrantyCard = trim($this->data['warranty_card']) ?? null;
$WarrantyCard = ($WarrantyCard == '0') ? null : $WarrantyCard;
$LoadRate = $this->data['load_rate'] ?? 0;
$BundleQuantity = $this->data['bundle_quantity'] ?? null;
$MaterialType = $this->data['material_type'] ?? null;
$createdBy = Filament::auth()->user()->name;
$updatedBy = Filament::auth()->user()->name;
@@ -195,19 +224,19 @@ class StickerMasterImporter extends Importer
}
if (! $plant) {
$warnMsg[] = 'Plant not found';
$warnMsg[] = 'Plant not found!';
} else {
$plantId = $plant->id;
if (Str::length($itemCod) < 6 || ! ctype_alnum($itemCod)) {
$warnMsg[] = 'Invalid item code found';
$warnMsg[] = 'Invalid item code found!';
} else {
$item = Item::where('code', $itemCod)->first();
if (! $item) {
$warnMsg[] = 'Item code not found';
$warnMsg[] = 'Item code not found!';
} else {
$item = Item::where('code', $itemCod)->where('plant_id', $plantId)->first();
if (! $item) {
$warnMsg[] = 'Item code not found for the plant';
$warnMsg[] = 'Item code not found for the plant!';
} else {
$itemId = $item->id;
@@ -217,7 +246,7 @@ class StickerMasterImporter extends Importer
}
if (Str::length($panelCod) > 0 && (Str::length($panelCod) < 6 || ! ctype_alnum($panelCod))) {
$warnMsg[] = 'Invalid panel box code found';
$warnMsg[] = 'Invalid panel box code found!';
} elseif ($panelCod) {
$parts = [$part1, $part2, $part3, $part4];
$validParts = array_values(array_filter($parts, fn ($p) => ! empty($p)));
@@ -228,53 +257,53 @@ class StickerMasterImporter extends Importer
[$part1, $part2, $part3, $part4, $part5] = array_pad($validParts, 5, '');
}
if (Str::length($this->data['serial_number_motor']) > 0 && $this->data['serial_number_motor'] != '1') {
$warnMsg[] = 'Serial number motor must be 1 or empty';
if (Str::length($SerialNumberMotor) > 0 && (! is_numeric($SerialNumberMotor) || $SerialNumberMotor < 1)) {
$warnMsg[] = "Serial number motor must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['serial_number_pump']) > 0 && $this->data['serial_number_pump'] != '1') {
$warnMsg[] = 'Serial number pump must be 1 or empty';
if (Str::length($SerialNumberPump) > 0 && (! is_numeric($SerialNumberPump) || $SerialNumberPump < 1)) {
$warnMsg[] = "Serial number pump must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['serial_number_pumpset']) > 0 && $this->data['serial_number_pumpset'] != '1') {
$warnMsg[] = 'Serial number pumpset must be 1 or empty';
if (Str::length($SerialNumberPumpSet) > 0 && (! is_numeric($SerialNumberPumpSet) || $SerialNumberPumpSet < 1)) {
$warnMsg[] = "Serial number pumpset must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['pack_slip_motor']) > 0 && $this->data['pack_slip_motor'] != '1') {
$warnMsg[] = 'Pack slip motor must be 1 or empty';
if (Str::length($PackSlipMotor) > 0 && (! is_numeric($PackSlipMotor) || $PackSlipMotor < 1)) {
$warnMsg[] = "Pack slip motor must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['pack_slip_pump']) > 0 && $this->data['pack_slip_pump'] != '1') {
$warnMsg[] = 'Pack slip pump must be 1 or empty';
if (Str::length($PackSlipPump) > 0 && (! is_numeric($PackSlipPump) || $PackSlipPump < 1)) {
$warnMsg[] = "Pack slip pump must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['pack_slip_pumpset']) > 0 && $this->data['pack_slip_pumpset'] != '1') {
$warnMsg[] = 'Pack slip pumpset must be 1 or empty';
if (Str::length($PackSlipPumpSet) > 0 && (! is_numeric($PackSlipPumpSet) || $PackSlipPumpSet < 1)) {
$warnMsg[] = "Pack slip pumpset must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['name_plate_motor']) > 0 && $this->data['name_plate_motor'] != '1') {
$warnMsg[] = 'Name plate motor must be 1 or empty';
if (Str::length($NamePlateMotor) > 0 && (! is_numeric($NamePlateMotor) || $NamePlateMotor < 1)) {
$warnMsg[] = "Name plate motor must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['name_plate_pump']) > 0 && $this->data['name_plate_pump'] != '1') {
$warnMsg[] = 'Name plate pump must be 1 or empty';
if (Str::length($NamePlatePump) > 0 && (! is_numeric($NamePlatePump) || $NamePlatePump < 1)) {
$warnMsg[] = "Name plate pump must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['name_plate_pumpset']) > 0 && $this->data['name_plate_pumpset'] != '1') {
$warnMsg[] = 'Name plate pumpset must be 1 or empty';
if (Str::length($NamePlatePumpSet) > 0 && (! is_numeric($NamePlatePumpSet) || $NamePlatePumpSet < 1)) {
$warnMsg[] = "Name plate pumpset must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['tube_sticker_motor']) > 0 && $this->data['tube_sticker_motor'] != '1') {
$warnMsg[] = 'Tube sticker motor must be 1 or empty';
if (Str::length($TubeStickMotor) > 0 && (! is_numeric($TubeStickMotor) || $TubeStickMotor < 1)) {
$warnMsg[] = "Tube sticker motor must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['tube_sticker_pump']) > 0 && $this->data['tube_sticker_pump'] != '1') {
$warnMsg[] = 'Tube sticker pump must be 1 or empty';
if (Str::length($TubeStickPump) > 0 && (! is_numeric($TubeStickPump) || $TubeStickPump < 1)) {
$warnMsg[] = "Tube sticker pump must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['tube_sticker_pumpset']) > 0 && $this->data['tube_sticker_pumpset'] != '1') {
$warnMsg[] = 'Tube sticker pumpset must be 1 or empty';
if (Str::length($TubeStickPumpSet) > 0 && (! is_numeric($TubeStickPumpSet) || $TubeStickPumpSet < 1)) {
$warnMsg[] = "Tube sticker pumpset must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['warranty_card']) > 0 && $this->data['warranty_card'] != '1') {
$warnMsg[] = 'Warranty card must be 1 or empty';
if (Str::length($WarrantyCard) > 0 && (! is_numeric($WarrantyCard) || $WarrantyCard < 1)) {
$warnMsg[] = "Warranty card must be greater than or equal to '1' or empty!";
}
if (Str::length($this->data['load_rate']) < 0 || ! is_numeric($this->data['load_rate']) || $this->data['load_rate'] < 0) {
$warnMsg[] = 'Load rate must be greater than or equal to 0';
if (Str::length($LoadRate) < 0 || ! is_numeric($LoadRate) || $LoadRate < 0) {
$warnMsg[] = "Load rate must be greater than or equal to '0'!";
}
if (Str::length($this->data['bundle_quantity']) > 0 && (! is_numeric($this->data['bundle_quantity']) || $this->data['bundle_quantity'] <= 1)) {
$warnMsg[] = "Bundle quantity must be greater than or equal to '2' or empty";
if (Str::length($BundleQuantity) > 0 && (! is_numeric($BundleQuantity) || $BundleQuantity <= 1)) {
$warnMsg[] = "Bundle quantity must be greater than or equal to '2' or empty!";
}
if (Str::length($this->data['material_type']) > 0 && $this->data['material_type'] != '1' && $this->data['material_type'] != '2' && $this->data['material_type'] != '3') { // ($this->data['material_type'] != null) &&
$warnMsg[] = 'Material type must be 1 or 2 or 3 or empty';
if (Str::length($MaterialType) > 0 && $MaterialType != '1' && $MaterialType != '2' && $MaterialType != '3' && $MaterialType != '4') { // ($this->data['material_type'] != null) &&
$warnMsg[] = "Material type must be '1' or '2' or '3' or '4' or empty!";
}
if (empty($warnMsg)) {
@@ -298,19 +327,19 @@ class StickerMasterImporter extends Importer
'plant_id' => $plantId,
],
[
'serial_number_motor' => $this->data['serial_number_motor'],
'serial_number_pump' => $this->data['serial_number_pump'],
'serial_number_pumpset' => $this->data['serial_number_pumpset'],
'pack_slip_motor' => $this->data['pack_slip_motor'],
'pack_slip_pump' => $this->data['pack_slip_pump'],
'pack_slip_pumpset' => $this->data['pack_slip_pumpset'],
'name_plate_motor' => $this->data['name_plate_motor'],
'name_plate_pump' => $this->data['name_plate_pump'],
'name_plate_pumpset' => $this->data['name_plate_pumpset'],
'tube_sticker_motor' => $this->data['tube_sticker_motor'],
'tube_sticker_pump' => $this->data['tube_sticker_pump'],
'tube_sticker_pumpset' => $this->data['tube_sticker_pumpset'],
'warranty_card' => $this->data['warranty_card'],
'serial_number_motor' => $SerialNumberMotor,
'serial_number_pump' => $SerialNumberPump,
'serial_number_pumpset' => $SerialNumberPumpSet,
'pack_slip_motor' => $PackSlipMotor,
'pack_slip_pump' => $PackSlipPump,
'pack_slip_pumpset' => $PackSlipPumpSet,
'name_plate_motor' => $NamePlateMotor,
'name_plate_pump' => $NamePlatePump,
'name_plate_pumpset' => $NamePlatePumpSet,
'tube_sticker_motor' => $TubeStickMotor,
'tube_sticker_pump' => $TubeStickPump,
'tube_sticker_pumpset' => $TubeStickPumpSet,
'warranty_card' => $WarrantyCard,
'part_validation1' => $part1,
'part_validation2' => $part2,
'part_validation3' => $part3,
@@ -319,9 +348,9 @@ class StickerMasterImporter extends Importer
'laser_part_validation1' => $laserPart1,
'laser_part_validation2' => $laserPart2,
'panel_box_code' => $panelCod,
'load_rate' => $this->data['load_rate'],
'bundle_quantity' => $this->data['bundle_quantity'],
'material_type' => $this->data['material_type'],
'load_rate' => $LoadRate,
'material_type' => $MaterialType,
'bundle_quantity' => $BundleQuantity,
'created_by' => $createdBy,
'updated_by' => $updatedBy,
]);

View File

@@ -575,6 +575,10 @@ class TempClassCharacteristicImporter extends Importer
->label('ZQMM QTY')
->exampleHeader('ZQMM QTY')
->example(''),
ImportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->exampleHeader('ZMM OPERATING TEMPERATURE')
->example(''),
ImportColumn::make('winded_serial_number')
->label('WINDed SERIAL NUMBER')
->exampleHeader('WINDED SERIAL NUMBER')

View File

@@ -8,6 +8,7 @@ use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Spatie\Permission\Models\Role;
use Str;
@@ -56,6 +57,12 @@ class UserImporter extends Importer
$warnMsg = [];
$plantCod = $this->data['plant_id'];
$plant = null;
$user = $this->data['name'];
$mail = $this->data['email'];
$pass = $this->data['password'];
$restrictedUsers = ['Admin', 'Dhanabalan S', 'Ranjith B'];
$adminUser = Filament::auth()->user()?->name;
if (Str::length($plantCod) > 0 && (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod))) {
$warnMsg[] = 'Invalid plant code found!';
} elseif (Str::length($plantCod) <= 0) {
@@ -70,14 +77,14 @@ class UserImporter extends Importer
}
}
if (Str::length($this->data['name']) < 3) {
if (Str::length($user) < 3) {
$warnMsg[] = 'Invalid user name found!';
}
// || !is_numeric($this->data['code']) || !preg_match('/^[1-9]\d{3,}$/', $this->data['code'])
if (Str::length($this->data['email']) < 5) {
if (Str::length($mail) < 5) {
$warnMsg[] = 'Invalid email found!';
}
if (Str::length($this->data['password']) < 3) {
if (Str::length($pass) < 3) {
$warnMsg[] = 'Invalid password found!';
}
// Validate roles if provided
@@ -97,16 +104,20 @@ class UserImporter extends Importer
$warnMsg[] = 'User roles not found!';
}
if (! in_array($adminUser, $restrictedUsers, true) && in_array($user, $restrictedUsers, true)) {
throw new RowImportFailedException("You don't have permission to import user with name '{$user}'!");
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
$user = User::updateOrCreate([
'email' => $this->data['email'],
'email' => $mail,
],
[
'name' => $this->data['name'],
'password' => $this->data['password'],
'name' => $user,
'password' => $pass,
'plant_id' => $plant,
]);
@@ -118,7 +129,7 @@ class UserImporter extends Importer
return null;
// return User::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// 'email' => $mail,
// ]);
// return new User();

View File

@@ -0,0 +1,88 @@
<?php
namespace App\Filament\Imports;
use App\Models\VehicleEntry;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
class VehicleEntryImporter extends Importer
{
protected static ?string $model = VehicleEntry::class;
public static function getColumns(): array
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('PLANT CODE')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('vehicle_number')
->requiredMapping()
->exampleHeader('VEHICLE NUMBER')
->example('ABC123')
->label('VEHICLE NUMBER')
->rules(['required']),
ImportColumn::make('uuid')
->label('UUID')
->exampleHeader('UUID')
->example('ABC123'),
ImportColumn::make('boom_opened')
->exampleHeader('BOOM OPENED')
->example('Auto')
->label('BOOM OPENED'),
ImportColumn::make('entry_time')
->requiredMapping()
->exampleHeader('ENTRY TIME')
->example('2023-01-01 09:00:00')
->label('ENTRY TIME'),
ImportColumn::make('exit_time')
->exampleHeader('EXIT TIME')
->example('2023-01-01 17:00:00')
->label('EXIT TIME'),
ImportColumn::make('duration')
->exampleHeader('DURATION (HOURS)')
->example('8')
->label('DURATION (HOURS)'),
ImportColumn::make('type')
->exampleHeader('TYPE')
->example('TRUCK')
->label('TYPE'),
ImportColumn::make('created_by')
->exampleHeader('CREATED BY')
->example('John Doe')
->label('CREATED BY'),
ImportColumn::make('updated_by')
->exampleHeader('UPDATED BY')
->example('Jane Doe')
->label('UPDATED BY'),
];
}
public function resolveRecord(): ?VehicleEntry
{
// return VehicleEntry::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
return new VehicleEntry();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your vehicle entry import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace App\Filament\Imports;
use App\Models\VisitorEntry;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
class VisitorEntryImporter extends Importer
{
protected static ?string $model = VisitorEntry::class;
public static function getColumns(): array
{
return [
ImportColumn::make('employeeMaster')
->requiredMapping()
->relationship()
->rules(['required']),
ImportColumn::make('mobile_number')
->requiredMapping()
->numeric()
->rules(['required', 'integer']),
ImportColumn::make('name'),
ImportColumn::make('company'),
ImportColumn::make('purpose_of_visit'),
ImportColumn::make('type'),
ImportColumn::make('photo'),
ImportColumn::make('number_of_person')
->numeric()
->rules(['integer']),
ImportColumn::make('in_time')
->rules(['datetime']),
ImportColumn::make('out_time')
->rules(['datetime']),
ImportColumn::make('created_by'),
ImportColumn::make('updated_by'),
ImportColumn::make('register_id'),
ImportColumn::make('valid_upto')
->rules(['datetime']),
];
}
public function resolveRecord(): ?VisitorEntry
{
// return VisitorEntry::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
return new VisitorEntry();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your visitor entry import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -23,6 +23,8 @@ class Dashboard extends \Filament\Pages\Dashboard
protected static string $view = 'filament.pages.dashboard';
protected static ?string $slug = 'welcome';
// public function mount(): void
// {
// session()->forget(['selected_plant']);

View File

@@ -0,0 +1,79 @@
<?php
namespace App\Filament\Pages;
use App\Models\Plant;
use App\Models\VisitorEntry;
use Filament\Facades\Filament;
use Filament\Pages\Page;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Auth;
class GateOutEntry extends Page implements HasForms
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.gate-out-entry';
protected static ?string $navigationGroup = 'Gate Entry';
public $pId, $invoiceNumber;
public array $invoiceOverviewData = [];
public array $filters = [];
public function form(Form $form): Form
{
return $form
->statePath('filters')
->schema([
Section::make('') // You can give your section a title or leave it blank
->schema([
TextInput::make('scan_out_gate_pass')
->label('Scan Out Gate Pass')
->required()
->reactive()
->extraAttributes([
'wire:keydown.enter' => 'processGatePass($event.target.value)',
]),
])
->columns(5)
]);
}
public function processGatePass($gatePass)
{
$entry = VisitorEntry::where('register_id', $gatePass)->first();
if ($entry) {
$entry->out_time = now();
$entry->save();
Notification::make()
->title('Gate Pass Processed')
->body('Gate pass has been successfully processed. Visitor marked as exited.')
->success()
->send();
$this->filters['scan_out_gate_pass'] = '';
} else {
Notification::make()
->title('Invalid Gate Pass')
->body('The scanned gate pass is not valid. Please try again.')
->danger()
->send();
}
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view gate entry page');
}
}

View File

@@ -59,6 +59,7 @@ class AlertMailRuleResource extends Resource
'QualityValidation' => 'QualityValidation',
'InvoiceTransit' => 'InvoiceTransit',
'ImportTransit' => 'ImportTransit',
'VehicleReport' => 'VehicleReport',
]),
Forms\Components\Select::make('rule_name')
->label('Rule Name')
@@ -71,6 +72,7 @@ class AlertMailRuleResource extends Resource
'QualityMail' => 'Quality Mail',
'InvoiceTransitMail' => 'Invoice Transit Mail',
'ImportTransitMail' => 'Import Transit Mail',
'VehicleReportMail' => 'Vehicle Report Mail',
])
->required(),
Forms\Components\TextInput::make('email')

View File

@@ -0,0 +1,446 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\AsrsItemValidationExporter;
use App\Filament\Imports\AsrsItemValidationImporter;
use App\Filament\Resources\AsrsItemValidationResource\Pages;
use App\Filament\Resources\AsrsItemValidationResource\RelationManagers;
use App\Models\AsrsItemValidation;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use Filament\Forms\Get;
use App\Models\Item;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\DateTimePicker;
use App\Models\Plant;
use Illuminate\Support\Facades\Auth;
class AsrsItemValidationResource extends Resource
{
protected static ?string $model = AsrsItemValidation::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('plant_id')
->label('Plant')
->relationship('plant', 'name')
->required()
->disabledOn('edit'),
Forms\Components\Select::make('item_code')
->label('Item Code')
->reactive()
->options(function (Get $get) {
$plantId = $get('plant_id');
if (!$plantId) {
return [];
}
return AsrsItemValidation::where('plant_id', $plantId)
->pluck('item_code', 'item_code');
})
->searchable()
->afterStateUpdated(function (callable $set, $state) {
$item = AsrsItemValidation::where('item_code', $state)->first();
if ($item) {
$set('item_description', $item->item_description);
$set('uom', $item->uom);
} else {
$set('item_description', null);
$set('uom', null);
}
})
->disabledOn('edit'),
Forms\Components\TextInput::make('item_description')
->label('Item Description')
->readOnly()
->reactive()
->disabledOn('edit'),
Forms\Components\TextInput::make('uom')
->label('UOM')
->readOnly()
->reactive()
->disabledOn('edit'),
Forms\Components\TextInput::make('material_type')
->label('Material Type')
->readOnly()
->reactive()
->disabledOn('edit'),
Forms\Components\TextInput::make('material_group')
->label('Material Group')
->readOnly()
->reactive()
->disabledOn('edit'),
Forms\Components\Select::make('mhe')
->label('MHE')
->options([
'Bin1000*800*750' => 'Bin 1000*800*750',
'Bin1000*800*1000' => 'Bin 1000*800*1000',
'Pallet' => 'Pallet',
'ChinaBin' => 'China Bin',
'PalletWithPlasticCrate' => 'Pallet With Plastic Crate',
'PlasticCrateBig' => 'Plastic Crate Big',
'PlasticCrateSmall' => 'Plastic Crate Small',
'OutsideStorage' => 'Outside Storage',
]),
Forms\Components\TextInput::make('bin_quantity')
->label('Bin Quantity'),
Forms\Components\Select::make('asrs')
->label('ASRS')
->options([
'ASRS1' => 'ASRS1',
'ASRS2' => 'ASRS2',
]),
Forms\Components\Select::make('asrs_category')
->label('ASRS Category')
->options([
'In' => 'In',
'Out' => 'Out',
]),
// Forms\Components\Select::make('status')
// ->label('Status')
// ->options([
// 'Updated' => 'Updated',
// 'NotUpdated' => 'Not Updated',
// ]),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name ?? ''),
Forms\Components\Hidden::make('updated_by')
->label('Updated By')
->default(Filament::auth()->user()?->name ?? ''),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
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;
})
->alignCenter(),
Tables\Columns\TextColumn::make('plant.name')
->label('Plant')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item_code')
->label('Item Code')
->alignCenter()
->searchable(query: function ($query, string $search) {
$itemCode = explode('|', trim($search))[0];
$query->where('item_code', $itemCode);
})
// ->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item_description')
->label('Item Description')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('uom')
->label('UOM')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('material_type')
->label('Material Type')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('material_group')
->label('Material Group')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('mhe')
->label('MHE')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('bin_quantity')
->label('Bin Quantity')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('asrs')
->label('ASRS')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('asrs_category')
->label('ASRS Category')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('status')
->label('Status')
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->dateTime()
->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()
->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('asrsItemValidations', 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_code', null);
}),
Select::make('item_code')
->label('Item Code')
->reactive()
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (!$plantId) {
return [];
}
return AsrsItemValidation::where('plant_id', $plantId)
->distinct()
->pluck('item_code', 'item_code')
->toArray();
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('uom', null);
}),
TextInput::make('uom')
->label('UOM')
->reactive()
->placeholder('Enter UOM'),
Select::make('status')
->label('Status')
->reactive()
->options(function (callable $get) {
$plantId = $get('Plant');
if (!$plantId) {
return [];
}
return [
'Updated' => 'Updated',
'NotUpdated' => 'Not Updated',
];
}),
DateTimePicker::make('created_from')
->label('Created From')
->placeholder('Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->placeholder('Select To DateTime')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
$status = $data['status'] ?? 'NotUpdated';
// Hide all records initially if no filters are applied
// if (empty($data['Plant']) && empty($data['item_code']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
// // return $query->whereRaw('1 = 0');
// $query->where('status', 'NotUpdated');
// }
if (
empty($data['Plant']) &&
empty($data['item_code']) &&
empty($data['uom']) &&
empty($data['status']) &&
empty($data['created_from']) &&
empty($data['created_to'])
) {
// $query->where('status', 'NotUpdated');
$query->where(function ($q) {
$q->where('status', 'NotUpdated')
->orWhereNull('status')
->orWhere('status', '');
});
}
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['item_code'])) {
$query->where('item_code', 'like', '%'.$data['item_code'].'%');
}
if (! empty($data['uom'])) {
$query->where('uom', 'like', '%'.$data['uom'].'%');
}
if (!empty($data['status'])) {
if ($data['status'] == 'NotUpdated') {
$query->where(function ($q) {
$q->where('status', 'NotUpdated')
->orWhereNull('status')
->orWhere('status', '');
});
} else {
$query->where('status', $data['status']);
}
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
// $query->orderBy('created_at', 'asc');
})
->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 Name: Choose plant to filter records.';
// }
// }
if (! empty($data['item_code'])) {
$indicators[] = 'Item Code: '.$data['item_code'];
}
if (! empty($data['uom'])) {
$indicators[] = 'UOM: '.$data['uom'];
}
if (! empty($data['status'])) {
$indicators[] = 'Status: '.$data['status'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
// ->hidden(function ($record): bool {
// if (auth()->user()?->hasRole('SuperAdmin')) {
// return false;
// }
// return trim(strtolower($record->status)) == 'updated';
// }),
// ->visible(function ($record): bool {
// return auth()->user()?->hasRole('SuperAdmin')
// || strtolower(trim($record->status ?? '')) != 'updated' || strtolower(trim($record->status ?? '')) == null || strtolower(trim($record->status ?? '')) == '';
// }),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->importer(AsrsItemValidationImporter::class)
->visible(function() {
return Filament::auth()->user()->can('view import asrs item validation');
}),
ExportAction::make()
->exporter(AsrsItemValidationExporter::class)
->visible(function() {
return Filament::auth()->user()->can('view export asrs item validation');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListAsrsItemValidations::route('/'),
'create' => Pages\CreateAsrsItemValidation::route('/create'),
'view' => Pages\ViewAsrsItemValidation::route('/{record}'),
'edit' => Pages\EditAsrsItemValidation::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\AsrsItemValidationResource\Pages;
use App\Filament\Resources\AsrsItemValidationResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateAsrsItemValidation extends CreateRecord
{
protected static string $resource = AsrsItemValidationResource::class;
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Filament\Resources\AsrsItemValidationResource\Pages;
use App\Filament\Resources\AsrsItemValidationResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditAsrsItemValidation extends EditRecord
{
protected static string $resource = AsrsItemValidationResource::class;
protected function mutateFormDataBeforeSave(array $data): array
{
$data['status'] = 'Updated';
return $data;
}
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl(
'index',
[
'tableFilters' => [
'advanced_filters' => [
'status' => 'NotUpdated',
],
],
]
);
}
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\AsrsItemValidationResource\Pages;
use App\Filament\Resources\AsrsItemValidationResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListAsrsItemValidations extends ListRecords
{
protected static string $resource = AsrsItemValidationResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}

View File

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

View File

@@ -968,6 +968,12 @@ class ClassCharacteristicResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('mark_status')
->label('MARKED STATUS')
->reactive()
@@ -1804,6 +1810,10 @@ class ClassCharacteristicResource extends Resource
->label('ZQMM QTY')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('mark_status')
->label('MARKED STATUS')
->alignCenter()
@@ -2031,9 +2041,6 @@ class ClassCharacteristicResource extends Resource
TextInput::make('zmm_heading')
->label('Heading')
->placeholder('Enter Heading'),
TextInput::make('model_type')
->label('Model Type')
->placeholder('Enter Model Type'),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder('Select From DateTime')
@@ -2047,7 +2054,7 @@ class ClassCharacteristicResource extends Resource
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['machine']) && empty($data['item_id']) && empty($data['aufnr']) && empty($data['gernr']) && empty($data['zmm_heading']) && empty($data['model_type']) && empty($data['created_from']) && empty($data['created_to'])) {
if (empty($data['Plant']) && empty($data['machine']) && empty($data['item_id']) && empty($data['aufnr']) && empty($data['gernr']) && empty($data['zmm_heading']) && empty($data['created_from']) && empty($data['created_to'])) {
return $query->whereRaw('1 = 0');
}
@@ -2081,10 +2088,6 @@ class ClassCharacteristicResource extends Resource
$query->where('zmm_heading', 'like', '%'.$data['zmm_heading'].'%');
}
if (! empty($data['model_type'])) {
$query->where('model_type', 'like', '%'.$data['model_type'].'%');
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
@@ -2126,10 +2129,6 @@ class ClassCharacteristicResource extends Resource
$indicators[] = 'Heading: '.$data['zmm_heading'];
}
if (! empty($data['model_type'])) {
$indicators[] = 'Model Type: '.$data['model_type'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}

View File

@@ -0,0 +1,219 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\EmployeeMasterExporter;
use App\Filament\Imports\EmployeeMasterImporter;
use App\Filament\Resources\EmployeeMasterResource\Pages;
use App\Filament\Resources\EmployeeMasterResource\RelationManagers;
use App\Models\EmployeeMaster;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use Illuminate\Validation\Rule;
class EmployeeMasterResource extends Resource
{
protected static ?string $model = EmployeeMaster::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Gate Entry';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('plant_id')
->label('Plant')
->relationship('plant', 'name')
->required(),
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->reactive()
->extraInputAttributes([
'oninput' => 'this.value = this.value.replace(/[^a-zA-Z\s]/g, "")',
]),
Forms\Components\TextInput::make('code')
->label('ID')
->extraInputAttributes([
'oninput' => 'this.value = this.value.replace(/[^a-zA-Z0-9]/g, "")',])
->required()
->unique(
table: 'employee_masters',
column: 'code',
ignoreRecord: true
)
->validationMessages([
'unique' => 'Duplicate employee code already exists.',
]),
Forms\Components\TextInput::make('department')
->label('Department')
->required(),
// Forms\Components\TextInput::make('designation')
// ->label('Designation')
// ->extraInputAttributes([
// 'oninput' => 'this.value = this.value.replace(/[^a-zA-Z\s]/g, "")',])
// ->required(),
Forms\Components\TextInput::make('email')
->label('Email')
->email()
->required(),
Forms\Components\TextInput::make('mobile_number')
->label('Mobile Number')
->length(10)
->reactive()
->extraInputAttributes([
'oninput' => 'this.value = this.value.replace(/[^0-9]/g, "").slice(0, 10)', // blocks non-numbers + limits to 10 chars
'maxlength' => 10,
])
->required()
->unique(
table: 'employee_masters',
column: 'mobile_number',
ignoreRecord: true
)
->validationMessages([
'unique' => 'Duplicate mobile number already exists.',
]),
Forms\Components\Hidden::make('created_by')
->label('Created by')
->default(Filament::auth()->user()?->name ?? ''),
Forms\Components\Hidden::make('updated_by')
->label('Updated by')
->default(Filament::auth()->user()?->name ?? ''),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
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;
})
->alignCenter(),
Tables\Columns\TextColumn::make('plant.name')
->numeric()
->sortable()
->alignCenter(),
Tables\Columns\TextColumn::make('name')
->label('Name')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('code')
->label('Employee ID')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('department')
->label('Department')
->sortable()
->alignCenter()
->searchable(),
// Tables\Columns\TextColumn::make('designation')
// ->label('Designation')
// ->sortable()
// ->alignCenter()
// ->searchable(),
Tables\Columns\TextColumn::make('email')
->label('Email')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('mobile_number')
->label('Mobile Number')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->alignCenter(),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
Tables\Columns\TextColumn::make('created_by')
->label('Created by')
->sortable()
->alignCenter(),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated by')
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
Tables\Columns\TextColumn::make('deleted_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->importer(EmployeeMasterImporter::class)
->visible(function() {
return Filament::auth()->user()->can('view import employee master');
}),
ExportAction::make()
->exporter(EmployeeMasterExporter::class)
->visible(function() {
return Filament::auth()->user()->can('view export employee master');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListEmployeeMasters::route('/'),
'create' => Pages\CreateEmployeeMaster::route('/create'),
'view' => Pages\ViewEmployeeMaster::route('/{record}'),
'edit' => Pages\EditEmployeeMaster::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\EmployeeMasterResource\Pages;
use App\Filament\Resources\EmployeeMasterResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateEmployeeMaster extends CreateRecord
{
protected static string $resource = EmployeeMasterResource::class;
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Filament\Resources\EmployeeMasterResource\Pages;
use App\Filament\Resources\EmployeeMasterResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditEmployeeMaster extends EditRecord
{
protected static string $resource = EmployeeMasterResource::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\EmployeeMasterResource\Pages;
use App\Filament\Resources\EmployeeMasterResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListEmployeeMasters extends ListRecords
{
protected static string $resource = EmployeeMasterResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}

View File

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

View File

@@ -3,6 +3,7 @@
namespace App\Filament\Resources;
use App\Filament\Exports\ImportTransitExporter;
use App\Filament\Imports\ImportTransitImporter;
use App\Filament\Resources\ImportTransitResource\Pages;
use App\Filament\Resources\ImportTransitResource\RelationManagers;
use App\Models\ImportTransit;
@@ -22,6 +23,7 @@ use Filament\Notifications\Notification;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Maatwebsite\Excel\Facades\Excel;
use Filament\Tables\Actions\ImportAction;
// use PhpOffice\PhpSpreadsheet\IOFactory;
class ImportTransitResource extends Resource
@@ -73,6 +75,16 @@ class ImportTransitResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\DatePicker::make('inv_value')
->label('Inv Value')
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('freight_charge')
->label('Freight Charge')
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('customs_agent_name')
->label('Customs Agent Name')
->afterStateUpdated(function (callable $set) {
@@ -97,6 +109,11 @@ class ImportTransitResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('insurance_status')
->label('Insurance Status')
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('delivery_location')
->label('Delivery Location')
->afterStateUpdated(function (callable $set) {
@@ -167,6 +184,17 @@ class ImportTransitResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('remark')
->label('Remark')
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('is_transit_identified')
->label('Is Transit Identified')
->default(0)
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
@@ -221,6 +249,16 @@ class ImportTransitResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('shipper_invoice_date')
->label('Shipper Invoice Date')
->date()
->formatStateUsing(fn ($state) => $state?->format('Y-m-d'))
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('inv_value')
->label('Inv Value')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('freight_charge')
->label('Freight Charge')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('customs_agent_name')
@@ -229,18 +267,24 @@ class ImportTransitResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('eta_date')
->label('ETA Date')
->date()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('status')
->label('Status')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('insurance_status')
->label('Insurance Status')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('delivery_location')
->label('Delivery Location')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('etd_date')
->label('ETD Date')
->date()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('mode')
@@ -292,6 +336,14 @@ class ImportTransitResource extends Resource
->label('Vessel Number')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('remark')
->label('Remark')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('is_transit_identified')
->label('Is Transit Identified')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()
@@ -333,297 +385,304 @@ class ImportTransitResource extends Resource
]),
])
->headerActions([
Tables\Actions\Action::make('Import Transit')
// Tables\Actions\Action::make('Import Transit')
// ->label('Import Transit')
// ->form([
// FileUpload::make('import_transit_file')
// ->label('Import Transit')
// // ->required()
// ->preserveFilenames()
// ->storeFiles(false)
// ->reactive()
// ->required()
// ->disk('local')
// // ->visible(fn (Get $get) => !empty($get('plant_id')))
// ->directory('uploads/ImportTransit'),
// ])
// ->action(function (array $data) {
// $uploadedFile = $data['import_transit_file'];
// $disk = Storage::disk('local');
// $user = Filament::auth()->user();
// $operatorName = $user->name;
// // Get original filename
// $originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
// $originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
// // Store manually using storeAs to keep original name
// $path = $uploadedFile->storeAs('uploads/ImportTransit', $originalName, 'local'); // returns relative path
// $fullPath = Storage::disk('local')->path($path);
// if ($fullPath && file_exists($fullPath)) {
// $rows = Excel::toArray(null, $fullPath)[0];
// if ((count($rows) - 1) <= 0) {
// Notification::make()
// ->title('Records Not Found')
// ->body("Import the valid 'Import Transit' file to proceed..!")
// ->danger()
// ->send();
// if ($disk->exists($path))
// {
// $disk->delete($path);
// }
// return;
// }
// $invalidCriNo = [];
// foreach ($rows as $index => $row)
// {
// if ($index == 0) {
// continue;
// }
// $rowNumber = $index + 1;
// $criRfqNo = trim($row[1] ?? '');
// $mailRcvdDate = trim($row[2] ?? '');
// $pricolRefNo = trim($row[3] ?? '');
// $requester = trim($row[4] ?? '');
// $shipper = trim($row[5] ?? '');
// $shipperLocation = trim($row[6] ?? '');
// $shipperInv = trim($row[7] ?? '');
// $shipperInvDate = trim($row[8] ?? '');
// $cha = trim($row[9] ?? '');
// $eta = trim($row[10] ?? '');
// $status = trim($row[11] ?? '');
// $dlyLoc = trim($row[12] ?? '');
// $etd = trim($row[13] ?? '');
// $mode = trim($row[14] ?? '');
// $incoTerms = trim($row[15] ?? '');
// $portOfLoading = trim($row[16] ?? '');
// $portOfDischarge = trim($row[17] ?? '');
// $deliveryCity = trim($row[18] ?? '');
// $packages = trim($row[19] ?? '');
// $typeOfPkg = trim($row[20] ?? '');
// $grossWeight = trim($row[21] ?? '');
// $volumeWeight = trim($row[22] ?? '');
// $blNo = trim($row[23] ?? '');
// $blRcvdDate = trim($row[24] ?? '');
// $vesselNo = trim($row[25] ?? '');
// if (empty($criRfqNo)) {
// $invalidCriNo[] = $rowNumber;
// }
// }
// if (! empty($invalidCriNo)){
// $errorMsg = '';
// if (! empty($invalidCriNo)) {
// $errorMsg .= 'Missing CRI Rfq No in rows: '.implode(', ', $invalidCriNo).'<br>';
// }
// Notification::make()
// ->title('Missing Mandatory Fields')
// ->body($errorMsg)
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// // $spreadsheet = IOFactory::load($fullPath);
// // foreach ($spreadsheet->getAllSheets() as $sheet) {
// // $state = $sheet->getSheetState();
// // if ($state == \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::SHEETSTATE_HIDDEN ||
// // $state == \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::SHEETSTATE_VERYHIDDEN) {
// // Notification::make()
// // ->title('Import Failed')
// // ->body("Hidden sheet found: \"{$sheet->getTitle()}\". Please remove all hidden sheets and try again.")
// // ->danger()
// // ->send();
// // return;
// // }
// // }
// try
// {
// foreach ($rows as $index => $row)
// {
// if ($index == 0) {
// continue;
// }
// $rowNumber = $index + 1;
// try
// {
// $formattedDate = null;
// $formattedShipperDate = null;
// $etaDate = null;
// $etdDate = null;
// $formattedBlRcvdDate = null;
// $criRfqNo = trim($row[1] ?? '');
// $mailRcvdDate = trim($row[2] ?? '');
// $pricolRefNo = trim($row[3] ?? '');
// $requester = trim($row[4] ?? '');
// $shipper = trim($row[5] ?? '');
// $shipperLocation = trim($row[6] ?? '');
// $shipperInv = trim($row[7] ?? '');
// $shipperInvDate = trim($row[8] ?? '');
// $cha = trim($row[9] ?? '');
// $eta = trim($row[10] ?? '');
// $status = trim($row[11] ?? '');
// $dlyLoc = trim($row[12] ?? '');
// $etd = trim($row[13] ?? '');
// $mode = trim($row[14] ?? '');
// $incoTerms = trim($row[15] ?? '');
// $portOfLoading = trim($row[16] ?? '');
// $portOfDischarge = trim($row[17] ?? '');
// $deliveryCity = trim($row[18] ?? '');
// $packages = trim($row[19] ?? '');
// $typeOfPkg = trim($row[20] ?? '');
// $grossWeight = trim($row[21] ?? '');
// $volumeWeight = trim($row[22] ?? '');
// $blNo = trim($row[23] ?? '');
// $blRcvdDate = trim($row[24] ?? '');
// $vesselNo = trim($row[25] ?? '');
// if (! empty($mailRcvdDate)) {
// if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $mailRcvdDate)) {
// [$day, $month, $year] = preg_split('/[-\/]/', $mailRcvdDate);
// $formattedDate = "{$year}-{$month}-{$day}";
// } elseif (is_numeric($mailRcvdDate)) {
// $formattedDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($mailRcvdDate)->format('Y-m-d');
// } else {
// $formattedDate = date('Y-m-d', strtotime($mailRcvdDate));
// }
// }
// if (! empty($shipperInvDate)) {
// if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $shipperInvDate)) {
// [$day, $month, $year] = preg_split('/[-\/]/', $shipperInvDate);
// $formattedShipperDate = "{$year}-{$month}-{$day}";
// } elseif (is_numeric($shipperInvDate)) {
// $formattedShipperDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($shipperInvDate)->format('Y-m-d');
// } else {
// $formattedShipperDate = date('Y-m-d', strtotime($shipperInvDate));
// }
// }
// if (! empty($eta)) {
// if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $eta)) {
// [$day, $month, $year] = preg_split('/[-\/]/', $eta);
// $etaDate = "{$year}-{$month}-{$day}";
// } elseif (is_numeric($eta)) {
// $etaDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($eta)->format('Y-m-d');
// } else {
// $etaDate = date('Y-m-d', strtotime($eta));
// }
// }
// if (! empty($etd)) {
// if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $etd)) {
// [$day, $month, $year] = preg_split('/[-\/]/', $etd);
// $etdDate = "{$year}-{$month}-{$day}";
// } elseif (is_numeric($etd)) {
// $etdDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($etd)->format('Y-m-d');
// } else {
// $etdDate = date('Y-m-d', strtotime($etd));
// }
// }
// if (! empty($blRcvdDate)) {
// if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $blRcvdDate)) {
// [$day, $month, $year] = preg_split('/[-\/]/', $blRcvdDate);
// $formattedBlRcvdDate = "{$year}-{$month}-{$day}";
// } elseif (is_numeric($blRcvdDate)) {
// $formattedBlRcvdDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($blRcvdDate)->format('Y-m-d');
// } else {
// $formattedBlRcvdDate = date('Y-m-d', strtotime($blRcvdDate));
// }
// }
// $inserted = ImportTransit::updateOrCreate(
// [
// 'cri_rfq_number' => $criRfqNo,
// ],
// [
// 'mail_received_date' => $formattedDate ?? null,
// 'pricol_ref_number' => $pricolRefNo ?? null,
// 'requester' => $requester ?? null,
// 'shipper' => $shipper ?? null,
// 'shipper_location' => $shipperLocation ?? null,
// 'shipper_invoice' => $shipperInv ?? null,
// 'shipper_invoice_date' => $formattedShipperDate ?? null,
// 'customs_agent_name' => $cha ?? null,
// 'eta_date' => $etaDate ?? null,
// 'status' => $status ?? null,
// 'delivery_location' => $dlyLoc ?? null,
// 'etd_date' => $etdDate ?? null,
// 'mode' => $mode ?? null,
// 'inco_terms' => $incoTerms ?? null,
// 'port_of_loading' => $portOfLoading ?? null,
// 'port_of_discharge' => $portOfDischarge ?? null,
// 'delivery_city' => $deliveryCity ?? null,
// 'packages' => $packages ?? null,
// 'type_of_package' => $typeOfPkg ?? null,
// 'gross_weight' => $grossWeight ?? null,
// 'volume' => $volumeWeight ?? null,
// 'bill_number' => $blNo ?? null,
// 'bill_received_date' => $formattedBlRcvdDate ?? null,
// 'vessel_number' => $vesselNo ?? null,
// 'created_by' => $operatorName,
// ]
// );
// }
// catch (\Exception $e) {
// Notification::make()
// ->title('Import Failed')
// ->body("Error occurred while processing row. Error : {$e->getMessage()}")
// ->danger()
// ->send();
// }
// }
// if (! $inserted) {
// Notification::make()
// ->title('Failed')
// ->body("Records insertion failed!")
// ->success()
// ->send();
// }
// else{
// Notification::make()
// ->title('Success')
// ->body("Records inserted successfully!")
// ->success()
// ->send();
// }
// }
// catch (\Exception $e) {
// Notification::make()
// ->title('Import Failed')
// ->body("No records were inserted. Error : {$e->getMessage()}")
// ->danger()
// ->send();
// }
// }
// })
// ->visible(function () {
// return Filament::auth()->user()->can('view import transit');
// }),
ImportAction::make()
->label('Import Transit')
->form([
FileUpload::make('import_transit_file')
->label('Import Transit')
// ->required()
->preserveFilenames()
->storeFiles(false)
->reactive()
->required()
->disk('local')
// ->visible(fn (Get $get) => !empty($get('plant_id')))
->directory('uploads/ImportTransit'),
])
->action(function (array $data) {
$uploadedFile = $data['import_transit_file'];
$disk = Storage::disk('local');
$user = Filament::auth()->user();
$operatorName = $user->name;
// Get original filename
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
// Store manually using storeAs to keep original name
$path = $uploadedFile->storeAs('uploads/ImportTransit', $originalName, 'local'); // returns relative path
$fullPath = Storage::disk('local')->path($path);
if ($fullPath && file_exists($fullPath)) {
$rows = Excel::toArray(null, $fullPath)[0];
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Records Not Found')
->body("Import the valid 'Import Transit' file to proceed..!")
->danger()
->send();
if ($disk->exists($path))
{
$disk->delete($path);
}
return;
}
$invalidCriNo = [];
foreach ($rows as $index => $row)
{
if ($index == 0) {
continue;
}
$rowNumber = $index + 1;
$criRfqNo = trim($row[1] ?? '');
$mailRcvdDate = trim($row[2] ?? '');
$pricolRefNo = trim($row[3] ?? '');
$requester = trim($row[4] ?? '');
$shipper = trim($row[5] ?? '');
$shipperLocation = trim($row[6] ?? '');
$shipperInv = trim($row[7] ?? '');
$shipperInvDate = trim($row[8] ?? '');
$cha = trim($row[9] ?? '');
$eta = trim($row[10] ?? '');
$status = trim($row[11] ?? '');
$dlyLoc = trim($row[12] ?? '');
$etd = trim($row[13] ?? '');
$mode = trim($row[14] ?? '');
$incoTerms = trim($row[15] ?? '');
$portOfLoading = trim($row[16] ?? '');
$portOfDischarge = trim($row[17] ?? '');
$deliveryCity = trim($row[18] ?? '');
$packages = trim($row[19] ?? '');
$typeOfPkg = trim($row[20] ?? '');
$grossWeight = trim($row[21] ?? '');
$volumeWeight = trim($row[22] ?? '');
$blNo = trim($row[23] ?? '');
$blRcvdDate = trim($row[24] ?? '');
$vesselNo = trim($row[25] ?? '');
if (empty($criRfqNo)) {
$invalidCriNo[] = $rowNumber;
}
}
if (! empty($invalidCriNo)){
$errorMsg = '';
if (! empty($invalidCriNo)) {
$errorMsg .= 'Missing CRI Rfq No in rows: '.implode(', ', $invalidCriNo).'<br>';
}
Notification::make()
->title('Missing Mandatory Fields')
->body($errorMsg)
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
// $spreadsheet = IOFactory::load($fullPath);
// foreach ($spreadsheet->getAllSheets() as $sheet) {
// $state = $sheet->getSheetState();
// if ($state == \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::SHEETSTATE_HIDDEN ||
// $state == \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::SHEETSTATE_VERYHIDDEN) {
// Notification::make()
// ->title('Import Failed')
// ->body("Hidden sheet found: \"{$sheet->getTitle()}\". Please remove all hidden sheets and try again.")
// ->danger()
// ->send();
// return;
// }
// }
try
{
foreach ($rows as $index => $row)
{
if ($index == 0) {
continue;
}
$rowNumber = $index + 1;
try
{
$formattedDate = null;
$formattedShipperDate = null;
$etaDate = null;
$etdDate = null;
$formattedBlRcvdDate = null;
$criRfqNo = trim($row[1] ?? '');
$mailRcvdDate = trim($row[2] ?? '');
$pricolRefNo = trim($row[3] ?? '');
$requester = trim($row[4] ?? '');
$shipper = trim($row[5] ?? '');
$shipperLocation = trim($row[6] ?? '');
$shipperInv = trim($row[7] ?? '');
$shipperInvDate = trim($row[8] ?? '');
$cha = trim($row[9] ?? '');
$eta = trim($row[10] ?? '');
$status = trim($row[11] ?? '');
$dlyLoc = trim($row[12] ?? '');
$etd = trim($row[13] ?? '');
$mode = trim($row[14] ?? '');
$incoTerms = trim($row[15] ?? '');
$portOfLoading = trim($row[16] ?? '');
$portOfDischarge = trim($row[17] ?? '');
$deliveryCity = trim($row[18] ?? '');
$packages = trim($row[19] ?? '');
$typeOfPkg = trim($row[20] ?? '');
$grossWeight = trim($row[21] ?? '');
$volumeWeight = trim($row[22] ?? '');
$blNo = trim($row[23] ?? '');
$blRcvdDate = trim($row[24] ?? '');
$vesselNo = trim($row[25] ?? '');
if (! empty($mailRcvdDate)) {
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $mailRcvdDate)) {
[$day, $month, $year] = preg_split('/[-\/]/', $mailRcvdDate);
$formattedDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($mailRcvdDate)) {
$formattedDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($mailRcvdDate)->format('Y-m-d');
} else {
$formattedDate = date('Y-m-d', strtotime($mailRcvdDate));
}
}
if (! empty($shipperInvDate)) {
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $shipperInvDate)) {
[$day, $month, $year] = preg_split('/[-\/]/', $shipperInvDate);
$formattedShipperDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($shipperInvDate)) {
$formattedShipperDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($shipperInvDate)->format('Y-m-d');
} else {
$formattedShipperDate = date('Y-m-d', strtotime($shipperInvDate));
}
}
if (! empty($eta)) {
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $eta)) {
[$day, $month, $year] = preg_split('/[-\/]/', $eta);
$etaDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($eta)) {
$etaDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($eta)->format('Y-m-d');
} else {
$etaDate = date('Y-m-d', strtotime($eta));
}
}
if (! empty($etd)) {
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $etd)) {
[$day, $month, $year] = preg_split('/[-\/]/', $etd);
$etdDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($etd)) {
$etdDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($etd)->format('Y-m-d');
} else {
$etdDate = date('Y-m-d', strtotime($etd));
}
}
if (! empty($blRcvdDate)) {
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $blRcvdDate)) {
[$day, $month, $year] = preg_split('/[-\/]/', $blRcvdDate);
$formattedBlRcvdDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($blRcvdDate)) {
$formattedBlRcvdDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($blRcvdDate)->format('Y-m-d');
} else {
$formattedBlRcvdDate = date('Y-m-d', strtotime($blRcvdDate));
}
}
$inserted = ImportTransit::updateOrCreate(
[
'cri_rfq_number' => $criRfqNo,
],
[
'mail_received_date' => $formattedDate ?? null,
'pricol_ref_number' => $pricolRefNo ?? null,
'requester' => $requester ?? null,
'shipper' => $shipper ?? null,
'shipper_location' => $shipperLocation ?? null,
'shipper_invoice' => $shipperInv ?? null,
'shipper_invoice_date' => $formattedShipperDate ?? null,
'customs_agent_name' => $cha ?? null,
'eta_date' => $etaDate ?? null,
'status' => $status ?? null,
'delivery_location' => $dlyLoc ?? null,
'etd_date' => $etdDate ?? null,
'mode' => $mode ?? null,
'inco_terms' => $incoTerms ?? null,
'port_of_loading' => $portOfLoading ?? null,
'port_of_discharge' => $portOfDischarge ?? null,
'delivery_city' => $deliveryCity ?? null,
'packages' => $packages ?? null,
'type_of_package' => $typeOfPkg ?? null,
'gross_weight' => $grossWeight ?? null,
'volume' => $volumeWeight ?? null,
'bill_number' => $blNo ?? null,
'bill_received_date' => $formattedBlRcvdDate ?? null,
'vessel_number' => $vesselNo ?? null,
'created_by' => $operatorName,
]
);
}
catch (\Exception $e) {
Notification::make()
->title('Import Failed')
->body("Error occurred while processing row. Error : {$e->getMessage()}")
->danger()
->send();
}
}
if (! $inserted) {
Notification::make()
->title('Failed')
->body("Records insertion failed!")
->success()
->send();
}
else{
Notification::make()
->title('Success')
->body("Records inserted successfully!")
->success()
->send();
}
}
catch (\Exception $e) {
Notification::make()
->title('Import Failed')
->body("No records were inserted. Error : {$e->getMessage()}")
->danger()
->send();
}
}
})
->color('warning')
->importer(ImportTransitImporter::class)
->visible(function () {
return Filament::auth()->user()->can('view import transit');
}),

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,8 @@ use App\Models\InvoiceValidation;
use App\Models\Item;
use App\Models\Plant;
use App\Models\StickerMaster;
use App\Models\WireMasterPacking;
use DB;
use Filament\Facades\Filament;
use Filament\Notifications\Notification;
use Filament\Pages\Concerns\ExposesTableToWidgets;
@@ -174,17 +176,15 @@ class CreateInvoiceValidation extends CreateRecord
}
if (isset($matches[1])) {
$invoiceNumber = $matches[1];
$invoiceNumber = strtoupper($matches[1]);
}
} else {
$invoiceNumber = strtoupper($invoiceNumber);
}
// dd($invoiceNumber);
// ..
$updateStatus = $this->form->getState()['update_invoice'] ?? null;
$this->invoiceNumber = trim($this->form->getState()['invoice_number']) ?? $invoiceNumber;
$this->invoiceNumber = strtoupper(trim($this->form->getState()['invoice_number'])) ?? $invoiceNumber;
$invoiceType = null;
// $this->invoiceNumber = $this->invoiceNumber ?? $invoiceNumber;
@@ -581,7 +581,7 @@ class CreateInvoiceValidation extends CreateRecord
$materialType = $sticker->material_type;
// $sticker = StickerMaster::where('plant_id', $plantId)->whereHas('item', function ($query) use ($code) { $query->where('plant_id', $this->plantId)->where('code', $code); })->first();
if ($materialType == 1) {
if ($materialType == 1 || $materialType == 4) {
$totalExcelQty = 0;
foreach ($rows as $index => $row) {
@@ -1765,7 +1765,7 @@ class CreateInvoiceValidation extends CreateRecord
$materialType = $sticker->material_type;
// $sticker = StickerMaster::where('plant_id', $plantId)->whereHas('item', function ($query) use ($code) { $query->where('plant_id', $this->plantId)->where('code', $code); })->first();
if ($materialType == 1) {
if ($materialType == 1 || $materialType == 4) {
$totalExcelQty = 0;
foreach ($rows as $index => $row) {
@@ -2317,7 +2317,7 @@ class CreateInvoiceValidation extends CreateRecord
protected function refreshInvoiceTable()
{
$this->plantId = $this->form->getState()['plant_id'] ?? '';
$this->invoiceNumber = $this->form->getState()['invoice_number'] ?? '';
$this->invoiceNumber = strtoupper(trim($this->form->getState()['invoice_number'])) ?? '';
if (! empty($this->invoiceNumber)) {
$hasInvoice = InvoiceValidation::where('invoice_number', $this->invoiceNumber)->where('plant_id', $this->plantId)->first();
@@ -2378,7 +2378,7 @@ class CreateInvoiceValidation extends CreateRecord
$serialNumber = null;
$plantId = $this->form->getState()['plant_id'];
$this->plantId = $plantId;
$invoiceNumber = $this->form->getState()['invoice_number'];
$invoiceNumber = strtoupper(trim($this->form->getState()['invoice_number']));
$this->invoiceNumber = $invoiceNumber;
$plant = Plant::find($plantId);
@@ -2455,14 +2455,65 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
}
$pattern0 = '/^(?<item_code>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\|(?<batch_quantity>[0-9]+(?:\.[0-9]+)?)\s?kg$/i';
$pattern1 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\/(?<batch_quantity>.+)$/i';
$pattern2 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>.+)$/i';
$pattern3 = '/^(?<item_code>[^|]+)\|(?<batch_id>[^|]+)-(?<batch_count>.+)$/i';
$pattern4 = '/^MP-(?<code>.+)$/i';
$itemCode = '';
$batchNumber = '';
$curScanQty = '';
$wirePallet = '';
$curMaterialQty = '';
$curMaterialSer = '';
if (preg_match($pattern1, $serNo, $matches)) {
if (preg_match($pattern0, $serNo, $matches)) {
$itemCode = $matches['item_code'];
$this->currentItemCode = $itemCode;
$curScanQty = trim($matches['batch_quantity']);
$serialNumber = $matches['batch_id'].'-'.$matches['batch_count'];
$serNo = null;
if (empty($matches['batch_id']) || ! $matches['batch_id']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
} elseif (empty($matches['batch_count']) || ! $matches['batch_count']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
}
} elseif (preg_match($pattern1, $serNo, $matches)) {
$itemCode = $matches['item_code'];
$this->currentItemCode = $itemCode;
$batchNumber = $matches['batch_number'];
@@ -2470,11 +2521,45 @@ class CreateInvoiceValidation extends CreateRecord
$curScanQty = $matches['batch_quantity'];
$serNo = null;
if (empty($matches['batch_id']) || ! $matches['batch_id']) {
if (empty($matches['batch_number']) || ! $matches['batch_number']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
// .Mail
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'InvalidMaterialFormat')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
} elseif (empty($matches['batch_id']) || ! $matches['batch_id']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2508,42 +2593,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
// .Mail
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'InvalidMaterialFormat')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
} elseif (! is_numeric($curScanQty)) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2580,13 +2630,48 @@ class CreateInvoiceValidation extends CreateRecord
$this->currentItemCode = $itemCode;
$batchNumber = $matches['batch_number'];
$serialNumber = $matches['batch_id'].'-'.$matches['batch_count'];
$curMaterialSer = $matches['batch_number'].'-'.$matches['batch_id'];
$curMaterialQty = $matches['batch_count'];
$serNo = null;
if (empty($matches['batch_id']) || ! $matches['batch_id']) {
if (empty($matches['batch_number']) || ! $matches['batch_number']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
// .Mail
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'InvalidMaterialFormat')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
} elseif (empty($matches['batch_id']) || ! $matches['batch_id']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2619,7 +2704,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2659,7 +2744,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2693,7 +2778,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2723,6 +2808,294 @@ class CreateInvoiceValidation extends CreateRecord
return;
}
} elseif (preg_match($pattern4, $serNo, $matches)) {
$wirePallet = 'MP-'.$matches['code'];
$wirePattern = '/^MP-(?<code>\d+)$/i';
if (! preg_match($wirePattern, $serNo, $matches)) {
Notification::make()
->title('Invalid Master Packing QR Format')
->body("Scan valid Master Packing QR code proceed!<br>Sample format : 'MP-2601001'")
->danger()
->seconds(1)
->send();
return;
}
$wireMaster = WireMasterPacking::where('plant_id', $plantId)->where('wire_packing_number', $wirePallet)->first();
if (! $wireMaster) {
Notification::make()
->title('Master Pallet Not Found')
->body("No record found for this Master Packing QR $wirePallet")
->danger()
->seconds(2)
->send();
return;
}
$wireItemCodes = WireMasterPacking::join('items', 'items.id', '=', 'wire_master_packings.item_id')
->where('wire_master_packings.plant_id', $plantId)
->where('wire_master_packings.wire_packing_number', $wirePallet)
->pluck('items.code')
->unique()
->toArray();
$invoiceItemCodes = InvoiceValidation::join(
'sticker_masters',
'sticker_masters.id',
'=',
'invoice_validations.sticker_master_id'
)
->join(
'items',
'items.id',
'=',
'sticker_masters.item_id'
)
->where('invoice_validations.plant_id', $plantId)
->where('invoice_validations.invoice_number', $this->invoiceNumber)
->pluck('items.code')
->unique()
->toArray();
$missedCodes = array_diff($wireItemCodes, $invoiceItemCodes);
if (! empty($missedCodes)) {
Notification::make()
->title('Items Missing in Invoice')
->body('Item codes are missing in invoice: '.implode(', ', $missedCodes))
->danger()
->seconds(3)
->send();
return;
}
$duplicateSerial = [];
$weightExceeded = [];
$processedItems = [];
$invalidMaterialItems = [];
$wireItems1 = WireMasterPacking::join('items', 'items.id', '=', 'wire_master_packings.item_id')
->where('wire_master_packings.plant_id', $plantId)
->where('wire_master_packings.wire_packing_number', $wirePallet)
->select(
'items.code as item_code',
'wire_master_packings.process_order',
DB::raw('SUM(wire_master_packings.weight::numeric) as pallet_weight')
)
->groupBy('items.code', 'wire_master_packings.process_order')
->get();
foreach ($wireItems1 as $wireItem) {
$processOrder = $wireItem->process_order;
$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)
->exists();
if ($duplicate) {
$duplicateSerial[] = $processOrder;
continue;
}
$materialType = StickerMaster::where('item_id', function ($q) use ($itemCode) {
$q->select('id')->from('items')->where('code', $itemCode);
})->value('material_type');
if ($materialType != 3) {
if (! in_array($itemCode, $invalidMaterialItems)) {
$invalidMaterialItems[] = $itemCode;
}
}
$scannedQty = InvoiceValidation::join('sticker_masters', 'sticker_masters.id', '=', 'invoice_validations.sticker_master_id')
->join('items', 'items.id', '=', 'sticker_masters.item_id')
->where('invoice_validations.plant_id', $plantId)
->where('invoice_validations.invoice_number', $this->invoiceNumber)
->where('items.code', $itemCode)
->sum(DB::raw('invoice_validations.quantity::numeric'));
if ($palletWeight > $scannedQty) {
$weightExceeded[] = $itemCode;
}
}
if (! empty($invalidMaterialItems)) {
$uniqueInvalidItems = array_unique($invalidMaterialItems);
Notification::make()
->title('Invalid Material Type')
->body(implode(', ', $uniqueInvalidItems)."<br>Invalid material type found for the invoice '$invoiceNumber'.")
->danger()
->seconds(4)
->send();
return;
} elseif (! empty($weightExceeded)) {
Notification::make()
->title('Item Code Limit')
->body(implode(', ', $weightExceeded)."<br>Master pallet weight exceeds the remaining quantity in invoice '$invoiceNumber'.")
->danger()
->seconds(4)
->send();
return;
} elseif (! empty($duplicateSerial)) {
Notification::make()
->title('Duplicate Serial Number')
->body(implode(', ', $duplicateSerial)."<br>Duplicate Serial numbers found for the invoice '$invoiceNumber'.")
->danger()
->seconds(4)
->send();
return;
}
$itemExceeded = [];
$invoiceRows = InvoiceValidation::where('plant_id', $plantId)
->where('invoice_number', $invoiceNumber)
->whereNull('serial_number')
->get();
$palletItems = WireMasterPacking::where('wire_master_packings.plant_id', $plantId)
->where('wire_master_packings.wire_packing_number', $wirePallet)
->join('items', 'items.id', '=', 'wire_master_packings.item_id')
->select(
'items.code as item_code',
DB::raw('SUM(wire_master_packings.weight::numeric) as pallet_weight')
)
->groupBy('items.code')
->get();
foreach ($invoiceRows as $row) {
$itemCode = $row->stickerMaster->item->code ?? null;
if (! $itemCode) {
continue;
}
$pallet = $palletItems->firstWhere('item_code', $itemCode);
$palletWeight = $pallet->pallet_weight ?? 0;
$remainingQty = $row->quantity;
if ($palletWeight > $remainingQty) {
$itemExceeded[] = $itemCode;
}
}
$items = implode(', ', $itemExceeded);
if (! empty($itemExceeded)) {
Notification::make()
->title('Item Code Limit')
->body("Pallet weight exceeds remaining quantity for invoice number '$invoiceNumber'for below item codes <br>$items")
->danger()
->seconds(5)
->send();
return;
}
$wireItems = WireMasterPacking::join('items', 'items.id', '=', 'wire_master_packings.item_id')
->where('wire_master_packings.wire_packing_number', $wirePallet)
->select(
'items.code as item_code',
'wire_master_packings.process_order',
'wire_master_packings.weight as pallet_weight'
// DB::raw('(wire_master_packings.weight::numeric) as pallet_weight')
)
->get();
foreach ($wireItems as $wireItem) {
$itemCode = $wireItem->item_code;
$palletWeight = $wireItem->pallet_weight;
$processOrder = $wireItem->process_order;
if (! $processOrder || $palletWeight <= 0) {
continue;
}
$records = InvoiceValidation::join('sticker_masters', 'sticker_masters.id', '=', 'invoice_validations.sticker_master_id')
->join('items', 'items.id', '=', 'sticker_masters.item_id')
->where('invoice_validations.invoice_number', $invoiceNumber)
->where('invoice_validations.plant_id', $plantId)
->where('items.code', $itemCode)
->whereNull('invoice_validations.serial_number')
->where('invoice_validations.quantity', '>', 0)
->orderBy('invoice_validations.created_at')
->select('invoice_validations.*')
->get();
if ($records->isEmpty()) {
continue;
}
foreach ($records as $record) {
if ($palletWeight <= 0) {
break;
}
$usedQty = min($record->quantity, $palletWeight);
$record->quantity -= $usedQty;
if ($usedQty == $record->quantity + $usedQty) {
$record->serial_number = $processOrder;
$record->quantity = $palletWeight;
$record->save();
} else {
$record->save();
InvoiceValidation::create([
'sticker_master_id' => $record->sticker_master_id,
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => $processOrder,
'quantity' => $usedQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
}
$palletWeight -= $usedQty;
// if ($record->quantity <= 0) {
// $records->forget($key);
// }
}
}
$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();
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMQuan,
]);
return;
} else {
$itemCode = null;
$this->currentItemCode = '';
@@ -2733,7 +3106,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code proceed!<br>Sample formats are:<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1')
->seconds(1)
->send();
@@ -2866,6 +3239,12 @@ class CreateInvoiceValidation extends CreateRecord
$hasQuanTyp = ($record->material_type == 3) ? true : false;
if ($hasQuanTyp && $curMaterialSer && $curMaterialQty) {
$batchNumber = null;
$serialNumber = $curMaterialSer;
$curScanQty = $curMaterialQty;
}
$record = InvoiceValidation::where('invoice_number', $invoiceNumber)
->where('plant_id', $plantId)
->whereHas('stickerMasterRelation.item', function ($query) use ($itemCode) {
@@ -2948,7 +3327,7 @@ class CreateInvoiceValidation extends CreateRecord
Notification::make()
->danger()
->title('Invalid Quantity Material QR Format')
->body('Scan valid Quantity Material QR code proceed!<br>Ex:123456|12345|12345678|1/1')
->body('Scan valid Quantity Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
@@ -2994,8 +3373,8 @@ class CreateInvoiceValidation extends CreateRecord
$record->serial_number = $serialNumber;
$record->batch_number = $batchNumber;
$record->operator_id = $operatorName;
// $record->updated_by = $operatorName;
// $record->updated_at = now();
$record->updated_by = $operatorName;
$record->updated_at = now();
$record->save();
// InvoiceValidation::create([
@@ -3231,7 +3610,6 @@ class CreateInvoiceValidation extends CreateRecord
}
$record = InvoiceValidation::where('serial_number', $serialNumber)->where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first();
// $invoiceNumber = $this->form->getState()['invoice_number'];
if (! $record) {
Notification::make()

View File

@@ -0,0 +1,463 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\LeakTestReadingExporter;
use App\Filament\Resources\LeakTestReadingResource\Pages;
use App\Models\LeakTestReading;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms;
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\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;
class LeakTestReadingResource extends Resource
{
protected static ?string $model = LeakTestReading::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = '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')
->required()
->label('Plant Name')
->relationship('plant', 'name')
->searchable()
->reactive()
// ->columnSpan(1)
->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();
})
->default(function () {
return optional(LeakTestReading::latest()->first())->plant_id;
})
->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('lsrPlantError', null);
$set('lsrCodeError', null);
$set('lsrSerialError', null);
$set('item_code', null);
$set('serial_number', null);
$set('test_status', null);
if (! $plantId) {
$set('lsrPlantError', 'Please select a plant first.');
return;
}
})
->extraAttributes(fn ($get) => [
'class' => $get('lsrPlantError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('lsrPlantError') ? $get('lsrPlantError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('item_code')
->required()
->label('Item Code')
->placeholder('Scan the valid item code')
->autofocus(true)
->alphaNum()
->minLength(6)
->reactive()
->disabled(fn (Get $get) => ! empty($get('id')) && ! Filament::auth()->user()->hasRole('Super Admin'))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$code = $get('item_code');
$set('lsrCodeError', null);
if (! $code) {
$set('lsrCodeError', 'Scan the valid item code.');
return;
} else {
if (strlen($code) < 6) {
$set('lsrCodeError', 'Item code must be at least 6 digits.');
return;
} elseif (! ctype_alnum($code)) {
$set('item_code', null);
$set('lsrCodeError', 'Item code must contain only alpha-numeric characters!');
return;
} elseif (! preg_match('/^[a-zA-Z1-9][a-zA-Z0-9]{5,}$/', $code)) {
$set('item_code', null);
$set('lsrCodeError', "Item code should not begin with '0' or letter!");
return;
}
$set('lsrCodeError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('lsrCodeError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('lsrCodeError') ? $get('lsrCodeError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('serial_number')
->required()
->label('Serial Number')
->placeholder('Scan the valid serial number')
->alphaNum()
->minLength(9)
->reactive()
->disabled(fn (Get $get) => ! empty($get('id')) && ! Filament::auth()->user()->hasRole('Super Admin'))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$serial = $get('serial_number');
$set('lsrSerialError', null);
if (! $serial) {
$set('lsrSerialError', 'Scan the valid serial number!');
return;
} else {
if (strlen($serial) < 9) {
$set('lsrSerialError', 'Serial number must be at least 9 digits!');
return;
} elseif (! ctype_alnum($serial)) {
$set('serial_number', null);
$set('lsrSerialError', 'Serial number must contain only alpha-numeric characters!');
return;
} elseif (! preg_match('/^[1-9][a-zA-Z0-9]{8,}$/', $serial)) {
$set('serial_number', null);
$set('lsrSerialError', "Serial number should not begin with '0' or letter!");
return;
}
$set('lsrSerialError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('lsrSerialError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('lsrSerialError') ? $get('lsrSerialError') : null)
->hintColor('danger'),
Forms\Components\Select::make('test_status')
->required()
->label('Test Status')
->searchable()
->reactive()
// ->disabled(fn (Get $get) => ! empty($get('id')))
->options(function (callable $set, callable $get) {
$plantId = $get('plant_id');
$itemCode = $get('item_code');
$serialNumber = $get('serial_number');
if (! $plantId || ! $itemCode || ! $serialNumber) {
$set('test_status', null);
return [];
}
return [
'P' => 'PASS',
'F' => 'FAIL',
];
})
->default(function () {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? 'F' : 'P';
// return optional(CharacteristicApproverMaster::latest()->first())->approver_type ?? null;
}),
Forms\Components\TextInput::make('id')
->hidden()
->readOnly(),
])
->columns(['default' => 1, 'sm' => 2]),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
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')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item_code')
->label('Item Code')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('serial_number')
->label('Serial Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('test_status')
->label('Test Status')
->alignCenter()
->searchable()
->sortable()
->formatStateUsing(function ($state) {
return match ($state) {
'P' => 'PASS',
'F' => 'FAIL',
default => '-',
};
}),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->alignCenter()
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->searchPlaceholder('Search Serial Number')
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->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('leakTestReadings', function ($query) {
$query->whereNotNull('id');
})->orderBy('code')->pluck('name', 'id')->toArray();
}
})
->searchable()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get): void {
$set('item_code', null);
$set('serial_number', null);
$set('test_status', null);
}),
Select::make('item_code')
->label('Search by Item Code')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
return $plantId ? LeakTestReading::where('plant_id', $plantId)->pluck('item_code', 'item_code')->toArray() : [];
})
->searchable()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get): void {
$set('serial_number', null);
$set('test_status', null);
}),
TextInput::make('serial_number')
->label('Search by Serial Number')
->placeholder(placeholder: 'Enter Serial Number')
->afterStateUpdated(function ($state, callable $set, callable $get): void {
$set('test_status', null);
}),
Select::make('test_status')
->label('Search by Test Status')
->nullable()
->options(function () {
return [
'P' => 'PASS',
'F' => 'FAIL',
];
})
->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),
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['item_code']) && empty($data['serial_number']) && empty($data['test_status']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to'])) {
return $query->whereRaw('1 = 0');
}
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
$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['item_code'])) {
$query->where('item_code', $data['item_code']);
}
if (! empty($data['serial_number'])) {
$query->where('serial_number', 'like', '%'.$data['serial_number'].'%');
}
if (! empty($data['test_status'])) {
$query->where('test_status', $data['test_status']);
}
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_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: '.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['item_code'])) {
$indicators[] = 'Item Code: '.$data['item_code'];
}
if (! empty($data['serial_number'])) {
$indicators[] = 'Serial Number: '.$data['serial_number'];
}
if (! empty($data['test_status'])) {
$indicators[] = 'Test Status: '.$data['test_status'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
if (! empty($data['updated_from'])) {
$indicators[] = 'From: '.$data['updated_from'];
}
if (! empty($data['updated_to'])) {
$indicators[] = 'To: '.$data['updated_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ExportAction::make()
->label('Export Leak Test Readings')
->color('warning')
->exporter(LeakTestReadingExporter::class)
->visible(function () {
return Filament::auth()->user()->can('view export leak test reading');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListLeakTestReadings::route('/'),
'create' => Pages\CreateLeakTestReading::route('/create'),
'view' => Pages\ViewLeakTestReading::route('/{record}'),
'edit' => Pages\EditLeakTestReading::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\LeakTestReadingResource\Pages;
use App\Filament\Resources\LeakTestReadingResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateLeakTestReading extends CreateRecord
{
protected static string $resource = LeakTestReadingResource::class;
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Filament\Resources\LeakTestReadingResource\Pages;
use App\Filament\Resources\LeakTestReadingResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditLeakTestReading extends EditRecord
{
protected static string $resource = LeakTestReadingResource::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\LeakTestReadingResource\Pages;
use App\Filament\Resources\LeakTestReadingResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListLeakTestReadings extends ListRecords
{
protected static string $resource = LeakTestReadingResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}

View File

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

View File

@@ -43,6 +43,7 @@ class MachineResource extends Resource
Forms\Components\Select::make('plant_id')
->label('Plant Name')
->relationship('plant', 'name')
->searchable()
->required()
->columnSpan(1)
->reactive()
@@ -74,7 +75,8 @@ class MachineResource extends Resource
->hintColor('danger'),
Forms\Components\Select::make('line_id')
->label('Line Name')
->relationship('line', 'name')
// ->relationship('line', 'name')
->searchable()
->required()
->columnSpan(1)
->reactive()
@@ -114,7 +116,8 @@ class MachineResource extends Resource
->hintColor('danger'),
Forms\Components\Select::make('work_group_master_id')
->label('Group Work Center')
->relationship('workGroupMaster', 'name')
// ->relationship('workGroupMaster', 'name')
->searchable()
->required()
->columnSpan(1)
->reactive()
@@ -142,6 +145,7 @@ class MachineResource extends Resource
$lineId = $get('line_id');
if (! $lineId) {
$set('mGroupWorkError', 'Please select a line first.');
$set('work_group_master_id', null);
return;
} else {

View File

@@ -119,7 +119,7 @@ class MotorTestingMasterResource extends Resource
Forms\Components\TextInput::make('subassembly_code')
->label('Subassembly Code')
// ->required()
->placeholder('Scan the valid code')
->placeholder('Scan the subassembly code')
->reactive()
->alphaNum()
->minLength(6)
@@ -195,42 +195,49 @@ class MotorTestingMasterResource extends Resource
->reactive(),
Forms\Components\TextInput::make('hp')
->label('HP')
->placeholder('Scan the HP')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('kw')
->label('KW')
->placeholder('Scan the KW')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('volt')
->label('Volt')
->placeholder('Scan the volt')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('current')
->label('Current')
->placeholder('Scan the current')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('rpm')
->label('RPM')
->placeholder('Scan the RPM')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('torque')
->label('Torque')
->placeholder('Scan the torque')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('frequency')
->label('Frequency')
->placeholder('Scan the frequency')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
@@ -265,12 +272,14 @@ class MotorTestingMasterResource extends Resource
->reactive(),
Forms\Components\TextInput::make('ins_res_limit')
->label('Insulation Resistance Limit')
->placeholder('Scan the insulation resistance limit')
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
Forms\Components\Select::make('ins_res_type')
->label('Insulation Resistance Type')
->placeholder('Scan the insulation resistance type')
->default('O')
->selectablePlaceholder(false)
->options(function (callable $get) {
@@ -294,96 +303,112 @@ class MotorTestingMasterResource extends Resource
}),
Forms\Components\TextInput::make('res_ry_ll')
->label('Resistance RY LL')
->placeholder('Scan the resistance RY LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('res_ry_ul')
->label('Resistance RY UL')
->placeholder('Scan the resistance RY UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('res_yb_ll')
->label('Resistance YB LL')
->placeholder('Scan the resistance YB LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('res_yb_ul')
->label('Resistance YB UL')
->placeholder('Scan the resistance YB UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('res_br_ll')
->label('Resistance BR LL')
->placeholder('Scan the resistance BR LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('res_br_ul')
->label('Resistance BR UL')
->placeholder('Scan the resistance BR UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('lock_volt_limit')
->label('Lock Volt Limit')
->placeholder('Scan the lock volt limit')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('leak_cur_limit')
->label('Leakage Current Limit')
->placeholder('Scan the leakage current limit')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('lock_cur_ll')
->label('Lock Current LL')
->placeholder('Scan the lock current LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('lock_cur_ul')
->label('Lock Current UL')
->placeholder('Scan the lock current UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_cur_ll')
->label('No Load Current LL')
->placeholder('Scan the no load current LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_cur_ul')
->label('No Load Current UL')
->placeholder('Scan the no load current UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_pow_ll')
->label('No Load Power LL')
->placeholder('Scan the no load power LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_pow_ul')
->label('No Load Power UL')
->placeholder('Scan the no load power UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_spd_ll')
->label('No Load Speed LL')
->placeholder('Scan the no load speed LL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('noload_spd_ul')
->label('No Load Speed UL')
->placeholder('Scan the no load speed UL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
@@ -420,6 +445,7 @@ class MotorTestingMasterResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('item.category')
->label('Category')
->default('-')
->searchable()
->alignCenter()
->sortable(),
@@ -430,6 +456,7 @@ class MotorTestingMasterResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('subassembly_code')
->label('Subassembly Code')
->default('-')
->searchable()
->alignCenter()
->sortable(),
@@ -593,17 +620,34 @@ class MotorTestingMasterResource extends Resource
->options(function (callable $get) {
$pId = $get('Plant');
return Item::whereHas('motorTestingMasters', function ($query) use ($pId) {
if ($pId) {
$query->where('plant_id', $pId);
}
})->pluck('code', 'id');
if (! $pId) {
return [];
} else {
return Item::whereHas('motorTestingMasters', function ($query) use ($pId) {
if ($pId) {
$query->where('plant_id', $pId);
}
})->pluck('code', 'id');
}
})
->searchable()
->reactive(),
Select::make('subassembly_code')
->label('Search by Subassembly Code')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return [];
} else {
return MotorTestingMaster::where('plant_id', $plantId)->whereNotNull('subassembly_code')->select('subassembly_code')->distinct()->pluck('subassembly_code', 'subassembly_code');
}
})
->searchable()
->reactive(),
TextInput::make('description')
->label('Description')
->placeholder('Enter Description'),
->label('Model')
->placeholder('Enter Model'),
Radio::make('isi_type')
->label('ISI Model ?')
->boolean()
@@ -714,7 +758,7 @@ class MotorTestingMasterResource extends Resource
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Item']) && empty($data['description']) && empty($data['isi_type']) && empty($data['phase_type']) && empty($data['connection_type']) && empty($data['created_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {// || $data['isi_type'] == 'All')
if (empty($data['Plant']) && empty($data['Item']) && empty($data['subassembly_code']) && empty($data['description']) && empty($data['isi_type']) && empty($data['phase_type']) && empty($data['connection_type']) && empty($data['created_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {// || $data['isi_type'] == 'All')
return $query->whereRaw('1 = 0');
}
@@ -738,6 +782,10 @@ class MotorTestingMasterResource extends Resource
}
}
if (! empty($data['subassembly_code'])) {
$query->where('subassembly_code', $data['subassembly_code']);
}
if (! empty($data['description'])) {
$pId = $data['Plant'] ?? null;
$descIds = Item::where('description', 'like', '%'.$data['description'].'%')->whereHas('motorTestingMasters', function ($query) use ($pId) {
@@ -807,8 +855,12 @@ class MotorTestingMasterResource extends Resource
$indicators[] = 'Item Codes: '.$itemCode;
}
if (! empty($data['subassembly_code'])) {
$indicators[] = 'Subassembly Code: '.$data['subassembly_code'];
}
if (! empty($data['description'])) {
$indicators[] = 'Description: '.$data['description'];
$indicators[] = 'Model: '.$data['description'];
}
if ($data['isi_type'] == 'Y') {

View File

@@ -132,7 +132,7 @@ class PlantResource extends Resource
->hint(fn ($get) => $get('pNameError') ? $get('pNameError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('warehouse_number')
->required()
// ->required()
->label('Warehouse Number')
->placeholder('Scan the valid warehouse number')
->unique(ignoreRecord: true)

View File

@@ -221,6 +221,12 @@ class ProductCharacteristicsMasterResource extends Resource
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('category')
->label('Category')
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\Select::make('inspection_type')
->label('Inspection Type')
->searchable()
@@ -351,6 +357,11 @@ class ProductCharacteristicsMasterResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('category')
->label('Category')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('line.name')
->label('Line Name')
->alignCenter()

View File

@@ -247,6 +247,18 @@ class ProductionOrderResource extends Resource
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('item.description')
->label('Item Description')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.uom')
->label('Unit of Measure')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('quantity')
->label('Quantity')
->searchable()

View File

@@ -210,6 +210,41 @@ class CreateProductionOrder extends CreateRecord
}
}
public function printItemSerial()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
$plantCode = Plant::where('id', $plantId)->value('code');
if (empty($plantId)) {
Notification::make()
->title('Plant name cannot be empty!')
->danger()
->send();
return;
} elseif (empty($pOrder)) {
Notification::make()
->title('Production order cannot be empty!')
->danger()
->send();
return;
}
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
if (! $pOrderExists) {
Notification::make()
->title("Production Order '{$pOrder}' does not exist to get print!")
->danger()
->send();
return;
} else {
return redirect()->route('production-orders.printItemSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
}
}
public function printPanel()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;

View File

@@ -89,6 +89,74 @@ class EditProductionOrder extends EditRecord
}
// public function printItemSerial()
// {
// $pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
// $plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
// $plantCode = Plant::where('id', $plantId)->value('code');
// if (empty($plantId)) {
// Notification::make()
// ->title('Plant name cannot be empty!')
// ->danger()
// ->send();
// return;
// } elseif (empty($pOrder)) {
// Notification::make()
// ->title('Production order cannot be empty!')
// ->danger()
// ->send();
// return;
// }
// $pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
// if (! $pOrderExists) {
// Notification::make()
// ->title("Production Order '{$pOrder}' does not exist to get print!")
// ->danger()
// ->send();
// return;
// } else {
// return redirect()->route('production-orders.printItemSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
// }
// }
public function printItemSerial()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
$plantCode = Plant::where('id', $plantId)->value('code');
if (empty($plantId)) {
Notification::make()
->title('Plant name cannot be empty!')
->danger()
->send();
return;
} elseif (empty($pOrder)) {
Notification::make()
->title('Production order cannot be empty!')
->danger()
->send();
return;
}
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
if (! $pOrderExists) {
Notification::make()
->title("Production Order '{$pOrder}' does not exist to get print!")
->danger()
->send();
return;
} else {
return redirect()->route('production-orders.printItemSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
}
}
protected function getHeaderActions(): array
{
return [

View File

@@ -13,7 +13,7 @@ class ViewProductionOrder extends ViewRecord
{
protected static string $resource = ProductionOrderResource::class;
public function printProductionOrder()
public function printProductionOrder()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
@@ -89,6 +89,76 @@ class ViewProductionOrder extends ViewRecord
}
// public function printItemSerial()
// {
// $pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
// $plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
// $plantCode = Plant::where('id', $plantId)->value('code');
// if (empty($plantId)) {
// Notification::make()
// ->title('Plant name cannot be empty!')
// ->danger()
// ->send();
// return;
// } elseif (empty($pOrder)) {
// Notification::make()
// ->title('Production order cannot be empty!')
// ->danger()
// ->send();
// return;
// }
// $pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
// if (! $pOrderExists) {
// Notification::make()
// ->title("Production Order '{$pOrder}' does not exist to get print!")
// ->danger()
// ->send();
// return;
// } else {
// return redirect()->route('production-orders.printItemSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
// }
// }
public function printItemSerial()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
$plantCode = Plant::where('id', $plantId)->value('code');
if (empty($plantId)) {
Notification::make()
->title('Plant name cannot be empty!')
->danger()
->send();
return;
} elseif (empty($pOrder)) {
Notification::make()
->title('Production order cannot be empty!')
->danger()
->send();
return;
}
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
if (! $pOrderExists) {
Notification::make()
->title("Production Order '{$pOrder}' does not exist to get print!")
->danger()
->send();
return;
} else {
return redirect()->route('production-orders.printItemSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
}
}
protected function getHeaderActions(): array
{
return [

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,7 @@ class CreateQualityValidation extends CreateRecord
'checklistUpdated' => 'setChecklist',
'checklist-cancelled' => 'handleChecklistCancel',
'checklist-saved' => 'checkListSaved',
'trigger-create' => 'doCreate',
// 'trigger-create' => 'doCreate',
];
public function setChecklist($checklist)
@@ -89,13 +89,15 @@ class CreateQualityValidation extends CreateRecord
->where('plant_id', $plantId)
->first();
$categoryName = trim($item->category) ?? null;
if (!$item) {
$this->existingRecords = collect();
return false;
}
$this->existingRecords = ProductCharacteristicsMaster::where('plant_id', $plantId)
->where('item_id', $item->id)
->where('category', $categoryName)
->where('line_id', $lineId)
->get();
}
@@ -201,6 +203,7 @@ class CreateQualityValidation extends CreateRecord
$checklist = $this->data['data']['checklist'] ?? [];
if (count($this->existingRecords) > 0){
$this->showChecklist = true;
$this->halt();
}
@@ -223,10 +226,11 @@ class CreateQualityValidation extends CreateRecord
return;
}
$item_id = $item->id;
// $item_id = $item->id;
$categoryName = trim($item->category) ?? null;
$this->existingRecords = ProductCharacteristicsMaster::where('plant_id', $plant_id)
->where('item_id', $item_id)
->where('category', $categoryName)
->where('line_id', $line_id)
->get();
}

View File

@@ -267,6 +267,9 @@ class SerialValidationResource extends Resource
Tables\Columns\TextColumn::make('scanned_status')
->label('Scanned Status')
->alignCenter(),
Tables\Columns\TextColumn::make('panel_box_code')
->label('Panel Box Code')
->alignCenter(),
Tables\Columns\TextColumn::make('panel_box_supplier')
->label('Panel Box Supplier')
->alignCenter(),
@@ -296,12 +299,25 @@ class SerialValidationResource extends Resource
->dateTime()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('operator_id')
->label('Operator ID')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->dateTime()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->dateTime()
@@ -324,65 +340,392 @@ class SerialValidationResource extends Resource
// ->reactive()
// ]),
// Tables\Actions\Action::make('Import Serial Number')
// ->label('Import Serial Invoice')
// ->form([
// Select::make('plant_id')
// // ->options(Plant::pluck('name', 'id')->toArray()) // Fetch plant names and IDs
// ->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();
// })
// ->label('Select Plant')
// ->required()
// ->default(function () {
// return optional(SerialValidation::latest()->first())->plant_id;
// })
// ->afterStateUpdated(function ($state, callable $set, callable $get) {
// $set('invoice_serial_number', null);
// })
// ->reactive(),
// FileUpload::make('invoice_serial_number')
// ->label('Invoice Serial Number')
// // ->required()
// ->preserveFilenames() // <- this keeps the original filename
// ->storeFiles(false) // prevent auto-storing, we will store manually
// ->reactive()
// ->required()
// ->disk('local') // 'local' refers to the local storage disk defined in config/filesystems.php, typically pointing to storage/app.
// ->visible(fn (Get $get) => ! empty($get('plant_id')))
// ->directory('uploads/temp'),
// ])
// ->action(function (array $data) {
// $uploadedFile = $data['invoice_serial_number'];
// $disk = Storage::disk('local');
// $plantId = $data['plant_id'];
// // Get original filename
// $originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
// $originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
// // Store manually using storeAs to keep original name
// $path = $uploadedFile->storeAs('uploads/temp', $originalName, 'local'); // returns relative path
// // uploads/temp/3RA0018735.xlsx
// $fullPath = Storage::disk('local')->path($path);
// // /home/iot-dev/projects/pds/storage/app/private/uploads/temp/3RA0018735.xlsx
// $totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->count();
// if ($totQuan > 0) {
// $scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->count();
// if ($totQuan == $scanSQuan) {
// $invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
// $plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
// Notification::make()
// ->title("Serial invoice number : '$originalNameOnly' already completed the scanning process for plant : '$plantName'.")
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } else {
// $invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
// // $plantCode = $invoiceFirst ? (String)$invoiceFirst->plant->code : null;
// $plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
// $invoicePlantId = $invoiceFirst->plant_id;
// if ($plantId != $invoicePlantId) {
// Notification::make()
// ->title("Serial invoice number : '$originalNameOnly' already exists for plant : '$plantName'.<br>Choose the valid 'Plant' to proceed!")
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// }
// }
// $totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('plant_id', $plantId)->count();
// $scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
// if ($totQuan > 0 && $totQuan == $scanSQuan) {
// Notification::make()
// ->title('Serial invoice already completed the scanning process for selected plant.')
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// if ($fullPath && file_exists($fullPath)) {
// $rows = Excel::toArray(null, $fullPath)[0];
// if ((count($rows) - 1) <= 0) {
// Notification::make()
// ->title('Records Not Found')
// ->body("Import the valid 'Serial Invoice' file to proceed..!")
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// $invalidMatCodes = [];
// $invalidSerialCodes = [];
// $materialCodes = [];
// $missingSerials = [];
// $duplicateSerials = [];
// $seenSerialNumbers = [];
// $validRowsFound = false;
// foreach ($rows as $index => $row) {
// if ($index == 0) {
// continue;
// } // Skip header
// $materialCode = trim($row[0]);
// $serialNumber = trim($row[1]);
// if (empty($materialCode) && empty($serialNumber)) {
// continue;
// }
// if (! empty($materialCode)) {
// if (Str::length($materialCode) < 6 || ! ctype_alnum($materialCode)) {
// $invalidMatCodes[] = $materialCode;
// } else {
// if (empty($serialNumber)) {
// $missingSerials[] = $materialCode;
// } elseif (Str::length($serialNumber) < 9 || ! ctype_alnum($serialNumber)) {
// $invalidSerialCodes[] = $serialNumber;
// } else {
// if (in_array($serialNumber, $seenSerialNumbers)) {
// $duplicateSerials[] = $serialNumber;
// } else {
// $seenSerialNumbers[] = $serialNumber;
// $materialCodes[] = $materialCode;
// $validRowsFound = true;
// }
// }
// }
// } else {
// continue;
// }
// }
// $uniqueInvalidCodes = array_unique($invalidMatCodes);
// $uniqueMissingSerials = array_unique($missingSerials);
// $uniqueSerialCodes = array_unique($invalidSerialCodes);
// $duplicateSerialCodes = array_unique($duplicateSerials);
// if (! empty($uniqueInvalidCodes)) {
// Notification::make()
// ->title('Invalid Item Codes')
// ->body('The following item codes should contain minimum 6 digit alpha numeric values:<br>'.implode(', ', $uniqueInvalidCodes))
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } elseif (! empty($uniqueMissingSerials)) {
// Notification::make()
// ->title('Missing Serial Numbers')
// ->body("The following item codes doesn't have valid serial number:<br>".implode(', ', $uniqueMissingSerials))
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } elseif (! empty($uniqueSerialCodes)) {
// Notification::make()
// ->title('Invalid Serial Number')
// ->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>'.implode(', ', $uniqueSerialCodes))
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } elseif (! empty($duplicateSerialCodes)) {
// Notification::make()
// ->title('Duplicate Serial Numbers')
// ->body('The following serial numbers are already exist in imported excel:<br>'.implode(', ', $duplicateSerialCodes))
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// if (! $validRowsFound) {
// Notification::make()
// ->title('Invalid Serial Invoice')
// ->danger() // This makes the notification red to indicate an error
// ->body('Uploaded Excel sheet is empty or<br>contains no valid data.')
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// $uniqueCodes = array_unique($materialCodes);
// $matchedItems = StickerMaster::with('item')
// ->whereHas('item', function ($query) use ($uniqueCodes) {
// $query->whereIn('code', $uniqueCodes);
// })
// ->get();
// $matchedCodes = $matchedItems->pluck('item.code')->toArray();
// $missingCodes = array_diff($uniqueCodes, $matchedCodes);
// if (! empty($missingCodes)) {
// $missingCount = count($missingCodes);
// $message = $missingCount > 10 ? "'$missingCount' item codes are not found in database." : 'The following item codes are not found in database:<br>'.implode(', ', $missingCodes);
// Notification::make()
// ->title('Unknown Item Codes')
// ->body($message)
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// }
// // Check which codes have a material_type set (not null)
// $invalidCodes = $matchedItems
// ->filter(fn ($sticker) => ! empty($sticker->material_type)) // filter invalid
// ->pluck('item.code')
// ->toArray();
// if (count($invalidCodes) > 10) {
// Notification::make()
// ->title('Invalid item codes found')
// ->body(''.count($invalidCodes).'item codes found have material type.')
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } elseif (count($invalidCodes) > 0) {
// Notification::make()
// ->title('Invalid item codes found')
// ->body('Material invoice Item Codes found : '.implode(', ', $invalidCodes))
// ->danger()
// ->send();
// if ($disk->exists($path)) {
// $disk->delete($path);
// }
// return;
// } else {
// // Save full file path to session
// session(['uploaded_invoice_path' => $fullPath]);
// Notification::make()
// ->title('Serial invoice imported successfully.')
// ->success()
// ->send();
// }
// }
// })
Tables\Actions\Action::make('Import Serial Number')
->label('Import Serial Invoice')
->form([
Select::make('plant_id')
// ->options(Plant::pluck('name', 'id')->toArray()) // Fetch plant names and IDs
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
->label('Import Serial Invoice')
->form([
Select::make('plant_id')
// ->options(Plant::pluck('name', 'id')->toArray()) // Fetch plant names and IDs
->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();
})
->label('Select Plant')
->required()
->default(function () {
return optional(SerialValidation::latest()->first())->plant_id;
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('invoice_serial_number', null);
})
->reactive(),
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->searchable()
->label('Search by Plant Name')
->required()
->default(function () {
return optional(SerialValidation::latest()->first())->plant_id;
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('invoice_serial_number', null);
$plantId = $get('plant_id');
if (! $plantId) {
$set('invoice_serial_number', null);
FileUpload::make('invoice_serial_number')
->label('Invoice Serial Number')
// ->required()
->preserveFilenames() // <- this keeps the original filename
->storeFiles(false) // prevent auto-storing, we will store manually
->reactive()
->required()
->disk('local') // 'local' refers to the local storage disk defined in config/filesystems.php, typically pointing to storage/app.
->visible(fn (Get $get) => ! empty($get('plant_id')))
->directory('uploads/temp'),
])
->action(function (array $data) {
$uploadedFile = $data['invoice_serial_number'];
return;
}
$plantCode = Plant::find($plantId)?->code ?? null;
$disk = Storage::disk('local');
$directory = "uploads/temp/{$plantCode}";
if ($plantId && ! Storage::disk('local')->exists($directory)) {
Storage::disk('local')->makeDirectory($directory);
}
})
->reactive(),
$plantId = $data['plant_id'];
FileUpload::make('invoice_serial_number')
->label('Choose Serial Invoice')
->required()
->acceptedFileTypes([
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
// 'application/vnd.ms-excel', // Legacy .xls fallback if needed
])
->rules(['mimes:xlsx', 'max:50']) // Laravel validation: extension check
->maxSize(50)
->preserveFilenames() // <- this keeps the original filename
->reactive()
->storeFiles(false) // prevent auto-storing, we will store manually
->disk('local') // 'local' refers to the local storage disk defined in config/filesystems.php, typically pointing to storage/app.
->visible(fn (Get $get) => ! empty($get('plant_id')))
->directory(function (callable $get) {
$plant = Plant::find($get('plant_id'));
$plantCode = $plant?->code ?? null;
// Get original filename
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
return "uploads/temp/{$plantCode}";
})
->uploadingMessage('Uploading...')
->helperText('Only .xlsx files are allowed (Excel files).'),
])
->action(function (array $data) {
$uploadedFile = $data['invoice_serial_number'];
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$disk = Storage::disk('local');
// Store manually using storeAs to keep original name
$path = $uploadedFile->storeAs('uploads/temp', $originalName, 'local'); // returns relative path
// uploads/temp/3RA0018735.xlsx
$plantId = $data['plant_id'];
$fullPath = Storage::disk('local')->path($path);
// /home/iot-dev/projects/pds/storage/app/private/uploads/temp/3RA0018735.xlsx
$plant = Plant::find($plantId);
$plantCode = $plant?->code ?? null;
$totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->count();
if ($totQuan > 0) {
$scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->count();
if ($totQuan == $scanSQuan) {
$invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
$plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
// Get original filename
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
if ($extension != 'xlsx') {
throw new \Exception('Only .xlsx files allowed.');
}
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
$originalName = "{$originalNameOnly}.xlsx";
// Store manually using storeAs to keep original name
$path = $uploadedFile->storeAs("uploads/temp/{$plantCode}", $originalName, 'local'); // returns relative path
// uploads/temp/{$plantCode}/3RA0018735.xlsx
if (strlen($originalNameOnly) < 8 || ! ctype_alnum($originalNameOnly)) {
Notification::make()
->title("Serial invoice number : '$originalNameOnly' already completed the scanning process for plant : '$plantName'.")
->title("Serial invoice number : '$originalNameOnly' should contain minimum 8 digit alpha numeric values!")
->danger()
->send();
@@ -391,14 +734,71 @@ class SerialValidationResource extends Resource
}
return;
} else {
$invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
// $plantCode = $invoiceFirst ? (String)$invoiceFirst->plant->code : null;
$plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
$invoicePlantId = $invoiceFirst->plant_id;
if ($plantId != $invoicePlantId) {
}
$fullPath = Storage::disk('local')->path($path);
// /home/iot-dev/projects/pds/storage/app/private/uploads/temp/{$plantCode}/3RA0018735.xlsx
$totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->count();
if ($totQuan > 0) {
$scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->count();
if ($totQuan == $scanSQuan) {
$invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
$plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
Notification::make()
->title("Serial invoice number : '$originalNameOnly' already exists for plant : '$plantName'.<br>Choose the valid 'Plant' to proceed!")
->title("Serial invoice number : '$originalNameOnly' already completed the scanning process for plant : '$plantName'.")
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} else {
$invoiceFirst = SerialValidation::with('plant')->where('invoice_number', $originalNameOnly)->first();
// $plantCode = $invoiceFirst ? (String)$invoiceFirst->plant->code : null;
$plantName = $invoiceFirst ? (string) $invoiceFirst->plant->name : null;
$invoicePlantId = $invoiceFirst->plant_id;
if ($plantId != $invoicePlantId) {
Notification::make()
->title("Serial invoice number : '$originalNameOnly' already exists for plant : '$plantName'.<br>Choose the valid 'Plant' to proceed!")
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
}
}
$totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('plant_id', $plantId)->count();
$scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
if ($totQuan > 0 && $totQuan == $scanSQuan) {
Notification::make()
->title('Serial invoice already completed the scanning process for selected plant.')
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
if ($fullPath && file_exists($fullPath)) {
$rows = Excel::toArray(null, $fullPath)[0];
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Records Not Found')
->body("Import the valid 'Serial Invoice' file to proceed..!")
->danger()
->send();
@@ -408,223 +808,186 @@ class SerialValidationResource extends Resource
return;
}
}
}
$totQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('plant_id', $plantId)->count();
$scanSQuan = SerialValidation::where('invoice_number', $originalNameOnly)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
$invalidMatCodes = [];
$invalidSerialCodes = [];
$materialCodes = [];
$missingSerials = [];
$duplicateSerials = [];
$seenSerialNumbers = [];
$validRowsFound = false;
if ($totQuan > 0 && $totQuan == $scanSQuan) {
Notification::make()
->title('Serial invoice already completed the scanning process for selected plant.')
->danger()
->send();
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
} // Skip header
if ($disk->exists($path)) {
$disk->delete($path);
}
$materialCode = trim($row[0]);
$serialNumber = trim($row[1]);
return;
}
if (empty($materialCode) && empty($serialNumber)) {
continue;
}
if ($fullPath && file_exists($fullPath)) {
$rows = Excel::toArray(null, $fullPath)[0];
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Records Not Found')
->body("Import the valid 'Serial Invoice' file to proceed..!")
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$invalidMatCodes = [];
$invalidSerialCodes = [];
$materialCodes = [];
$missingSerials = [];
$duplicateSerials = [];
$seenSerialNumbers = [];
$validRowsFound = false;
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
} // Skip header
$materialCode = trim($row[0]);
$serialNumber = trim($row[1]);
if (empty($materialCode) && empty($serialNumber)) {
continue;
}
if (! empty($materialCode)) {
if (Str::length($materialCode) < 6 || ! ctype_alnum($materialCode)) {
$invalidMatCodes[] = $materialCode;
} else {
if (empty($serialNumber)) {
$missingSerials[] = $materialCode;
} elseif (Str::length($serialNumber) < 9 || ! ctype_alnum($serialNumber)) {
$invalidSerialCodes[] = $serialNumber;
if (! empty($materialCode)) {
if (Str::length($materialCode) < 6 || ! ctype_alnum($materialCode)) {
$invalidMatCodes[] = $materialCode;
} else {
if (in_array($serialNumber, $seenSerialNumbers)) {
$duplicateSerials[] = $serialNumber;
if (empty($serialNumber)) {
$missingSerials[] = $materialCode;
} elseif (Str::length($serialNumber) < 9 || ! ctype_alnum($serialNumber)) {
$invalidSerialCodes[] = $serialNumber;
} else {
$seenSerialNumbers[] = $serialNumber;
$materialCodes[] = $materialCode;
$validRowsFound = true;
if (in_array($serialNumber, $seenSerialNumbers)) {
$duplicateSerials[] = $serialNumber;
} else {
$seenSerialNumbers[] = $serialNumber;
$materialCodes[] = $materialCode;
$validRowsFound = true;
}
}
}
} else {
continue;
}
}
$uniqueInvalidCodes = array_unique($invalidMatCodes);
$uniqueMissingSerials = array_unique($missingSerials);
$uniqueSerialCodes = array_unique($invalidSerialCodes);
$duplicateSerialCodes = array_unique($duplicateSerials);
if (! empty($uniqueInvalidCodes)) {
Notification::make()
->title('Invalid Item Codes')
->body('The following item codes should contain minimum 6 digit alpha numeric values:<br>'.implode(', ', $uniqueInvalidCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($uniqueMissingSerials)) {
Notification::make()
->title('Missing Serial Numbers')
->body("The following item codes doesn't have valid serial number:<br>".implode(', ', $uniqueMissingSerials))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($uniqueSerialCodes)) {
Notification::make()
->title('Invalid Serial Number')
->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>'.implode(', ', $uniqueSerialCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($duplicateSerialCodes)) {
Notification::make()
->title('Duplicate Serial Numbers')
->body('The following serial numbers are already exist in imported excel:<br>'.implode(', ', $duplicateSerialCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! $validRowsFound) {
Notification::make()
->title('Invalid Serial Invoice')
->danger() // This makes the notification red to indicate an error
->body('Uploaded Excel sheet is empty or<br>contains no valid data.')
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$uniqueCodes = array_unique($materialCodes);
$matchedItems = StickerMaster::with('item')->where('plant_id', $plantId)
->whereHas('item', function ($query) use ($uniqueCodes, $plantId) {
$query->whereIn('code', $uniqueCodes)->where('plant_id', $plantId);
})
->get();
$matchedCodes = $matchedItems->pluck('item.code')->toArray();
$missingCodes = array_diff($uniqueCodes, $matchedCodes);
if (! empty($missingCodes)) {
$missingCount = count($missingCodes);
$message = $missingCount > 10 ? "'$missingCount' item codes are not found in sticker master." : 'The following item codes are not found in sticker master:<br>'.implode(', ', $missingCodes);
Notification::make()
->title('Unknown Item Codes')
->body($message)
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
// Check which codes have a material_type set (not null)
$invalidCodes = $matchedItems
->filter(fn ($sticker) => ! empty($sticker->material_type)) // filter invalid
->pluck('item.code')
->toArray();
if (count($invalidCodes) > 10) {
Notification::make()
->title('Invalid item codes found')
->body(''.count($invalidCodes).' item codes have material type.')
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (count($invalidCodes) > 0) {
Notification::make()
->title('Invalid item codes found')
->body('Material invoice Item Codes found : '.implode(', ', $invalidCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} else {
continue;
// Save full file path to session
session(['uploaded_invoice_path' => $fullPath]);
Notification::make()
->title('Serial invoice imported successfully.')
->success()
->send();
}
}
$uniqueInvalidCodes = array_unique($invalidMatCodes);
$uniqueMissingSerials = array_unique($missingSerials);
$uniqueSerialCodes = array_unique($invalidSerialCodes);
$duplicateSerialCodes = array_unique($duplicateSerials);
if (! empty($uniqueInvalidCodes)) {
Notification::make()
->title('Invalid Item Codes')
->body('The following item codes should contain minimum 6 digit alpha numeric values:<br>'.implode(', ', $uniqueInvalidCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($uniqueMissingSerials)) {
Notification::make()
->title('Missing Serial Numbers')
->body("The following item codes doesn't have valid serial number:<br>".implode(', ', $uniqueMissingSerials))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($uniqueSerialCodes)) {
Notification::make()
->title('Invalid Serial Number')
->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>'.implode(', ', $uniqueSerialCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (! empty($duplicateSerialCodes)) {
Notification::make()
->title('Duplicate Serial Numbers')
->body('The following serial numbers are already exist in imported excel:<br>'.implode(', ', $duplicateSerialCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
if (! $validRowsFound) {
Notification::make()
->title('Invalid Serial Invoice')
->danger() // This makes the notification red to indicate an error
->body('Uploaded Excel sheet is empty or<br>contains no valid data.')
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$uniqueCodes = array_unique($materialCodes);
$matchedItems = StickerMaster::with('item')
->whereHas('item', function ($query) use ($uniqueCodes) {
$query->whereIn('code', $uniqueCodes);
})
->get();
$matchedCodes = $matchedItems->pluck('item.code')->toArray();
$missingCodes = array_diff($uniqueCodes, $matchedCodes);
if (! empty($missingCodes)) {
$missingCount = count($missingCodes);
$message = $missingCount > 10 ? "'$missingCount' item codes are not found in database." : 'The following item codes are not found in database:<br>'.implode(', ', $missingCodes);
Notification::make()
->title('Unknown Item Codes')
->body($message)
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
// Check which codes have a material_type set (not null)
$invalidCodes = $matchedItems
->filter(fn ($sticker) => ! empty($sticker->material_type)) // filter invalid
->pluck('item.code')
->toArray();
if (count($invalidCodes) > 10) {
Notification::make()
->title('Invalid item codes found')
->body(''.count($invalidCodes).'item codes found have material type.')
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} elseif (count($invalidCodes) > 0) {
Notification::make()
->title('Invalid item codes found')
->body('Material invoice Item Codes found : '.implode(', ', $invalidCodes))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
} else {
// Save full file path to session
session(['uploaded_invoice_path' => $fullPath]);
Notification::make()
->title('Serial invoice imported successfully.')
->success()
->send();
}
}
})
})
->visible(function () {
return Filament::auth()->user()->can('view import serial validation invoice');
}),

View File

@@ -296,9 +296,10 @@ class StickerMasterResource extends Resource
Forms\Components\Select::make('material_type')
->label('Material Type')
->options([
'1' => 'Individual',
'2' => 'Bundle',
'3' => 'Quantity',
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
])
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -307,7 +308,7 @@ class StickerMasterResource extends Resource
$set('load_rate', 0);
}
if ($state !== '2') {
if ($state != '2' && $state != '4') {
$set('bundle_quantity', null);
} else {
$set('bundle_quantity', 2);
@@ -319,12 +320,12 @@ class StickerMasterResource extends Resource
Forms\Components\TextInput::make('bundle_quantity')
->label('Bundle Quantity')
->integer()
->readOnly(fn (callable $get) => $get('material_type') !== '2')
->readOnly(fn (callable $get) => $get('material_type') != 2 && $get('material_type') != 4)
->nullable()
->minValue(2)
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
if ($get('material_type') !== '2') {
if ($get('material_type') != 2 && $get('material_type') != 4) {
$set('bundle_quantity', null);
} elseif ($get('bundle_quantity') < 2) {
$set('bundle_quantity', 2);
@@ -655,10 +656,6 @@ class StickerMasterResource extends Resource
->label('Load Rate')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('bundle_quantity')
->label('Bundle Quantity')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('material_type')
->label('Material Type')
->default('-')
@@ -672,9 +669,14 @@ class StickerMasterResource extends Resource
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
default => '-',
};
}),
Tables\Columns\TextColumn::make('bundle_quantity')
->label('Bundle Quantity')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->alignCenter()
@@ -754,12 +756,13 @@ class StickerMasterResource extends Resource
->searchable()
->reactive(),
Select::make('material_type')
->label('Select Material Type')
->label('Search by Material Type')
->nullable()
->options([
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
])
->searchable()
->reactive(),
@@ -870,6 +873,8 @@ class StickerMasterResource extends Resource
$indicators[] = 'Material Type: Bundle';
} elseif ($data['material_type'] == 3) {
$indicators[] = 'Material Type: Quantity';
} elseif ($data['material_type'] == 4) {
$indicators[] = 'Material Type: Bundle Individual';
}
// $indicators[] = 'Material Type: '.$data['material_type'];
}

View File

@@ -967,6 +967,12 @@ class TempClassCharacteristicResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('winded_serial_number')
->label('WINDED SERIAL NUMBER')
->reactive()
@@ -1574,6 +1580,10 @@ class TempClassCharacteristicResource extends Resource
->label('ZQMM QTY')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('winded_serial_number')
->label('WINDED SERIAL NUMBER')
->alignCenter()

View File

@@ -14,6 +14,7 @@ use App\Models\MotorTestingMaster;
use App\Models\Plant;
use App\Models\TestingPanelReading;
use Barryvdh\DomPDF\Facade\Pdf;
use Closure;
// use Barryvdh\Reflection\DocBlock\Type\Collection;
use Filament\Facades\Filament;
use Filament\Forms;
@@ -36,6 +37,7 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Response;
// use Barryvdh\Snappy\Facades\SnappyPdf as PDF;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Facades\Excel;
// use App\Exports\TestingPanelReadingExport;
use PhpOffice\PhpSpreadsheet\IOFactory; // For loading Excel file
@@ -49,7 +51,7 @@ class TestingPanelReadingResource extends Resource
protected static ?string $navigationGroup = 'Testing Panel';
protected static ?int $navigationSort = 3;
protected static ?int $navigationSort = 4;
public static function form(Form $form): Form
{
@@ -95,7 +97,7 @@ class TestingPanelReadingResource extends Resource
->hintColor('danger'),
Forms\Components\Select::make('line_id')
->label('Line Name')
->relationship('line', 'name')
// ->relationship('line', 'name')
->searchable()
->options(function (callable $get) {
$plantId = $get('plant_id');
@@ -115,11 +117,12 @@ class TestingPanelReadingResource extends Resource
->reactive()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('motor_testing_master_id', null);
$set('machine_id', null);
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\Select::make('machine_id')
->label('Work Center')
->relationship('machine', 'work_center')
// ->relationship('machine', 'work_center')
->searchable()
->options(function (callable $get) {
$lineId = $get('line_id');
@@ -183,17 +186,92 @@ class TestingPanelReadingResource extends Resource
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
})
->rule(function (callable $get) {
return function (string $attribute, $value, Closure $fail) use ($get) {
$plantId = $get('plant_id');
$lineId = $get('line_id');
$machineId = $get('machine_id');
$itemId = $get('motor_testing_master_id');
$output = trim($value);
// $currentId = $get('id'); // current editing record id
if (! $plantId || ! $lineId || ! $machineId || ! $itemId) {
return;
}
if ($output == null || $output == '' || ! $output) {
$fail("Output can't be empty!"); // Output1 - Output99
} elseif (Str::length($output) < 7) {
$fail('Output must be at least 7 characters long!');
} elseif (Str::length($output) > 8) {
$fail('Output must be at most 8 characters long!');
} elseif (! ctype_alnum($output)) {
$fail('Output should contain only alpha-numeric values!');
} elseif (! preg_match('/^Output([1-9]|[1-9][0-9])$/', $output)) {
$fail("Output should be between 'Output1' and 'Output99'!");
}
};
}),
Forms\Components\TextInput::make('serial_number')
->label('Serial Number')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
})
->rule(function (callable $get) {
return function (string $attribute, $value, Closure $fail) use ($get) {
$plantId = $get('plant_id');
$lineId = $get('line_id');
$machineId = $get('machine_id');
$itemId = $get('motor_testing_master_id');
$serialNumber = trim($value);
// $currentId = $get('id'); // current editing record id
if (! $plantId || ! $lineId || ! $machineId || ! $itemId) {
return;
}
if ($serialNumber == null || $serialNumber == '' || ! $serialNumber) {
$fail("Serial number can't be empty!");
} elseif (Str::length($serialNumber) < 9) {
$fail('Serial number should contain minimum 9 digits!');
} elseif (! ctype_alnum($serialNumber)) {
$fail('Serial number should contain only alpha-numeric values!');
} elseif (! preg_match('/^[1-9][a-zA-Z0-9]{8,}$/', $serialNumber)) {
$fail("Serial number should not begin with '0' or letter!");
}
};
}),
Forms\Components\TextInput::make('winded_serial_number')
->label('Winded Serial Number')
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
})
->rule(function (callable $get) {
return function (string $attribute, $value, Closure $fail) use ($get) {
$plantId = $get('plant_id');
$lineId = $get('line_id');
$machineId = $get('machine_id');
$itemId = $get('motor_testing_master_id');
$serialNumber = trim($value);
// $currentId = $get('id'); // current editing record id
if (! $plantId || ! $lineId || ! $machineId || ! $itemId || ! $serialNumber) {
return;
}
if (Str::length($serialNumber) > 0 && Str::length($serialNumber) < 9) {
$fail('Winded serial number should contain minimum 9 digits!');
} elseif (! ctype_alnum($serialNumber)) {
$fail('Winded serial number should contain only alpha-numeric values!');
} elseif (! preg_match('/^[1-9][a-zA-Z0-9]{8,}$/', $serialNumber)) {
$fail("Winded serial number should not begin with '0' or letter!");
}
};
}),
Forms\Components\TextInput::make('before_fr_volt')
->label('Before FR Volt')
@@ -350,24 +428,40 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('hv_test')
Forms\Components\Select::make('hv_test')
->label('High Voltage Test')
->options([
'With Stood' => 'With Stood',
'Not With Stood' => 'Not With Stood',
])
->selectablePlaceholder(false)
->default('Not With Stood')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('batch_number')
->label('Batch Number')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('batch_count')
->label('Batch Count')
->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('result')
Forms\Components\Select::make('result')
->label('Result')
->options([
'PASS' => 'PASS', // Not With Stood
'FAIL' => 'FAIL',
])
->selectablePlaceholder(false)
->default('FAIL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
@@ -379,27 +473,28 @@ class TestingPanelReadingResource extends Resource
Forms\Components\TextInput::make('rework_count')
->label('Rework Count')
->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('update_count')
->label('Update Count')
->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('output_flag')
->label('Output Flag')
->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('tested_by')
->label('Tested By')
Forms\Components\Hidden::make('tested_by')
->default(fn () => Filament::auth()->user()?->name)
->required(),
Forms\Components\TextInput::make('updated_by')
->label('Updated By')
Forms\Components\Hidden::make('updated_by')
->default(fn () => Filament::auth()->user()?->name)
->required(),
Forms\Components\TextInput::make('id')
@@ -438,7 +533,7 @@ class TestingPanelReadingResource extends Resource
Tables\Columns\TextColumn::make('motorTestingMaster.item.code')
->label('Item Code')
->alignCenter(),
Tables\Columns\TextColumn::make('motorTestingMaster.subassembly_code')
Tables\Columns\TextColumn::make('motorTestingMaster.subassembly_code')
->label('Subassembly Code')
->alignCenter(),
Tables\Columns\TextColumn::make('motorTestingMaster.item.description')
@@ -639,7 +734,7 @@ class TestingPanelReadingResource extends Resource
})->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();
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -665,6 +760,24 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_code', null);
}),
Select::make('machine_name')
->label('Search by Work Center')
->searchable()
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
$lineId = $get('Line');
if (! $plantId || ! $lineId) {
return [];
}
return Machine::where('plant_id', $plantId)
->where('line_id', $lineId)
->pluck('work_center', 'id')
->toArray();
})
->reactive(),
Select::make('item_code')
->label('Search by Item Code')
->searchable()
@@ -687,30 +800,37 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_description', null);
}),
Select::make('machine_name')
->label('Search by Work Center')
->searchable()
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
$lineId = $get('Line');
if (! $plantId || ! $lineId) {
return [];
}
return Machine::where('plant_id', $plantId)
->where('line_id', $lineId)
->pluck('work_center', 'id')
->toArray();
})
->reactive(),
TextInput::make('serial_number')
->label('Serial Number')
->reactive()
->placeholder('Enter Serial Number'),
Select::make('subassembly_code')
->label('Search by Subassembly Code')
->searchable()
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if ($plantId) {
return MotorTestingMaster::whereHas('testingPanelReadings', function ($query) {
$query->whereNotNull('id');
})->orderBy('subassembly_code')->pluck('subassembly_code', 'id');
} else {
return [];
// return Item::whereHas('motorTestingMasters')
// ->pluck('code', 'id')
// ->toArray();
}
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_description', null);
}),
TextInput::make('winded_serial_number')
->label('Winded Serial Number')
->reactive()
->placeholder('Enter Winded Serial Number'),
Select::make('item_description')
->label('Model')
->label('Search by Model')
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
@@ -732,20 +852,19 @@ class TestingPanelReadingResource extends Resource
// ->pluck('description', 'id')
// ->toArray();
}
//return $query->pluck('description', 'description')->toArray();
// return $query->pluck('description', 'description')->toArray();
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_code', null);
}),
Select::make('output')
->label('Output')
->label('Search by Output')
->searchable()
->options(function () {
return TestingPanelReading::query()
return TestingPanelReading::whereNotNull('output')
->select('output')
->distinct()
->whereNotNull('output')
->orderBy('output')
->pluck('output', 'output') // key and label are both the output value
->toArray();
@@ -781,6 +900,7 @@ class TestingPanelReadingResource extends Resource
// })
// ->reactive(),
// ...
Select::make('connection')
->label('Connection')
->required()
@@ -805,13 +925,14 @@ class TestingPanelReadingResource extends Resource
// ..
TextInput::make('remark')
->label('Remark')
->reactive(),
->reactive()
->placeholder(placeholder: 'Enter Remark'),
TextInput::make('batch_number')
->label('Batch Number')
->reactive()
->placeholder(placeholder: 'Enter Batch Number'),
Select::make('result')
->label('Result')
->label('Search by Result')
->searchable()
->options(function () {
return TestingPanelReading::query()
@@ -823,7 +944,19 @@ class TestingPanelReadingResource extends Resource
->toArray();
})
->reactive(),
Select::make('tested_by')
->label('Tested By')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return TestingPanelReading::whereNotNull('tested_by')->select('tested_by')->distinct()->pluck('tested_by', 'tested_by');
} else {
return TestingPanelReading::where('plant_id', $plantId)->whereNotNull('tested_by')->select('tested_by')->distinct()->pluck('tested_by', 'tested_by');
}
})
->searchable()
->reactive(),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder(placeholder: 'Select From DateTime')
@@ -834,12 +967,35 @@ class TestingPanelReadingResource extends Resource
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
Select::make('updated_by')
->label('Updated By')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (! $plantId) {
return TestingPanelReading::whereNotNull('updated_by')->select('updated_by')->distinct()->pluck('updated_by', 'updated_by');
} else {
return TestingPanelReading::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) {
// dd($data);
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Line']) && empty($data['item_code']) && empty($data['machine_name']) && empty($data['item_description']) && empty($data['serial_number']) && empty($data['output']) && empty($data['phase']) && empty($data['connection']) && empty($data['remark']) && empty($data['batch_no']) && empty($data['result']) && empty($data['created_from']) && empty($data['created_to'])) {
if (empty($data['Plant']) && empty($data['Line']) && empty($data['item_code']) && empty($data['subassembly_code']) && empty($data['machine_name']) && empty($data['item_description']) && empty($data['serial_number']) && empty($data['winded_serial_number']) && empty($data['output']) && empty($data['phase']) && empty($data['connection']) && empty($data['remark']) && empty($data['batch_no']) && empty($data['result']) && empty($data['tested_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');
}
@@ -868,12 +1024,20 @@ class TestingPanelReadingResource extends Resource
});
}
if (! empty($data['subassembly_code'])) {
$query->where('motor_testing_master_id', $data['subassembly_code']);
}
if (! empty($data['machine_name'])) {
$query->where('machine_id', $data['machine_name']);
}
if (! empty($data['serial_number'])) {
$query->where('serial_number', $data['serial_number']);
$query->where('serial_number', 'like', '%'.$data['serial_number'].'%');
}
if (! empty($data['winded_serial_number'])) {
$query->where('winded_serial_number', 'like', '%'.$data['winded_serial_number'].'%');
}
if (! empty($data['item_description'])) {
@@ -919,11 +1083,11 @@ class TestingPanelReadingResource extends Resource
}
if (! empty($data['remark'])) {
$query->where('remark', $data['remark']);
$query->where('remark', 'like', '%'.$data['remark'].'%');
}
if (! empty($data['batch_number'])) {
$query->where('batch_number', $data['batch_number']);
$query->where('batch_number', 'like', '%'.$data['batch_number'].'%');
}
if (! empty($data['result'])) {
@@ -937,6 +1101,22 @@ class TestingPanelReadingResource extends Resource
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
if (! empty($data['tested_by'])) {
$query->where('tested_by', $data['tested_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']);
}
if (! empty($data['updated_by'])) {
$query->where('updated_by', $data['updated_by']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
@@ -953,11 +1133,14 @@ class TestingPanelReadingResource extends Resource
if (! empty($data['Line'])) {
$indicators[] = 'Line Name: '.Line::where('id', $data['Line'])->value('name');
}
if (! empty($data['machine_name'])) {
$indicators[] = 'Work Center: '.Machine::where('id', $data['machine_name'])->value('work_center');
}
if (! empty($data['item_code'])) {
$indicators[] = 'Item Code: '.Item::where('id', $data['item_code'])->value('code');
}
if (! empty($data['machine_name'])) {
$indicators[] = 'Work Center: '.Machine::where('id', $data['machine_name'])->value('work_center');
if (! empty($data['subassembly_code'])) {
$indicators[] = 'Subassembly Code: '.MotorTestingMaster::where('id', $data['subassembly_code'])->value('subassembly_code');
}
if (! empty($data['output'])) {
$indicators[] = 'Output: '.$data['output'];
@@ -969,8 +1152,8 @@ class TestingPanelReadingResource extends Resource
// if (!empty($data['phase'])) {
// $indicators[] = 'Phase: ' . $data['phase'];
// }
if (!empty($data['connection'])) {
$indicators[] = 'Connection: ' . $data['connection'];
if (! empty($data['connection'])) {
$indicators[] = 'Connection: '.$data['connection'];
}
if (! empty($data['remark'])) {
$indicators[] = 'Remark: '.$data['remark'];
@@ -986,6 +1169,10 @@ class TestingPanelReadingResource extends Resource
$indicators[] = 'Serial Number: '.$data['serial_number'];
}
if (! empty($data['tested_by'])) {
$indicators[] = 'Tested By: '.$data['tested_by'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
@@ -994,6 +1181,18 @@ class TestingPanelReadingResource extends Resource
$indicators[] = '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;
}),
])

View File

@@ -10,6 +10,7 @@ use App\Models\User;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Forms\Get;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
@@ -53,16 +54,19 @@ class UserResource extends Resource
->minLength(3)
// ->reactive()
->live(debounce: 600)
->disabled(fn (Get $get) => ! empty($get('id')) && Filament::auth()->user()?->name != 'Admin' && Filament::auth()->user()?->name != 'Dhanabalan S' && Filament::auth()->user()?->name != 'Ranjith B' && ($get('name') == 'Admin' || $get('name') == 'Dhanabalan S' || $get('name') == 'Ranjith B'))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('email', $state.'@cripumps.com');
if (Filament::auth()->user()?->name != 'Dhanabalan S') {
$set('email', $state.'@cripumps.com');
}
})
->maxLength(255),
Forms\Components\TextInput::make('email')
->label('Email')
->required()
// ->email()
->unique(ignoreRecord: true)
->required()
->readOnly()
->readOnly(fn () => Filament::auth()->user()?->name != 'Dhanabalan S')
// ->rule(function (callable $get) {
// return Rule::unique('users', 'email')
// ->ignore($get('id')); // Ignore current record during updates
@@ -75,10 +79,11 @@ class UserResource extends Resource
->label('Email Verified At'),
Forms\Components\TextInput::make('password')
->label('Password')
->required()
->password()
->minLength(3)
->revealable()
->required()
->disabled(fn (Get $get) => ! empty($get('id')) && Filament::auth()->user()?->name != 'Admin' && Filament::auth()->user()?->name != 'Dhanabalan S' && Filament::auth()->user()?->name != 'Ranjith B' && ($get('name') == 'Admin' || $get('name') == 'Dhanabalan S' || $get('name') == 'Ranjith B'))
// ->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->maxLength(255),
// Forms\Components\Select::make('roles')

View File

@@ -2,7 +2,10 @@
namespace App\Filament\Resources;
use App\Filament\Exports\VehicleEntryExporter;
use App\Filament\Imports\VehicleEntryImporter;
use App\Filament\Resources\VehicleEntryResource\Pages;
use App\Models\Item;
use App\Models\Plant;
use App\Models\VehicleEntry;
use Carbon\Carbon;
@@ -14,6 +17,12 @@ use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
class VehicleEntryResource extends Resource
{
@@ -43,6 +52,9 @@ class VehicleEntryResource extends Resource
Forms\Components\TextInput::make('vehicle_number')
->label('Vehicle Number')
->required(),
Forms\Components\TextInput::make('boom_opened')
->label('Boom Opened')
->required(),
Forms\Components\DateTimePicker::make('entry_time')
->label('Entry Time')
->required()
@@ -105,15 +117,21 @@ class VehicleEntryResource extends Resource
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('uuid')
->label('UUID')
->alignCenter()
->sortable()
->searchable(),
// Tables\Columns\TextColumn::make('uuid')
// ->label('UUID')
// ->alignCenter()
// ->sortable()
// ->searchable(),
Tables\Columns\TextColumn::make('vehicle_number')
->label('Vehicle Number')
->alignCenter()
->sortable()
->searchable()
->formatStateUsing(fn ($state) => strtoupper($state)),
Tables\Columns\TextColumn::make('boom_opened')
->label('Boom Opened')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('entry_time')
->label('Entry Time')
@@ -141,12 +159,22 @@ class VehicleEntryResource extends Resource
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->alignCenter()
->searchable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->searchable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->alignCenter()
@@ -156,7 +184,106 @@ class VehicleEntryResource extends Resource
])
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->searchable()
->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('vehicleEntries', 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('vehicle_number', null);
}),
TextInput::make('vehicle_number')
->label('Vehicle Number')
->reactive()
->placeholder('Enter Vehicle Number')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Rework', null);
}),
DateTimePicker::make('created_from')
->label('Created From')
->placeholder('Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->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['vehicle_number']) && empty($data['created_from']) && empty($data['created_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['vehicle_number'])) {
$query->where('vehicle_number', 'like', '%'.$data['vehicle_number'].'%');
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
// $query->orderBy('created_at', 'asc');
})
->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 Name: Choose plant to filter records.';
}
}
if (! empty($data['vehicle_number'])) {
$indicators[] = 'Vehicle Number: '.$data['vehicle_number'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
@@ -167,6 +294,18 @@ class VehicleEntryResource extends Resource
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->importer(VehicleEntryImporter::class)
->visible(function() {
return Filament::auth()->user()->can('view import vehicle entry');
}),
ExportAction::make()
->exporter(VehicleEntryExporter::class)
->visible(function() {
return Filament::auth()->user()->can('view export vehicle entry');
}),
]);
}

View File

@@ -0,0 +1,624 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\VisitorEntryExporter;
use App\Filament\Imports\VisitorEntryImporter;
use App\Filament\Resources\VisitorEntryResource\Pages;
use App\Filament\Resources\VisitorEntryResource\RelationManagers;
use App\Models\VisitorEntry;
use App\Models\EmployeeMaster;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\ImageEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Infolists\Components\Section;
use Carbon\Carbon;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
class VisitorEntryResource extends Resource
{
protected static ?string $model = VisitorEntry::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Gate Entry';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('register_id')
->label('Register ID')
->default(function () {
$datePart = Carbon::now()->format('ymd'); // 260527
$prefix = 'CRI' . $datePart . 'V';
// Get latest record for today
$lastRecord = VisitorEntry::where('register_id', 'like', $prefix . '%')
->latest('id')
->first();
if ($lastRecord) {
$lastNumber = (int) substr($lastRecord->register_id, -3);
$nextNumber = str_pad($lastNumber + 1, 3, '0', STR_PAD_LEFT);
} else {
$nextNumber = '001';
}
return $prefix . $nextNumber;
})
->readOnly(),
Forms\Components\TextInput::make('mobile_number')
->label('Mobile Number')
->length(10)
->reactive()
->extraInputAttributes([
'oninput' => 'this.value = this.value.replace(/[^0-9]/g, "").slice(0, 10)', // blocks non-numbers + limits to 10 chars
'maxlength' => 10,
])
->required()
->extraAttributes([
'id' => 'mobile_number_input',
'x-data' => '{ value: "" }',
'x-model' => 'value',
'wire:keydown.enter.prevent' => 'processMobile(value)',
]),
Forms\Components\TextInput::make('name')
->label('Name')
->required()
->reactive()
->extraInputAttributes([
'oninput' => 'this.value = this.value.replace(/[^a-zA-Z\s]/g, "")',
]),
Forms\Components\Select::make('type')
->label('Type')
->reactive()
->options([
'Student' => 'Student',
'Consultant' => 'Consultant',
'Supplier' => 'Supplier',
'InterviewCandidates' => 'Interview Candidates',
'Customers/Dealers' => 'Customers/Dealers',
'Bankers' => 'Bankers',
'ServiceProviders' => 'Service Providers',
'GovermentOfficials' => 'Government Officials',
'Other' => 'Other',
])
->required()
->dehydrateStateUsing(function ($state, callable $get) {
return $state == 'Other'
? $get('other_type')
: $state;
}),
Forms\Components\TextInput::make('other_type')
->label('Specify Type')
->reactive()
->visible(fn (callable $get) => $get('type') == 'Other')
->required(fn (callable $get) => $get('type') == 'Other')
->dehydrated(false),
Forms\Components\TextInput::make('company')
->label('Company')
->required(),
Forms\Components\Select::make('department')
->label('Employee Department')
->options(
EmployeeMaster::distinct()
->orderBy('department')
->pluck('department', 'department')
)
->searchable()
->required()
->reactive()
->afterStateUpdated(function (callable $set) {
$set('employee_master_id', null);
$set('code', null);
}),
// Forms\Components\Select::make('employee_master_id')
// ->label('Recipient Employee')
// ->required()
// ->options(function (callable $get) {
// $department = $get('department');
// if (!$department) {
// return [];
// }
// return \App\Models\EmployeeMaster::where('department', $department)
// ->pluck('name', 'id');
// })
// ->reactive()
// ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
// $department = $get('department');
// $employee = \App\Models\EmployeeMaster::where('id', $state)
// ->where('department', $department)
// ->first();
// $set('code', $employee ? $employee->code : '');
// }),
Forms\Components\Select::make('employee_master_id')
->label('Recipient Employee')
->required()
->searchable()
->options(function (callable $get) {
$department = $get('department');
if (!$department) {
return [];
}
// Always load ALL employees, filter by department if set
if ($department) {
return EmployeeMaster::where('department', $department)
->pluck('name', 'id');
}
// Fallback: load all so fill() can always match the ID
return EmployeeMaster::pluck('name', 'id');
})
->reactive()
->afterStateUpdated(function (callable $set, ?string $state) {
$employee = EmployeeMaster::find($state);
$set('code', $employee?->code ?? '');
}),
Forms\Components\TextInput::make('code')
->label('Employee Code')
->readOnly(),
Forms\Components\Textarea::make('purpose_of_visit')
->label('Purpose of Visit')
->required(),
Forms\Components\TextInput::make('number_of_person')
->numeric()
->default(1)
->required(),
Forms\Components\DateTimePicker::make('in_time')
->label('In Time')
->required()
->default(now()),
Forms\Components\DateTimePicker::make('out_time')
->label('Out Time'),
Forms\Components\DateTimePicker::make('valid_upto')
->label('Valid Upto')
->after('in_time')
->validationMessages([
'after' => 'Valid Upto must be after the In Time.',
]),
Forms\Components\View::make('components.webcam-field')
->columnSpanFull(),
Forms\Components\Hidden::make('photo'),
Forms\Components\Hidden::make('created_by')
->label('created_by')
->default(Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by')
->label('updated_by')
->default(Filament::auth()->user()?->name),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('No.')
->label('NO')
->alignCenter()
->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\ImageColumn::make('photo')
->label('Photo')
->disk('public')
->height(50)
->width(50)
// ->defaultImageUrl('https://ui-avatars.com/api/?name=Visitor&background=555&color=fff')
->defaultImageUrl(asset('images/profile.png'))
->alignCenter()
->extraImgAttributes(['style' => 'border-radius: 6px; object-fit: cover;']),
Tables\Columns\TextColumn::make('register_id')
->label('Register ID')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('type')
->label('Visitor Type')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('name')
->label('Visitor Name')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('mobile_number')
->label('Visitor Mobile Number')
->alignCenter()
->searchable()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('employeeMaster.name')
->label('Recipient Name')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('employeeMaster.code')
->label('Receipient ID')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('employeeMaster.department')
->label('Receipient Department')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('number_of_person')
->label('Number of Person')
->numeric()
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('in_time')
->label('In Time')
->searchable()
->dateTime()
->sortable()
->alignCenter(),
Tables\Columns\TextColumn::make('out_time')
->label('Out Time')
->searchable()
->dateTime()
->sortable()
->alignCenter(),
Tables\Columns\TextColumn::make('valid_upto')
->label('Valid Upto')
->searchable()
->dateTime()
->sortable()
->alignCenter()
->color(fn ($record) => $record->valid_upto && \Carbon\Carbon::parse($record->valid_upto)->isPast()
? 'danger'
: 'success'
),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true)
->alignCenter(),
])
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
TextInput::make('register_id')
->label('Register ID')
->reactive()
->placeholder('Enter Register ID')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('type', null);
}),
Select::make('type')
->label('Type')
->reactive()
->options([
'Student' => 'Student',
'Consultant' => 'Consultant',
'Supplier' => 'Supplier',
'InterviewCandidates' => 'Interview Candidates',
'Customers/Dealers' => 'Customers/Dealers',
'Bankers' => 'Bankers',
'ServiceProviders' => 'Service Providers',
'GovermentOfficials' => 'Government Officials',
'Other' => 'Other',
])
->placeholder('Choose Type')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('name', null);
}),
TextInput::make('other_type')
->label('Specify Type')
->placeholder('Enter Type')
->visible(fn (callable $get) => $get('type') == 'Other')
->required(fn (callable $get) => $get('type') == 'Other'),
TextInput::make('name')
->label('Visitor Name')
->reactive()
->placeholder('Enter Visitor Name')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('company', null);
}),
TextInput::make('company')
->label('Visitor Company')
->reactive()
->placeholder('Enter Visitor Company')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('employee_master_id', null);
}),
Select::make('employee_department')
->label('Employee Department')
->options(function () {
return EmployeeMaster::query()
->whereNotNull('department')
->distinct()
->orderBy('department')
->pluck('department', 'department')
->toArray();
})
->searchable()
->preload()
->reactive()
->placeholder('Select Department')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('employee_master_id', null);
}),
Select::make('employee_master_id')
->label('Employee Name')
->relationship('employeeMaster', 'name')
->searchable()
->preload()
->reactive()
->placeholder('Select Employee')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Rework', null);
}),
DateTimePicker::make('created_from')
->label('Created From')
->placeholder('Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->placeholder('Select To DateTime')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['register_id']) && empty($data['type']) && empty($data['name']) && empty($data['company']) && empty($data['employee_master_id']) && empty($data['created_from']) && empty($data['created_to'])) {
$query->where(function ($q) {
});
}
if (! empty($data['register_id'])) {
$query->where('register_id', $data['register_id']);
}
if (! empty($data['type'])) {
if ($data['type'] == 'Other') {
$query->where('type', 'like', '%'.$data['other_type'].'%');
}
else{
$query->where('type', $data['type']);
}
}
if (! empty($data['name'])) {
$query->where('name', 'like', '%'.$data['name'].'%');
}
if (! empty($data['company'])) {
$query->where('company', 'like', '%'.$data['company'].'%');
}
if (! empty($data['employee_department'])) {
$query->where('department', $data['employee_department']);
}
if (! empty($data['employee_master_id'])) {
$query->where('employee_master_id', $data['employee_master_id']);
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
// $query->orderBy('created_at', 'asc');
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['register_id'])) {
$indicators[] = 'Register ID: '.$data['register_id'];
}
if (! empty($data['type'])) {
$indicators[] = 'Type: '.$data['type'];
}
if (! empty($data['other_type'])) {
$indicators[] = 'Specify Type: '.$data['other_type'];
}
if (! empty($data['name'])) {
$indicators[] = 'Name: '.$data['name'];
}
if (! empty($data['company'])) {
$indicators[] = 'Company: '.$data['company'];
}
if (! empty($data['employee_department'])) {
$indicators[] = 'Employee Department: '.$data['employee_department'];
}
if (! empty($data['employee_master_id'])) {
$indicators[] = 'Employee Name: '.EmployeeMaster::where('id', $data['employee_master_id'])->value('name');
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->importer(VisitorEntryImporter::class)
->visible(function() {
return Filament::auth()->user()->can('view import visitor entries');
}),
ExportAction::make()
->exporter(VisitorEntryExporter::class)
->visible(function() {
return Filament::auth()->user()->can('view export visitor entries');
}),
]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
// ── Visitor Photo (full width at the top) ──
Section::make('Visitor Photo')
->schema([
ImageEntry::make('photo')
->label('')
->disk('public')
->height(220)
->defaultImageUrl(asset('images/profile.png'))
->extraImgAttributes([
'style' => 'border-radius: 10px; object-fit: cover;'
]),
])
->columnSpanFull(),
// ── Visitor Details ──
Section::make('Visitor Details')
->schema([
TextEntry::make('register_id')
->label('Register ID'),
TextEntry::make('name')
->label('Visitor Name'),
TextEntry::make('mobile_number')
->label('Mobile Number'),
TextEntry::make('type')
->label('Visitor Type')
->badge()
->color(fn (string $state): string => match ($state) {
'internal' => 'success',
'external' => 'warning',
default => 'gray',
}),
TextEntry::make('company')
->label('Company'),
TextEntry::make('purpose_of_visit')
->label('Purpose of Visit')
->columnSpanFull(),
])
->columns(2),
// ── Employee Details ──
Section::make('Recipient Details')
->schema([
TextEntry::make('employeeMaster.name')
->label('Recipient Employee'),
TextEntry::make('code')
->label('Employee Code'),
TextEntry::make('employeeMaster.department')
->label('Department'),
TextEntry::make('number_of_person')
->label('Number of Persons'),
])
->columns(2),
// ── Visit Timing ──
Section::make('Visit Timing')
->schema([
TextEntry::make('in_time')
->label('In Time')
->dateTime(),
TextEntry::make('out_time')
->label('Out Time')
->dateTime(),
TextEntry::make('valid_upto')
->label('Valid Upto')
->dateTime()
->badge()
->color(fn ($record) => $record->valid_upto && \Carbon\Carbon::parse($record->valid_upto)->isPast()
? 'danger'
: 'success'
),
])
->columns(2),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListVisitorEntries::route('/'),
'create' => Pages\CreateVisitorEntry::route('/create'),
'view' => Pages\ViewVisitorEntry::route('/{record}'),
'edit' => Pages\EditVisitorEntry::route('/{record}/edit'),
];
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}

View File

@@ -0,0 +1,142 @@
<?php
namespace App\Filament\Resources\VisitorEntryResource\Pages;
use App\Filament\Resources\VisitorEntryResource;
use App\Models\EmployeeMaster;
use App\Models\VisitorEntry;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Support\Facades\Storage;
use Livewire\Attributes\On;
use App\Mail\VisitorMail;
use Illuminate\Support\Facades\Mail;
class CreateVisitorEntry extends CreateRecord
{
protected static string $resource = VisitorEntryResource::class;
public $capturedPhoto;
public function processMobile($mobile)
{
$visitor = VisitorEntry::where('mobile_number', $mobile)->latest()->first();
if ($visitor) {
$employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first();
$this->form->fill([
'register_id' => $visitor->register_id ?? '',
'mobile_number' => $mobile ?? '',
'name' => $visitor->name ?? '',
'company' => $visitor->company ?? '',
'type' => $visitor->type ?? '',
'department' => $employee->department ?? '',
'employee_master_id' => $visitor->employee_master_id->name ?? '',
'code' => $employee->code ?? '',
]);
}
else {
$registerId = $this->form->getState()['register_id'] ?? '';
$this->form->fill([
'register_id' => $registerId ?? '',
'mobile_number' => $mobile ?? '',
'name' => $visitor->name ?? '',
'company' => $visitor->company ?? '',
'type' => $visitor->type ?? '',
'department' => $employee->department ?? '',
'employee_master_id' => $visitor->employee_master_id->name ?? '',
'code' => $employee->code ?? '',
]);
}
}
#[On('photo-captured')]
public function handlePhotoCapture(string $photo): void
{
$this->data['photo'] = $photo;
\Log::info('WEBCAM: photo-captured event received, length: ' . strlen($photo));
}
protected function mutateFormDataBeforeCreate(array $data): array
{
if (
!empty($data['photo']) &&
str_starts_with($data['photo'], 'data:image')
) {
try {
$imageData = explode(',', $data['photo'])[1];
$filename = 'visitor_' . time() . '_' . uniqid() . '.jpg';
$path = 'visitor-photos/' . $filename;
$decoded = base64_decode($imageData);
$saved = Storage::disk('public')->put($path, $decoded);
$data['photo'] = $path;
} catch (\Exception $e) {
\Log::error('PHOTO UPLOAD ERROR: ' . $e->getMessage());
}
}
return $data;
}
public function setPhoto(string $photo): void
{
$this->capturedPhoto = $photo;
$this->dispatch('photo-captured', photo: $photo)->to(\App\Filament\Resources\VisitorEntryResource\Pages\CreateVisitorEntry::class);
}
// ── Custom form action buttons ──
protected function getFormActions(): array
{
return [
$this->getCreateFormAction(),
$this->getCreateAnotherFormAction(),
Action::make('createAndPrint')
->label('Create & Print')
->color('success')
->icon('heroicon-o-printer')
->action(function () {
// Save the record using existing logic (calls mutateFormDataBeforeCreate internally)
$this->create();
// Open the badge print page in a new tab
$this->js("window.open('" . route('visitor.badge', $this->record->id) . "', '_blank')");
}),
$this->getCancelFormAction(),
];
}
protected function afterCreate(): void
{
$visitor = $this->record;
$employee = EmployeeMaster::find($visitor->employee_master_id);
if ($employee && !empty($employee->email)) {
Mail::to($employee->email)
->send(new VisitorMail($visitor)); // or ->send()
}
else{
\Log::warning('No email found for employee ID: ' . $visitor->employee_master_id);
}
}
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('view', ['record' => $this->record]);
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Filament\Resources\VisitorEntryResource\Pages;
use App\Filament\Resources\VisitorEntryResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Illuminate\Support\Facades\Storage;
use Livewire\Attributes\On;
class EditVisitorEntry extends EditRecord
{
protected static string $resource = VisitorEntryResource::class;
protected function getHeaderActions(): array
{
return [
Actions\ViewAction::make(),
Actions\DeleteAction::make(),
Actions\ForceDeleteAction::make(),
Actions\RestoreAction::make(),
];
}
// Receives the photo from the webcam component
#[On('photo-captured')]
public function handlePhotoCapture(string $photo): void
{
$this->data['photo'] = $photo;
}
// Runs automatically before the record is updated in the database
protected function mutateFormDataBeforeSave(array $data): array
{
if (
!empty($data['photo']) &&
str_starts_with($data['photo'], 'data:image')
) {
// Delete the old photo file if one exists
$oldPhoto = $this->record->photo;
if ($oldPhoto && Storage::disk('public')->exists($oldPhoto)) {
Storage::disk('public')->delete($oldPhoto);
}
// Save the new photo
$imageData = explode(',', $data['photo'])[1];
$filename = 'visitor_' . time() . '_' . uniqid() . '.jpg';
$path = 'visitor-photos/' . $filename;
Storage::disk('public')->put($path, base64_decode($imageData));
$data['photo'] = $path;
}
return $data;
}
}

View File

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

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Filament\Resources\VisitorEntryResource\Pages;
use App\Filament\Resources\VisitorEntryResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;
class ViewVisitorEntry extends ViewRecord
{
protected static string $resource = VisitorEntryResource::class;
protected function getHeaderActions(): array
{
return [
Actions\EditAction::make(),
Actions\Action::make('print')
->label('Print Badge')
->icon('heroicon-o-printer')
->color('success')
->url(fn () => route('visitor.badge', $this->record->id))
->openUrlInNewTab(),
];
}
}

View File

@@ -4,6 +4,8 @@ namespace App\Filament\Resources;
use App\Filament\Resources\WireMasterPackingResource\Pages;
use App\Models\CustomerPoMaster;
use App\Models\Item;
use App\Models\Line;
use App\Models\Plant;
use App\Models\WireMasterPacking;
use Filament\Facades\Filament;
@@ -17,6 +19,10 @@ use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\DateTimePicker;
use Str;
class WireMasterPackingResource extends Resource
{
@@ -269,7 +275,189 @@ class WireMasterPackingResource extends Resource
])
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->searchable()
->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('wireMasterPacking', 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);
}),
Select::make('Item')
->label('Search by Item Code')
->nullable()
->searchable()
->reactive()
->options(function (callable $get) {
$plantId = $get('Plant');
if (empty($plantId)) {
return [];
}
return Item::whereHas('wireMasterPacking', function ($query) use ($plantId) {
if ($plantId) {
$query->where('plant_id', $plantId);
}
})->pluck('code', 'id');
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('process_order', null);
}),
TextInput::make('wire_packing_number')
->label('Wire Packing Number')
->reactive()
->placeholder('Enter Wire Packing Number')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('process_order', null);
}),
TextInput::make('process_order')
->label('Process Order')
->reactive()
->placeholder('Enter Process Order')
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Rework', null);
}),
TextInput::make('customer_po_master_id')
->label('Customer PO')
->reactive()
->placeholder('Enter Customer PO'),
Select::make('wire_packing_status')
->label('Wire Packing Status')
->reactive()
->options([
'Completed' => 'Completed',
'Pending' => 'Pending',
]),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder('Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->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['Item']) && empty($data['process_order']) && empty($data['wire_packing_number']) && empty($data['customer_po_master_id']) && empty($data['wire_packing_status']) && empty($data['created_from']) && empty($data['created_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['Item'])) {
$query->where('item_id', $data['Item']);
}
if (! empty($data['process_order'])) {
$query->where('process_order', 'like', '%'.$data['process_order'].'%');
}
if (! empty($data['wire_packing_number'])) {
$query->where('wire_packing_number', 'like', '%'.$data['wire_packing_number'].'%');
}
if (!empty($data['customer_po_master_id'])) {
$customerPoId = CustomerPoMaster::where('customer_po', $data['customer_po_master_id'])
->where('plant_id', $data['Plant'])
->value('id');
$query->where('customer_po_master_id', $customerPoId);
}
if (! empty($data['wire_packing_status'])) {
if ($data['wire_packing_status'] == 'Pending') {
$query->where(function ($q) {
$q->whereNull('wire_packing_status')
->orWhere('wire_packing_status', '');
});
} else {
$query->where('wire_packing_status', $data['wire_packing_status']);
}
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
// $query->orderBy('created_at', 'asc');
})
->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 Name: Choose plant to filter records.';
}
}
if (! empty($data['Item'])) {
$indicators[] = 'Item Code: '.Item::where('id', $data['Item'])->value('code');
}
if (! empty($data['process_order'])) {
$indicators[] = 'Process Order: '.$data['process_order'];
}
if (! empty($data['wire_packing_number'])) {
$indicators[] = 'Wire Packing Number: '.$data['wire_packing_number'];
}
if (! empty($data['customer_po_master_id'])) {
$indicators[] = 'Customer PO: '.$data['customer_po_master_id'];
}
if (! empty($data['wire_packing_status'])) {
$indicators[] = 'Wire Packing Status: '.$data['wire_packing_status'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),

View File

@@ -259,7 +259,7 @@ class CreateWireMasterPacking extends CreateRecord
{
Notification::make()
->title("Scanned Weight Exceeds PO Quantity")
->body("Scanned weight '$weight' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPo' and Item '$materialCode'")
->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoName' and Item '$materialCode'")
->danger()
->duration(5000)
->send();

View File

@@ -40,6 +40,7 @@ class WorkGroupMasterResource extends Resource
Forms\Components\Select::make('plant_id')
->label('Plant Name')
->relationship('plant', 'name')
->searchable()
->reactive()
->columnSpan(1)
->required()
@@ -55,22 +56,20 @@ class WorkGroupMasterResource extends Resource
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
if (! $plantId) {
$set('pqPlantError', 'Please select a plant first.');
$set('name', null);
$set('description', null);
$set('operation_number', null);
return;
}
$set('validationError', null);
$set('pqPlantError', null);
$set('wgmPlantError', null);
$set('name', null);
$set('description', null);
$set('operation_number', null);
if (! $plantId) {
$set('wgmPlantError', 'Please select a plant first.');
return;
}
})
->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null)
->extraAttributes(fn ($get) => [
'class' => $get('wgmPlantError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('wgmPlantError') ? $get('wgmPlantError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('name')
->label('Group Work Center')

View File

@@ -1288,7 +1288,7 @@ class CharacteristicsController extends Controller
$machineId = $machine->id;
$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_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_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name',
$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_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_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name'
if ($itemCode != '' && $itemCode != null && $itemCode && Str::length($itemCode) > 0) {
$existingJobNo = ClassCharacteristic::where('aufnr', $jobNo)->first(); // ->where('machine_id', $machineId)->where('plant_id', $plantId)
@@ -1845,7 +1845,7 @@ class CharacteristicsController extends Controller
}
}
$masterFields = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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', 'pending_released_status'];
$masterFields = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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', 'pending_released_status'];
$isInsertOrUpdate = false;
@@ -2175,7 +2175,7 @@ class CharacteristicsController extends Controller
$columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
$characteristicsColumns = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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'];
$characteristicsColumns = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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'];
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
@@ -2709,7 +2709,7 @@ class CharacteristicsController extends Controller
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
$characteristicsColumns = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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'];
$characteristicsColumns = ['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_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', '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'];
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
@@ -2951,7 +2951,7 @@ class CharacteristicsController extends Controller
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
// $characteristicsColumns = ['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_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', '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', 'zqmm_qty'];
// $characteristicsColumns = ['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_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', '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', 'zqmm_qty', 'zmm_operating_temperature'];
// $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();

View File

@@ -50,6 +50,7 @@ class ProductionOrderController extends Controller
$qrCode = new QrCode($qrData);
$output = new Output\Png;
// $qrBinary = $output->output($qrCode, 100);
$qrBinary = $output->output($qrCode, 100);
$qrBase64 = base64_encode($qrBinary);
@@ -79,7 +80,8 @@ class ProductionOrderController extends Controller
$wareHouseNo = Plant::where('code', $plantCode)->first();
$wareNo = $wareHouseNo->warehouse_number;
$wareNo = $wareHouseNo->warehouse_number ?? null;
\Log::info('Plant Data', [
'plant' => $wareHouseNo ? $wareHouseNo->toArray() : null,
@@ -100,13 +102,20 @@ class ProductionOrderController extends Controller
$itemDes = $order->item->description ?? '';
$now = Carbon::now();
$year = $now->format('y');
$month = $now->format('m');
// $month = $now->format('m');
// $month = $now->format('m');
$stickers = [];
for ($i = $fromSerial; $i <= $toSerial; $i++)
{
$currentSerial = (string) $i;
$year = substr($currentSerial, -10, 2);
$month = substr($currentSerial, -8, 2);
$serial = str_pad($i, 6, '0', STR_PAD_LEFT);
$serialCount = substr(str_pad($i, 6, '0', STR_PAD_LEFT), -6);
@@ -128,7 +137,78 @@ class ProductionOrderController extends Controller
}
$pdf = Pdf::loadView('production-orders.printpanel', compact('stickers'))
->setPaper([0, 0, 113.39, 113.39]);
->setPaper([0, 0, 113.39, 113.39]);
return $pdf->stream('stickers.pdf');
}
}
public function printitemserial($production_order, $plantCode)
{
$order = ProductionOrder::where('production_order', $production_order)->first();
if (!$order) {
abort(404, 'Production Order not found');
}
else{
$fromSerial = (int) $order->from_serial_number;
$toSerial = (int) $order->to_serial_number;
$itemCode = $order->item->code ?? '';
$itemDes = $order->item->description ?? '';
$wareHouseNo = Plant::where('code', $plantCode)->first();
$wareNo = $wareHouseNo->warehouse_number ?? null;
$now = Carbon::now();
$year = $now->format('y');
$month = $now->format('m');
$stickers = [];
for ($i = $fromSerial; $i <= $toSerial; $i++)
{
$serial = str_pad($i, 6, '0', STR_PAD_LEFT);
if(!empty($wareNo)){
$serial = substr($serial, 0, 4) . $wareNo . substr($serial, 4);
$qrData = $itemCode . '|' . $serial;
} else {
$qrData = $itemCode . '|' . $serial;
$serial = str_pad($i, 6, '0', STR_PAD_LEFT);
}
// $qrData = $itemCode . '|' . $serial;
// $serialCount = substr(str_pad($i, 6, '0', STR_PAD_LEFT), -6);
// $serialWithWarehouse = substr($serial, 0, 4) . $wareNo . substr($serial, 4);
// $qrData = $itemCode . '|' . $serialWithWarehouse;
// $panel = $plantCode . $wareNo . '/' . $itemCode . '/' . $year.$month . '/' . $serialCount;
// $qrBase64 = base64_encode(
// QrCode::format('png')->size(100)->generate($qrData)
// );
$qrCode = new QrCode($qrData);
$output = new Output\Png;
// $qrBinary = $output->output($qrCode, 100);
$qrBinary = $output->output($qrCode, 100);
$qrBase64 = base64_encode($qrBinary);
$stickers[] = [
'serial' => $serial,
'qr' => 'data:image/png;base64,' . $qrBase64,
'production_order' => $itemCode,
'description' => $itemDes ?? ''
];
}
$pdf = Pdf::loadView('production-orders.printItemSerial', compact('stickers'))
->setPaper([0, 0, 170, 40]);
return $pdf->stream('stickers.pdf');
}

View File

@@ -3,7 +3,7 @@
namespace App\Http\Controllers;
use App\Models\Item;
use App\Models\Line;
use App\Models\LeakTestReading;
use App\Models\Machine;
use App\Models\MotorTestingMaster;
use App\Models\Plant;
@@ -23,9 +23,9 @@ class TestingPanelController extends Controller
}
/**
* Store a newly created resource in storage.
* Store a newly created readings in storage.
*/
public function store(Request $request)
public function storeReadings(Request $request)
{
$expectedUser = env('API_AUTH_USER');
$expectedPw = env('API_AUTH_PW');
@@ -48,12 +48,12 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code can't be empty!",
], 400);
], 404);
} elseif (Str::length($data['plant_code']) < 4 || ! is_numeric($data['plant_code']) || ! preg_match('/^[1-9]\d{3,}$/', $data['plant_code'])) {// !ctype_digit($data['plant_code'])
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid plant code found!',
], 400);
], 404);
}
$plant = Plant::where('code', $data['plant_code'])->first();
@@ -62,7 +62,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Plant not found!',
], 400);
], 404);
}
$plantId = $plant->id;
@@ -71,12 +71,12 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Group work center can't be empty!",
], 400);
], 404);
} elseif (Str::length($data['line_name']) < 0) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid group work center found!',
], 400);
], 404);
}
$gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->first();
@@ -84,7 +84,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Group work center not found!',
], 400);
], 404);
}
$gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->where('plant_id', $plantId)->first();
@@ -93,7 +93,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Group work center not found for the specified plant : '{$data['plant_code']}'!",
], 400);
], 404);
}
$gWorkCenterId = $gWorkCenter->id;
@@ -102,12 +102,12 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Work center can't be empty!",
], 400);
], 404);
} elseif (Str::length($data['machine_name']) < 0) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid work center found!',
], 400);
], 404);
}
$machine = Machine::where('work_center', $data['machine_name'])->first();
@@ -115,7 +115,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Work center not found!',
], 400);
], 404);
}
$machine = Machine::where('work_center', $data['machine_name'])->where('plant_id', $plantId)->first();
@@ -123,7 +123,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified plant : '{$data['plant_code']}'!",
], 400);
], 404);
}
$machine = Machine::where('work_center', $data['machine_name'])->where('work_group_master_id', $gWorkCenterId)->first();
@@ -132,7 +132,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified Group work center : '{$data['line_name']}'!",
], 400);
], 404);
}
@@ -141,7 +141,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified Plant : '{$data['plant_code']}' and Group work center : '{$data['line_name']}'!",
], 400);
], 404);
}
$lineId = $machine->line_id;
@@ -162,7 +162,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code can't be empty!",
], 400);
], 404);
}
// Collect duplicates
@@ -196,7 +196,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Duplicate item codes found in request: '.implode(', ', $duplicateItemCodes),
], 400);
], 404);
}
$uniqueInvalidCodes = array_unique($missedItemCodes);
@@ -209,7 +209,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in master for the specified plant : '{$plant->name}'!",
], 400);
], 404);
}
$insertedSnoCount = [];
@@ -326,7 +326,7 @@ class TestingPanelController extends Controller
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Missed serial numbers are: '.implode(', ', $missingSno),
], 400);
], 404);
}
}
} catch (\Exception $e) {
@@ -338,6 +338,328 @@ class TestingPanelController extends Controller
}
}
/**
* Store a newly created leak test status in storage.
*/
public function storeLeakTestStatus(Request $request)
{
$expectedUser = env('API_AUTH_USER');
$expectedPw = env('API_AUTH_PW');
$header_auth = $request->header('Authorization');
$expectedToken = $expectedUser.':'.$expectedPw;
if ('Bearer '.$expectedToken != $header_auth) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',
], 403);
}
$data = $request->all();
$plantCode = $data['plant_code'] ?? '';
$itemCode = $data['item_code'] ?? '';
$serialNumber = $data['serial_number'] ?? '';
$testStatus = $data['test_status'] ?? 'F';
if ($plantCode == null || $plantCode == '' || ! $plantCode) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code can't be empty!",
], 404);
} elseif (! is_numeric($plantCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' should contain only numeric values!",
], 404);
} elseif (Str::length($plantCode) < 4 || Str::length($plantCode) > 7) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' must be between 4 and 7 digits only!",
], 404);
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Invalid plant code '{$plantCode}' found!",
], 404);
}
if ($itemCode == null || $itemCode == '' || ! $itemCode) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code can't be empty!",
], 404);
} elseif (Str::length($itemCode) < 6) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code '{$itemCode}' should contain minimum 6 digits!",
], 404);
} elseif (! ctype_alnum($itemCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code '{$itemCode}' should contain only alpha-numeric values!",
], 404);
} elseif (! preg_match('/^[a-zA-Z1-9][a-zA-Z0-9]{5,}$/', $itemCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code '{$itemCode}' should not begin with '0'!",
], 404);
}
if ($serialNumber == null || $serialNumber == '' || ! $serialNumber) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Serial number can't be empty!",
], 404);
} elseif (Str::length($serialNumber) < 9) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' should contain minimum 9 digits!",
], 404);
} elseif (! ctype_alnum($serialNumber)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' should contain only alpha-numeric values!",
], 404);
} elseif (! preg_match('/^[1-9][a-zA-Z0-9]{8,}$/', $serialNumber)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' should not begin with '0' or letter!",
], 404);
}
if ($testStatus == null || $testStatus == '') {
$testStatus = 'F';
} elseif (Str::contains($testStatus, 'P', ignoreCase: true)) {
$testStatus = 'P';
} elseif (Str::contains($testStatus, 'F', ignoreCase: true)) {
$testStatus = 'F';
} else {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Leak test status must be 'P' or 'F'!",
], 404);
}
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
// return response("Plant not found.", 400)->header('Content-Type', 'text/plain');
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' not found!",
], 404);
}
$plantId = $plant->id;
try {
LeakTestReading::create([
'plant_id' => $plantId,
'item_code' => $itemCode,
'serial_number' => $serialNumber,
'test_status' => $testStatus,
]);
$existing = LeakTestReading::where('serial_number', $serialNumber)->where('item_code', $itemCode)->where('test_status', $testStatus)->where('plant_id', $plantId)->latest()->first();
if ($existing) {
return response()->json([
'status_code' => 'SUCCESS',
'status_description' => 'Successfully updated leak test status.',
], 200);
} else {
return response()->json([
'status_code' => 'SUCCESS',
'status_description' => 'Failed to update leak test status!',
], 200);
}
} catch (\Exception $e) {
// return response($e->getMessage(), 500)->header('Content-Type', 'text/plain');
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Store leak test status internal server error : '.$e?->getCode(),
], 500);
}
}
/**
* Get leak test status.
*/
public function getLeakTestStatus(Request $request)
{
$expectedUser = env('API_AUTH_USER');
$expectedPw = env('API_AUTH_PW');
$header_auth = $request->header('Authorization');
$expectedToken = $expectedUser.':'.$expectedPw;
// $data = $request->all();
if ('Bearer '.$expectedToken != $header_auth) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',
'status_response' => (object) [],
], 403);
}
$plantCode = trim($request->header('plant-code')) ?? null;
// $serialNumbers = $request->header('serial-numbers') ?? null;
$data = $request->all();
$serialNumbers = $data['serial_numbers'] ?? '';
// $serialNumbers = $request->input('serial_numbers', []);
if ($plantCode == null || $plantCode == '' || ! $plantCode) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code can't be empty!",
'status_response' => (object) [],
], 404);
} elseif (! is_numeric($plantCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' should contain only numeric values!",
'status_response' => (object) [],
], 404);
} elseif (Str::length($plantCode) < 4 || Str::length($plantCode) > 7) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' must be between 4 and 7 digits only!",
'status_response' => (object) [],
], 404);
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Invalid plant code '{$plantCode}' found!",
'status_response' => (object) [],
], 404);
}
if (empty($serialNumbers) || ! is_array($serialNumbers) || count($serialNumbers) == 0) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Serial numbers is required and must be a non-empty array.',
'status_response' => (object) [],
], 404);
}
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
// return response("Plant not found.", 400)->header('Content-Type', 'text/plain');
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant code '{$plantCode}' not found!",
'status_response' => (object) [],
], 404);
}
$plantId = $plant->id;
// $serialArray = array_map('trim', explode(',', $serialNumbers));
// // $serialNumber = 'SNO-'.Str::random(5).'-'.time(); // Default random serial number if not provided
$serialArray = $serialNumbers;
// Remove null, empty string, or falsy values from $serialArray
// $serialArray = array_filter($serialArray, function ($serial) {
// return $serial != null && $serial != '' && $serial;
// });
// Remove null/empty/falsy and reindex the array
$serialArray = array_values(array_filter($serialNumbers, function ($serial) {
return $serial != null && $serial != '' && is_string($serial) && trim($serial) != '';
}));
$serialStatus = [];
$validSerials = [];
$hasFail = false;
foreach ($serialArray as $serialNumber) {
if ($serialNumber == null || $serialNumber == '' || ! $serialNumber) {
$serialStatus[$serialNumber] = "Serial number can't be empty!";
$hasFail = true;
// $serialStatus[$serialNumber] = 'I';
} elseif (Str::length($serialNumber) < 9) {
$serialStatus[$serialNumber] = 'Should contain minimum 9 digits!';
$hasFail = true;
// $serialStatus[$serialNumber] = 'I';
} elseif (! ctype_alnum($serialNumber)) {
$serialStatus[$serialNumber] = 'Should contain only alpha-numeric values!';
$hasFail = true;
// $serialStatus[$serialNumber] = 'I';
} elseif (! preg_match('/^[1-9][a-zA-Z0-9]{8,}$/', $serialNumber)) {
$serialStatus[$serialNumber] = "Should not begin with '0' or letter!";
$hasFail = true;
// $serialStatus[$serialNumber] = 'I';
} else {
$validSerials[$serialNumber] = 'Not Found';
}
}
// $key = array_search('26021040180982', $serialArray);
// if ($key !== false) {
// unset($serialArray[$key]);
// }
if ($validSerials == null || empty($validSerials)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Has pending leak test!',
'status_response' => [$serialStatus],
], 404);
} else {
$serialArray = $validSerials; // nonExistingSerials
}
// Check which serial numbers exist in leak_test_readings table
$existingSerials = [];
$existingSerials = LeakTestReading::where('plant_id', $plantId)->whereIn('serial_number', array_keys($serialArray))
->pluck('test_status', 'serial_number')
->toArray();
if ($existingSerials == null || empty($existingSerials)) {
$mergedResult = $serialStatus + $serialArray; // array_merge($serialStatus, $serialArray);
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Has pending leak test!',
'status_response' => [$mergedResult],
], 404);
}
$hasFail = (! $hasFail) ? in_array('F', $existingSerials) : $hasFail;
// Map 'F' to 'Fail' and 'P' to 'Pass'
$existingSerials = array_map(function ($status) {
return $status === 'F' ? 'Fail' : ($status === 'P' ? 'Pass' : $status);
}, $existingSerials);
// Sort: Fail comes first, then Pass
uasort($existingSerials, function ($a, $b) {
// 'Fail' < 'Pass' so Fail comes first
return $a <=> $b;
});
// Get non-existing serial numbers (serials not in the database)
// $serialArray = array_diff($serialArray, array_keys($existingSerials));
$nonExistingSerials = array_diff_key($serialArray, $existingSerials);
if ($nonExistingSerials == null || empty($nonExistingSerials)) {
$mergedResult = $serialStatus + $existingSerials;
return response()->json([
'status_code' => $hasFail ? 'ERROR' : 'SUCCESS',
'status_description' => $hasFail ? 'Has pending leak test!' : 'Each serial number has passed the leak test!',
'status_response' => [$mergedResult],
], $hasFail ? 404 : 200);
} else {
$mergedResult = $serialStatus + $nonExistingSerials + $existingSerials; // nonExistingSerials
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Has pending leak test!',
'status_response' => [$mergedResult],
], 404);
}
}
/**
* Display the specified resource.
*/

View File

@@ -147,12 +147,22 @@ class VehicleController extends Controller
foreach ($data as $item) {
$uuid = $item['uuid'] ?? '';
$vehicleNo = trim($item['vehicle_number'] ?? '');
// $vehicleNo = strtoupper(trim($item['vehicle_number'] ?? ''));
$vehicleNo = strtoupper(
str_replace(' ', '', trim($item['vehicle_number'] ?? ''))
);
$entryTimeRaw = $item['entry_time'] ?? '';
$exitTimeRaw = $item['exit_time'] ?? '';
$duration = $item['duration'] ?? '';
$type = $item['type'] ?? '';
$manualVehicles = [
'TN01KK0004',
'TN01KK0001',
];
$boomOpened = in_array($vehicleNo, $manualVehicles) ? 'Manual' : 'Auto';
if(!empty($entryTimeRaw)){
$entryTime = $entryTimeRaw
? Carbon::createFromFormat('d/m/Y h:i:s A', $entryTimeRaw)
@@ -173,8 +183,10 @@ class VehicleController extends Controller
!empty($entryTime) &&
!empty($exitTime)
) {
$entry = Carbon::parse($entryTime); // 2026-05-22 16:13:35
$exit = Carbon::parse($exitTime); // 2026-05-25 14:17:29
$totalSeconds = $entryTime->diffInSeconds($exitTime);
$totalSeconds = $entry->diffInSeconds($exit);
$hours = floor($totalSeconds / 3600);
$minutes = floor(($totalSeconds % 3600) / 60);
@@ -195,6 +207,7 @@ class VehicleController extends Controller
],
[
'vehicle_number' => $vehicleNo,
'boom_opened' => $boomOpened,
'entry_time' => $entryTime,
'exit_time' => $exitTime ?? null,
'duration' => $duration ?: null,

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers;
use App\Models\VisitorEntry;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class VisitorBadgeController extends Controller
{
public function show($id)
{
$visitor = VisitorEntry::with('employeeMaster')->findOrFail($id);
$photoUrl = $visitor->photo
? Storage::disk('public')->url($visitor->photo)
: null;
return view('visitor.badge', compact('visitor', 'photoUrl'));
}
}

View File

@@ -50,6 +50,7 @@ class InvoiceDataTable extends Component
'refreshEmptyInvoice' => 'loadEmptyData',
'refreshInvoiceData' => 'loadData',
'refreshMaterialInvoiceData' => 'loadMaterialData',
'refreshMaterialInvoiceData1' => 'loadMaterialData1',
'openCapacitorModal' => 'showCapacitorInputBox',
];
@@ -406,49 +407,47 @@ class InvoiceDataTable extends Component
$scannedCount++;
}
}
if ($sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1) {
if ($sm->tube_sticker_motor == 1) {
// $sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1
if (! empty($sm->tube_sticker_motor) || ! empty($sm->tube_sticker_pump) || ! empty($sm->tube_sticker_pumpset)) {
if (! empty($sm->tube_sticker_motor)) {
$stickCount++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
if (
$sm->tube_sticker_pump == 1 ||
($sm->tube_sticker_pumpset != 1 &&
$sm->tube_sticker_pump != 1 &&
$sm->pack_slip_pump == 1)
) {
// ($sm->tube_sticker_pumpset != 1 && $sm->tube_sticker_pump != 1 && $sm->pack_slip_pump == 1)
if (! empty($sm->tube_sticker_pump) || (empty($sm->tube_sticker_pumpset) && empty($sm->tube_sticker_pump) && ! empty($sm->pack_slip_pump))) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->tube_sticker_pumpset == 1) {
if (! empty($sm->tube_sticker_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
}
}
} elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1) {
if ($sm->pack_slip_motor == 1) {
} elseif (! empty($sm->pack_slip_motor) || ! empty($sm->pack_slip_pump) || ! empty($sm->pack_slip_pumpset)) {
if (! empty($sm->pack_slip_motor)) {
$stickCount++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->pack_slip_pump == 1) {
if (! empty($sm->pack_slip_pump)) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->pack_slip_pumpset == 1) {
if (! empty($sm->pack_slip_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
@@ -596,12 +595,14 @@ class InvoiceDataTable extends Component
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
if ($matType === 1) {
if ($matType == 1) {
$row['material_type'] = 'Individual';
} elseif ($matType === 2) {
} elseif ($matType == 2) {
$row['material_type'] = 'Bundle';
} elseif ($matType === 3) {
} elseif ($matType == 3) {
$row['material_type'] = 'Quantity';
} elseif ($matType == 4) {
$row['material_type'] = 'Bundle Individual';
} else {
$row['material_type'] = 'N/A';
}
@@ -679,7 +680,7 @@ class InvoiceDataTable extends Component
// foreach ($this->invoiceData as &$row) {
// if (($row['code'] ?? '') === $this->currentItemCode && ($row['serial_number'] ?? '') === $this->currentSerialNumber) {
// if (($row['code'] ?? '') == $this->currentItemCode && ($row['serial_number'] ?? '') == $this->currentSerialNumber) {
// $row['panel_box_supplier'] = $supplier;
// $row['panel_box_code'] = $itemCode;
// $row['panel_box_serial_number'] = $serialNumber;
@@ -691,7 +692,7 @@ class InvoiceDataTable extends Component
// ->where('plant_id', $this->plantId)
// ->get()
// ->first(function ($validation) {
// return $validation->stickerMaster?->item?->code === $this->currentItemCode;
// return $validation->stickerMaster?->item?->code == $this->currentItemCode;
// });
// // dd($matchingValidation);
@@ -709,7 +710,7 @@ class InvoiceDataTable extends Component
// $packCnt = 1;
// $scanCnt = 1;
// // if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
// // if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
// if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
// $packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
// $packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
@@ -719,7 +720,7 @@ class InvoiceDataTable extends Component
// $scanCnt = $hadPumpQr ? $scanCnt + 1 : $scanCnt;
// $scanCnt = $hadPumpSetQr ? $scanCnt + 1 : $scanCnt;
// if ($packCnt === $scanCnt) {
// if ($packCnt == $scanCnt) {
// $matchingValidation->update([
// 'panel_box_supplier' => $supplier,
// 'panel_box_code' => $itemCode,
@@ -766,7 +767,7 @@ class InvoiceDataTable extends Component
// // 'scanned_quantity'=> $scannedQuantity,
// // ]);
// if ($totalQuantity === $scannedQuantity) {
// if ($totalQuantity == $scannedQuantity) {
// Notification::make()
// ->title('Completed: Serial Invoice')
// ->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
@@ -845,7 +846,7 @@ class InvoiceDataTable extends Component
$stickerCode = $row->stickerMasterRelation?->item?->code ?? null;
$serialNo = $row->serial_number ?? null;
if ($stickerCode === $this->currentItemCode && $serialNo === $this->currentSerialNumber) {
if ($stickerCode == $this->currentItemCode && $serialNo == $this->currentSerialNumber) {
$row['panel_box_supplier'] = $supplier;
$row['panel_box_code'] = $itemCode;
$row['panel_box_serial_number'] = $serialNumber;
@@ -857,7 +858,7 @@ class InvoiceDataTable extends Component
->where('plant_id', $this->plantId)
->get()
->first(function ($validation) {
return $validation->stickerMaster?->item?->code === $this->currentItemCode;
return $validation->stickerMaster?->item?->code == $this->currentItemCode;
});
// dd($matchingValidation);
@@ -875,7 +876,7 @@ class InvoiceDataTable extends Component
$packCnt = 1;
$scanCnt = 1;
// if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
// if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
$packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
@@ -932,7 +933,7 @@ class InvoiceDataTable extends Component
// 'scanned_quantity'=> $scannedQuantity,
// ]);
if ($totalQuantity === $scannedQuantity) {
if ($totalQuantity == $scannedQuantity) {
Notification::make()
->title('Completed: Serial Invoice')
->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")

View File

@@ -2,20 +2,24 @@
namespace App\Livewire;
use App\Models\SerialValidation;
use App\Models\StickerMaster;
use Filament\Facades\Filament;
use Filament\Notifications\Notification;
use Livewire\Component;
use App\Models\SerialValidation;
use Livewire\WithPagination;
class SerialValidationData extends Component
{
use WithPagination;
public $invoiceData = [];
public $plantId = 0;
public string $invoiceNumber = '';
public string $serialNumber = '';
public bool $completedInvoice = false;
@@ -30,22 +34,22 @@ class SerialValidationData extends Component
public bool $showCapacitorInput = false;
// protected $listeners = ['refreshInvoiceData' => 'loadData',];
// protected $listeners = ['refreshInvoiceData' => 'loadData',];
protected $listeners = [
'refreshCompletedInvoice' => 'loadCompletedData',
'refreshEmptyInvoice' => 'loadEmptyData',
'refreshInvoiceData' => 'loadData',
'refreshMaterialInvoiceData' => 'loadMaterialData',
'focusCapacitor' => 'focusCapacitorInput'
//'openCapacitorModal' => 'showCapacitorInputBox',
'focusCapacitor' => 'focusCapacitorInput',
// 'openCapacitorModal' => 'showCapacitorInputBox',
];
public $capacitorInput = '';
public $panel_box_supplier;
public $panel_box_item_code;
public $panel_box_code;
public $panel_box_serial_number;
@@ -96,43 +100,155 @@ class SerialValidationData extends Component
// $this->showCapacitorInput = false;
}
public function loadData($invoiceNumber, $plantId)
// public function loadData($invoiceNumber, $plantId)
// {
// $this->plantId = $plantId;
// $this->invoiceNumber = $invoiceNumber;
// $this->completedInvoice = false;
// $this->isSerial = true;
// $this->emptyInvoice = false;
// $this->hasSearched = true;
// $this->materialInvoice = false;
// // $this->showCapacitorInput = false;
// // ->where('serial_number', '!=', '')
// $this->invoiceData = SerialValidation::where('invoice_number', $this->invoiceNumber)
// ->where('plant_id', $plantId)->where('scanned_status', null)
// ->get()
// ->map(function ($record) {
// return [
// 'sticker_master_id' => $record->sticker_master_id,
// 'serial_number' => $record->serial_number,
// 'motor_scanned_status' => $record->motor_scanned_status ?? '',
// 'pump_scanned_status' => $record->pump_scanned_status ?? '',
// 'capacitor_scanned_status' => $record->capacitor_scanned_status ?? '',
// 'scanned_status_set' => $record->scanned_status_set ?? '',
// 'scanned_status' => $record->scanned_status ?? '', //
// 'panel_box_code' => $record->panel_box_code ?? '',
// 'panel_box_supplier' => $record->panel_box_supplier ?? '',
// 'panel_box_serial_number' => $record->panel_box_serial_number ?? '',
// 'created_at' => $record->created_at,
// 'operator_id' => $record->operator_id,
// ];
// })
// ->toArray();
// // Loop through and replace 'code' using related StickerMaster > Item > code
// foreach ($this->invoiceData as &$row) {
// // $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
// $row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
// }
// }
public function loadData($invoiceNumber, $plantId, $onCapFocus = false)
{
$this->plantId = $plantId;
$this->invoiceNumber = $invoiceNumber;
$this->plantId = $plantId;
$this->completedInvoice = false;
$this->isSerial = true;
$this->onCapFocus = $onCapFocus;
$this->emptyInvoice = false;
$this->hasSearched = true;
$this->materialInvoice = false;
// $this->showCapacitorInput = false;
//->where('serial_number', '!=', '')
$this->invoiceData = SerialValidation::where('invoice_number', $this->invoiceNumber)
->where('plant_id', $plantId)->where('scanned_status', null)
->get()
->map(function ($record) {
return [
'sticker_master_id' => $record->sticker_master_id,
'serial_number' => $record->serial_number,
'motor_scanned_status' => $record->motor_scanned_status ?? '',
'pump_scanned_status' => $record->pump_scanned_status ?? '',
'capacitor_scanned_status' => $record->capacitor_scanned_status ?? '',
'scanned_status_set' => $record->scanned_status_set ?? '',
'scanned_status' => $record->scanned_status ?? '',
'panel_box_supplier' => $record->panel_box_supplier ?? '',
'panel_box_serial_number' => $record->panel_box_serial_number ?? '',
'created_at' => $record->created_at,
'operator_id' => $record->operator_id,
];
})
->toArray();
$this->resetPage();
$this->packageCount = 0;
//Loop through and replace 'code' using related StickerMaster > Item > code
foreach ($this->invoiceData as &$row) {
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
}
$records = SerialValidation::with('stickerMasterRelation')
->where('invoice_number', $this->invoiceNumber)
->where('plant_id', $this->plantId)
->get();
$this->packageCount = $records->sum(function ($record) {
$sm = $record->stickerMasterRelation;
if (! $sm) {
return 0;
}
$stickCount = 0;
$scannedCount = 0;
if (! empty($sm->panel_box_code)) {
$stickCount++;
if ($record->capacitor_scanned_status == 1) {
$scannedCount++;
}
}
// $sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1
if (! empty($sm->tube_sticker_motor) || ! empty($sm->tube_sticker_pump) || ! empty($sm->tube_sticker_pumpset)) {
if (! empty($sm->tube_sticker_motor)) {
$stickCount++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
// ($sm->tube_sticker_pumpset != 1 && $sm->tube_sticker_pump != 1 && $sm->pack_slip_pump == 1)
if (! empty($sm->tube_sticker_pump) || (empty($sm->tube_sticker_pumpset) && empty($sm->tube_sticker_pump) && ! empty($sm->pack_slip_pump))) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if (! empty($sm->tube_sticker_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
}
}
} elseif (! empty($sm->pack_slip_motor) || ! empty($sm->pack_slip_pump) || ! empty($sm->pack_slip_pumpset)) {
if (! empty($sm->pack_slip_motor)) {
$stickCount++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
if (! empty($sm->pack_slip_pump)) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if (! empty($sm->pack_slip_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
}
}
}
return max($stickCount - $scannedCount, 0);
});
$this->dispatch(
$onCapFocus ? 'focus-capacitor-input' : 'focus-serial-number'
);
}
public function getInvoiceRecordsProperty()
{
return SerialValidation::with('stickerMasterRelation.item')
->where('invoice_number', $this->invoiceNumber)
->where('plant_id', $this->plantId)
->where(function ($query) {
$query->whereNull('scanned_status')
->orWhere('scanned_status', '');
})
// ->when($this->hasSearched, function ($query) {
// $query->where('invoice_number', $this->invoiceNumber)
// ->where('plant_id', $this->plantId)
// ->where('scanned_status', '=', '');
// })
->paginate(6);
}
public function loadMaterialData($invoiceNumber, $plantId)
@@ -146,43 +262,36 @@ class SerialValidationData extends Component
$this->materialInvoice = true;
// $this->showCapacitorInput = false;
//->where('serial_number', '!=', '')
// ->where('serial_number', '!=', '')
$this->invoiceData = SerialValidation::where('invoice_number', $this->invoiceNumber)->where('plant_id', $plantId)->where('serial_number', null)
->get()
->map(function ($record) {
return [
'sticker_master_id' => $record->sticker_master_id,
// 'material_type' => StickerMaster::where('id', $record->sticker_master_id)->first()->material_type ?? '',
'quantity' => $record->quantity ?? '',
'serial_number' => $record->serial_number ?? '',
'batch_number' => $record->batch_number ?? '',
'created_at' => $record->created_at,
'operator_id' => $record->operator_id,
];
})
->toArray();
->get()
->map(function ($record) {
return [
'sticker_master_id' => $record->sticker_master_id,
// 'material_type' => StickerMaster::where('id', $record->sticker_master_id)->first()->material_type ?? '',
'quantity' => $record->quantity ?? '',
'serial_number' => $record->serial_number ?? '',
'batch_number' => $record->batch_number ?? '',
'created_at' => $record->created_at,
'operator_id' => $record->operator_id,
];
})
->toArray();
//Loop through and replace 'code' using related StickerMaster > Item > code
// Loop through and replace 'code' using related StickerMaster > Item > code
foreach ($this->invoiceData as &$row) {
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
if($matType === 1)
{
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
if ($matType === 1) {
$row['material_type'] = 'Individual';
}
else if($matType === 2)
{
} elseif ($matType === 2) {
$row['material_type'] = 'Bundle';
}
else if($matType === 3)
{
} elseif ($matType === 3) {
$row['material_type'] = 'Quantity';
}
else
{
} else {
$row['material_type'] = 'N/A';
}
}
}
}
@@ -216,11 +325,11 @@ class SerialValidationData extends Component
$user = Filament::auth()->user();
$operatorName = $user->name;
if (!$this->capacitorInput) {
if (! $this->capacitorInput) {
return;
}
if (!preg_match('/^[^\/]+\/[^\/]+\/.+$/', $this->capacitorInput)) {
if (! preg_match('/^[^\/]+\/[^\/]+\/.+$/', $this->capacitorInput)) {
Notification::make()
->title('Invalid Panel Box QR Format:')
->body('Scan the valid panel box QR code to proceed!')
@@ -228,6 +337,7 @@ class SerialValidationData extends Component
// ->duration(3000)
->seconds(2)
->send();
return;
}
@@ -239,9 +349,9 @@ class SerialValidationData extends Component
$existsInStickerMaster = StickerMaster::where('panel_box_code', $itemCode)->where('plant_id', $this->plantId)->whereHas('item', function ($query) {
$query->where('code', $this->currentItemCode);
})
->exists();
->exists();
if (!$existsInStickerMaster) {
if (! $existsInStickerMaster) {
Notification::make()
->title('Unknown: Panel Box Code')
->body("Unknown panel box code: $itemCode found for item code: $this->currentItemCode")
@@ -250,6 +360,7 @@ class SerialValidationData extends Component
->seconds(2)
->send();
$this->capacitorInput = '';
return;
}
@@ -259,7 +370,7 @@ class SerialValidationData extends Component
($row['serial_number'] ?? '') === $this->currentSerialNumber
) {
$row['panel_box_supplier'] = $supplier;
$row['panel_box_item_code'] = $itemCode;
$row['panel_box_code'] = $itemCode;
$row['panel_box_serial_number'] = $serialNumber;
$row['capacitor_scanned_status'] = 1;
// $row['scanned_status_set'] = true;
@@ -286,47 +397,41 @@ class SerialValidationData extends Component
$packCnt = 1;
$scanCnt = 1;
// if($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
if($hasMotorQr || $hasPumpQr || $hasPumpSetQr)
{
if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
$packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
$packCnt = $hasPumpSetQr ? $packCnt + 1 : $packCnt;
$scanCnt = $hadMotorQr ? $scanCnt + 1: $scanCnt;
$scanCnt = $hadPumpQr ? $scanCnt + 1: $scanCnt;
$scanCnt = $hadPumpSetQr ? $scanCnt + 1: $scanCnt;
$scanCnt = $hadMotorQr ? $scanCnt + 1 : $scanCnt;
$scanCnt = $hadPumpQr ? $scanCnt + 1 : $scanCnt;
$scanCnt = $hadPumpSetQr ? $scanCnt + 1 : $scanCnt;
if($packCnt === $scanCnt)
{
if ($packCnt === $scanCnt) {
$matchingValidation->update([
'panel_box_supplier' => $supplier,
'panel_box_item_code' => $itemCode,
'panel_box_code' => $itemCode,
'panel_box_serial_number' => $serialNumber,
'capacitor_scanned_status' => 1,
'scanned_status' => 'Scanned',
'operator_id'=> $operatorName,
'operator_id' => $operatorName,
]);
}
else
{
} else {
$matchingValidation->update([
'panel_box_supplier' => $supplier,
'panel_box_item_code' => $itemCode,
'panel_box_code' => $itemCode,
'panel_box_serial_number' => $serialNumber,
'capacitor_scanned_status' => 1,
'operator_id'=> $operatorName,
'operator_id' => $operatorName,
]);
}
}
else
{
} else {
$matchingValidation->update([
'panel_box_supplier' => $supplier,
'panel_box_item_code' => $itemCode,
'panel_box_code' => $itemCode,
'panel_box_serial_number' => $serialNumber,
'capacitor_scanned_status' => 1,
'scanned_status' => 'Scanned',
'operator_id'=> $operatorName,
'operator_id' => $operatorName,
]);
}
@@ -341,15 +446,14 @@ class SerialValidationData extends Component
$totalQuantity = SerialValidation::where('invoice_number', $matchingValidation->invoice_number)->where('plant_id', $this->plantId)->count();
$scannedQuantity = SerialValidation::where('invoice_number', $matchingValidation->invoice_number)->where('plant_id', $this->plantId)->where('scanned_status', 'Scanned')->count();
// $this->form->fill([
// 'plant_id' => $matchingValidation->plant_id,
// 'invoice_number' => $matchingValidation->invoice_number,
// 'serial_number' => null,
// 'total_quantity' => $totalQuantity,
// 'scanned_quantity'=> $scannedQuantity,
// ]);
// 'plant_id' => $matchingValidation->plant_id,
// 'invoice_number' => $matchingValidation->invoice_number,
// 'serial_number' => null,
// 'total_quantity' => $totalQuantity,
// 'scanned_quantity'=> $scannedQuantity,
// ]);
if($totalQuantity === $scannedQuantity)
{
if ($totalQuantity === $scannedQuantity) {
Notification::make()
->title('Completed: Serial Invoice')
->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
@@ -357,9 +461,7 @@ class SerialValidationData extends Component
->seconds(2)
->send();
$this->loadCompletedData($matchingValidation->invoice_number, $matchingValidation->plant_id, true);
}
else
{
} else {
$this->loadData($matchingValidation->invoice_number, $matchingValidation->plant_id);
}
}
@@ -373,7 +475,8 @@ class SerialValidationData extends Component
public function render()
{
return view('livewire.serial-validation-data');
return view('livewire.serial-validation-data', [
'records' => $this->invoiceRecords,
]);
}
}

33
app/Livewire/Webcam.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Livewire;
use Livewire\Component;
class Webcam extends Component
{
public string $capturedPhoto = '';
// Called from JavaScript when a photo is taken
public function setPhoto(string $photo): void
{
$this->capturedPhoto = $photo;
// Fires a browser event that the Filament form will listen to
$this->dispatch('photo-captured', photo: $photo);
}
// Called from JavaScript when user clicks "Retake"
public function clearPhoto(): void
{
$this->capturedPhoto = '';
$this->dispatch('photo-captured', photo: '');
}
public function render()
{
return view('livewire.webcam');
}
}

View File

@@ -0,0 +1,90 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class VehicleEntryMail extends Mailable
{
use Queueable, SerializesModels;
public $scheduleType;
public $tableData;
public $mailSubject;
/**
* Create a new message instance.
*/
public function __construct($scheduleType, $tableData, $mailSubject)
{
$this->scheduleType = $scheduleType;
$this->tableData = $tableData ?? [];
$this->mailSubject = $mailSubject ?? 'Vehicle Entry Report';
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Vehicle Entry Mail',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
$greeting = '<b>Dear Sir</b>';
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
if ($this->scheduleType == 'Daily') {
$reportPeriod = "";
$greeting .= $reportPeriod;
}
if ($this->scheduleType == 'Hourly') {
$now = now();
$fromHour = $now->copy()->subHour()->format('H:i:s');
$toHour = $now->format('H:i:s');
$reportDate = $now->format('d/m/Y');
$greeting .= "from: $reportDate, $fromHour to $toHour. <br><br>Please arrange to receipt the same immediately.";
}
if ($this->scheduleType == 'Live') {
$now = now();
$fromMinute = $now->copy()->subMinute()->format('d/m/Y H:i:s');
$toMinute = $now->format('d/m/Y H:i:s');
$greeting .= "from: $fromMinute to $toMinute. <br><br>Please arrange to receipt the same immediately.";
}
return new Content(
view: 'mail.vehicle_entry_report',
with: [
'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting,
'tableData' => $this->tableData,
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

62
app/Mail/VisitorMail.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class VisitorMail extends Mailable
{
use Queueable, SerializesModels;
public $visitor;
/**
* Create a new message instance.
*/
public function __construct($visitor)
{
$this->visitor = $visitor;
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Visitor Arrival Notification',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
$greeting = '<b>Dear Sir</b>';
return new Content(
view: 'mail.visitor-arrival',
with: [
'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting,
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class AsrsItemValidation extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'item_code',
'item_description',
'uom',
'mhe',
'bin_quantity',
'asrs',
'asrs_category',
'status',
'material_type',
'material_group',
'created_at',
'updated_at',
'created_by',
'updated_by',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
}

View File

@@ -152,6 +152,7 @@ class ClassCharacteristic extends Model
'zmm_motor_heading',
'zmm_motor_speed',
'zqmm_qty',
'zmm_operating_temperature',
'mark_status',
'marked_datetime',
'marked_physical_count',

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class EmployeeMaster extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'name',
'code',
'department',
'designation',
'email',
'mobile_number',
'created_at',
'updated_at',
'created_by',
'updated_by',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
}

View File

@@ -10,6 +10,14 @@ class ImportTransit extends Model
use SoftDeletes;
protected $casts = [
'mail_received_date' => 'date',
'shipper_invoice_date' => 'date',
'eta_date' => 'date',
'etd_date' => 'date',
'bill_received_date' => 'date',
];
protected $fillable = [
'cri_rfq_number',
'mail_received_date',
@@ -22,6 +30,7 @@ class ImportTransit extends Model
'customs_agent_name',
'eta_date',
'status',
'insurance_status',
'delivery_location',
'etd_date',
'mode',
@@ -36,6 +45,10 @@ class ImportTransit extends Model
'bill_number',
'bill_received_date',
'vessel_number',
'remark',
'is_transit_identified',
'inv_value',
'freight_charge',
'created_at',
'created_by',
'updated_at',

View File

@@ -24,9 +24,9 @@ class Item extends Model
return $this->belongsTo(Plant::class);
}
public function item()
public function line()
{
return $this->belongsTo(Item::class, 'item_id', 'id');
return $this->belongsTo(Line::class, 'line_id', 'id');
}
public function stickerMasters()
@@ -79,6 +79,11 @@ class Item extends Model
return $this->hasMany(RequestCharacteristic::class, 'item_id', 'id');
}
public function wireMasterPacking()
{
return $this->hasMany(WireMasterPacking::class, 'item_id', 'id');
}
public function productionCharacteristics()
{
return $this->hasMany(ProductionCharacteristic::class, 'item_id', 'id');

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class LeakTestReading extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'item_code',
'serial_number',
'test_status',
'created_at',
'updated_at',
];
public function plant()
{
return $this->belongsTo(Plant::class);
}
}

View File

@@ -109,6 +109,11 @@ class Plant extends Model
return $this->hasMany(ProcessOrder::class, 'plant_id', 'id');
}
public function wireMasterPacking()
{
return $this->hasMany(WireMasterPacking::class, 'plant_id', 'id');
}
public function productionOrder()
{
return $this->hasMany(ProductionOrder::class, 'plant_id', 'id');
@@ -158,4 +163,19 @@ class Plant extends Model
{
return $this->hasMany(User::class, 'plant_id', 'id');
}
public function vehicleEntries()
{
return $this->hasMany(VehicleEntry::class, 'plant_id', 'id');
}
public function leakTestReadings()
{
return $this->hasMany(LeakTestReading::class, 'plant_id', 'id');
}
public function asrsItemValidations()
{
return $this->hasMany(AsrsItemValidation::class, 'plant_id', 'id');
}
}

View File

@@ -18,6 +18,7 @@ class ProductCharacteristicsMaster extends Model
'machine_id',
'characteristics_type',
'name',
'category',
'inspection_type',
'lower',
'upper',

View File

@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class SerialValidation extends Model
{
use Prunable;
// use Prunable;
use SoftDeletes;
protected $fillable = [
@@ -30,6 +30,9 @@ class SerialValidation extends Model
'batch_number',
'quantity',
'operator_id',
'created_by',
'updated_by',
'panel_box_code',
];
public function plant(): BelongsTo
@@ -47,8 +50,8 @@ class SerialValidation extends Model
return $this->belongsTo(StickerMaster::class, 'sticker_master_id');
}
public function prunable(): Builder
{
return static::where('created_at', '<=', now()->subMonthsNoOverflow(6));
}
// public function prunable(): Builder
// {
// return static::where('created_at', '<=', now()->subMonthsNoOverflow(6));
// }
}

View File

@@ -149,6 +149,7 @@ class TempClassCharacteristic extends Model
'zmm_motor_heading',
'zmm_motor_speed',
'zqmm_qty',
'zmm_operating_temperature',
'winded_serial_number',
'model_type',
'has_work_flow_id',

View File

@@ -18,6 +18,7 @@ class VehicleEntry extends Model
'duration',
'type',
'uuid',
'boom_opened',
'created_at',
'created_by',
'updated_at',

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class VisitorEntry extends Model
{
use SoftDeletes;
protected $fillable = [
'mobile_number',
'register_id',
'name',
'company',
'purpose_of_visit',
'type',
'in_time',
'out_time',
'photo',
'employee_master_id',
'number_of_person',
'valid_upto',
];
public function employeeMaster(): BelongsTo
{
return $this->belongsTo(EmployeeMaster::class);
}
}

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More