89 Commits

Author SHA1 Message Date
c841ff830d Update dependency erag/laravel-pwa to v2
Some checks failed
renovate/artifacts Artifact file update failure
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 14s
Laravel Pint / pint (pull_request) Failing after 1m27s
Laravel Larastan / larastan (pull_request) Failing after 1m31s
2026-06-14 00:01:08 +00:00
f99bc12603 Merge pull request 'Added logic to slect default ok button in checklist of quality' (#752) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #752
2026-06-13 11:30:24 +00:00
dhanabalan
2b3d423769 Added logic to slect default ok button in checklist of quality
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 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m23s
2026-06-13 17:00:09 +05:30
efd469e07d Merge pull request 'Updated PUMP SET model as PUMPSET on request approval' (#751) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 34s
Reviewed-on: #751
2026-06-13 09:45:20 +00:00
dhanabalan
e0ed67dfc0 Updated PUMP SET model as PUMPSET on request approval
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 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 2m23s
Laravel Larastan / larastan (pull_request) Failing after 4m21s
2026-06-13 15:14:43 +05:30
dd88bdca78 Merge pull request 'Removed unique rfq number in import transaction page' (#750) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
Reviewed-on: #750
2026-06-13 07:10:13 +00:00
dhanabalan
efd5416ced Removed unique rfq number in import transaction page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 1m53s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2026-06-13 12:39:24 +05:30
229a69b82a Merge pull request 'Changed body message of import transit mail' (#749) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 22s
Reviewed-on: #749
2026-06-13 06:43:05 +00:00
dhanabalan
03df2f50dc Changed body message of import transit mail
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 2m3s
Laravel Larastan / larastan (pull_request) Failing after 3m37s
2026-06-13 12:12:47 +05:30
3d404d93ef Merge pull request 'Added sort of rfq number logic in import transit mail' (#748) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 22s
Reviewed-on: #748
2026-06-13 05:36:45 +00:00
dhanabalan
aaaa021597 Added sort of rfq number logic in import transit mail
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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m29s
Laravel Larastan / larastan (pull_request) Failing after 4m3s
2026-06-13 11:06:25 +05:30
d1f170440c Merge pull request 'Changed report time for import transit mail' (#747) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #747
2026-06-13 05:27:05 +00:00
dhanabalan
78961a7436 Changed report time for import transit mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 29s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Laravel Pint / pint (pull_request) Successful in 2m12s
Laravel Larastan / larastan (pull_request) Failing after 3m54s
2026-06-13 10:56:52 +05:30
01bda8f736 Merge pull request 'Adjusted logic for mobile an dtab screen resolution for quality check' (#746) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #746
2026-06-13 05:25:01 +00:00
dhanabalan
f0bb74690f Adjusted logic for mobile an dtab screen resolution for quality check
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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 1m56s
Laravel Larastan / larastan (pull_request) Failing after 3m39s
2026-06-13 10:54:41 +05:30
0b83b7cb22 Merge pull request 'Removed form box of ref number from import transit page' (#745) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #745
2026-06-13 04:32:28 +00:00
dhanabalan
88e00b2f8a Removed form box of ref number from import transit 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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m5s
Laravel Larastan / larastan (pull_request) Failing after 3m24s
2026-06-13 10:02:13 +05:30
3bb3674d39 Merge pull request 'Added proper subject name for import transit mail' (#744) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Reviewed-on: #744
2026-06-13 03:27:05 +00:00
dhanabalan
ab79a2235a Added proper subject name for import transit mail
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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 2m22s
Laravel Larastan / larastan (pull_request) Failing after 3m38s
2026-06-13 08:56:47 +05:30
f02598feeb Merge pull request 'Changed label name of ref number in import tranist page' (#743) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 22s
Reviewed-on: #743
2026-06-13 03:13:18 +00:00
dhanabalan
c17bc3be3a Changed label name of ref number in import tranist 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 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m34s
2026-06-13 08:43:04 +05:30
f84a579224 Merge pull request 'Changed font size for all column text values in import tranist mail' (#742) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #742
2026-06-13 03:06:28 +00:00
dhanabalan
4edac7987d Changed font size for all column text values in import tranist mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
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 Pint / pint (pull_request) Successful in 2m4s
Laravel Larastan / larastan (pull_request) Failing after 3m34s
2026-06-13 08:35:37 +05:30
15241feae2 Merge pull request 'corrected spell mistake of searchable in import transit' (#741) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #741
2026-06-13 02:53:48 +00:00
dhanabalan
9cbeb5166f corrected spell mistake of searchable in import transit
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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m19s
Laravel Larastan / larastan (pull_request) Failing after 3m58s
2026-06-13 08:23:35 +05:30
4915d12c7d Merge pull request 'Added searchable in import transit and change tto inv value as text input' (#740) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #740
2026-06-13 02:49:15 +00:00
dhanabalan
46f1ecd7be Added searchable in import transit and change tto inv value as text input
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 20s
Laravel Pint / pint (pull_request) Successful in 2m1s
Laravel Larastan / larastan (pull_request) Failing after 3m29s
2026-06-13 08:18:49 +05:30
44779683fd Merge pull request 'Added import transit excel attachment logic in mail' (#739) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 26s
Reviewed-on: #739
2026-06-12 03:50:24 +00:00
dhanabalan
05a3c9f7ac Added import transit excel attachment logic in mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 3m28s
2026-06-12 09:20:03 +05:30
82cb39feb5 Merge pull request 'Added import transit export excel file page' (#738) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #738
2026-06-11 04:13:47 +00:00
dhanabalan
3c5f9f7273 Added import transit export excel file 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 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 2m14s
Laravel Larastan / larastan (pull_request) Failing after 3m38s
2026-06-11 09:43:30 +05:30
9db03a4c56 Merge pull request 'added left alignment logic for all columns' (#737) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 26s
Reviewed-on: #737
2026-06-10 06:07:27 +00:00
dhanabalan
cef8415b2c added left alignment logic for all columns
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 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 12m36s
Laravel Larastan / larastan (pull_request) Failing after 14m26s
2026-06-10 11:37:10 +05:30
3140a1e88d Merge pull request 'changed logic by default loading of of data in table list of asrs' (#736) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #736
2026-06-10 03:53:20 +00:00
dhanabalan
7b71f07f39 changed logic by default loading of of data in table list of asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 53s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m5s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 40s
Laravel Pint / pint (pull_request) Successful in 10m23s
Laravel Larastan / larastan (pull_request) Failing after 17m59s
2026-06-10 09:22:58 +05:30
58b2df8d94 Merge pull request 'Added body in import transit mail of mail' (#735) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #735
2026-06-09 08:58:20 +00:00
dhanabalan
4bade21e10 Added body in import transit mail of mail
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 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 5m52s
Laravel Larastan / larastan (pull_request) Failing after 15m48s
2026-06-09 14:28:06 +05:30
e9eb5539d3 Merge pull request 'Added logic for fetch against visitor names' (#734) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #734
2026-06-09 07:13:27 +00:00
dhanabalan
e103755a8b Added logic for fetch against visitor names
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 16s
Laravel Larastan / larastan (pull_request) Failing after 7m11s
Laravel Pint / pint (pull_request) Failing after 15m27s
2026-06-09 12:43:07 +05:30
aa403f00c0 Merge pull request 'ranjith-dev' (#733) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #733
2026-06-09 05:54:12 +00:00
dhanabalan
2ec549019e Added In and out logic in gate out entry page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
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 15m44s
Laravel Pint / pint (pull_request) Failing after 15m43s
2026-06-09 11:23:51 +05:30
dhanabalan
72274d6f47 solved issue in entering mobile number logic in visitor create page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:23:11 +05:30
dhanabalan
9d23f7f3e8 Added mode of travel in visitor resource page and only shows todays records
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:22:27 +05:30
dhanabalan
e0ab003852 Added column in model file of visitor entry page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:19:56 +05:30
dhanabalan
769a034167 Added mode of travel column in visitor entry page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:18:50 +05:30
c5fe2379e7 Merge pull request 'Chnaged logic in create visitor entry page' (#732) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Reviewed-on: #732
2026-06-09 04:19:45 +00:00
dhanabalan
12490c0a23 Chnaged logic in create visitor entry 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 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 22s
Laravel Pint / pint (pull_request) Failing after 4m46s
Laravel Larastan / larastan (pull_request) Failing after 27m19s
2026-06-09 09:48:49 +05:30
03d620607d Merge pull request 'remove dfe columns and adjusted alignment in import transit mail' (#731) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #731
2026-06-08 13:19:11 +00:00
dhanabalan
461188788b remove dfe columns and adjusted alignment in import transit mail
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 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 7m14s
Laravel Larastan / larastan (pull_request) Failing after 8m53s
2026-06-08 18:48:56 +05:30
bfdaef7cec Merge pull request 'Added logic in part validation 1 for pipeline' (#730) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #730
2026-06-08 12:31:34 +00:00
dhanabalan
27fc3e2cbf Added logic in part validation 1 for pipeline
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 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 7m47s
Laravel Larastan / larastan (pull_request) Failing after 8m49s
2026-06-08 18:01:17 +05:30
bd15298ee8 Merge pull request 'Added logic to show plant names in visitor entry page' (#729) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #729
2026-06-08 11:15:20 +00:00
dhanabalan
24865267a2 Added logic to show plant names in visitor entry page
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 14s
Laravel Larastan / larastan (pull_request) Failing after 4m16s
Laravel Pint / pint (pull_request) Failing after 4m23s
2026-06-08 16:45:03 +05:30
14ec323086 Merge pull request 'added three columns in import transit exporter' (#728) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 25s
Reviewed-on: #728
2026-06-08 08:49:26 +00:00
dhanabalan
be0a0cc78e added three columns in import transit exporter
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 Pint / pint (pull_request) Successful in 8m9s
Laravel Larastan / larastan (pull_request) Failing after 8m56s
2026-06-08 14:19:09 +05:30
ab2211cf85 Merge pull request 'changed logic in visitor badge blade file' (#727) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #727
2026-06-08 06:34:04 +00:00
dhanabalan
9ce11ed5ff changed logic in visitor badge blade file
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 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 28s
Laravel Pint / pint (pull_request) Successful in 8m28s
Laravel Larastan / larastan (pull_request) Failing after 8m57s
2026-06-08 12:03:49 +05:30
20de7e9b71 Merge pull request 'Added logic for gate out entry for out time' (#726) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #726
2026-06-08 05:27:49 +00:00
dhanabalan
f7bfc1373d Added logic for gate out entry for out time
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 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 34s
Laravel Pint / pint (pull_request) Successful in 13m14s
Laravel Larastan / larastan (pull_request) Failing after 15m42s
2026-06-08 10:56:35 +05:30
d935e5044d Merge pull request 'Added company and in table list in visitor resource page' (#725) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #725
2026-06-08 05:14:42 +00:00
dhanabalan
f00cc4c386 Added company and in table list in visitor resource 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 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Failing after 4m38s
Laravel Larastan / larastan (pull_request) Failing after 8m1s
2026-06-08 10:44:25 +05:30
deaeaa4754 Merge pull request 'Added charset in print panel in production order' (#724) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 41s
Reviewed-on: #724
2026-06-08 03:57:57 +00:00
dhanabalan
e59acd6458 Added charset in print panel in production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 31s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Larastan / larastan (pull_request) Failing after 8m5s
Laravel Pint / pint (pull_request) Successful in 4m48s
2026-06-08 09:27:39 +05:30
97aed0a4b1 Merge pull request 'added logic in print item of production order' (#723) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #723
2026-06-08 03:53:59 +00:00
dhanabalan
84634302b1 added logic in print item of production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 34s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 27s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Larastan / larastan (pull_request) Failing after 7m18s
Laravel Pint / pint (pull_request) Successful in 8m12s
2026-06-08 09:23:37 +05:30
acab42ee6b Merge pull request 'issue solved of showing 1/2 inch number in item description of producion order' (#722) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 50s
Reviewed-on: #722
2026-06-08 03:50:36 +00:00
dhanabalan
46e5a46121 issue solved of showing 1/2 inch number in item description of producion order
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 38s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 39s
Laravel Pint / pint (pull_request) Failing after 13s
Laravel Larastan / larastan (pull_request) Failing after 10m56s
2026-06-08 09:20:20 +05:30
16f1937e9c Merge pull request 'changed updated logic for import transit' (#721) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #721
2026-06-07 09:07:50 +00:00
dhanabalan
59e6bd7b10 changed updated logic for import transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Failing after 9m50s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 4m2s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13m47s
Laravel Larastan / larastan (pull_request) Failing after 6m35s
Laravel Pint / pint (pull_request) Failing after 6m34s
2026-06-07 14:37:35 +05:30
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
27 changed files with 1063 additions and 348 deletions

View File

@@ -337,7 +337,7 @@ class Scheduler extends Command
} }
break; break;
case 'Daily': case 'Daily':
if (now()->format('H:i') == '11:10') { if (now()->format('H:i') == '11:30') {
try { try {
\Artisan::call('send-import-transit', [ \Artisan::call('send-import-transit', [
'schedule_type' => $rule->schedule_type, 'schedule_type' => $rule->schedule_type,

View File

@@ -7,6 +7,8 @@ use App\Models\AlertMailRule;
use App\Models\ImportTransit; use App\Models\ImportTransit;
use App\Models\Plant; use App\Models\Plant;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\ImportTransitReportExport;
class SendImportTransit extends Command class SendImportTransit extends Command
{ {
@@ -58,37 +60,45 @@ class SendImportTransit extends Command
// return; // return;
// } // }
$tableData = ImportTransit::select([ // $tableData = ImportTransit::select([
'cri_rfq_number', // 'cri_rfq_number',
'mail_received_date', // 'mail_received_date',
'pricol_ref_number', // 'pricol_ref_number',
'requester', // 'requester',
'shipper', // 'shipper',
'shipper_location', // 'shipper_location',
'shipper_invoice', // 'shipper_invoice',
'shipper_invoice_date', // 'shipper_invoice_date',
'customs_agent_name', // 'customs_agent_name',
'eta_date', // 'eta_date',
'status', // 'status',
'delivery_location', // 'delivery_location',
'etd_date', // 'etd_date',
'mode', // 'mode',
'inco_terms', // 'inco_terms',
'port_of_loading', // 'port_of_loading',
'port_of_discharge', // 'port_of_discharge',
'delivery_city', // 'delivery_city',
'packages', // 'packages',
'type_of_package', // 'type_of_package',
'gross_weight', // 'gross_weight',
'volume', // 'volume',
'bill_number', // 'bill_number',
'bill_received_date', // 'bill_received_date',
'vessel_number', // 'vessel_number',
'remark', // 'remark',
'is_transit_identified', // 'is_transit_identified',
]) // ])
->where('status', '!=', 'Delivered') // ->where('status', '!=', 'Delivered')
->get(); // ->get();
$tableData = ImportTransit::where('status', '!=', 'Delivered')->orderByRaw("
CAST(
regexp_replace(cri_rfq_number, '.*-([0-9]+).*', '\\1')
AS INTEGER
)
")->get();
if ($tableData->isEmpty()) { if ($tableData->isEmpty()) {
$this->info('No pending Import Transit records found. Mail skipped.'); $this->info('No pending Import Transit records found. Mail skipped.');
@@ -101,10 +111,19 @@ class SendImportTransit extends Command
$mailSubject = 'Daily Import Transit Report'; $mailSubject = 'Daily Import Transit Report';
$fileName = 'reports/pending_import_shipment_' . now()->format('Ymd_His') . '.xlsx';
Excel::store(
new ImportTransitReportExport($tableData),
$fileName,
'local'
);
$mail = new ImportTransitMail( $mail = new ImportTransitMail(
$scheduleType, $scheduleType,
$tableData, $tableData,
$mailSubject $mailSubject,
$fileName
); );
$toEmails = collect(explode(',', $rule->email)) $toEmails = collect(explode(',', $rule->email))

View File

@@ -0,0 +1,97 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithEvents;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use Illuminate\Support\Facades\Log;
use Maatwebsite\Excel\Events\AfterSheet;
class ImportTransitReportExport implements FromCollection, WithHeadings, WithMapping, WithEvents
{
protected $data;
public function __construct($data)
{
$this->data = $data;
}
public function headings(): array
{
return [
'No',
'CRI RFQ Number',
'Requestor',
'Shipper',
'Shipper Location',
'Shipper Invoice',
'Shipper Invoice Date',
'Custom Agent Name',
'ETA',
'Status',
'Delivery Location',
'ETD Date',
'Remark',
];
}
public function collection()
{
return collect($this->data);
}
public function map($row): array
{
static $srNo = 0;
$srNo++;
return [
$srNo,
$row->cri_rfq_number,
$row->requester,
$row->shipper,
$row->shipper_location,
$row->shipper_invoice,
$row->shipper_invoice_date,
$row->customs_agent_name,
$row->eta_date,
$row->status,
$row->delivery_location,
$row->etd_date,
$row->remark,
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$rowNumber = 2; // Excel row starts after header
foreach ($this->data as $row) {
if ((int) $row->is_transit_identified == 1) {
$event->sheet
->getStyle("A{$rowNumber}:M{$rowNumber}")
->applyFromArray([
'fill' => [
'fillType' => Fill::FILL_SOLID,
'startColor' => [
'rgb' => 'FFFF00',
],
],
]);
}
$rowNumber++;
}
},
];
}
}

View File

@@ -36,12 +36,18 @@ class ImportTransitExporter extends Exporter
->label('SHIPPER INVOICE'), ->label('SHIPPER INVOICE'),
ExportColumn::make('shipper_invoice_date') ExportColumn::make('shipper_invoice_date')
->label('SHIPPER INVOICE DATE'), ->label('SHIPPER INVOICE DATE'),
ExportColumn::make('inv_value')
->label('Inv Value'),
ExportColumn::make('freight_charge')
->label('Freight Charge'),
ExportColumn::make('customs_agent_name') ExportColumn::make('customs_agent_name')
->label('CUSTOMS AGENT NAME'), ->label('CUSTOMS AGENT NAME'),
ExportColumn::make('eta_date') ExportColumn::make('eta_date')
->label('ETA DATE'), ->label('ETA DATE'),
ExportColumn::make('status') ExportColumn::make('status')
->label('STATUS'), ->label('STATUS'),
ExportColumn::make('insurance_status')
->label('Insurance Status'),
ExportColumn::make('delivery_location') ExportColumn::make('delivery_location')
->label('DELIVERY LOCATION'), ->label('DELIVERY LOCATION'),
ExportColumn::make('etd_date') ExportColumn::make('etd_date')

View File

@@ -75,7 +75,7 @@ class ImportTransitImporter extends Importer
->label('Status'), ->label('Status'),
ImportColumn::make('insurance_status') ImportColumn::make('insurance_status')
->exampleHeader('Insurance Status') ->exampleHeader('Insurance Status')
->example('Receipted') ->example('Yes')
->label('Insurance Status'), ->label('Insurance Status'),
ImportColumn::make('delivery_location') ImportColumn::make('delivery_location')
->exampleHeader('Delivery Location') ->exampleHeader('Delivery Location')
@@ -176,6 +176,7 @@ class ImportTransitImporter extends Importer
return ImportTransit::updateOrCreate([ return ImportTransit::updateOrCreate([
'cri_rfq_number' => $criRfqNumber, 'cri_rfq_number' => $criRfqNumber,
'shipper_invoice' => $shipperInvoice,
], ],
[ [
'mail_received_date' => $this->formatDate($mailRecDate), 'mail_received_date' => $this->formatDate($mailRecDate),
@@ -187,7 +188,6 @@ class ImportTransitImporter extends Importer
'requester' => $requester, 'requester' => $requester,
'shipper' => $shipper, 'shipper' => $shipper,
'shipper_location' => $shipperLocation, 'shipper_location' => $shipperLocation,
'shipper_invoice' => $shipperInvoice,
'inv_value' => $invValue, 'inv_value' => $invValue,
'freight_charge' => $freightCharge, 'freight_charge' => $freightCharge,
'custom_agent_name' => $customsAgentname, 'custom_agent_name' => $customsAgentname,

View File

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

View File

@@ -4,6 +4,7 @@ namespace App\Filament\Pages;
use App\Models\Plant; use App\Models\Plant;
use App\Models\VisitorEntry; use App\Models\VisitorEntry;
use Carbon\Carbon;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Pages\Page; use Filament\Pages\Page;
use Filament\Forms\Contracts\HasForms; use Filament\Forms\Contracts\HasForms;
@@ -37,38 +38,172 @@ class GateOutEntry extends Page implements HasForms
->schema([ ->schema([
Section::make('') // You can give your section a title or leave it blank Section::make('') // You can give your section a title or leave it blank
->schema([ ->schema([
TextInput::make('scan_out_gate_pass') Select::make('scan_out_gate_pass')
->label('Scan Gate Pass')
->required()
->reactive()
->options([
'In' => 'In',
'Out' => 'Out',
]),
TextInput::make('scan_out_gate_pass_in')
->label('Scan In Gate Pass')
->required()
->reactive()
->visible(fn ($get) => $get('scan_out_gate_pass') == 'In')
->extraAttributes([
'wire:keydown.enter' => 'processGatePassIn($event.target.value)',
]),
TextInput::make('scan_out_gate_pass_out')
->label('Scan Out Gate Pass') ->label('Scan Out Gate Pass')
->required() ->required()
->reactive() ->reactive()
->visible(fn ($get) => $get('scan_out_gate_pass') == 'Out')
->extraAttributes([ ->extraAttributes([
'wire:keydown.enter' => 'processGatePass($event.target.value)', 'wire:keydown.enter' => 'processGatePassOut($event.target.value)',
]), ]),
]) ])
->columns(5) ->columns(5)
]); ]);
} }
public function processGatePass($gatePass) public function processGatePassIn($gatePass)
{ {
$entry = VisitorEntry::where('register_id', $gatePass)->first(); $entry = VisitorEntry::where('register_id', $gatePass)->latest()->first();
if ($entry) { if ($entry)
$entry->out_time = now(); {
$entry->save(); if($entry->in_time && !$entry->out_time && (empty($entry->valid_upto) || $entry->valid_upto == '' || $entry->valid_upto == null)){
Notification::make()
->title('Already Entered')
->body('Gate pass In has already been processed for entry.')
->warning()
->send();
$this->filters['scan_out_gate_pass_in'] = '';
return;
}
elseif (
!empty($entry->valid_upto) &&
Carbon::parse($entry->valid_upto)->endOfDay()->gte(now())
){
if (empty($entry->out_time)) {
Notification::make()
->title('Gate In Not Allowed')
->body("Previous gate-out has not been punched. Please complete gate-out first for ID ' . $gatePass . '.")
->warning()
->send();
Notification::make() $this->filters['scan_out_gate_pass_in'] = '';
->title('Gate Pass Processed') return;
->body('Gate pass has been successfully processed. Visitor marked as exited.') }
->success() else{
->send(); $newEntry = $entry->replicate();
$this->filters['scan_out_gate_pass'] = ''; $newEntry->in_time = now();
} else { $newEntry->out_time = null;
$newEntry->save();
Notification::make()
->title('Gate In')
->body('Gate in has been successfully processed. Visitor marked as entered.')
->success()
->send();
$this->filters['scan_out_gate_pass_in'] = '';
}
}
else{
Notification::make()
->title('Visitor Pass Expired')
->body('Your visitor pass validity has expired.')
->danger()
->send();
$this->filters['scan_out_gate_pass_in'] = '';
return;
}
}
else
{
Notification::make() Notification::make()
->title('Invalid Gate Pass') ->title('Invalid Gate Pass')
->body('The scanned gate pass is not valid. Please try again.') ->body('Scanned gate in pass is not valid.')
->danger() ->danger()
->send(); ->send();
return;
}
}
public function processGatePassOut($gatePass)
{
$entry = VisitorEntry::where('register_id', $gatePass)->latest()->first();
if (!$entry) {
Notification::make()
->title('Invalid Gate Pass')
->body('Scanned gate out pass is not valid.')
->danger()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
return;
}
if (empty($entry->valid_upto) || $entry->valid_upto == '' || $entry->valid_upto == null) {
if (!empty($entry->out_time)) {
Notification::make()
->title('Already Exited')
->body('Gate pass has already been processed.')
->warning()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
return;
}
else
{
$entry->out_time = now();
$entry->save();
Notification::make()
->title('Gate Pass Processed')
->body('Visitor marked as exited.')
->success()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
return;
}
}
elseif ((empty($entry->valid_upto) || $entry->valid_upto != '' || $entry->valid_upto != null))
{
if (Carbon::parse($entry->valid_upto)->endOfDay()->lt(now()))
{
Notification::make()
->title('Visitor Pass Expired')
->body('Your visitor pass validity has expired.')
->danger()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
return;
}
if (!empty($entry->out_time)) {
Notification::make()
->title('Already Exited')
->body('Gate pass has already been processed.')
->warning()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
return;
}
else{
$entry->out_time = now();
$entry->save();
Notification::make()
->title('Gate Out')
->body('Visitor marked as exited.')
->success()
->send();
$this->filters['scan_out_gate_pass_out'] = '';
}
} }
} }

View File

@@ -285,27 +285,27 @@ class AsrsItemValidationResource extends Resource
$status = $data['status'] ?? 'NotUpdated'; $status = $data['status'] ?? 'NotUpdated';
// Hide all records initially if no filters are applied // 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'])) { if (empty($data['Plant']) && empty($data['item_code']) && empty($data['uom']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
// // return $query->whereRaw('1 = 0'); 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('status', 'NotUpdated');
$query->where(function ($q) {
$q->where('status', 'NotUpdated')
->orWhereNull('status')
->orWhere('status', '');
});
} }
// 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'])) { if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']); $query->where('plant_id', $data['Plant']);
} }
@@ -387,11 +387,12 @@ class AsrsItemValidationResource extends Resource
Tables\Actions\ViewAction::make(), Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(), Tables\Actions\EditAction::make(),
// ->hidden(function ($record): bool { // ->hidden(function ($record): bool {
// if (auth()->user()?->hasRole('SuperAdmin')) { // if (auth()->user()?->hasRole('Super Admin')) {
// return false; // return false;
// } // }
// else{
// return trim(strtolower($record->status)) == 'updated'; // return trim(($record->status)) == 'Updated';
// }
// }), // }),
// ->visible(function ($record): bool { // ->visible(function ($record): bool {
// return auth()->user()?->hasRole('SuperAdmin') // return auth()->user()?->hasRole('SuperAdmin')

View File

@@ -40,16 +40,16 @@ class ImportTransitResource extends Resource
->schema([ ->schema([
Forms\Components\TextInput::make('cri_rfq_number') Forms\Components\TextInput::make('cri_rfq_number')
->label('CRI/RFQ Number') ->label('CRI/RFQ Number')
->disabled(fn ($operation) => $operation == 'edit') ->required()
->unique(ignoreRecord: true), ->disabled(fn ($operation) => $operation == 'edit'),
Forms\Components\DatePicker::make('mail_received_date') Forms\Components\DatePicker::make('mail_received_date')
->label('Mail Received Date') ->label('Mail Received Date')
->required(), ->required(),
Forms\Components\TextInput::make('pricol_ref_number') // Forms\Components\TextInput::make('pricol_ref_number')
->label('Pricol Ref Number') // ->label('Ref Number')
->afterStateUpdated(function (callable $set) { // ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); // $set('updated_by', Filament::auth()->user()?->name);
}), // }),
Forms\Components\TextInput::make('requester') Forms\Components\TextInput::make('requester')
->label('Requester') ->label('Requester')
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
@@ -75,7 +75,7 @@ class ImportTransitResource extends Resource
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\DatePicker::make('inv_value') Forms\Components\TextInput::make('inv_value')
->label('Inv Value') ->label('Inv Value')
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
@@ -220,128 +220,158 @@ class ImportTransitResource extends Resource
}), }),
Tables\Columns\TextColumn::make('cri_rfq_number') Tables\Columns\TextColumn::make('cri_rfq_number')
->label('CRI/RFQ Number') ->label('CRI/RFQ Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mail_received_date') Tables\Columns\TextColumn::make('mail_received_date')
->label('Mail Received Date') ->label('Mail Received Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('pricol_ref_number') Tables\Columns\TextColumn::make('pricol_ref_number')
->label('Pricol Ref Number') ->label('Ref Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('requester') Tables\Columns\TextColumn::make('requester')
->label('Requester') ->label('Requester')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper') Tables\Columns\TextColumn::make('shipper')
->label('Shipper') ->label('Shipper')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_location') Tables\Columns\TextColumn::make('shipper_location')
->label('Shipper Location') ->label('Shipper Location')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_invoice') Tables\Columns\TextColumn::make('shipper_invoice')
->label('Shipper Invoice') ->label('Shipper Invoice')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_invoice_date') Tables\Columns\TextColumn::make('shipper_invoice_date')
->label('Shipper Invoice Date') ->label('Shipper Invoice Date')
->searchable()
->date() ->date()
->formatStateUsing(fn ($state) => $state?->format('Y-m-d')) ->formatStateUsing(fn ($state) => $state?->format('Y-m-d'))
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('inv_value') Tables\Columns\TextColumn::make('inv_value')
->label('Inv Value') ->label('Inv Value')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('freight_charge') Tables\Columns\TextColumn::make('freight_charge')
->label('Freight Charge') ->label('Freight Charge')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('customs_agent_name') Tables\Columns\TextColumn::make('customs_agent_name')
->label('Customs Agent Name') ->label('Customs Agent Name')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('eta_date') Tables\Columns\TextColumn::make('eta_date')
->label('ETA Date') ->label('ETA Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('status') Tables\Columns\TextColumn::make('status')
->label('Status') ->label('Status')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('insurance_status') Tables\Columns\TextColumn::make('insurance_status')
->label('Insurance Status') ->label('Insurance Status')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('delivery_location') Tables\Columns\TextColumn::make('delivery_location')
->label('Delivery Location') ->label('Delivery Location')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('etd_date') Tables\Columns\TextColumn::make('etd_date')
->label('ETD Date') ->label('ETD Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mode') Tables\Columns\TextColumn::make('mode')
->label('Mode') ->label('Mode')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('inco_terms') Tables\Columns\TextColumn::make('inco_terms')
->label('Inco Terms') ->label('Inco Terms')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('port_of_loading') Tables\Columns\TextColumn::make('port_of_loading')
->label('Port of Loading') ->label('Port of Loading')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('port_of_discharge') Tables\Columns\TextColumn::make('port_of_discharge')
->label('Port of Discharge') ->label('Port of Discharge')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('delivery_city') Tables\Columns\TextColumn::make('delivery_city')
->label('Delivery City') ->label('Delivery City')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('packages') Tables\Columns\TextColumn::make('packages')
->label('Packages') ->label('Packages')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('type_of_package') Tables\Columns\TextColumn::make('type_of_package')
->label('Type of Package') ->label('Type of Package')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('gross_weight') Tables\Columns\TextColumn::make('gross_weight')
->label('Gross Weight') ->label('Gross Weight')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('volume') Tables\Columns\TextColumn::make('volume')
->label('Volume') ->label('Volume')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('bill_number') Tables\Columns\TextColumn::make('bill_number')
->label('Bill Number') ->label('Bill Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('bill_received_date') Tables\Columns\TextColumn::make('bill_received_date')
->label('Bill Received Date') ->label('Bill Received Date')
->searchable()
->alignCenter() ->alignCenter()
->date() ->date()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('vessel_number') Tables\Columns\TextColumn::make('vessel_number')
->label('Vessel Number') ->label('Vessel Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('remark') Tables\Columns\TextColumn::make('remark')
->label('Remark') ->label('Remark')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('is_transit_identified') Tables\Columns\TextColumn::make('is_transit_identified')
->label('Is Transit Identified') ->label('Is Transit Identified')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('created_at') Tables\Columns\TextColumn::make('created_at')

View File

@@ -75,7 +75,7 @@ class MachineResource extends Resource
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('line_id') Forms\Components\Select::make('line_id')
->label('Line Name') ->label('Line Name')
->relationship('line', 'name') // ->relationship('line', 'name')
->searchable() ->searchable()
->required() ->required()
->columnSpan(1) ->columnSpan(1)
@@ -116,7 +116,7 @@ class MachineResource extends Resource
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('work_group_master_id') Forms\Components\Select::make('work_group_master_id')
->label('Group Work Center') ->label('Group Work Center')
->relationship('workGroupMaster', 'name') // ->relationship('workGroupMaster', 'name')
->searchable() ->searchable()
->required() ->required()
->columnSpan(1) ->columnSpan(1)

View File

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

View File

@@ -3507,6 +3507,17 @@ class QualityValidationResource extends Resource
return; return;
} }
if (strpos($state, '|') !== false) {
$state = explode('|', $state)[0];
if ($state != $expectedValue){
$set('part_validation1_error', 'Invalid input for part validation 1.');
}
else{
$set('part_validation1', $state);
$set('part_validation1_error', null);
}
}
if ($state == $expectedValue) { if ($state == $expectedValue) {
$set('part_validation1_error', null); $set('part_validation1_error', null);
} else { } else {

View File

@@ -14,6 +14,7 @@ use App\Models\MotorTestingMaster;
use App\Models\Plant; use App\Models\Plant;
use App\Models\TestingPanelReading; use App\Models\TestingPanelReading;
use Barryvdh\DomPDF\Facade\Pdf; use Barryvdh\DomPDF\Facade\Pdf;
use Closure;
// use Barryvdh\Reflection\DocBlock\Type\Collection; // use Barryvdh\Reflection\DocBlock\Type\Collection;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
@@ -36,6 +37,7 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Response;
// use Barryvdh\Snappy\Facades\SnappyPdf as PDF; // use Barryvdh\Snappy\Facades\SnappyPdf as PDF;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
// use App\Exports\TestingPanelReadingExport; // use App\Exports\TestingPanelReadingExport;
use PhpOffice\PhpSpreadsheet\IOFactory; // For loading Excel file use PhpOffice\PhpSpreadsheet\IOFactory; // For loading Excel file
@@ -95,7 +97,7 @@ class TestingPanelReadingResource extends Resource
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('line_id') Forms\Components\Select::make('line_id')
->label('Line Name') ->label('Line Name')
->relationship('line', 'name') // ->relationship('line', 'name')
->searchable() ->searchable()
->options(function (callable $get) { ->options(function (callable $get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
@@ -115,11 +117,12 @@ class TestingPanelReadingResource extends Resource
->reactive() ->reactive()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('motor_testing_master_id', null); $set('motor_testing_master_id', null);
$set('machine_id', null);
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\Select::make('machine_id') Forms\Components\Select::make('machine_id')
->label('Work Center') ->label('Work Center')
->relationship('machine', 'work_center') // ->relationship('machine', 'work_center')
->searchable() ->searchable()
->options(function (callable $get) { ->options(function (callable $get) {
$lineId = $get('line_id'); $lineId = $get('line_id');
@@ -183,17 +186,92 @@ class TestingPanelReadingResource extends Resource
->required() ->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $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') Forms\Components\TextInput::make('serial_number')
->label('Serial Number') ->label('Serial Number')
->required() ->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $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') Forms\Components\TextInput::make('winded_serial_number')
->label('Winded Serial Number') ->label('Winded Serial Number')
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $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') Forms\Components\TextInput::make('before_fr_volt')
->label('Before FR Volt') ->label('Before FR Volt')
@@ -350,24 +428,40 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('hv_test') Forms\Components\Select::make('hv_test')
->label('High Voltage 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) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('batch_number') Forms\Components\TextInput::make('batch_number')
->label('Batch Number') ->label('Batch Number')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('batch_count') Forms\Components\TextInput::make('batch_count')
->label('Batch Count') ->label('Batch Count')
->default('0') ->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('result') Forms\Components\Select::make('result')
->label('Result') ->label('Result')
->options([
'PASS' => 'PASS', // Not With Stood
'FAIL' => 'FAIL',
])
->selectablePlaceholder(false)
->default('FAIL')
->required()
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
@@ -379,27 +473,28 @@ class TestingPanelReadingResource extends Resource
Forms\Components\TextInput::make('rework_count') Forms\Components\TextInput::make('rework_count')
->label('Rework Count') ->label('Rework Count')
->default('0') ->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('update_count') Forms\Components\TextInput::make('update_count')
->label('Update Count') ->label('Update Count')
->default('0') ->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('output_flag') Forms\Components\TextInput::make('output_flag')
->label('Output Flag') ->label('Output Flag')
->default('0') ->default('0')
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('tested_by') Forms\Components\Hidden::make('tested_by')
->label('Tested By')
->default(fn () => Filament::auth()->user()?->name) ->default(fn () => Filament::auth()->user()?->name)
->required(), ->required(),
Forms\Components\TextInput::make('updated_by') Forms\Components\Hidden::make('updated_by')
->label('Updated By')
->default(fn () => Filament::auth()->user()?->name) ->default(fn () => Filament::auth()->user()?->name)
->required(), ->required(),
Forms\Components\TextInput::make('id') Forms\Components\TextInput::make('id')
@@ -665,6 +760,24 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_code', null); $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') Select::make('item_code')
->label('Search by Item Code') ->label('Search by Item Code')
->searchable() ->searchable()
@@ -687,30 +800,37 @@ class TestingPanelReadingResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('item_description', null); $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') TextInput::make('serial_number')
->label('Serial Number') ->label('Serial Number')
->reactive() ->reactive()
->placeholder('Enter Serial Number'), ->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') Select::make('item_description')
->label('Model') ->label('Search by Model')
->searchable() ->searchable()
->options(function (callable $get) { ->options(function (callable $get) {
$plantId = $get('Plant'); $plantId = $get('Plant');
@@ -739,13 +859,12 @@ class TestingPanelReadingResource extends Resource
$set('item_code', null); $set('item_code', null);
}), }),
Select::make('output') Select::make('output')
->label('Output') ->label('Search by Output')
->searchable() ->searchable()
->options(function () { ->options(function () {
return TestingPanelReading::query() return TestingPanelReading::whereNotNull('output')
->select('output') ->select('output')
->distinct() ->distinct()
->whereNotNull('output')
->orderBy('output') ->orderBy('output')
->pluck('output', 'output') // key and label are both the output value ->pluck('output', 'output') // key and label are both the output value
->toArray(); ->toArray();
@@ -781,6 +900,7 @@ class TestingPanelReadingResource extends Resource
// }) // })
// ->reactive(), // ->reactive(),
// ... // ...
Select::make('connection') Select::make('connection')
->label('Connection') ->label('Connection')
->required() ->required()
@@ -805,13 +925,14 @@ class TestingPanelReadingResource extends Resource
// .. // ..
TextInput::make('remark') TextInput::make('remark')
->label('Remark') ->label('Remark')
->reactive(), ->reactive()
->placeholder(placeholder: 'Enter Remark'),
TextInput::make('batch_number') TextInput::make('batch_number')
->label('Batch Number') ->label('Batch Number')
->reactive() ->reactive()
->placeholder(placeholder: 'Enter Batch Number'), ->placeholder(placeholder: 'Enter Batch Number'),
Select::make('result') Select::make('result')
->label('Result') ->label('Search by Result')
->searchable() ->searchable()
->options(function () { ->options(function () {
return TestingPanelReading::query() return TestingPanelReading::query()
@@ -823,7 +944,19 @@ class TestingPanelReadingResource extends Resource
->toArray(); ->toArray();
}) })
->reactive(), ->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') DateTimePicker::make(name: 'created_from')
->label('Created From') ->label('Created From')
->placeholder(placeholder: 'Select From DateTime') ->placeholder(placeholder: 'Select From DateTime')
@@ -834,12 +967,35 @@ class TestingPanelReadingResource extends Resource
->placeholder(placeholder: 'Select To DateTime') ->placeholder(placeholder: 'Select To DateTime')
->reactive() ->reactive()
->native(false), ->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) { ->query(function ($query, array $data) {
// dd($data); // dd($data);
// Hide all records initially if no filters are applied // 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'); 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'])) { if (! empty($data['machine_name'])) {
$query->where('machine_id', $data['machine_name']); $query->where('machine_id', $data['machine_name']);
} }
if (! empty($data['serial_number'])) { 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'])) { if (! empty($data['item_description'])) {
@@ -919,11 +1083,11 @@ class TestingPanelReadingResource extends Resource
} }
if (! empty($data['remark'])) { if (! empty($data['remark'])) {
$query->where('remark', $data['remark']); $query->where('remark', 'like', '%'.$data['remark'].'%');
} }
if (! empty($data['batch_number'])) { if (! empty($data['batch_number'])) {
$query->where('batch_number', $data['batch_number']); $query->where('batch_number', 'like', '%'.$data['batch_number'].'%');
} }
if (! empty($data['result'])) { if (! empty($data['result'])) {
@@ -937,6 +1101,22 @@ class TestingPanelReadingResource extends Resource
if (! empty($data['created_to'])) { if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $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) { ->indicateUsing(function (array $data) {
$indicators = []; $indicators = [];
@@ -953,11 +1133,14 @@ class TestingPanelReadingResource extends Resource
if (! empty($data['Line'])) { if (! empty($data['Line'])) {
$indicators[] = 'Line Name: '.Line::where('id', $data['Line'])->value('name'); $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'])) { if (! empty($data['item_code'])) {
$indicators[] = 'Item Code: '.Item::where('id', $data['item_code'])->value('code'); $indicators[] = 'Item Code: '.Item::where('id', $data['item_code'])->value('code');
} }
if (! empty($data['machine_name'])) { if (! empty($data['subassembly_code'])) {
$indicators[] = 'Work Center: '.Machine::where('id', $data['machine_name'])->value('work_center'); $indicators[] = 'Subassembly Code: '.MotorTestingMaster::where('id', $data['subassembly_code'])->value('subassembly_code');
} }
if (! empty($data['output'])) { if (! empty($data['output'])) {
$indicators[] = 'Output: '.$data['output']; $indicators[] = 'Output: '.$data['output'];
@@ -986,6 +1169,10 @@ class TestingPanelReadingResource extends Resource
$indicators[] = 'Serial Number: '.$data['serial_number']; $indicators[] = 'Serial Number: '.$data['serial_number'];
} }
if (! empty($data['tested_by'])) {
$indicators[] = 'Tested By: '.$data['tested_by'];
}
if (! empty($data['created_from'])) { if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from']; $indicators[] = 'From: '.$data['created_from'];
} }
@@ -994,6 +1181,18 @@ class TestingPanelReadingResource extends Resource
$indicators[] = 'To: '.$data['created_to']; $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; return $indicators;
}), }),
]) ])

View File

@@ -118,8 +118,10 @@ class VisitorEntryResource extends Resource
->label('Employee Department') ->label('Employee Department')
->options( ->options(
EmployeeMaster::distinct() EmployeeMaster::distinct()
->orderBy('department')
->pluck('department', 'department') ->pluck('department', 'department')
) )
->searchable()
->required() ->required()
->reactive() ->reactive()
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
@@ -156,6 +158,11 @@ class VisitorEntryResource extends Resource
->searchable() ->searchable()
->options(function (callable $get) { ->options(function (callable $get) {
$department = $get('department'); $department = $get('department');
if (!$department) {
return [];
}
// Always load ALL employees, filter by department if set // Always load ALL employees, filter by department if set
if ($department) { if ($department) {
return EmployeeMaster::where('department', $department) return EmployeeMaster::where('department', $department)
@@ -180,6 +187,15 @@ class VisitorEntryResource extends Resource
->numeric() ->numeric()
->default(1) ->default(1)
->required(), ->required(),
Forms\Components\Select::make('mode_of_travel')
->label('Mode of Travel')
->options([
'Rental' => 'Rental',
'Car' => 'Car',
'Bike' => 'Bike',
])
->reactive()
->placeholder('Select Mode of Travel'),
Forms\Components\DateTimePicker::make('in_time') Forms\Components\DateTimePicker::make('in_time')
->label('In Time') ->label('In Time')
->required() ->required()
@@ -207,6 +223,7 @@ class VisitorEntryResource extends Resource
public static function table(Table $table): Table public static function table(Table $table): Table
{ {
return $table return $table
// ->modifyQueryUsing(fn (Builder $query) => $query->whereDate('created_at', today()))
->columns([ ->columns([
Tables\Columns\TextColumn::make('No.') Tables\Columns\TextColumn::make('No.')
->label('NO') ->label('NO')
@@ -237,15 +254,25 @@ class VisitorEntryResource extends Resource
->alignCenter() ->alignCenter()
->searchable() ->searchable()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mobile_number')
->label('Visitor Mobile Number')
->alignCenter()
->searchable()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('name') Tables\Columns\TextColumn::make('name')
->label('Visitor Name') ->label('Visitor Name')
->sortable() ->sortable()
->alignCenter() ->alignCenter()
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('mobile_number') Tables\Columns\TextColumn::make('company')
->label('Visitor Mobile Number') ->label('Visitor Company')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('employeeMaster.plant.name')
->label('Visited Plant')
->alignCenter() ->alignCenter()
->searchable()
->searchable() ->searchable()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('employeeMaster.name') Tables\Columns\TextColumn::make('employeeMaster.name')
@@ -268,6 +295,16 @@ class VisitorEntryResource extends Resource
->searchable() ->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('purpose_of_visit')
->label('Purpose of Visit')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('mode_of_travel')
->label('Mode of Travel')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('in_time') Tables\Columns\TextColumn::make('in_time')
->label('In Time') ->label('In Time')
->searchable() ->searchable()
@@ -319,7 +356,7 @@ class VisitorEntryResource extends Resource
->reactive() ->reactive()
->placeholder('Enter Register ID') ->placeholder('Enter Register ID')
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Rework', null); $set('type', null);
}), }),
Select::make('type') Select::make('type')
->label('Type') ->label('Type')
@@ -356,7 +393,24 @@ class VisitorEntryResource extends Resource
->reactive() ->reactive()
->placeholder('Enter Visitor Company') ->placeholder('Enter Visitor Company')
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Rework', null); $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') Select::make('employee_master_id')
->label('Employee Name') ->label('Employee Name')
@@ -381,9 +435,23 @@ class VisitorEntryResource extends Resource
]) ])
->query(function ($query, array $data) { ->query(function ($query, array $data) {
// Hide all records initially if no filters are applied // 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'])) { // 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) { // $query->where(function ($q) {
}); // });
// }
$hasAnyFilter = !empty($data['register_id'])
|| !empty($data['type'])
|| !empty($data['name'])
|| !empty($data['company'])
|| !empty($data['employee_master_id'])
|| !empty($data['employee_department'])
|| !empty($data['created_from'])
|| !empty($data['created_to']);
if (!$hasAnyFilter) {
$query->whereDate('created_at', today());
return;
} }
if (! empty($data['register_id'])) { if (! empty($data['register_id'])) {
@@ -399,14 +467,25 @@ class VisitorEntryResource extends Resource
} }
} }
// if (! empty($data['name'])) {
// $query->where('name', 'like', '%'.$data['name'].'%');
// }
if (! empty($data['name'])) { if (! empty($data['name'])) {
$query->where('name', 'like', '%'.$data['name'].'%'); $query->whereRaw(
'LOWER(name) LIKE ?',
['%' . strtolower($data['name']) . '%']
);
} }
if (! empty($data['company'])) { if (! empty($data['company'])) {
$query->where('company', 'like', '%'.$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'])) { if (! empty($data['employee_master_id'])) {
$query->where('employee_master_id', $data['employee_master_id']); $query->where('employee_master_id', $data['employee_master_id']);
} }
@@ -443,6 +522,10 @@ class VisitorEntryResource extends Resource
$indicators[] = 'Company: '.$data['company']; $indicators[] = 'Company: '.$data['company'];
} }
if (! empty($data['employee_department'])) {
$indicators[] = 'Employee Department: '.$data['employee_department'];
}
if (! empty($data['employee_master_id'])) { if (! empty($data['employee_master_id'])) {
$indicators[] = 'Employee Name: '.EmployeeMaster::where('id', $data['employee_master_id'])->value('name'); $indicators[] = 'Employee Name: '.EmployeeMaster::where('id', $data['employee_master_id'])->value('name');
} }
@@ -589,4 +672,5 @@ class VisitorEntryResource extends Resource
SoftDeletingScope::class, SoftDeletingScope::class,
]); ]);
} }
} }

View File

@@ -10,6 +10,8 @@ use Filament\Actions\Action;
use Filament\Resources\Pages\CreateRecord; use Filament\Resources\Pages\CreateRecord;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Livewire\Attributes\On; use Livewire\Attributes\On;
use App\Mail\VisitorMail;
use Illuminate\Support\Facades\Mail;
class CreateVisitorEntry extends CreateRecord class CreateVisitorEntry extends CreateRecord
{ {
@@ -19,36 +21,42 @@ class CreateVisitorEntry extends CreateRecord
public function processMobile($mobile) public function processMobile($mobile)
{ {
$visitor = VisitorEntry::where('mobile_number', $mobile)->latest()->first(); $registerId = $this->data['register_id'] ?? null;
$visitor = VisitorEntry::where('mobile_number', $mobile)->latest()->first();
if ($visitor) { if ($visitor) {
$employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first(); $employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first();
$this->form->fill([ $this->form->fill([
'register_id' => $visitor->register_id ?? '', 'register_id' => $registerId ?? '',
'mobile_number' => $mobile ?? '', 'mobile_number' => $visitor->mobile_number,
'name' => $visitor->name ?? '', 'name' => $visitor->name ?? '',
'company' => $visitor->company ?? '', 'company' => $visitor->company ?? '',
'type' => $visitor->type ?? '', 'type' => $visitor->type ?? '',
'department' => $employee->department ?? '', 'department' => $employee?->department ?? '',
'employee_master_id' => $visitor->employee_master_id->name ?? '', 'employee_master_id' => $visitor->employee_master_id,
'code' => $employee->code ?? '', 'code' => $employee?->code ?? '',
'purpose_of_visit' => '',
'in_time' => now(),
'out_time' => null,
'valid_upto' => null,
]); ]);
} }
else { else {
$registerId = $this->form->getState()['register_id'] ?? '';
$this->form->fill([ $this->form->fill([
'register_id' => $registerId ?? '', 'register_id' => $registerId ?? '',
'mobile_number' => $mobile ?? '', 'mobile_number' => $mobile,
'name' => $visitor->name ?? '', 'name' => '',
'company' => $visitor->company ?? '', 'company' => '',
'type' => $visitor->type ?? '', 'type' => '',
'department' => $employee->department ?? '', 'department' => '',
'employee_master_id' => $visitor->employee_master_id->name ?? '', 'employee_master_id' => null,
'code' => $employee->code ?? '', 'code' => '',
'purpose_of_visit' => '',
'in_time' => now(),
'out_time' => null,
'valid_upto' => null,
]); ]);
} }
} }
@@ -118,6 +126,21 @@ class CreateVisitorEntry extends CreateRecord
]; ];
} }
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 protected function getRedirectUrl(): string
{ {
return $this->getResource()::getUrl('view', ['record' => $this->record]); return $this->getResource()::getUrl('view', ['record' => $this->record]);

View File

@@ -520,7 +520,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -673,7 +673,7 @@ class CharacteristicsController extends Controller
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!", // 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
// ], 404); // ], 404);
} }
} elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) { } elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!", 'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
@@ -1562,7 +1562,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -1941,7 +1941,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -2399,7 +2399,7 @@ class CharacteristicsController extends Controller
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!", // 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
// ], 404); // ], 404);
} }
} elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) { } elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!", 'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
@@ -3666,7 +3666,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -4701,7 +4701,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];

View File

@@ -25,15 +25,15 @@ class ProductionCheckList extends Component
public $existingRecords = []; public $existingRecords = [];
public bool $shouldSkipChecklist = false; // public bool $shouldSkipChecklist = false;
public array $checklist = []; public array $checklist = [];
public $showChecklist = false; public $showChecklist = false;
public $skipChecklistValidation = false; // public $skipChecklistValidation = false;
protected $listeners = ['focus-item-id' => 'handleFocus', 'trigger-create' => 'doCreate',]; // protected $listeners = ['focus-item-id' => 'handleFocus', 'trigger-create' => 'doCreate',];
public $data = public $data =
[ [
@@ -45,23 +45,21 @@ class ProductionCheckList extends Component
'checklist' => [], 'checklist' => [],
]; ];
#[On('focus-item-id')] // public function doCreate()
public function handleFocus() // {
{ // $this->create();
$this->dispatch('focus-input');
}
public function doCreate()
{
$this->create();
$this->shouldSkipChecklist = false;
}
// $this->shouldSkipChecklist = false;
// }
public function mount($records = []) public function mount($records = [])
{ {
$this->records = collect($records); // $this->records = collect($records);
$this->records = $records;
foreach ($records as $record) {
$this->checklist[$record['id']] = 'ok';
}
} }
public function cancel() public function cancel()
@@ -255,11 +253,10 @@ class ProductionCheckList extends Component
]; ];
} }
public function updatedDataChecklist() // public function updatedDataChecklist()
{ // {
$this->dispatch('checklistUpdated', $this->data['checklist']); // $this->dispatch('checklistUpdated', $this->data['checklist']);
} // }
public function render() public function render()
{ {

View File

@@ -9,6 +9,7 @@ use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope; use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Mail\Mailables\Attachment;
class ImportTransitMail extends Mailable class ImportTransitMail extends Mailable
{ {
@@ -20,14 +21,17 @@ class ImportTransitMail extends Mailable
public $mailSubject; public $mailSubject;
public $excelPath;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($scheduleType, $tableData, $mailSubject) public function __construct($scheduleType, $tableData, $mailSubject, $excelPath)
{ {
$this->scheduleType = $scheduleType; $this->scheduleType = $scheduleType;
$this->tableData = $tableData ?? []; $this->tableData = $tableData ?? [];
$this->mailSubject = $mailSubject ?? 'Import Transit'; $this->mailSubject = $mailSubject ?? 'Import Transit';
$this->excelPath = $excelPath;
} }
/** /**
@@ -36,7 +40,7 @@ class ImportTransitMail extends Mailable
public function envelope(): Envelope public function envelope(): Envelope
{ {
return new Envelope( return new Envelope(
subject: 'Import Transit Mail', subject: 'Import Shipment InTransit Mail',
); );
} }
@@ -45,7 +49,9 @@ class ImportTransitMail extends Mailable
*/ */
public function content(): Content public function content(): Content
{ {
$greeting = '<b>Dear Sir</b>'; $now = now();
$reportDate = $now->format('d/m/Y');
$greeting = '<b>Dear Sir/Madam</b>,<br>Kindly find attached the Pending Import Shipment Status Report as on ' . $reportDate . ' for your reference.<br>We request you to review the shipments highlighted in <span style="background-color: yellow; font-weight: bold;">yellow</span> and arrange for their clearance at the earliest to avoid further delays and additional charges.<br>Please note that for shipments pending under <b>Telex Release</b> and <b>Duty Payment</b>, CFS charges will be commenced post ETA. We therefore urge you to expedite the necessary actions at your end.';
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same'; //$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
@@ -88,6 +94,14 @@ class ImportTransitMail extends Mailable
*/ */
public function attachments(): array public function attachments(): array
{ {
return []; return [
Attachment::fromStorageDisk(
'local',
$this->excelPath
)->as('Import_Transit_Report.xlsx')
->withMime(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
),
];
} }
} }

View File

@@ -23,6 +23,7 @@ class VisitorEntry extends Model
'employee_master_id', 'employee_master_id',
'number_of_person', 'number_of_person',
'valid_upto', 'valid_upto',
'mode_of_travel',
]; ];
public function employeeMaster(): BelongsTo public function employeeMaster(): BelongsTo

View File

@@ -10,7 +10,7 @@
"alperenersoy/filament-export": "^3.0", "alperenersoy/filament-export": "^3.0",
"althinect/filament-spatie-roles-permissions": "^2.3", "althinect/filament-spatie-roles-permissions": "^2.3",
"diogogpinto/filament-auth-ui-enhancer": "^1.0", "diogogpinto/filament-auth-ui-enhancer": "^1.0",
"erag/laravel-pwa": "^1.9", "erag/laravel-pwa": "^2.0",
"filament/filament": "^3.3", "filament/filament": "^3.3",
"intervention/image": "^3.11", "intervention/image": "^3.11",
"irazasyed/telegram-bot-sdk": "^3.15", "irazasyed/telegram-bot-sdk": "^3.15",

View File

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

View File

@@ -1,7 +1,11 @@
<div class="fixed inset-0 flex items-center justify-center z-50"> <div class="fixed inset-0 flex items-center justify-center z-50">
<div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto" {{-- <div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto"
style="width:30vw !important; max-width:none !important;"> style="width:30vw !important; max-width:none !important;"> --}}
<div
class="bg-white rounded-lg shadow-lg pointer-events-auto
w-full max-w-2xl max-h-[90vh] flex flex-col">
{{-- @if($records && $records->count()) --}} {{-- @if($records && $records->count()) --}}
@if(!empty($records) && count($records)) @if(!empty($records) && count($records))

View File

@@ -19,13 +19,13 @@
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
font-size: 14px; font-size: 10px;
white-space: nowrap !important; white-space: nowrap !important;
} }
th, td { th, td {
border: 1px solid #020813da; border: 1px solid #020813da;
padding: 8px 10px; padding: 8px 10px;
text-align: center; text-align: left;
white-space: nowrap !important; white-space: nowrap !important;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@@ -41,6 +41,13 @@
background-color: #f3f4f6; background-color: #f3f4f6;
} }
.status-column {
text-align: left !important;
white-space: normal !important;
min-width: 250px;
width: 250px;
vertical-align: top;
}
.footer { .footer {
text-align: center; text-align: center;
font-size: 13px; font-size: 13px;
@@ -64,30 +71,16 @@
<tr> <tr>
<th>No</th> <th>No</th>
<th>CRI RFQ Number</th> <th>CRI RFQ Number</th>
<th>Mail Received Date</th>
<th>Pricol Ref Number</th>
<th>Requestor</th> <th>Requestor</th>
<th>Shipper</th> <th>Shipper</th>
<th>Shipper Location</th> <th>Shipper Location</th>
<th>Shipper Invoice</th> <th>Shipper Invoice</th>
<th>Shipper Invoice Date</th> <th>Shipper Invoice Date</th>
<th>Custom Agent Name</th> <th>Custom Agent Name</th>
<th>ETA Date</th> <th>ETA</th>
<th>Status</th> <th>Status</th>
<th>Delivery Location</th> <th>Delivery Location</th>
<th>ETD Date</th> <th>ETD Date</th>
<th>Mode</th>
<th>Inco Terms</th>
<th>Port Of Loading</th>
<th>Port Of Discharge</th>
<th>Delivery City</th>
<th>Packages</th>
<th>Type of package</th>
<th>Gross Weight</th>
<th>Volume</th>
<th>Bill Number</th>
<th>Bill Received Date</th>
<th>Vessel Number</th>
<th>Remark</th> <th>Remark</th>
</tr> </tr>
</thead> </thead>
@@ -96,19 +89,26 @@
<tr style="{{ $row['is_transit_identified'] == 1 ? 'background-color:#FFFF00;' . 'font-weight: bold;' : '' }}"> <tr style="{{ $row['is_transit_identified'] == 1 ? 'background-color:#FFFF00;' . 'font-weight: bold;' : '' }}">
<td>{{ $loop->iteration }}</td> <td>{{ $loop->iteration }}</td>
<td>{{ $row['cri_rfq_number'] }}</td> <td>{{ $row['cri_rfq_number'] }}</td>
<td>{{ $row['mail_received_date'] }}</td> {{-- <td>{{ $row['mail_received_date'] }}</td> --}}
<td>{{ $row['pricol_ref_number'] }}</td> {{-- <td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</td> --}}
{{-- <td>{{ $row['pricol_ref_number'] }}</td> --}}
<td>{{ $row['requester'] }}</td> <td>{{ $row['requester'] }}</td>
<td>{{ $row['shipper'] }}</td> <td>{{ $row['shipper'] }}</td>
<td>{{ $row['shipper_location'] }}</td> <td>{{ $row['shipper_location'] }}</td>
<td>{{ $row['shipper_invoice'] }}</td> <td>{{ $row['shipper_invoice'] }}</td>
<td>{{ $row['shipper_invoice_date'] }}</td> {{-- <td>{{ $row['shipper_invoice_date'] }}</td> --}}
<td>{{ \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') }}</td>
<td>{{ $row['customs_agent_name'] }}</td> <td>{{ $row['customs_agent_name'] }}</td>
<td>{{ $row['eta_date'] }}</td> {{-- <td>{{ $row['eta_date'] }}</td> --}}
<td>{{ $row['status'] }}</td> <td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</td>
{{-- <td>{{ $row['status'] }}</td> --}}
<td class="status-column">
{{ $row['status'] }}
</td>
<td>{{ $row['delivery_location'] }}</td> <td>{{ $row['delivery_location'] }}</td>
<td>{{ $row['etd_date'] }}</td> {{-- <td>{{ $row['etd_date'] }}</td> --}}
<td>{{ $row['mode'] }}</td> <td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td>
{{-- <td>{{ $row['mode'] }}</td>
<td>{{ $row['inco_terms'] }}</td> <td>{{ $row['inco_terms'] }}</td>
<td>{{ $row['port_of_loading'] }}</td> <td>{{ $row['port_of_loading'] }}</td>
<td>{{ $row['port_of_discharge'] }}</td> <td>{{ $row['port_of_discharge'] }}</td>
@@ -117,9 +117,10 @@
<td>{{ $row['type_of_package'] }}</td> <td>{{ $row['type_of_package'] }}</td>
<td>{{ $row['gross_weight'] }}</td> <td>{{ $row['gross_weight'] }}</td>
<td>{{ $row['volume'] }}</td> <td>{{ $row['volume'] }}</td>
<td>{{ $row['bill_number'] }}</td> <td>{{ $row['bill_number'] }}</td> --}}
<td>{{ $row['bill_received_date'] }}</td> {{-- <td>{{ $row['bill_received_date'] }}</td> --}}
<td>{{ $row['vessel_number'] }}</td> {{-- <td>{{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }}</td>
<td>{{ $row['vessel_number'] }}</td> --}}
<td>{{ $row['remark'] }}</td> <td>{{ $row['remark'] }}</td>
</tr> </tr>
@endforeach @endforeach

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -41,32 +41,26 @@
.badge-header { .badge-header {
background: #1a1a2e; background: #1a1a2e;
color: #fff; color: #fff;
text-align: center; padding: 1.5mm 2mm;
padding: 2mm 2mm 1.5mm;
font-size: 8pt; font-size: 8pt;
font-weight: bold; font-weight: bold;
letter-spacing: 1px; letter-spacing: 1px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-shrink: 0;
} }
.badge-header .type { .badge-header .type { font-size: 9pt; letter-spacing: 2px; }
font-size: 9pt; .badge-header .badge-id { font-size: 7pt; opacity: 0.85; }
letter-spacing: 2px;
}
.badge-header .badge-id {
font-size: 7pt;
opacity: 0.85;
}
/* ── Body ── */ /* ── Body ── */
.badge-body { .badge-body {
display: flex; display: flex;
flex: 1; flex: 1;
padding: 2mm; padding: 1.5mm 2mm;
gap: 2mm; gap: 2mm;
overflow: hidden;
} }
/* ── Fields (left) ── */ /* ── Fields (left) ── */
@@ -74,82 +68,104 @@
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.2mm; overflow: hidden;
} }
.field-row { .field-row {
display: grid; display: grid;
grid-template-columns: 16mm 3mm 1fr; grid-template-columns: 16mm 3mm 1fr;
line-height: 1.3; line-height: 1.25;
margin-bottom: 0.7mm; margin-bottom: 0.6mm;
align-items: start;
} }
.field-label { .field-label {
color: #000; /* was #555 — now pure black */ color: #000;
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; /* was normal — now bold */ font-weight: 700;
white-space: nowrap;
} }
.field-colon { .field-colon {
color: #000; /* was #555 — now pure black */ color: #000;
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; /* added bold */ font-weight: 700;
text-align: center; text-align: center;
} }
.field-value { .field-value {
font-weight: 700; /* was 600 — now fully bold */ font-weight: 700;
font-size: 6.5pt; font-size: 6.5pt;
color: #000; /* was #111 — now pure black */ color: #000;
/* Prevent wrapping — truncate with ellipsis if too long */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
/* ── Photo (right) ── */ /* ── Photo column (right) ── */
.badge-photo { .badge-photo {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 1mm;
width: 18mm; width: 18mm;
flex-shrink: 0;
gap: 0.5mm;
} }
.badge-photo img { .badge-photo img {
width: 16mm; width: 16mm;
height: 18mm; height: 16mm;
object-fit: cover; object-fit: cover;
border: 1px solid #ccc; border: 1px solid #000;
} }
.badge-photo .no-photo { .badge-photo .no-photo {
width: 16mm; width: 16mm;
height: 18mm; height: 16mm;
border: 1.5px dashed #000; /* was #aaa — darker border */ border: 1.5px dashed #000;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 6pt; /* slightly larger */ font-size: 6pt;
color: #000; /* was #aaa */ color: #000;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
} }
.host-sign { .host-sign {
font-size: 6pt; /* was 5.5pt — slightly larger */ font-size: 6pt;
color: #000; /* was #555 — now pure black */ color: #000;
font-weight: 700; /* added bold */ font-weight: 700;
text-align: center; text-align: center;
border-top: 1px solid #000; /* was 0.5px #aaa — darker line */ border-top: 1px solid #000;
padding-top: 0.5mm; padding-top: 0.5mm;
width: 100%; width: 100%;
} }
/* ── QR code ── */
.visitor-qr {
margin-top: 1mm;
width: 18mm;
display: flex;
justify-content: center;
}
.visitor-qr svg {
width: 16mm !important;
height: 16mm !important;
display: block;
}
/* ── Footer ── */ /* ── Footer ── */
.badge-footer { .badge-footer {
border-top: 1px solid #000; /* was 0.5px #ddd — darker line */ border-top: 1px solid #000;
padding: 1mm 2mm; padding: 0.8mm 2mm;
text-align: right; text-align: right;
font-size: 6pt; /* was 5.5pt — slightly larger */ font-size: 6pt;
color: #000; /* was #888 — now pure black */ color: #000;
font-weight: 700; /* added bold */ font-weight: 700;
flex-shrink: 0;
} }
@media print { @media print {
@@ -158,9 +174,9 @@
} }
</style> </style>
</head> </head>
<body onload="window.print()"> <body>
{{-- ── Print button (visible on screen only, hidden when printing) ── --}} {{-- ── Print / Close buttons (screen only) ── --}}
<div class="no-print" style="padding: 8px; text-align:center; background:#f3f4f6;"> <div class="no-print" style="padding: 8px; text-align:center; background:#f3f4f6;">
<button onclick="window.print()" style="padding:6px 18px; background:#1a1a2e; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:13px;"> <button onclick="window.print()" style="padding:6px 18px; background:#1a1a2e; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:13px;">
🖨️ Print Badge 🖨️ Print Badge
@@ -175,7 +191,7 @@
{{-- Header --}} {{-- Header --}}
<div class="badge-header"> <div class="badge-header">
<span class="type">{{ strtoupper($visitor->type ?? 'VISITOR') }}</span> <span class="type">{{ strtoupper($visitor->type ?? 'VISITOR') }}</span>
<span class="badge-id">#{{ str_pad($visitor->register_id, 5, '0', STR_PAD_LEFT) }}</span> <span class="badge-id">#{{ $visitor->register_id ?? str_pad($visitor->id, 5, '0', STR_PAD_LEFT) }}</span>
</div> </div>
{{-- Body --}} {{-- Body --}}
@@ -183,61 +199,62 @@
{{-- Left: fields --}} {{-- Left: fields --}}
<div class="badge-fields"> <div class="badge-fields">
<div class="field-row"> <div class="field-row">
<span class="field-label">Name</span> <span class="field-label">Name</span>
<span class="field-colon">:</span> <span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->name) }}</span> <span class="field-value">{{ strtoupper($visitor->name) }}</span>
</div>
<div class="field-row">
<span class="field-label">Company</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->company }}</span>
</div>
<div class="field-row">
<span class="field-label">To Meet</span>
<span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->name ?? '—') }}</span>
</div>
<div class="field-row">
<span class="field-label">Dept</span>
<span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->department ?? $visitor->department ?? '—') }}</span>
</div>
<div class="field-row">
<span class="field-label">Valid Upto</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->valid_upto ? \Carbon\Carbon::parse($visitor->valid_upto)->format('d/m/Y H:i:s') : '—' }}</span>
</div>
<div class="field-row">
<span class="field-label">Date & Time</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->in_time ? \Carbon\Carbon::parse($visitor->in_time)->format('d/m/Y H:i:s') : '—' }}</span>
</div>
<div class="field-row">
<span class="field-label">No of Visitors</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->number_of_person ?? 1 }}</span>
</div>
</div> </div>
<div class="field-row">
<span class="field-label">Company</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->company }}</span>
</div>
<div class="field-row">
<span class="field-label">To Meet</span>
<span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->name ?? '—') }}</span>
</div>
<div class="field-row">
<span class="field-label">Dept</span>
<span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->department ?? $visitor->department ?? '—') }}</span>
</div>
<div class="field-row">
<span class="field-label">Valid Upto</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->valid_upto ? \Carbon\Carbon::parse($visitor->valid_upto)->format('d/m/Y H:i:s') : '—' }}</span>
</div>
<div class="field-row">
<span class="field-label">Date & Time</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->in_time ? \Carbon\Carbon::parse($visitor->in_time)->format('d/m/Y H:i:s') : '—' }}</span>
</div>
<div class="field-row">
<span class="field-label">No of Visitors</span>
<span class="field-colon">:</span>
<span class="field-value">{{ $visitor->number_of_person ?? 1 }}</span>
</div>
</div>
{{-- Right: photo + host sign --}} {{-- Right: photo + host sign + QR --}}
<div class="badge-photo"> <div class="badge-photo">
@if($photoUrl) @if($photoUrl)
<img src="{{ $photoUrl }}" alt="Visitor Photo" /> <img src="{{ $photoUrl }}" alt="Visitor Photo" />
@else @else
<div class="no-photo">No Photo</div> <div class="no-photo">No Photo</div>
@endif @endif
<div class="host-sign">Host Sign</div> <div class="host-sign">Host Sign</div>
<div class="visitor-qr" style="margin-top:2mm;">
{{-- {!! QrCode::size(25) {{-- QR Code high res, with quiet zone and high error correction --}}
->margin(0) @if(!empty($visitor->register_id))
->generate($visitor->register_id) !!} --}} <div class="visitor-qr">
@if(!empty($visitor->register_id)) {!! QrCode::size(300)
{!! QrCode::size(35) ->margin(2)
->margin(0) ->errorCorrection('H')
->generate((string) $visitor->register_id) !!} ->generate((string) $visitor->register_id) !!}
@endif </div>
</div> @endif
</div> </div>
</div> </div>
@@ -247,5 +264,11 @@
</div> </div>
<script>
window.addEventListener('load', function () {
setTimeout(function () { window.print(); }, 300);
});
</script>
</body> </body>
</html> </html>