57 Commits

Author SHA1 Message Date
dhanabalan
1ce7995105 removed inspection status column in production characteristic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 58s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 2m4s
Laravel Pint / pint (pull_request) Successful in 2m59s
Laravel Larastan / larastan (pull_request) Failing after 4m20s
2026-07-13 14:03:27 +05:30
dhanabalan
d5cd1437fe Removed afterStateUpdated method in actions control
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 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 2m22s
Laravel Larastan / larastan (pull_request) Failing after 4m6s
2026-07-09 12:40:13 +05:30
dhanabalan
d4d101c5c9 Added searchable method for plant and work center and updated_by name on every change and deleted_at column added at the end and Enhance EquipmentMasterResource form
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 18s
Laravel Pint / pint (pull_request) Successful in 3m1s
Laravel Larastan / larastan (pull_request) Failing after 5m2s
2026-07-08 18:44:17 +05:30
dhanabalan
b8cb0aa237 Added number of person in visitor mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 20s
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 1m45s
Laravel Larastan / larastan (pull_request) Failing after 3m17s
2026-07-08 16:18:22 +05:30
dhanabalan
eef42d9736 changed logic in pallet print controller
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 14s
Laravel Pint / pint (pull_request) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m5s
2026-07-08 11:29:21 +05:30
dhanabalan
3316c11036 issue solved undefined column error in wire
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 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Laravel Pint / pint (pull_request) Successful in 1m56s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
2026-07-08 11:20:24 +05:30
dhanabalan
bf22ef5af0 changed logic in wire pallet print
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 1m47s
Laravel Larastan / larastan (pull_request) Failing after 3m28s
2026-07-08 11:18:50 +05:30
dhanabalan
52868742c0 Added created by and updated by in customer po master 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 1m47s
Laravel Larastan / larastan (pull_request) Failing after 3m18s
2026-07-08 10:47:27 +05:30
dhanabalan
30175a71d3 Added id column for customer po 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 1m59s
Laravel Larastan / larastan (pull_request) Failing after 3m20s
2026-07-08 10:25:12 +05:30
dhanabalan
5fe8eeaeee Added plant code validation logic in resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 22s
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) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m25s
2026-07-08 09:58:02 +05:30
dhanabalan
fa10ea14fe removed unwanted lines in create panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Laravel Pint / pint (pull_request) Successful in 1m45s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2026-07-08 09:56:36 +05:30
dhanabalan
f0af6853ee Added updated logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 34s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 21s
Laravel Pint / pint (pull_request) Successful in 1m50s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2026-07-08 09:55:07 +05:30
dhanabalan
d213049fdd added one more validation in customer po master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m21s
Laravel Larastan / larastan (pull_request) Failing after 4m13s
2026-07-08 09:53:08 +05:30
dhanabalan
42e926f9c2 loaded pending pallet list against plant and customer po
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
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 2m38s
Laravel Larastan / larastan (pull_request) Failing after 5m8s
2026-07-07 12:39:29 +05:30
dhanabalan
140249e824 changed month logic in pallet print
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 1m52s
Laravel Larastan / larastan (pull_request) Failing after 3m27s
2026-07-07 09:22:33 +05:30
dhanabalan
5a77cdfdc2 Adjusted pdf column size in wire pallet pdf
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 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
2026-07-07 09:09:10 +05:30
dhanabalan
015976dcb5 Updated length validation on approver master
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 17s
Laravel Pint / pint (pull_request) Successful in 2m15s
Laravel Larastan / larastan (pull_request) Failing after 3m29s
2026-07-06 19:03:43 +05:30
dhanabalan
7627aa07fd changed item row size in wire pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 29s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 25s
Laravel Pint / pint (pull_request) Failing after 1m45s
Laravel Larastan / larastan (pull_request) Failing after 3m23s
2026-07-06 17:14:33 +05:30
dhanabalan
aad961260a changed logic in wire pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m0s
Laravel Larastan / larastan (pull_request) Failing after 3m54s
2026-07-06 17:12:26 +05:30
dhanabalan
305d28617b changed column size in wire pdf
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Larastan / larastan (pull_request) Failing after 1m51s
Laravel Pint / pint (pull_request) Failing after 1m45s
2026-07-06 17:09:33 +05:30
dhanabalan
851e753b74 adjusted size of the wire pallet pdf
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 2m9s
Laravel Larastan / larastan (pull_request) Failing after 4m18s
2026-07-06 17:04:28 +05:30
dhanabalan
c94688a794 added after state updated in wire master print 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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 2m14s
Laravel Larastan / larastan (pull_request) Failing after 3m31s
2026-07-06 16:17:56 +05:30
dhanabalan
9db6227566 modified logic against customer po in create 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 15s
Laravel Pint / pint (pull_request) Successful in 2m49s
Laravel Larastan / larastan (pull_request) Failing after 4m34s
2026-07-06 16:12:00 +05:30
dhanabalan
d24b4f35f4 removed select item_id box in wire master packing resource page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
2026-07-06 16:11:24 +05:30
dhanabalan
56656264c0 corrected logic pallet print controller
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 16s
Laravel Pint / pint (pull_request) Successful in 2m25s
Laravel Larastan / larastan (pull_request) Failing after 4m19s
2026-07-06 12:28:51 +05:30
dhanabalan
abf33605f5 changed logic of total box count in wire master print
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 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 3m57s
Laravel Larastan / larastan (pull_request) Failing after 5m44s
2026-07-06 12:12:55 +05:30
dhanabalan
60eb3c05a5 Added pallet in wire master print 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 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
2026-07-06 12:06:56 +05:30
dhanabalan
ccd06a4b6e changed logic in wire master print
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 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m27s
2026-07-06 11:59:49 +05:30
dhanabalan
0d6ced5f63 corrected logic in wire print page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 59s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m33s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 4m20s
2026-07-06 11:50:46 +05:30
dhanabalan
faa355ad79 Added group name of panel box validation 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 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 2m13s
Laravel Larastan / larastan (pull_request) Failing after 3m51s
2026-07-04 09:10:24 +05:30
dhanabalan
cc75016575 Added logic for characteristics not found halting record
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 2m8s
Laravel Larastan / larastan (pull_request) Failing after 3m39s
2026-07-04 09:04:06 +05:30
dhanabalan
6180cdda52 Added item id select box in wire master packing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 1m50s
Laravel Larastan / larastan (pull_request) Failing after 3m14s
2026-07-03 11:49:47 +05:30
dhanabalan
776d1664ce Added logic in panel check list
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m0s
Laravel Larastan / larastan (pull_request) Failing after 3m31s
2026-07-03 08:27:16 +05:30
dhanabalan
65b4ce50d3 solved issue in lower value in panel box
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m1s
Laravel Larastan / larastan (pull_request) Failing after 4m19s
2026-07-02 17:23:07 +05:30
dhanabalan
c338751a48 Added msg in import transit mail
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 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m21s
2026-07-01 09:51:52 +05:30
dhanabalan
075591459f Crted issue in characteristic approver master for filtering plant
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 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Failing after 31s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
2026-06-30 18:14:12 +05:30
dhanabalan
fc0a132c73 Added import and export wire master packing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
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 Pint / pint (pull_request) Successful in 1m53s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2026-06-30 14:32:16 +05:30
dhanabalan
a7e07affa0 Updated clear selection on plant or line name change
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 58s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m31s
Laravel Larastan / larastan (pull_request) Failing after 2m0s
Laravel Pint / pint (pull_request) Failing after 1m59s
2026-06-28 09:33:26 +05:30
dhanabalan
65f64b2915 Added rule and module of export dispatch
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 2m21s
Laravel Larastan / larastan (pull_request) Failing after 4m2s
2026-06-26 10:54:26 +05:30
dhanabalan
9ab0709c6d Added machines model in line
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 1m58s
Laravel Larastan / larastan (pull_request) Failing after 3m42s
2026-06-26 10:46:30 +05:30
dhanabalan
33425d6549 Added mail logic in gate out entry
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 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 1m54s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
2026-06-24 14:40:10 +05:30
dhanabalan
3d11ecc882 Added visitor out mail page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
2026-06-24 14:39:27 +05:30
dhanabalan
518f61b24d Updated serial_number column order in correct manner
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 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 1m59s
Laravel Larastan / larastan (pull_request) Failing after 4m15s
2026-06-23 17:40:00 +05:30
dhanabalan
7bdf72cc9f Updated column order in correct manner
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-23 17:38:46 +05:30
dhanabalan
b7d2ca4111 Added material invoice exporter and updated serial invoice exporter
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
2026-06-23 17:37:23 +05:30
dhanabalan
a62c4ce0c7 Added zmm_axial_force column in migration, model, resource, import, export, api on laser marking project
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 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m14s
2026-06-22 19:34:12 +05:30
dhanabalan
29b9eae080 Added logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 45s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m44s
Laravel Pint / pint (pull_request) Successful in 2m8s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2026-06-22 08:30:14 +05:30
dhanabalan
2e6129970c Added machine has many in model files
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 1m59s
Laravel Larastan / larastan (pull_request) Failing after 3m27s
2026-06-20 15:27:52 +05:30
dhanabalan
7e2098318e Added filter logic in machine page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
2026-06-20 15:26:09 +05:30
dhanabalan
021cdfa9c2 Added filter logic in work group master 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 16s
Laravel Pint / pint (pull_request) Successful in 2m6s
Laravel Larastan / larastan (pull_request) Failing after 3m24s
2026-06-20 12:21:33 +05:30
dhanabalan
7e97eed775 declared property in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m33s
2026-06-20 08:50:38 +05:30
dhanabalan
68c43b69e9 Added SAP Invoice Importer Page with validation
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 1m54s
Laravel Larastan / larastan (pull_request) Failing after 4m6s
2026-06-19 17:34:47 +05:30
dhanabalan
d6395224ff Added category column on report view and export logic
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-19 17:21:40 +05:30
dhanabalan
b069f3dbe7 Chnaged logic in import transit 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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Larastan / larastan (pull_request) Failing after 40s
Laravel Pint / pint (pull_request) Successful in 1m52s
2026-06-19 16:30:14 +05:30
dhanabalan
c307d5bc6a Added options in remark and i make text input for status
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 1m48s
Laravel Larastan / larastan (pull_request) Failing after 4m27s
2026-06-19 16:22:08 +05:30
dhanabalan
99cb1eb7a0 Updated warning label
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
2026-06-19 15:23:49 +05:30
dhanabalan
90876dda8d Added na radio option in quality validation
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 Pint / pint (pull_request) Successful in 1m52s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2026-06-19 14:55:01 +05:30
52 changed files with 2984 additions and 1385 deletions

View File

@@ -4,8 +4,10 @@ namespace App\Console\Commands;
use App\Mail\ImportTransitMail; use App\Mail\ImportTransitMail;
use App\Models\AlertMailRule; use App\Models\AlertMailRule;
use App\Models\EmployeeMaster;
use App\Models\ImportTransit; use App\Models\ImportTransit;
use App\Models\Plant; use App\Models\Plant;
use Filament\Facades\Filament;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use App\Exports\ImportTransitReportExport; use App\Exports\ImportTransitReportExport;
@@ -81,11 +83,22 @@ class SendImportTransit extends Command
'local' 'local'
); );
$updatedBy = $tableData->last()?->updated_by;
$employee = EmployeeMaster::where('code', $updatedBy)
->select('name', 'mobile_number')
->first();
$employeeName = $employee?->name;
$mobileNumber = $employee?->mobile_number;
$mail = new ImportTransitMail( $mail = new ImportTransitMail(
$scheduleType, $scheduleType,
$tableData, $tableData,
$mailSubject, $mailSubject,
$fileName $fileName,
$employeeName,
$mobileNumber,
); );
$toEmails = collect(explode(',', $rule->email)) $toEmails = collect(explode(',', $rule->email))
@@ -111,11 +124,9 @@ class SendImportTransit extends Command
->cc($ccEmails) ->cc($ccEmails)
->send($mail); ->send($mail);
$this->info( $this->info("Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails));
"Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails)
);
}
}
} }
} }
} }

View File

@@ -300,6 +300,8 @@ class ClassCharacteristicExporter extends Exporter
->label('ZQMM QTY'), ->label('ZQMM QTY'),
ExportColumn::make('zmm_operating_temperature') ExportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE'), ->label('ZMM OPERATING TEMPERATURE'),
ExportColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE'),
ExportColumn::make('mark_status') ExportColumn::make('mark_status')
->label('MARKED STATUS'), ->label('MARKED STATUS'),
ExportColumn::make('marked_datetime') ExportColumn::make('marked_datetime')

View File

@@ -36,15 +36,6 @@ class InvoiceValidationExporter extends Exporter
->label('ITEM DESCRIPTION'), ->label('ITEM DESCRIPTION'),
ExportColumn::make('stickerMaster.item.uom') ExportColumn::make('stickerMaster.item.uom')
->label('UNIT OF MEASURE'), ->label('UNIT OF MEASURE'),
ExportColumn::make('stickerMaster.material_type')
->label('MATERIAL TYPE')
->formatStateUsing(fn ($state) => match ($state) {
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
default => '-',
}),
ExportColumn::make('motor_scanned_status') ExportColumn::make('motor_scanned_status')
->label('MOTOR SCANNED STATUS'), ->label('MOTOR SCANNED STATUS'),
ExportColumn::make('pump_scanned_status') ExportColumn::make('pump_scanned_status')
@@ -65,10 +56,6 @@ class InvoiceValidationExporter extends Exporter
->label('LOAD RATE'), ->label('LOAD RATE'),
ExportColumn::make('upload_status') ExportColumn::make('upload_status')
->label('UPLOAD STATUS'), ->label('UPLOAD STATUS'),
ExportColumn::make('batch_number')
->label('BATCH NUMBER'),
ExportColumn::make('quantity')
->label('QUANTITY'),
ExportColumn::make('operator_id') ExportColumn::make('operator_id')
->label('OPERATOR ID'), ->label('OPERATOR ID'),
ExportColumn::make('created_at') ExportColumn::make('created_at')
@@ -90,7 +77,7 @@ class InvoiceValidationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string public static function getCompletedNotificationBody(Export $export): string
{ {
$body = 'Your invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.'; $body = 'Your serial invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) { if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.'; $body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';

View File

@@ -0,0 +1,85 @@
<?php
namespace App\Filament\Exports;
use App\Models\InvoiceValidation;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class MaterialInvoiceValidationExporter extends Exporter
{
protected static ?string $model = InvoiceValidation::class;
public static function getColumns(): array
{
static $rowNumber = 0;
return [
// ExportColumn::make('id')
// ->label('ID'),
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('invoice_number')
->label('INVOICE NUMBER'),
ExportColumn::make('stickerMaster.item.code')
->label('ITEM CODE'),
ExportColumn::make('stickerMaster.item.description')
->label('ITEM DESCRIPTION'),
ExportColumn::make('stickerMaster.item.uom')
->label('UNIT OF MEASURE'),
ExportColumn::make('stickerMaster.material_type')
->label('MATERIAL TYPE')
->formatStateUsing(fn ($state) => match ($state) {
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
default => '-',
}),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
ExportColumn::make('batch_number')
->label('BATCH NUMBER'),
ExportColumn::make('quantity')
->label('QUANTITY'),
ExportColumn::make('load_rate')
->label('LOAD RATE'),
ExportColumn::make('upload_status')
->label('UPLOAD STATUS'),
ExportColumn::make('operator_id')
->label('OPERATOR ID'),
ExportColumn::make('created_at')
->label('CREATED AT'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
// ->dateTimeFormat('d-m-Y H:i:s'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your material invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;
}
}

View File

@@ -39,8 +39,6 @@ class ProductionCharacteristicExporter extends Exporter
->label('OBSERVED VALUE'), ->label('OBSERVED VALUE'),
ExportColumn::make('status') ExportColumn::make('status')
->label('STATUS'), ->label('STATUS'),
ExportColumn::make('inspection_status')
->label('INSPECTION STATUS'),
ExportColumn::make('remark') ExportColumn::make('remark')
->label('REMARK'), ->label('REMARK'),
ExportColumn::make('created_at') ExportColumn::make('created_at')

View File

@@ -28,8 +28,10 @@ class StickerMasterExporter extends Exporter
->label('PLANT CODE'), ->label('PLANT CODE'),
ExportColumn::make('item.code') ExportColumn::make('item.code')
->label('ITEM CODE'), ->label('ITEM CODE'),
ExportColumn::make('item.category')
->label('CATEGORY'),
ExportColumn::make('item.description') ExportColumn::make('item.description')
->label('ITEM DESCRIPTION'), ->label('DESCRIPTION'),
ExportColumn::make('item.uom') ExportColumn::make('item.uom')
->label('UNIT OF MEASURE'), ->label('UNIT OF MEASURE'),
ExportColumn::make('serial_number_motor') ExportColumn::make('serial_number_motor')

View File

@@ -14,6 +14,7 @@ class TempClassCharacteristicExporter extends Exporter
public static function getColumns(): array public static function getColumns(): array
{ {
static $rowNumber = 0; static $rowNumber = 0;
return [ return [
ExportColumn::make('no') ExportColumn::make('no')
->label('NO') ->label('NO')
@@ -299,6 +300,8 @@ class TempClassCharacteristicExporter extends Exporter
->label('ZQMM QTY'), ->label('ZQMM QTY'),
ExportColumn::make('zmm_operating_temperature') ExportColumn::make('zmm_operating_temperature')
->label('ZMM OPERATING TEMPERATURE'), ->label('ZMM OPERATING TEMPERATURE'),
ExportColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE'),
ExportColumn::make('winded_serial_number') ExportColumn::make('winded_serial_number')
->label('WINDED SERIAL NUMBER'), ->label('WINDED SERIAL NUMBER'),
ExportColumn::make('model_type') ExportColumn::make('model_type')
@@ -321,10 +324,10 @@ class TempClassCharacteristicExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string public static function getCompletedNotificationBody(Export $export): string
{ {
$body = 'Your temp class characteristic export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.'; $body = 'Your temp class characteristic export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) { if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.'; $body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
} }
return $body; return $body;

View File

@@ -0,0 +1,68 @@
<?php
namespace App\Filament\Exports;
use App\Models\WireMasterPacking;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class WireMasterPackingExporter extends Exporter
{
protected static ?string $model = WireMasterPacking::class;
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('customerPo.customer_po')
->label('CUSTOMER PO NUMBER'),
ExportColumn::make('wire_packing_number')
->label('WIRE PACKING NUMBER'),
ExportColumn::make('process_order')
->label('PROCESS ORDER'),
ExportColumn::make('batch_number')
->label('BATCH NUMBER'),
ExportColumn::make('weight')
->label('WEIGHT'),
ExportColumn::make('wire_packing_status')
->label('WIRE PACKING STATUS'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('scanned_at')
->label('SCANNED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('scanned_by')
->label('SCANNED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your wire master packing export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}
return $body;
}
}

View File

@@ -579,6 +579,10 @@ class ClassCharacteristicImporter extends Importer
->label('ZMM OPERATING TEMPERATURE') ->label('ZMM OPERATING TEMPERATURE')
->exampleHeader('ZMM OPERATING TEMPERATURE') ->exampleHeader('ZMM OPERATING TEMPERATURE')
->example(''), ->example(''),
ImportColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->exampleHeader('ZMM AXIAL FORCE')
->example(''),
ImportColumn::make('mark_status') ImportColumn::make('mark_status')
->label('MARKED STATUS') ->label('MARKED STATUS')
->exampleHeader('MARKED STATUS') ->exampleHeader('MARKED STATUS')

View File

@@ -111,6 +111,13 @@ class CustomerPoMasterImporter extends Importer
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'."; $warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'.";
} }
$existingPoItem = CustomerPoMaster::where('plant_id', $plant->id)->where('item_id', $item->id)->where('customer_po', $this->data['customer_po'])->where('customer_name', $this->data['customer_name'])->first();
if ($existingPoItem)
{
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already exist with item code '{$this->data['item']}' and customer name '{$this->data['customer_name']}'.";
}
// $user = User::where('name', $this->data['created_by'])->first(); // $user = User::where('name', $this->data['created_by'])->first();
// if (! $user) { // if (! $user) {
// $warnMsg[] = 'User not found'; // $warnMsg[] = 'User not found';

View File

@@ -359,7 +359,7 @@ class InvoiceValidationImporter extends Importer
$curPanelBoxSerialNumber = $record->panel_box_serial_number ?? null; $curPanelBoxSerialNumber = $record->panel_box_serial_number ?? null;
} }
$warnMsg[] = 'Record Item ID : '.$record->sticker_master_id.' Master Item ID : '.$stickId; $warnMsg[] = 'Invoice Record Item ID : '.$record->sticker_master_id.' Master Item ID : '.$stickId;
if ($record->invoice_number != $invoiceNumber) { if ($record->invoice_number != $invoiceNumber) {
$stickId = null; $stickId = null;
$warnMsg[] = 'Invoice number mismatch with existing record!'; $warnMsg[] = 'Invoice number mismatch with existing record!';

View File

@@ -0,0 +1,308 @@
<?php
namespace App\Filament\Imports;
use App\Models\InvoiceValidation;
use App\Models\Item;
use App\Models\Plant;
use App\Models\StickerMaster;
use Carbon\Carbon;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Str;
class SapInvoiceValidationImporter extends Importer
{
protected static ?string $model = InvoiceValidation::class;
public static function getColumns(): array
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('PLANT CODE')
->example('2040')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('invoice_number')
->requiredMapping()
->exampleHeader('INVOICE NUMBER')
->example('INV000001')
->label('INVOICE NUMBER')
->rules(['required']),
ImportColumn::make('item_reference') // stickerMaster
->requiredMapping()
->exampleHeader('ITEM CODE')
->example('123456')
->label('ITEM CODE')
// ->relationship() // resolveUsing: 'items.code'
->rules(['required']),
ImportColumn::make('serial_number')
->requiredMapping()
->exampleHeader('SERIAL NUMBER')
->example('12345678901234')
->label('SERIAL NUMBER'),
ImportColumn::make('scanned_status_set')
->requiredMapping()
->exampleHeader('PUMPSET SCANNED STATUS')
->example('1')
->label('PUMPSET SCANNED STATUS'),
ImportColumn::make('created_at')
->requiredMapping()
->exampleHeader('CREATED AT')
->example('19-06-2026 15:00:00')
->label('CREATED AT')
->rules(['required']),
ImportColumn::make('operator_id')
->requiredMapping()
->exampleHeader('OPERATOR ID')
->example('USER00001')
->label('OPERATOR ID')
->rules(['required']),
];
}
public function resolveRecord(): ?InvoiceValidation
{
// return InvoiceValidation::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
$warnMsg = [];
$plantId = null;
$stickId = null;
$plantCod = $this->data['plant'];
$invoiceNumber = strtoupper(trim($this->data['invoice_number'])) ?? null;
$iCode = strtoupper(trim($this->data['item_reference'])) ?? null;
$serialNumber = trim($this->data['serial_number']) ?? null;
$curPumpSetQr = trim($this->data['scanned_status_set']) ?? null;
$curScanStatus = null;
$loadRate = 0;
$operatorId = trim($this->data['operator_id']);
$createdAt = $this->data['created_at'];
$createdBy = Filament::auth()->user()?->name;
$updatedBy = $createdBy;
$packCnt = 0;
$scanCnt = 0;
$hasPumpSetQr = null;
$hadPumpSetQr = null;
if ($plantCod == null || $plantCod == '') {
$warnMsg[] = "Plant code can't be empty!";
} elseif ($invoiceNumber == null || $invoiceNumber == '') {
$warnMsg[] = "Invoice number can't be empty!";
} elseif ($iCode == null || $iCode == '') {
$warnMsg[] = "Item code can't be empty!";
} elseif ($serialNumber == null || $serialNumber == '') {
$warnMsg[] = "Serial number can't be empty!";
} elseif ($curPumpSetQr != null && $curPumpSetQr != '' && $curPumpSetQr != '1' && $curPumpSetQr != 1) {
$warnMsg[] = 'PumpSet scanned status is invalid!';
} elseif ($operatorId == null || $operatorId == '') {
$warnMsg[] = "Operator ID can't be empty!";
} elseif ($createdAt == null || $createdAt == '') {
$warnMsg[] = "Created at timestamp can't be empty!";
}
if (Str::length($plantCod) > 0) {
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found!';
} elseif ($plantCod == '2040') { // 2040
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant code not found!';
} else {
$plantId = $plant->id;
}
} else {
$warnMsg[] = "Unknown plant code '$plantCod' found!";
}
}
if (Str::length($invoiceNumber) > 0 && ! ctype_alnum($invoiceNumber)) {
$warnMsg[] = "Invalid invoice number '$invoiceNumber' found!";
} elseif (Str::length($iCode) > 0 && (Str::length($iCode) < 6 || ! ctype_alnum($iCode))) {
$warnMsg[] = "Invalid item code '$iCode' found!";
} elseif ($plantId) {
$itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found in item master!';
} else {
$itemCode = Item::where('code', $iCode)->where('plant_id', $plantId)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found in item master for the given plant!';
} else {
$itemId = $itemCode->id;
$itemCode = StickerMaster::where('item_id', $itemId)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found in sticker master!';
} else {
if ($plantId) {
$itemCode = StickerMaster::where('item_id', $itemId)->where('plant_id', $plantId)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found in sticker master for the given plant!';
} elseif ($itemCode->material_type != '' && $itemCode->material_type != null) {
$stickId = null;
$warnMsg[] = 'Material invoice item code found!';
} else {
$stickId = $itemCode->id;
$loadRate = $itemCode->load_rate ?? 0;
$invalidPackage = false;
$hasMotorQr = $itemCode->tube_sticker_motor ?? null;
$hasPumpQr = $itemCode->tube_sticker_pump ?? null;
$hasPumpSetQr = $itemCode->tube_sticker_pumpset ?? null;
$hasCapacitorQr = $itemCode->panel_box_code ?? null;
if (! $hasMotorQr && ! $hasPumpQr && ! $hasPumpSetQr) {// && ! $hasCapacitorQr
$hasMotorQr = $itemCode->pack_slip_motor ?? null;
$hasPumpQr = $itemCode->pack_slip_pump ?? null;
$hasPumpSetQr = $itemCode->pack_slip_pumpset ?? null;
} else {
if (! $hasPumpSetQr && ! $hasPumpQr) {
$hasPumpQr = $itemCode->pack_slip_pump ?? null;
}
$hasTubeMotorQr = $itemCode->tube_sticker_motor ?? null;
$hasPackMotorQr = $itemCode->pack_slip_motor ?? null;
$hasTubePumpSetQr = $itemCode->tube_sticker_pumpset ?? null;
$hasPackPumpSetQr = $itemCode->pack_slip_pumpset ?? null;
if ($hasTubeMotorQr != $hasPackMotorQr || $hasTubePumpSetQr != $hasPackPumpSetQr) {
$invalidPackage = true;
}
}
if ($hasMotorQr || $hasPumpQr || ! $hasPumpSetQr || $hasCapacitorQr || $invalidPackage) {
$stickId = null;
$warnMsg[] = "Item code doesn't have valid package type to proceed!";
} else {
$packCnt++;
}
}
}
}
}
}
}
if ($stickId) {
$record = InvoiceValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
if ($record) {
if ($record->sticker_master_id != $stickId) {
$stickId = null;
$warnMsg[] = 'Item code mismatch with existing record!';
} else {
$record = InvoiceValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)
->whereHas('stickerMasterRelation.item', function ($query) use ($plantId, $iCode) {
$query->where('plant_id', $plantId)->where('code', $iCode);
})
->first();
if ($record) {
$hadPumpSetQr = $record->scanned_status_set ?? null;
if ($hadPumpSetQr && $hasPumpSetQr) {
$curPumpSetQr = $hadPumpSetQr;
}
$warnMsg[] = 'Invoice Record Item ID : '.$record->sticker_master_id.' Master Item ID : '.$stickId;
if ($record->invoice_number != $invoiceNumber) {
$stickId = null;
$warnMsg[] = 'Invoice number mismatch with existing record!';
} elseif ($record->scanned_status == 'Scanned') {
$stickId = null;
return null;
} else {
if ($hasPumpSetQr) {
$scanCnt = $curPumpSetQr ? $scanCnt + 1 : $scanCnt;
$record->scanned_status_set = $curPumpSetQr;
if ($packCnt == $scanCnt) {
$record->scanned_status = 'Scanned';
}
$record->upload_status = 'Y';
$record->updated_by = $updatedBy;
$record->save();
return null;
}
}
}
}
}
}
if ($stickId) {
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$cDateTime = null;
foreach ($formats as $format) {
try {
$cDateTime = Carbon::createFromFormat($format, $createdAt);
break;
} catch (\Exception $e) {
// $warnMsg[] = "Date format mismatch with format: $format";
}
}
if (! isset($cDateTime)) {
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
if ($stickId) {
if ($hasPumpSetQr) {
$scanCnt = $curPumpSetQr ? $scanCnt + 1 : $scanCnt;
if ($packCnt == $scanCnt) {
$curScanStatus = 'Scanned';
} else {
$curScanStatus = null;
}
}
// $curScanStatus
InvoiceValidation::updateOrCreate([
'plant_id' => $plantId,
'sticker_master_id' => $stickId,
'serial_number' => $serialNumber,
],
[
'invoice_number' => $invoiceNumber,
'scanned_status_set' => $curPumpSetQr,
'scanned_status' => $curScanStatus,
'load_rate' => $loadRate,
'upload_status' => 'Y',
'operator_id' => $operatorId,
'created_by' => $createdBy,
'created_at' => $cDateTime->format('Y-m-d H:i:s'),
'updated_by' => $updatedBy,
]);
}
return null;
// return new InvoiceValidation;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your sap invoice validation import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;
}
}

View File

@@ -579,6 +579,10 @@ class TempClassCharacteristicImporter extends Importer
->label('ZMM OPERATING TEMPERATURE') ->label('ZMM OPERATING TEMPERATURE')
->exampleHeader('ZMM OPERATING TEMPERATURE') ->exampleHeader('ZMM OPERATING TEMPERATURE')
->example(''), ->example(''),
ImportColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->exampleHeader('ZMM AXIAL FORCE')
->example(''),
ImportColumn::make('winded_serial_number') ImportColumn::make('winded_serial_number')
->label('WINDed SERIAL NUMBER') ->label('WINDed SERIAL NUMBER')
->exampleHeader('WINDED SERIAL NUMBER') ->exampleHeader('WINDED SERIAL NUMBER')
@@ -605,15 +609,15 @@ class TempClassCharacteristicImporter extends Importer
// 'email' => $this->data['email'], // 'email' => $this->data['email'],
// ]); // ]);
return new TempClassCharacteristic(); return new TempClassCharacteristic;
} }
public static function getCompletedNotificationBody(Import $import): string public static function getCompletedNotificationBody(Import $import): string
{ {
$body = 'Your temp class characteristic import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.'; $body = 'Your temp class characteristic import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) { if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.'; $body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
} }
return $body; return $body;

View File

@@ -0,0 +1,96 @@
<?php
namespace App\Filament\Imports;
use App\Models\WireMasterPacking;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
class WireMasterPackingImporter extends Importer
{
protected static ?string $model = WireMasterPacking::class;
public static function getColumns(): array
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('PLANT CODE')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('item')
->requiredMapping()
->exampleHeader('ITEM CODE')
->example('630214')
->label('ITEM CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('customer_po_master_id')
->requiredMapping()
->exampleHeader('CUSTOMER PO NUMBER')
->example('PO12345')
->label('CUSTOMER PO NUMBER')
->numeric()
->rules(['required', 'integer']),
ImportColumn::make('wire_packing_number')
->exampleHeader('WIRE PACKING NUMBER')
->example('WP001')
->label('WIRE PACKING NUMBER'),
ImportColumn::make('process_order')
->exampleHeader('PROCESS ORDER')
->example('PO001')
->label('PROCESS ORDER'),
ImportColumn::make('batch_number')
->exampleHeader('BATCH NUMBER')
->example('BN001')
->label('BATCH NUMBER'),
ImportColumn::make('weight')
->exampleHeader('WEIGHT')
->example('100.5')
->label('WEIGHT'),
ImportColumn::make('wire_packing_status')
->exampleHeader('WIRE PACKING STATUS')
->example('Active')
->label('WIRE PACKING STATUS'),
ImportColumn::make('scanned_at')
->requiredMapping()
->rules(['required', 'datetime']),
ImportColumn::make('created_by')
->exampleHeader('CREATED BY')
->example('John Doe')
->label('CREATED BY'),
ImportColumn::make('updated_by')
->exampleHeader('UPDATED BY')
->example('Jane Smith')
->label('UPDATED BY'),
ImportColumn::make('scanned_by')
->exampleHeader('SCANNED BY')
->example('John Doe')
->label('SCANNED BY'),
];
}
public function resolveRecord(): ?WireMasterPacking
{
// return WireMasterPacking::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
return new WireMasterPacking();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your wire master packing import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
}
return $body;
}
}

View File

@@ -2,6 +2,8 @@
namespace App\Filament\Pages; namespace App\Filament\Pages;
use App\Mail\VisitorOutMail;
use App\Models\EmployeeMaster;
use App\Models\Plant; use App\Models\Plant;
use App\Models\VisitorEntry; use App\Models\VisitorEntry;
use Carbon\Carbon; use Carbon\Carbon;
@@ -15,6 +17,8 @@ use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use App\Mail\VisitorMail;
use Illuminate\Support\Facades\Mail;
class GateOutEntry extends Page implements HasForms class GateOutEntry extends Page implements HasForms
{ {
@@ -162,6 +166,16 @@ class GateOutEntry extends Page implements HasForms
$entry->out_time = now(); $entry->out_time = now();
$entry->save(); $entry->save();
$employee = EmployeeMaster::find($entry->employee_master_id);
if ($employee && !empty($employee->email)) {
Mail::to($employee->email)
->send(new VisitorOutMail($entry)); // or ->send()
}
else{
\Log::warning('No email found for employee ID: ' . $entry->employee_master_id);
}
Notification::make() Notification::make()
->title('Gate Pass Processed') ->title('Gate Pass Processed')
->body('Visitor marked as exited.') ->body('Visitor marked as exited.')

View File

@@ -15,6 +15,7 @@ use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Log;
class WireMasterPrint extends Page class WireMasterPrint extends Page
{ {
@@ -77,41 +78,69 @@ class WireMasterPrint extends Page
return []; return [];
} }
return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id'); return CustomerPoMaster::where('plant_id', $plantId)->distinct()->pluck('customer_po', 'customer_po'); //->pluck('customer_po', 'id'); ->distinct()
}) })
->required(), ->required()
select::make('scan_pallet_no') ->afterStateUpdated(function ($state, callable $set) {
$set('scan_pallet_no', null);
}),
Select::make('scan_pallet_no')
->label('Scan Pallet No') ->label('Scan Pallet No')
->reactive() ->reactive()
->searchable()
->options(function ($get) { ->options(function ($get) {
$plantId = $get('plant_id'); // $plantId = $get('plant_id');
$customerPoId = $get('customer_po_master_id'); // $customerPoId = $get('customer_po_master_id');
if (! $plantId || ! $customerPoId) { // if (! $plantId || ! $customerPoId) {
// return [];
// }
// $palletNumbers = WireMasterPacking::query()
// ->select('wire_packing_number')
// ->where('plant_id', $plantId)
// ->where('customer_po_master_id', $customerPoId)
// ->whereNotNull('wire_packing_number')
// ->groupBy('wire_packing_number')
// ->havingRaw('COUNT(*) = COUNT(wire_packing_status)')
// ->havingRaw("SUM(CASE WHEN TRIM(wire_packing_status) = '' THEN 1 ELSE 0 END) = 0")
// ->orderBy('wire_packing_number', 'asc')
// ->pluck('wire_packing_number')
// ->toArray();
// return collect($palletNumbers)
// ->mapWithKeys(fn ($number) => [$number => $number])
// ->toArray();
//..New Logic
$plantId = $get('plant_id');
$customerPo = $get('customer_po_master_id');
if (! $plantId || ! $customerPo)
{
return []; return [];
} }
$poIds = CustomerPoMaster::where('plant_id', $plantId)->where('customer_po', $customerPo)->pluck('id');
$palletNumbers = WireMasterPacking::query() $palletNumbers = WireMasterPacking::query()
->select('wire_packing_number')
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->where('customer_po_master_id', $customerPoId) ->whereIn('customer_po_master_id', $poIds)
->whereNotNull('wire_packing_number') ->whereNotNull('wire_packing_number')
->groupBy('wire_packing_number') ->groupBy('wire_packing_number')
->havingRaw('COUNT(*) = COUNT(wire_packing_status)') ->havingRaw('COUNT(*) = COUNT(wire_packing_status)')
->havingRaw("SUM(CASE WHEN TRIM(wire_packing_status) = '' THEN 1 ELSE 0 END) = 0") ->havingRaw("SUM(CASE WHEN TRIM(wire_packing_status) = '' THEN 1 ELSE 0 END) = 0")
->orderBy('wire_packing_number', 'asc') ->orderBy('wire_packing_number')
->pluck('wire_packing_number') ->pluck('wire_packing_number')
->toArray(); ->toArray();
return collect($palletNumbers) ->mapWithKeys(fn ($number) => [$number => $number]) ->toArray();
return collect($palletNumbers)
->mapWithKeys(fn ($number) => [$number => $number])
->toArray();
}) })
->afterStateUpdated(function ($state, callable $set, $get) { ->afterStateUpdated(function ($state, callable $set, $get) {
$palletNo = $state; $palletNo = $state;
$plantId = $get('plant_id'); $plantId = $get('plant_id');
$this->dispatch('loadData', $palletNo, $plantId); $this->dispatch('loadData', $palletNo, $plantId);
}) })
->extraAttributes([ ->extraAttributes([

View File

@@ -60,6 +60,7 @@ class AlertMailRuleResource extends Resource
'InvoiceTransit' => 'InvoiceTransit', 'InvoiceTransit' => 'InvoiceTransit',
'ImportTransit' => 'ImportTransit', 'ImportTransit' => 'ImportTransit',
'VehicleReport' => 'VehicleReport', 'VehicleReport' => 'VehicleReport',
'ExportDispatchReport' => 'ExportDispatchReport'
]), ]),
Forms\Components\Select::make('rule_name') Forms\Components\Select::make('rule_name')
->label('Rule Name') ->label('Rule Name')
@@ -73,6 +74,7 @@ class AlertMailRuleResource extends Resource
'InvoiceTransitMail' => 'Invoice Transit Mail', 'InvoiceTransitMail' => 'Invoice Transit Mail',
'ImportTransitMail' => 'Import Transit Mail', 'ImportTransitMail' => 'Import Transit Mail',
'VehicleReportMail' => 'Vehicle Report Mail', 'VehicleReportMail' => 'Vehicle Report Mail',
'ExportDispatchReportMail' => 'Export Dispatch Report Mail'
]) ])
->required(), ->required(),
Forms\Components\TextInput::make('email') Forms\Components\TextInput::make('email')

View File

@@ -6,25 +6,24 @@ use App\Filament\Exports\CharacteristicApproverMasterExporter;
use App\Filament\Imports\CharacteristicApproverMasterImporter; use App\Filament\Imports\CharacteristicApproverMasterImporter;
use App\Filament\Resources\CharacteristicApproverMasterResource\Pages; use App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
use App\Models\CharacteristicApproverMaster; use App\Models\CharacteristicApproverMaster;
use App\Models\Item;
use App\Models\Machine; use App\Models\Machine;
use App\Models\Plant; use App\Models\Plant;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Section; use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Actions\ExportAction; use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction; use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Filters\Filter;
class CharacteristicApproverMasterResource extends Resource class CharacteristicApproverMasterResource extends Resource
{ {
@@ -34,6 +33,8 @@ class CharacteristicApproverMasterResource extends Resource
protected static ?string $navigationGroup = 'Laser Marking'; protected static ?string $navigationGroup = 'Laser Marking';
protected static ?int $navigationSort = 2;
public static function form(Form $form): Form public static function form(Form $form): Form
{ {
return $form return $form
@@ -224,7 +225,8 @@ class CharacteristicApproverMasterResource extends Resource
Forms\Components\TextInput::make('duration2') Forms\Components\TextInput::make('duration2')
->label('Duration (HH.MM)') ->label('Duration (HH.MM)')
->reactive() ->reactive()
->length(4) ->minLength(4)
->maxLength(5)
->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/') ->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/')
->validationMessages([ ->validationMessages([
'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)', 'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)',
@@ -256,7 +258,8 @@ class CharacteristicApproverMasterResource extends Resource
Forms\Components\TextInput::make('duration3') Forms\Components\TextInput::make('duration3')
->label('Duration (HH.MM)') ->label('Duration (HH.MM)')
->reactive() ->reactive()
->length(4) ->minLength(4)
->maxLength(5)
->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/') ->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/')
->validationMessages([ ->validationMessages([
'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)', 'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)',
@@ -411,7 +414,7 @@ class CharacteristicApproverMasterResource extends Resource
if ($userHas && strlen($userHas) > 0) { if ($userHas && strlen($userHas) > 0) {
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray(); return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
} else { } else {
return Plant::whereHas('requestCharacteristics', function ($query) { return Plant::whereHas('characteristicApproverMaster', function ($query) {
$query->whereNotNull('id'); $query->whereNotNull('id');
})->orderBy('code')->pluck('name', 'id'); })->orderBy('code')->pluck('name', 'id');
} }
@@ -434,7 +437,7 @@ class CharacteristicApproverMasterResource extends Resource
return []; return [];
} }
return Machine::whereHas('requestCharacteristics', function ($query) use ($plantId) { return Machine::whereHas('characteristicApproverMaster', function ($query) use ($plantId) {
if ($plantId) { if ($plantId) {
$query->where('plant_id', $plantId); $query->where('plant_id', $plantId);
} }

View File

@@ -11,22 +11,22 @@ use App\Models\Machine;
use App\Models\Plant; use App\Models\Plant;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Section; use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Forms\Get; use Filament\Forms\Get;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Actions\ExportAction; use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction; use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Str; use Str;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
class ClassCharacteristicResource extends Resource class ClassCharacteristicResource extends Resource
{ {
@@ -974,6 +974,12 @@ class ClassCharacteristicResource 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\TextInput::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('mark_status') Forms\Components\TextInput::make('mark_status')
->label('MARKED STATUS') ->label('MARKED STATUS')
->reactive() ->reactive()
@@ -1814,6 +1820,10 @@ class ClassCharacteristicResource extends Resource
->label('ZMM OPERATING TEMPERATURE') ->label('ZMM OPERATING TEMPERATURE')
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('mark_status') Tables\Columns\TextColumn::make('mark_status')
->label('MARKED STATUS') ->label('MARKED STATUS')
->alignCenter() ->alignCenter()

View File

@@ -82,6 +82,13 @@ class CustomerPoMasterResource extends Resource
return ($currentPage - 1) * $perPage + $rowLoop->iteration; return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}), }),
Tables\Columns\TextColumn::make('id')
->label('ID')
->numeric()
->alignCenter()
->sortable()
->searchable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('plant.name') Tables\Columns\TextColumn::make('plant.name')
->label('Plant') ->label('Plant')
->alignCenter() ->alignCenter()
@@ -110,10 +117,18 @@ class CustomerPoMasterResource extends Resource
->dateTime() ->dateTime()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at') Tables\Columns\TextColumn::make('updated_at')
->dateTime() ->dateTime()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at') Tables\Columns\TextColumn::make('deleted_at')
->dateTime() ->dateTime()
->sortable() ->sortable()

View File

@@ -12,6 +12,7 @@ use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Forms\Get;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
@@ -39,18 +40,32 @@ class EquipmentMasterResource extends Resource
return $form return $form
->schema([ ->schema([
Forms\Components\Select::make('plant_id') Forms\Components\Select::make('plant_id')
->label('Plant') ->label('Plant Name')
->reactive()
->relationship('plant', 'name') ->relationship('plant', 'name')
->required()
->searchable()
->reactive()
->options(function (callable $get) { ->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id; $userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray(); return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
}) })
->required(), ->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('machine_id', null);
$set('updated_by', Filament::auth()->user()?->name);
})
->default(function () {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(EquipmentMaster::latest()->first())->plant_id;
}),
Forms\Components\Select::make('machine_id') Forms\Components\Select::make('machine_id')
// ->relationship('machine', 'name') // ->relationship('machine', 'name')
->label('Work Center') ->label('Work Center')
->required()
->searchable()
->reactive() ->reactive()
->options(function (callable $get) { ->options(function (callable $get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
@@ -60,15 +75,30 @@ class EquipmentMasterResource extends Resource
return \App\Models\Machine::where('plant_id', $plantId)->pluck('work_center', 'id'); return \App\Models\Machine::where('plant_id', $plantId)->pluck('work_center', 'id');
}) })
->required(), ->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('name') Forms\Components\TextInput::make('name')
->label('Name'), ->label('Name')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('description') Forms\Components\TextInput::make('description')
->label('Description'), ->label('Description')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('make') Forms\Components\TextInput::make('make')
->label('Make'), ->label('Make')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('model') Forms\Components\TextInput::make('model')
->label('Model'), ->label('Model')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('equipment_number') Forms\Components\TextInput::make('equipment_number')
->label('Equipment Number') ->label('Equipment Number')
->reactive() ->reactive()
@@ -82,6 +112,8 @@ class EquipmentMasterResource extends Resource
]; ];
}) })
->afterStateUpdated(function ($state, callable $set) { ->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
if (! $state) { if (! $state) {
return; return;
} }
@@ -108,7 +140,10 @@ class EquipmentMasterResource extends Resource
// } // }
// }), // }),
Forms\Components\TextInput::make('instrument_serial_number') Forms\Components\TextInput::make('instrument_serial_number')
->label('Instrument Serial Number'), ->label('Instrument Serial Number')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
// Forms\Components\DateTimePicker::make('calibrated_on') // Forms\Components\DateTimePicker::make('calibrated_on')
// ->label('Calibrated On') // ->label('Calibrated On')
// ->required(), // ->required(),
@@ -128,6 +163,7 @@ class EquipmentMasterResource extends Resource
$frequency = $get('frequency') ?? '1'; $frequency = $get('frequency') ?? '1';
$nextDate = self::calculateNextCalibrationDate($state, $frequency); $nextDate = self::calculateNextCalibrationDate($state, $frequency);
$set('next_calibration_date', $nextDate); $set('next_calibration_date', $nextDate);
$set('updated_by', Filament::auth()->user()?->name);
}), }),
// ->afterStateUpdated(function ($state, callable $get, callable $set) { // ->afterStateUpdated(function ($state, callable $get, callable $set) {
// $frequency = (int) $get('frequency'); // $frequency = (int) $get('frequency');
@@ -152,6 +188,7 @@ class EquipmentMasterResource extends Resource
$calibratedOn = $get('calibrated_on'); $calibratedOn = $get('calibrated_on');
$nextDate = self::calculateNextCalibrationDate($calibratedOn, $state); $nextDate = self::calculateNextCalibrationDate($calibratedOn, $state);
$set('next_calibration_date', $nextDate); $set('next_calibration_date', $nextDate);
$set('updated_by', Filament::auth()->user()?->name);
}), }),
// ->afterStateUpdated(function ($state, callable $get, callable $set) { // ->afterStateUpdated(function ($state, callable $get, callable $set) {
// $calibratedOn = $get('calibrated_on'); // $calibratedOn = $get('calibrated_on');
@@ -171,12 +208,21 @@ class EquipmentMasterResource extends Resource
Forms\Components\DateTimePicker::make('next_calibration_date') Forms\Components\DateTimePicker::make('next_calibration_date')
->label('Next Calibration Date') ->label('Next Calibration Date')
->readOnly() ->readOnly()
->required(), ->required()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('calibrated_by') Forms\Components\TextInput::make('calibrated_by')
->label('Calibrated By'), ->label('Calibrated By')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\Textarea::make('calibration_certificate') Forms\Components\Textarea::make('calibration_certificate')
->label('Calibration Certificate'), ->label('Calibration Certificate')
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\FileUpload::make('attachment') Forms\Components\FileUpload::make('attachment')
->label('PDF Upload') ->label('PDF Upload')
@@ -185,7 +231,10 @@ class EquipmentMasterResource extends Resource
->disk('local') ->disk('local')
->directory('uploads/temp') ->directory('uploads/temp')
->preserveFilenames() ->preserveFilenames()
->reactive(), ->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
// Forms\Components\Actions::make([ // Forms\Components\Actions::make([
// Action::make('uploadNow') // Action::make('uploadNow')
@@ -341,7 +390,11 @@ class EquipmentMasterResource extends Resource
->label('Created By') ->label('Created By')
->default(Filament::auth()->user()?->name), ->default(Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by') Forms\Components\Hidden::make('updated_by')
->label('Updated By'), ->label('Updated By')
->default(Filament::auth()->user()?->name),
Forms\Components\TextInput::make('id')
->hidden()
->readOnly(),
]); ]);
} }
@@ -359,7 +412,7 @@ class EquipmentMasterResource extends Resource
return ($currentPage - 1) * $perPage + $rowLoop->iteration; return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}), }),
Tables\Columns\TextColumn::make('plant.name') Tables\Columns\TextColumn::make('plant.name')
->label('Plant') ->label('Plant Name')
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('machine.work_center') Tables\Columns\TextColumn::make('machine.work_center')
@@ -413,24 +466,30 @@ class EquipmentMasterResource extends Resource
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('created_by') Tables\Columns\TextColumn::make('created_by')
->label('Created Bys') ->label('Created By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('created_at') Tables\Columns\TextColumn::make('created_at')
->label('Created At') ->label('Created At')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: false),
Tables\Columns\TextColumn::make('updated_at') Tables\Columns\TextColumn::make('updated_at')
->label('Updated At') ->label('Updated At')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: false),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->dateTime()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
]) ])
->filters([ ->filters([

View File

@@ -99,16 +99,8 @@ 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\Select::make('status') Forms\Components\TextInput::make('status')
->label('Status') ->label('Status')
->options([
'Under Service Provider Finalization' => 'Under Service Provider Finalization',
'Yet to pick up' => 'Yet to pick up',
'Awaiting Vessel Loading' => 'Awaiting Vessel Loading',
'In Transit' => 'In Transit',
'Under Import Customs Clearance in Destination' => 'Under Import Customs Clearance in Destination',
'Delivered' => 'Delivered',
])
->reactive() ->reactive()
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
@@ -188,8 +180,17 @@ 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\TextInput::make('remark') Forms\Components\Select::make('remark')
->label('Remark') ->label('Remark')
->options([
'Under Service Provider Finalization' => 'Under Service Provider Finalization',
'Yet to pick up' => 'Yet to pick up',
'Awaiting Vessel Loading' => 'Awaiting Vessel Loading',
'In Transit' => 'In Transit',
'Under Import Customs Clearance in Destination' => 'Under Import Customs Clearance in Destination',
'Delivered' => 'Delivered',
])
->reactive()
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),

File diff suppressed because it is too large Load Diff

View File

@@ -11,13 +11,17 @@ use App\Models\Plant;
use App\Models\WorkGroupMaster; use App\Models\WorkGroupMaster;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Section; use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Forms\Get; use Filament\Forms\Get;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Actions\ExportAction; use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction; use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
@@ -66,6 +70,8 @@ class MachineResource extends Resource
return; return;
} else { } else {
$set('mPlantError', null); $set('mPlantError', null);
$set('line_id', null);
$set('work_group_master_id', null);
} }
}) })
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [
@@ -107,6 +113,7 @@ class MachineResource extends Resource
// return; // return;
// } // }
$set('mLineError', null); $set('mLineError', null);
$set('work_group_master_id', null);
} }
}) })
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [
@@ -249,7 +256,177 @@ class MachineResource extends Resource
]) ])
->filters([ ->filters([
Tables\Filters\TrashedFilter::make(), Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
if ($userHas && strlen($userHas) > 0) {
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
} else {
return Plant::whereHas('machines', function ($query) {
$query->whereNotNull('id');
})->orderBy('code')->pluck('name', 'id')->toArray();
}
})
->searchable()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get): void {
$set('code', null);
$set('operator_id', null);
}),
Select::make('Line')
->label('Search by Line')
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (empty($plantId)) {
return [];
}
return Line::whereHas('machines', function ($query) use ($plantId) {
if ($plantId) {
$query->where('plant_id', $plantId);
}
})->pluck('name', 'id');
})
->searchable()
->reactive(),
TextInput::make('name')
->label('Description')
->reactive(),
Select::make('work_group_master')
->label('Search by Work Group Center')
->options(function (callable $get) {
$plantId = $get('Plant');
return WorkGroupMaster::whereHas('machines', function ($query) use ($plantId) {
if ($plantId) {
$query->where('plant_id', $plantId);
}
})
->pluck('name', 'id')
->toArray();
})
->searchable()
->reactive(),
Select::make('work_center')
->label('Search by Work Center')
->options(function (callable $get) {
$plantId = $get('Plant');
$workGroupMasterId = $get('work_group_master');
if (! $workGroupMasterId) {
return [];
}
return Machine::query()
->when($plantId, fn ($q) => $q->where('plant_id', $plantId))
->where('work_group_master_id', $workGroupMasterId)
->pluck('work_center', 'work_center')
->toArray();
})
->searchable()
->reactive(),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder(placeholder: 'Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Line']) && empty($data['name']) && empty($data['work_group_master']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to'])) {
// return $query->whereRaw('1 = 0');
}
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (! empty($data['Line'])) {
$query->where('line_id', $data['Line']);
}
if (! empty($data['name'])) {
$query->where('name', $data['name']);
}
if (! empty($data['work_group_master'])) {
$query->where('work_group_master_id', $data['work_group_master']);
}
if (! empty($data['work_center'])) {
$query->where('work_center', $data['work_center']);
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['Plant'])) {
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return 'Plant: Choose plant to filter records.';
}
}
if (! empty($data['Line'])) {
$indicators[] = 'Line Name: '.Line::where('id', $data['Line'])->value('name');
}
if (! empty($data['name'])) {
$indicators[] = 'Description: '.$data['name'];
}
if (! empty($data['work_group_master'])) {
$indicators[] = 'Work Group Center: '.WorkGroupMaster::where('id', $data['work_group_master'])->value('name');
}
if (! empty($data['work_center'])) {
$indicators[] = 'Work Center: '.Machine::where('work_center', $data['work_center'])->value('work_center');
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
]) ])
->filtersFormMaxHeight('280px')
->actions([ ->actions([
Tables\Actions\ViewAction::make(), Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(), Tables\Actions\EditAction::make(),

View File

@@ -27,6 +27,8 @@ class PanelBoxValidationResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Panel Box';
public $isSubmitted = false; public $isSubmitted = false;
public $data = []; public $data = [];
@@ -176,6 +178,8 @@ class PanelBoxValidationResource extends Resource
->afterStateUpdated(function (callable $set, callable $get, ?string $state) { ->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$pId = $get('line_id'); $pId = $get('line_id');
$plantId = $get('plant_id');
$plaCode = Plant::find($plantId)?->code;
$set('part_validation_type', null); $set('part_validation_type', null);
$set('show_validation_image', false); $set('show_validation_image', false);
$set('validation1_image_url', null); $set('validation1_image_url', null);
@@ -269,14 +273,6 @@ class PanelBoxValidationResource extends Resource
$set('part_validation_type_options', []); $set('part_validation_type_options', []);
$set('validation1_image_url', null); $set('validation1_image_url', null);
return;
} elseif (strlen($sNumber) < 9) {
$set('validationError', 'Serial Number must be at least 9 digits.');
$set('part_validation_type', null);
$set('show_validation_image', false);
$set('part_validation_type_options', []);
$set('validation1_image_url', null);
return; return;
} }
// } // }
@@ -285,34 +281,132 @@ class PanelBoxValidationResource extends Resource
$set('validationError', null); $set('validationError', null);
} }
} }
// if ($state && str_contains($state, '|')) {
if ($state && str_contains($state, '|')) { // $parts = explode('|', $state);
$parts = explode('|', $state); // $itemCode = trim($parts[0]); // Extract item code // 123456|123456789
$itemCode = trim($parts[0]); // Extract item code // 123456|123456789 // $serialNumber = trim($parts[1]);
// }
// else
// {
// // $parts = explode('/', $state);
$serialNumber = trim($parts[1]); // // $itemCode = trim($parts[1] ?? ''); // item code
} // // $serialNumber = trim($parts[2] ?? ''); // serial number
else
{
// $parts = explode('/', $state);
// $itemCode = trim($parts[1] ?? ''); // item code // $parts = array_map('trim', explode('/', $state));
// $serialNumber = trim($parts[2] ?? ''); // serial number
$parts = array_map('trim', explode('/', $state)); // // Expected format: 121245/165467/2606/1002634
// if (count($parts) != 4) {
// Notification::make()
// ->title('Invalid QR Format')
// ->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
// ->danger()
// ->send();
$serialNumber = end($parts); // last part // return;
// }
// item code depends on format // $serialNumber = end($parts); // last part
$itemCode = $parts[1] ?? '';
} // $itemCode = $parts[1] ?? '';
// }
// Store serial number before resetting fields // Store serial number before resetting fields
$previousSerialNumber = $serialNumber;
$previousItemCode = $itemCode;
if (str_contains($state, '|')) {
$parts = array_map('trim', explode('|', $state));
if (count($parts) != 2) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: ItemCode|SerialNumber')
->danger()
->send();
return;
}
$itemCode = $parts[0];
$serialNumber = $parts[1];
if($serialNumber == '' || $serialNumber == null){
Notification::make()
->title('Unknown Serial number')
->body("Serial number can't be empty!")
->danger()
->send();
$set('item_id', null);
return;
}
elseif (! ctype_alnum($serialNumber)) {
$set('validationError', 'Serial Number should contain alpha-numeric values.');
$set('item_id', null);
return;
}
}
elseif (str_contains($state, '/'))
{
$parts = array_map('trim', explode('/', $state));
if (count($parts) != 4) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('item_id', null);
return;
}
$plantCode = $parts[0];
$itemCode = $parts[1];
$yearMonth = $parts[2];
$serialNumber = $parts[3];
if($serialNumber == '' || $serialNumber == null){
Notification::make()
->title('Unknown Serial number')
->body("Serial number can't be empty!")
->danger()
->send();
$set('item_id', null);
return;
}
elseif (! ctype_alnum($serialNumber)) {
$set('validationError', 'Serial Number should contain alpha-numeric values.');
$set('item_id', null);
return;
}
else if($plantCode != $plaCode){
Notification::make()
->title('Invalid Plant Code')
->body("Scanned plant code doesn't match the selected plant.")
->danger()
->send();
$set('item_id', null);
return;
}
}
else {
Notification::make()
->title('Invalid QR Format')
->body('QR must be in either ItemCode|SerialNumber or PlantCode/ItemCode/YearMM/SerialNumber format.')
->danger()
->send();
$set('item_id', null);
$set('validationError', null);
return;
}
if (strlen($itemCode) < 6) { if (strlen($itemCode) < 6) {
$set('validationError', 'Item code must be at least 6 digits.'); $set('validationError', 'Item code must be at least 6 digits.');
@@ -332,29 +426,6 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
//elseif ($serialNumber == '') {
// $set('validationError', 'Waiting for full QR scan...');
// return;
// } elseif (strlen($serialNumber) < 9) {
// $set('validationError', 'Serial Number must be at least 9 digits.');
// $set('part_validation_type', null);
// $set('show_validation_image', false);
// $set('part_validation_type_options', []);
// $set('validation1_image_url', null);
// return;
// } elseif (! ctype_alnum($serialNumber)) {
// $set('validationError', 'Serial Number should contain alpha-numeric values.');
// $set('item_id', null);
// $set('part_validation_type', null);
// $set('show_validation_image', false);
// $set('part_validation_type_options', []);
// $set('validation1_image_url', null);
// return;
// }
else { else {
$set('validationError', null); $set('validationError', null);
} }
@@ -419,6 +490,7 @@ class PanelBoxValidationResource extends Resource
// $set('serial_number', null); // $set('serial_number', null);
// $set('serial_number', $serialNumber); // $set('serial_number', $serialNumber);
} }
// Check if user input matches the database values // Check if user input matches the database values
foreach ($partValidationColumns as $field) { foreach ($partValidationColumns as $field) {
if ($get("{$field}_visible")) { if ($get("{$field}_visible")) {
@@ -436,7 +508,7 @@ class PanelBoxValidationResource extends Resource
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists(); $serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists();
if ($serialExists && ! $get('id')) { if ($serialExists && ! $get('id')) {
$set('validationError', 'Serial number already exists in quality validation.'); $set('validationError', 'Serial number already exists in panel box validation.');
$set('sticker_master_id', null); $set('sticker_master_id', null);
$set('uom', null); $set('uom', null);
$set('serial_number', null); $set('serial_number', null);
@@ -553,14 +625,43 @@ class PanelBoxValidationResource extends Resource
$options['part_validation4'] = 'Part Validation 4'; $options['part_validation4'] = 'Part Validation 4';
} }
// Save options in hidden field
$set('part_validation_type_options', $options); $set('part_validation_type_options', $options);
}) })
// ->extraAttributes(fn ($get) => [
// 'class' => $get('validationError') ? 'border-red-500' : '',
// 'id' => 'item_id',
// 'onkeydown' => "if (event.key === 'Enter') { event.preventDefault(); event.stopPropagation(); return false; }",
// ])
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [
'class' => $get('validationError') ? 'border-red-500' : '', 'class' => $get('validationError') ? 'border-red-500' : '',
'id' => 'item_id', 'id' => 'item_id',
'onkeydown' => "if (event.key === 'Enter') { event.preventDefault(); event.stopPropagation(); return false; }", 'onkeydown' => "
if (event.key === 'Enter') {
const serialFields = [
'serial_number_motor_qr', 'serial_number_pump_qr', 'pack_slip_motor_qr',
'name_plate_motor_qr', 'tube_sticker_motor_qr', 'warranty_card_qr'
];
const partValidationColumns = [
'part_validation1', 'part_validation2', 'part_validation3',
'part_validation4', 'part_validation5'
];
const allFields = [...serialFields.map(f => f + '_visible'), ...partValidationColumns.map(f => f + '_visible')];
const anyVisible = allFields.some(key => {
const el = document.querySelector('[wire\\\\:model*=\"' + key + '\"]');
return el && (el.value === '1' || el.value === 'true' || el.checked);
});
if (anyVisible) {
event.preventDefault();
event.stopPropagation();
return false;
}
}
",
]) ])
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null) ->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
->hintColor('danger'), ->hintColor('danger'),
@@ -595,6 +696,16 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('serial_number_panel_qr', null);
return;
}
$parts = explode('/', $state); $parts = explode('/', $state);
$extracted = trim(end($parts)); $extracted = trim(end($parts));
@@ -632,11 +743,21 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('pack_slip_panel_qr', null);
return;
}
$parts = explode('/', $state); $parts = explode('/', $state);
$extracted = trim(end($parts)); $extracted = trim(end($parts));
if (count($parts) < 3 || $extracted == '') { if ($extracted == '') {
$set('packSlipPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber'); $set('packSlipPanelError', "SerialNumber can't be empty!");
$set('pack_slip_panel_qr', null); $set('pack_slip_panel_qr', null);
return; return;
} }
@@ -675,11 +796,21 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('serial_number_panel_qr', null);
return;
}
$parts = explode('/', $state); $parts = explode('/', $state);
$extracted = trim(end($parts)); $extracted = trim(end($parts));
if (count($parts) < 3 || $extracted == '') { if ($extracted == '') {
$set('namePlatePanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber'); $set('namePlatePanelError', "SerialNumber cant't be empty!");
$set('name_plate_panel_qr', null); $set('name_plate_panel_qr', null);
return; return;
} }
@@ -718,11 +849,21 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('serial_number_panel_qr', null);
return;
}
$parts = explode('/', $state); $parts = explode('/', $state);
$extracted = trim(end($parts)); $extracted = trim(end($parts));
if (count($parts) < 3 || $extracted == '') { if ($extracted == '') {
$set('tubeStickerPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber'); $set('tubeStickerPanelError', "SerialNumber can't be empty!");
$set('tube_sticker_panel_qr', null); $set('tube_sticker_panel_qr', null);
return; return;
} }
@@ -741,7 +882,7 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
}) })
->hint(fn ($get) => $get('tubeStickerPanelError') ?? null) ->hint(fn ($get ) => $get('tubeStickerPanelError') ?? null)
->hintColor('danger') ->hintColor('danger')
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [
'class' => $get('tubeStickerPanelError') ? 'border-red-500' : '', 'class' => $get('tubeStickerPanelError') ? 'border-red-500' : '',
@@ -762,11 +903,21 @@ class PanelBoxValidationResource extends Resource
return; return;
} }
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
Notification::make()
->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger()
->send();
$set('serial_number_panel_qr', null);
return;
}
$parts = explode('/', $state); $parts = explode('/', $state);
$extracted = trim(end($parts)); $extracted = trim(end($parts));
if (count($parts) < 3 || $extracted == '') { if ($extracted == '') {
$set('warrantyCardPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber'); $set('warrantyCardPanelError', "SerialNumber can't be empty!");
$set('warranty_card_qr', null); $set('warranty_card_qr', null);
return; return;
} }
@@ -774,7 +925,7 @@ class PanelBoxValidationResource extends Resource
$expected = $get('serial_number'); $expected = $get('serial_number');
if ($extracted != $expected) { if ($extracted != $expected) {
$set('warrantyCardPanelError', 'Tube Sticker Panel serial does not match.'); $set('warrantyCardPanelError', 'Warranty Card Panel serial does not match.');
$set('warranty_card_qr', null); $set('warranty_card_qr', null);
return; return;
} }
@@ -826,7 +977,6 @@ class PanelBoxValidationResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('part_validation1_error', null); $set('part_validation1_error', null);
return; return;
} }
@@ -845,7 +995,6 @@ class PanelBoxValidationResource extends Resource
$set('part_validation1_error', null); $set('part_validation1_error', null);
} else { } else {
$set('part_validation1_error', 'Invalid input for part validation 1.'); $set('part_validation1_error', 'Invalid input for part validation 1.');
return; return;
} }
}) })
@@ -1078,7 +1227,6 @@ class PanelBoxValidationResource extends Resource
Forms\Components\Hidden::make('updated_by') Forms\Components\Hidden::make('updated_by')
->label('Updated By') ->label('Updated By')
->default(Filament::auth()->user()?->name), ->default(Filament::auth()->user()?->name),
Forms\Components\View::make('components.panel-checklist-wrapper') Forms\Components\View::make('components.panel-checklist-wrapper')
->visible(fn ($livewire) => $livewire->showChecklist) ->visible(fn ($livewire) => $livewire->showChecklist)
->statePath('checklist') ->statePath('checklist')

View File

@@ -65,8 +65,13 @@ class CreatePanelBoxValidation extends CreateRecord {
$this->showChecklist = true; $this->showChecklist = true;
$this->halt(); $this->halt();
} }
else{
return $data; \Filament\Notifications\Notification::make()
->title('Characteristics not found for the scanned item.')
->danger()
->send();
$this->halt();
}
} }
protected function checkIfHasCharacteristics(array $data) protected function checkIfHasCharacteristics(array $data)

View File

@@ -10,6 +10,8 @@ class ViewPanelBoxValidation extends ViewRecord
{ {
protected static string $resource = PanelBoxValidationResource::class; protected static string $resource = PanelBoxValidationResource::class;
public bool $showChecklist = false;
protected function getHeaderActions(): array protected function getHeaderActions(): array
{ {
return [ return [

View File

@@ -540,8 +540,15 @@ class StickerMasterResource extends Resource
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('item.category')
->label('Category')
->default('-')
->alignCenter()
->sortable()
->searchable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.description') Tables\Columns\TextColumn::make('item.description')
->label('Item Description') ->label('Description')
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->searchable() ->searchable()

View File

@@ -973,6 +973,12 @@ class TempClassCharacteristicResource 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\TextInput::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('winded_serial_number') Forms\Components\TextInput::make('winded_serial_number')
->label('WINDED SERIAL NUMBER') ->label('WINDED SERIAL NUMBER')
->reactive() ->reactive()
@@ -1584,6 +1590,10 @@ class TempClassCharacteristicResource extends Resource
->label('ZMM OPERATING TEMPERATURE') ->label('ZMM OPERATING TEMPERATURE')
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('zmm_axial_force')
->label('ZMM AXIAL FORCE')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('winded_serial_number') Tables\Columns\TextColumn::make('winded_serial_number')
->label('WINDED SERIAL NUMBER') ->label('WINDED SERIAL NUMBER')
->alignCenter() ->alignCenter()

View File

@@ -23,6 +23,10 @@ use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Forms\Components\DateTimePicker; use Filament\Forms\Components\DateTimePicker;
use Str; use Str;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use App\Filament\Exports\WireMasterPackingExporter;
use App\Filament\Imports\WireMasterPackingImporter;
class WireMasterPackingResource extends Resource class WireMasterPackingResource extends Resource
{ {
@@ -61,9 +65,14 @@ class WireMasterPackingResource extends Resource
return []; return [];
} }
return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id'); // return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id');
return CustomerPoMaster::where('plant_id', $plantId)->distinct()->pluck('customer_po', 'customer_po');
}) })
->required(), ->required()
->afterStateUpdated(function ($state, callable $set) {
$set('wire_packing_number', null);
}),
Forms\Components\TextInput::make('wire_packing_number') Forms\Components\TextInput::make('wire_packing_number')
->label('Scan Wire Packing No') ->label('Scan Wire Packing No')
->reactive() ->reactive()
@@ -160,13 +169,19 @@ class WireMasterPackingResource extends Resource
->options(function ($get) { ->options(function ($get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
$customerPo = $get('customer_po_master_id');
if (! $plantId) { if (!$plantId || !$customerPo) {
return []; return [];
} }
$customerPoIds = CustomerPoMaster::where('plant_id', $plantId)
->where('customer_po', $customerPo)
->pluck('id');
return WireMasterPacking::query() return WireMasterPacking::query()
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->whereIn('customer_po_master_id', $customerPoIds)
->where(function ($query) { ->where(function ($query) {
$query->whereNull('wire_packing_status') $query->whereNull('wire_packing_status')
->orWhere('wire_packing_status', ''); ->orWhere('wire_packing_status', '');
@@ -468,6 +483,22 @@ class WireMasterPackingResource extends Resource
Tables\Actions\ForceDeleteBulkAction::make(), Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(), Tables\Actions\RestoreBulkAction::make(),
]), ]),
])
->headerActions([
ImportAction::make()
->label('Import Wire Packing Master')
->color('warning')
->importer(WireMasterPackingImporter::class)
->visible(function () {
return Filament::auth()->user()->can('view import wire packing master');
}),
ExportAction::make()
->label('Export Wire Packing Master')
->color('warning')
->exporter(WireMasterPackingExporter::class)
->visible(function () {
return Filament::auth()->user()->can('view export wire packing master');
}),
]); ]);
} }

View File

@@ -164,10 +164,6 @@ class CreateWireMasterPacking extends CreateRecord
return; return;
} }
$itemId = Item::where('code', $materialCode)
->where('plant_id', $plantId)
->value('id');
$icodeAgaCPoPlant = CustomerPoMaster::where('item_id', $itemId)->where('plant_id', $plantId)->first(); $icodeAgaCPoPlant = CustomerPoMaster::where('item_id', $itemId)->where('plant_id', $plantId)->first();
if(!$icodeAgaCPoPlant) if(!$icodeAgaCPoPlant)
@@ -214,23 +210,24 @@ class CreateWireMasterPacking extends CreateRecord
return; return;
} }
$customerPoRecord = CustomerPoMaster::where('id', $customerPo) $customerPoRecord = CustomerPoMaster::where('customer_po', $customerPo)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->where('item_id', $itemId)
->first(); ->first();
$customerPoName = $customerPoRecord->customer_po; // $customerPoName = $customerPoRecord->customer_po;
if ($customerPoRecord) { // if ($customerPoRecord) {
$customerPoName = $customerPoRecord->customer_po; // $customerPoName = $customerPoRecord->customer_po;
} else { // } else {
$customerPoName = null; // $customerPoName = null;
} // }
if(!$customerPoRecord) if(!$customerPoRecord)
{ {
Notification::make() Notification::make()
->title("PO Not Found") ->title("PO Not Found")
->body("Customer PO '$customerPoName' for Item '$materialCode' not found against Plant '$plantcode'") ->body("Customer PO '$customerPoRecord->customer_po' for Item '$materialCode' not found against Plant '$plantcode'")
->danger() ->danger()
->duration(5000) ->duration(5000)
->send(); ->send();
@@ -247,7 +244,7 @@ class CreateWireMasterPacking extends CreateRecord
return; return;
} }
$alreadyScannedQty = WireMasterPacking::where('customer_po_master_id', $customerPo) $alreadyScannedQty = WireMasterPacking::where('customer_po_master_id', $customerPoRecord->id)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->where('item_id', $itemId) ->where('item_id', $itemId)
->selectRaw('SUM(CAST(weight AS NUMERIC)) as total_weight') ->selectRaw('SUM(CAST(weight AS NUMERIC)) as total_weight')
@@ -259,7 +256,7 @@ class CreateWireMasterPacking extends CreateRecord
{ {
Notification::make() Notification::make()
->title("Scanned Weight Exceeds PO Quantity") ->title("Scanned Weight Exceeds PO Quantity")
->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoName' and Item '$materialCode'") ->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoRecord->customer_po' and Item '$materialCode'")
->danger() ->danger()
->duration(5000) ->duration(5000)
->send(); ->send();
@@ -268,6 +265,7 @@ class CreateWireMasterPacking extends CreateRecord
'process_order' => null, 'process_order' => null,
'plant_id' => $plantId, 'plant_id' => $plantId,
'customer_po_master_id' => $customerPo, 'customer_po_master_id' => $customerPo,
'item_id' => $itemId,
'wire_packing_number' => $wirePackNo, 'wire_packing_number' => $wirePackNo,
'Sno_quantity' => 0, 'Sno_quantity' => 0,
'created_by' => $operatorName, 'created_by' => $operatorName,
@@ -294,7 +292,7 @@ class CreateWireMasterPacking extends CreateRecord
'item_id' => $itemId, 'item_id' => $itemId,
'wire_packing_number' => $wirePackNo, 'wire_packing_number' => $wirePackNo,
'process_order' => $processOrderId . '-' . $coilNo, 'process_order' => $processOrderId . '-' . $coilNo,
'customer_po_master_id' => $customerPo, 'customer_po_master_id' => $customerPoRecord->id,
'weight' => $weight, 'weight' => $weight,
'created_by' => $createdBy, 'created_by' => $createdBy,
'scanned_by' => $operatorName, 'scanned_by' => $operatorName,
@@ -314,6 +312,7 @@ class CreateWireMasterPacking extends CreateRecord
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'customer_po_master_id' => $customerPo, 'customer_po_master_id' => $customerPo,
'item_id' => $itemId,
'wire_packing_number' => $wirePackNo, 'wire_packing_number' => $wirePackNo,
'process_order' => null, 'process_order' => null,
// 'pending_pallet_list' => $pendingPallet, // 'pending_pallet_list' => $pendingPallet,
@@ -334,6 +333,7 @@ class CreateWireMasterPacking extends CreateRecord
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'customer_po_master_id' => $customerPo, 'customer_po_master_id' => $customerPo,
'item_id' => $itemId,
'wire_packing_number' => $wirePackNo, 'wire_packing_number' => $wirePackNo,
'process_order' => null, 'process_order' => null,
// 'pending_pallet_list' => $pendingPallet, // 'pending_pallet_list' => $pendingPallet,

View File

@@ -5,6 +5,7 @@ namespace App\Filament\Resources;
use App\Filament\Exports\WorkGroupMasterExporter; use App\Filament\Exports\WorkGroupMasterExporter;
use App\Filament\Imports\WorkGroupMasterImporter; use App\Filament\Imports\WorkGroupMasterImporter;
use App\Filament\Resources\WorkGroupMasterResource\Pages; use App\Filament\Resources\WorkGroupMasterResource\Pages;
use App\Models\Line;
use App\Models\Plant; use App\Models\Plant;
use App\Models\WorkGroupMaster; use App\Models\WorkGroupMaster;
use Filament\Facades\Filament; use Filament\Facades\Filament;
@@ -20,6 +21,11 @@ use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Tables\Filters\Filter;
class WorkGroupMasterResource extends Resource class WorkGroupMasterResource extends Resource
{ {
@@ -166,7 +172,144 @@ class WorkGroupMasterResource extends Resource
]) ])
->filters([ ->filters([
Tables\Filters\TrashedFilter::make(), Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Search by Plant Name')
->nullable()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
if ($userHas && strlen($userHas) > 0) {
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
} else {
return Plant::whereHas('workGroupMasters', function ($query) {
$query->whereNotNull('id');
})->orderBy('code')->pluck('name', 'id')->toArray();
}
})
->searchable()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get): void {
$set('code', null);
$set('operator_id', null);
}),
Select::make('name')
->label('Search by Work Group Center')
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
if(!$plantId){
return [];
}
else{
return $plantId ? WorkGroupMaster::where('plant_id', $plantId)->distinct()->pluck('name', 'name')->toArray(): [];
}
})
->searchable()
->reactive(),
TextInput::make('description')
->label('Description')
->reactive(),
TextInput::make('operation_number')
->label('Operation Number')
->reactive(),
DateTimePicker::make(name: 'created_from')
->label('Created From')
->placeholder(placeholder: 'Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('created_to')
->label('Created To')
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['name']) && empty($data['description']) && empty($data['operation_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to'])) {
// return $query->whereRaw('1 = 0');
}
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (! empty($data['name'])) {
$query->where('name', $data['name']);
}
if (! empty($data['description'])) {
$query->where('description', $data['description']);
}
if (! empty($data['operation_number'])) {
$query->where('operation_number', $data['operation_number']);
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['Plant'])) {
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return 'Plant: Choose plant to filter records.';
}
}
if (! empty($data['name'])) {
$indicators[] = 'Work Group Name: ' . $data['name'];
}
if (! empty($data['description'])) {
$indicators[] = 'Description: ' . $data['description'];
}
if (! empty($data['operation_number'])) {
$indicators[] = 'Operation Number: ' . $data['operation_number'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
if (! empty($data['updated_from'])) {
$indicators[] = 'From: '.$data['updated_from'];
}
if (! empty($data['updated_to'])) {
$indicators[] = 'To: '.$data['updated_to'];
}
return $indicators;
}),
]) ])
->filtersFormMaxHeight('280px')
->actions([ ->actions([
Tables\Actions\ViewAction::make(), Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(), Tables\Actions\EditAction::make(),

View File

@@ -1286,9 +1286,9 @@ class CharacteristicsController extends Controller
], 404); ], 404);
} }
$machineId = $machine->id; $machineId = $machine->id; //
$availFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name' $availFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name'
if ($itemCode != '' && $itemCode != null && $itemCode && Str::length($itemCode) > 0) { if ($itemCode != '' && $itemCode != null && $itemCode && Str::length($itemCode) > 0) {
$existingJobNo = ClassCharacteristic::where('aufnr', $jobNo)->first(); // ->where('machine_id', $machineId)->where('plant_id', $plantId) $existingJobNo = ClassCharacteristic::where('aufnr', $jobNo)->first(); // ->where('machine_id', $machineId)->where('plant_id', $plantId)
@@ -1845,7 +1845,7 @@ class CharacteristicsController extends Controller
} }
} }
$masterFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'pending_released_status']; $masterFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'pending_released_status'];
$isInsertOrUpdate = false; $isInsertOrUpdate = false;
@@ -2175,7 +2175,7 @@ class CharacteristicsController extends Controller
$columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id']; $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature']; $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get(); $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
@@ -2709,7 +2709,7 @@ class CharacteristicsController extends Controller
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id']; // $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature']; $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get(); $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
@@ -2951,7 +2951,7 @@ class CharacteristicsController extends Controller
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id']; // $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
// $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zqmm_qty', 'zmm_operating_temperature']; // $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
// $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get(); // $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();

View File

@@ -19,182 +19,23 @@ class PalletPrintController extends Controller
// //
} }
public function print(Request $request, $pallet, $plant)
{
$customerId = $request->query('customer');
// $customerName = $request->query('customer_name');
// $items = WireMasterPacking::with('item')
// ->where('plant_id', $plant)
// ->where('wire_packing_number', $pallet)
// ->get()
// ->groupBy('item_id')
// ->map(function ($rows) {
// $first = $rows->first();
// return (object) [
// 'code' => $first->item->code,
// 'description' => $first->item->description,
// 'box_count' => $rows->count(),
// 'weight' => $rows->sum('weight'),
// ];
// })
// ->values();
$items = WireMasterPacking::with('item')
->where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->get()
->map(function ($row) {
return (object) [
'code' => $row->item->code,
'description' => $row->item->description,
'box_count' => 1, // each row = one box
'weight' => $row->weight,
];
});
$masterBox = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->value('customer_po_master_id');
$customer = CustomerPoMaster::find($masterBox);
$customerCode = $customer->customer_po ?? '';
$customerName = $customer->customer_name ?? '';
// $masterBox = WireMasterPacking::where('plant_id', $plant)
// ->where('wire_packing_number', $pallet)
// ->distinct('customer_po')
// ->count('customer_po');
// $pallets = WireMasterPacking::where('plant_id', $plant)
// ->select('wire_packing_number', 'updated_at')
// ->distinct('wire_packing_number')
// ->orderBy('wire_packing_number')
// ->orderBy('updated_at', 'asc')
// ->get()
// ->pluck('wire_packing_number')
// ->values();
// $currentPalletNo = $pallets->search($pallet) + 1;
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
// // ->where('wire_packing_number', $pallet)
// ->distinct()
// ->count('customer_po');
// $boxLabel = $currentPalletNo . '/' . $totalBoxes;
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
->where('customer_po_master_id', $customerId)
->distinct('wire_packing_number')
->count('wire_packing_number');
$completedPallets = WireMasterPacking::where('plant_id', $plant)
->where('customer_po_master_id', $customerId)
->select('wire_packing_number')
->groupBy('wire_packing_number')
->havingRaw(
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
['Completed']
)
->orderBy('wire_packing_number')
->pluck('wire_packing_number')
->values();
$index = $completedPallets->search($pallet);
$currentPalletNo = ($index !== false) ? $index + 1 : 0;
$boxLabel = $currentPalletNo.'/'.$totalBoxes;
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
// ->select('wire_packing_number')
// ->groupBy('wire_packing_number')
// ->havingRaw('COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)', ['Completed'])
// ->orderBy('wire_packing_number')
// ->pluck('wire_packing_number')
// ->values();
// $currentPalletNo = $completedPallets->search($pallet) != false
// ? $completedPallets->search($pallet) + 1
// : 0;
// $boxLabel = $currentPalletNo . '/' . $totalBoxes;
$grossWeight = $items->sum('weight');
$widthPt = 85 * 2.83465; // 85mm → points
$heightPt = 100 * 2.83465; // 100mm → points
$plantName = Plant::where('id', $plant)->value('name');
$plantAddress = Plant::where('id', $plant)->value('address');
$pdf = Pdf::loadView('pdf.wire-pallet', [
'product' => 'Submersible Winding Wire',
'plantName' => $plantName,
'plantAddress' => $plantAddress,
'monthYear' => now()->format('M-y'),
'branch' => '',
'customerCode' => $customerCode,
'customerName' => $customerName,
'masterBox' => $boxLabel,
'items' => $items,
'grossWeight' => $grossWeight + 3.050,
'netWeight' => $grossWeight,
// 'grossWeight' => $grossWeight,
// 'netWeight' => $grossWeight - 3.05,
'pallet' => $pallet,
])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
return $pdf->stream("Pallet-{$pallet}.pdf");
// $pdfPath = storage_path("app/public/Pallet-{$pallet}.pdf");
// $pdf->save($pdfPath);
// $printerName = 'Tsc';
// $output = [];
// $returnVar = 0;
// exec("lp -d {$printerName} " . escapeshellarg($pdfPath), $output, $returnVar);
// if ($returnVar == 0) {
// return response()->json([
// 'status' => 'success',
// 'message' => "PDF sent to printer $printerName successfully."
// ]);
// } else {
// return response()->json([
// 'status' => 'error',
// 'message' => "Failed to send PDF to printer $printerName.",
// 'output' => $output,
// 'code' => $returnVar
// ], 500);
// }
}
/**
* Store a newly created resource in storage.
*/
// public function print(Request $request, $pallet, $plant) // public function print(Request $request, $pallet, $plant)
// { // {
// $customerId = $request->query('customer'); // $customerId = $request->query('customer');
// $items = WireMasterPacking::with('item') // $items = WireMasterPacking::with('item')
// ->where('plant_id', $plant) // ->where('plant_id', $plant)
// ->where('wire_packing_number', $pallet) // ->where('wire_packing_number', $pallet)
// ->get() // ->get()
// ->map(function ($row) { // ->map(function ($row) {
// return (object) [ // return (object) [
// 'code' => $row->item->code, // 'code' => $row->item->code,
// 'description' => $row->item->description, // 'description' => $row->item->description,
// 'box_count' => 1, // each row = one box // 'box_count' => 1, // each row = one box
// 'weight' => $row->weight, // 'weight' => $row->weight,
// ]; // ];
// }); // });
// $masterBox = WireMasterPacking::where('plant_id', $plant) // $masterBox = WireMasterPacking::where('plant_id', $plant)
// ->where('wire_packing_number', $pallet) // ->where('wire_packing_number', $pallet)
@@ -205,6 +46,29 @@ class PalletPrintController extends Controller
// $customerCode = $customer->customer_po ?? ''; // $customerCode = $customer->customer_po ?? '';
// $customerName = $customer->customer_name ?? ''; // $customerName = $customer->customer_name ?? '';
// // $masterBox = WireMasterPacking::where('plant_id', $plant)
// // ->where('wire_packing_number', $pallet)
// // ->distinct('customer_po')
// // ->count('customer_po');
// // $pallets = WireMasterPacking::where('plant_id', $plant)
// // ->select('wire_packing_number', 'updated_at')
// // ->distinct('wire_packing_number')
// // ->orderBy('wire_packing_number')
// // ->orderBy('updated_at', 'asc')
// // ->get()
// // ->pluck('wire_packing_number')
// // ->values();
// // $currentPalletNo = $pallets->search($pallet) + 1;
// // $totalBoxes = WireMasterPacking::where('plant_id', $plant)
// // // ->where('wire_packing_number', $pallet)
// // ->distinct()
// // ->count('customer_po');
// // $boxLabel = $currentPalletNo . '/' . $totalBoxes;
// $totalBoxes = WireMasterPacking::where('plant_id', $plant) // $totalBoxes = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerId) // ->where('customer_po_master_id', $customerId)
// ->distinct('wire_packing_number') // ->distinct('wire_packing_number')
@@ -226,7 +90,7 @@ class PalletPrintController extends Controller
// $currentPalletNo = ($index !== false) ? $index + 1 : 0; // $currentPalletNo = ($index !== false) ? $index + 1 : 0;
// $boxLabel = $currentPalletNo . '/' . $totalBoxes; // $boxLabel = $currentPalletNo.'/'.$totalBoxes;
// // $completedPallets = WireMasterPacking::where('plant_id', $plant) // // $completedPallets = WireMasterPacking::where('plant_id', $plant)
// // ->select('wire_packing_number') // // ->select('wire_packing_number')
@@ -243,50 +107,180 @@ class PalletPrintController extends Controller
// // $boxLabel = $currentPalletNo . '/' . $totalBoxes; // // $boxLabel = $currentPalletNo . '/' . $totalBoxes;
// $grossWeight = $items->sum('weight'); // $grossWeight = $items->sum('weight');
// $widthPt = 85 * 2.83465; // 85mm → points // $widthPt = 85 * 2.83465; // 85mm → points
// $heightPt = 100 * 2.83465; // 100mm → points // $heightPt = 100 * 2.83465; // 100mm → points
// $plantName = Plant::where('id', $plant)->value('name'); // $plantName = Plant::where('id', $plant)->value('name');
// $plantAddress = Plant::where('id', $plant)->value('address'); // $plantAddress = Plant::where('id', $plant)->value('address');
// $qrBase64 = $this->generateQrDataUri($pallet); // $pdf = Pdf::loadView('pdf.wire-pallet', [
// 'product' => 'Submersible Winding Wire',
// $mpdf = new Mpdf([ // 'plantName' => $plantName,
// 'format' => [85, 100],
// 'margin_left' => 0,
// 'margin_right' => 0,
// 'margin_top' => 0,
// 'margin_bottom' => 0,
// 'tempDir' => '/var/www/tmp/mpdf'
// ]);
// $html = view('pdf.wire-pallet', [
// 'product' => 'Submersible Winding Wire',
// 'plantName' => $plantName,
// 'plantAddress' => $plantAddress, // 'plantAddress' => $plantAddress,
// 'monthYear' => now()->format('M-y'), // 'monthYear' => now()->format('M-y'),
// 'branch' => '',
// 'customerCode' => $customerCode, // 'customerCode' => $customerCode,
// 'customerName' => $customerName, // 'customerName' => $customerName,
// 'masterBox' => $pallet, // 'masterBox' => $boxLabel,
// 'items' => $items, // 'items' => $items,
// 'grossWeight' => $grossWeight, // 'grossWeight' => $grossWeight + 3.050,
// 'netWeight' => $grossWeight - 3.05, // 'netWeight' => $grossWeight,
// 'pallet' => $pallet, // // 'grossWeight' => $grossWeight,
// 'qrBase64' => $qrBase64, // // 'netWeight' => $grossWeight - 3.05,
// ])->render(); // 'pallet' => $pallet,
// ])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
// $mpdf->WriteHTML($html); // return $pdf->stream("Pallet-{$pallet}.pdf");
// return $mpdf->Output("Pallet-{$pallet}.pdf", 'I'); // 'I' = inline view in browser // // $pdfPath = storage_path("app/public/Pallet-{$pallet}.pdf");
// // $pdf->save($pdfPath);
// // $printerName = 'Tsc';
// // $output = [];
// // $returnVar = 0;
// // exec("lp -d {$printerName} " . escapeshellarg($pdfPath), $output, $returnVar);
// // if ($returnVar == 0) {
// // return response()->json([
// // 'status' => 'success',
// // 'message' => "PDF sent to printer $printerName successfully."
// // ]);
// // } else {
// // return response()->json([
// // 'status' => 'error',
// // 'message' => "Failed to send PDF to printer $printerName.",
// // 'output' => $output,
// // 'code' => $returnVar
// // ], 500);
// // }
// } // }
// private function generateQrDataUri(string $data): string /**
// { * Store a newly created resource in storage.
// $qr = new \Mpdf\QrCode\QrCode($data, 'H'); */
// $output = new \Mpdf\QrCode\Output\Png();
// $pngData = $output->output($qr, 80, [255, 255, 255], [0, 0, 0]); public function print(Request $request, $pallet, $plant)
// return 'data:image/png;base64,' . base64_encode($pngData); {
// }
$customerPoMasterId = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->value('customer_po_master_id');
$masterIds = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->pluck('customer_po_master_id');
$customerPo = CustomerPoMaster::whereIn('id', $masterIds)
->value('customer_po');
$customerPoMasterIds = CustomerPoMaster::where('customer_po', $customerPo)
->pluck('id');
$items = WireMasterPacking::with('item')
->where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->get()
->map(function ($row) {
return (object) [
'code' => $row->item->code,
'description' => $row->item->description,
'box_count' => 1, // each row = one box
'weight' => $row->weight,
];
});
$customer = CustomerPoMaster::find($customerPoMasterId);
$customerCode = $customer->customer_po ?? '';
$customerName = $customer->customer_name ?? '';
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerPoMasterId)
// ->select('wire_packing_number')
// ->groupBy('wire_packing_number')
// ->havingRaw(
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
// ['Completed']
// )
// ->count();
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
->whereIn('customer_po_master_id', $customerPoMasterIds)
->select('wire_packing_number')
->groupBy('wire_packing_number')
->havingRaw(
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
['Completed']
)
->count();
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerPoMasterId)
// ->select('wire_packing_number')
// ->groupBy('wire_packing_number')
// ->havingRaw(
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
// ['Completed']
// )
// ->orderBy('wire_packing_number')
// ->pluck('wire_packing_number')
// ->values();
$completedPallets = WireMasterPacking::where('plant_id', $plant)
->whereIn('customer_po_master_id', $customerPoMasterIds)
->select('wire_packing_number')
->groupBy('wire_packing_number')
->havingRaw(
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
['Completed']
)
->orderBy('wire_packing_number')
->pluck('wire_packing_number')
->values();
$index = $completedPallets->search($pallet);
$currentPalletNo = ($index !== false) ? $index + 1 : 0;
$boxLabel = $currentPalletNo.'/'.$totalBoxes;
$grossWeight = $items->sum('weight');
$widthPt = 85 * 2.83465; // 85mm → points
$heightPt = 100 * 2.83465; // 100mm → points
$plantName = Plant::where('id', $plant)->value('name');
$plantAddress = Plant::where('id', $plant)->value('address');
$scannedAt = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet)
->value('scanned_at');
$pdf = Pdf::loadView('pdf.wire-pallet', [
'product' => 'Submersible Winding Wire',
'plantName' => $plantName,
'plantAddress' => $plantAddress,
// 'monthYear' => now()->format('M-y'),
'monthYear' => $scannedAt
? \Carbon\Carbon::parse($scannedAt)->format('M-y')
: '',
'branch' => '',
'customerCode' => $customerCode,
'customerName' => $customerName,
'masterBox' => $boxLabel,
'items' => $items,
'grossWeight' => $grossWeight + 3.050,
'netWeight' => $grossWeight,
'pallet' => $pallet,
])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
return $pdf->stream("Pallet-{$pallet}.pdf");
}
public function store(Request $request) public function store(Request $request)
{ {

View File

@@ -151,12 +151,27 @@ public $records = [];
$characteristic = ProductCharacteristicsMaster::find($characteristicId); $characteristic = ProductCharacteristicsMaster::find($characteristicId);
if (($characteristic?->inspection_type ?? null) === 'Value') { $itemCharacteristic = ProductCharacteristicsMaster::where('plant_id', $this->data['plant_id'])
if ( ->where('line_id', $this->data['line_id'])
$characteristic && ->where('name', $characteristic->name)
is_numeric($value) && ->where('item_id', $itemId)
$value >= $characteristic->lower && ->first();
$value <= $characteristic->upper
// if (($characteristic?->inspection_type ?? null) === 'Value') {
// if ($characteristic && is_numeric($value) && (($value >= $characteristic->lower && $value <= $characteristic->upper) || $value == $characteristic->lower || $value == $characteristic->upper)
// ) {
// $status = 'Ok';
// } else {
// $status = 'NotOk';
// }
// }
// else {
// $status = $value;
// }
if (($itemCharacteristic?->inspection_type ?? null) === 'Value') {
if ($itemCharacteristic && is_numeric($value) && $value >= $itemCharacteristic->lower && $value <= $itemCharacteristic->upper
) { ) {
$status = 'Ok'; $status = 'Ok';
} else { } else {
@@ -167,7 +182,7 @@ public $records = [];
$status = $value; $status = $value;
} }
ProductionCharacteristic::create([ $prod = ProductionCharacteristic::create([
'plant_id' => $this->data['plant_id'] ?? null, 'plant_id' => $this->data['plant_id'] ?? null,
'item_id' => $itemId ?? null, 'item_id' => $itemId ?? null,
'line_id' => $this->data['line_id'] ?? null, 'line_id' => $this->data['line_id'] ?? null,
@@ -182,6 +197,15 @@ public $records = [];
]); ]);
} }
if (! $prod) {
Notification::make()
->title('Failed to save Panel Box Validation')
->body('Something went wrong while inserting data.')
->danger()
->send();
return;
}
$this->showChecklist = false; $this->showChecklist = false;
$this->dispatch('checklist-saved'); $this->dispatch('checklist-saved');
@@ -201,7 +225,7 @@ public $records = [];
$characteristic = ProductCharacteristicsMaster::find($characteristicId); $characteristic = ProductCharacteristicsMaster::find($characteristicId);
if (! $characteristic || ! is_numeric($value) || $value <= $characteristic->lower || $value >= $characteristic->upper){ if (! $characteristic || ! is_numeric($value) || ($value < $characteristic->lower || $value > $characteristic->upper)) {
return false; return false;
} }
} }
@@ -218,11 +242,24 @@ public $records = [];
$characteristic = ProductCharacteristicsMaster::find($characteristicId); $characteristic = ProductCharacteristicsMaster::find($characteristicId);
$itemCode = $this->data['item_id'];
$itemId = Item::where('plant_id', $characteristic->plant_id)->where('code', $itemCode)->value('id');
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
$limit = ProductCharacteristicsMaster::where('plant_id', $characteristic->plant_id)
->where('line_id', $characteristic->line_id)
->where('name', $characteristic->name)
->where('item_id', $itemId)
->first();
if (! $characteristic || ! is_numeric($value)) { if (! $characteristic || ! is_numeric($value)) {
return 'Not Ok'; return 'Not Ok';
} }
// return ($value >= $characteristic->lower && $value <= $characteristic->upper) ? 'Ok' : 'Not Ok';
return ($value > $characteristic->lower && $value < $characteristic->upper) ? 'Ok' : 'Not Ok'; return ($value >= $limit->lower && $value <= $limit->upper) ? 'Ok' : 'Not Ok';
} }

View File

@@ -176,7 +176,12 @@ class ProductionCheckList extends Component
'serial_number' => $this->data['serial_number'] ?? null, 'serial_number' => $this->data['serial_number'] ?? null,
'characteristic_name' => $characteristic?->name ?? null, 'characteristic_name' => $characteristic?->name ?? null,
'observed_value' => $this->data['observed_value'] ?? null, 'observed_value' => $this->data['observed_value'] ?? null,
'status' => $value == 'ok' ? 'Ok' : 'NotOk', // 'status' => $value == 'ok' ? 'Ok' : 'NotOk',
'status' => match (strtolower($value)) {
'ok' => 'Ok',
'na' => 'N/A',
'not_ok' => 'NotOk',
},
'inspection_status' => $finalInspectionStatus ?? null, 'inspection_status' => $finalInspectionStatus ?? null,
'created_by' => $this->data['operator_id'] ?? null, 'created_by' => $this->data['operator_id'] ?? null,
]); ]);

View File

@@ -23,15 +23,21 @@ class ImportTransitMail extends Mailable
public $excelPath; public $excelPath;
public $name;
public $mobileNo;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath) public function __construct($scheduleType, $tableData, $mailSubject, $excelPath, $name, $mobileNo)
{ {
$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; $this->excelPath = $excelPath;
$this->name = $name;
$this->mobileNo = $mobileNo;
} }
/** /**
@@ -81,7 +87,7 @@ class ImportTransitMail extends Mailable
'company' => 'CRI Digital Manufacturing Solutions', 'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting, 'greeting' => $greeting,
'tableData' => $this->tableData, 'tableData' => $this->tableData,
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions', 'wishes' => "Thanks & Regards,<br>CRI Digital Manufacturing Solutions<br><b>Updated By</b> - $this->name<br>For any queries, please contact the number below<br>+91 $this->mobileNo",
], ],
); );
} }

View File

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

View File

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

View File

@@ -61,6 +61,11 @@ class Line extends Model
return $this->hasMany(ProcessOrder::class); return $this->hasMany(ProcessOrder::class);
} }
public function machines()
{
return $this->hasMany(Machine::class);
}
public function productCharacteristicsMasters() public function productCharacteristicsMasters()
{ {
return $this->hasMany(ProductCharacteristicsMaster::class); return $this->hasMany(ProductCharacteristicsMaster::class);

View File

@@ -53,6 +53,11 @@ class Machine extends Model
return $this->hasMany(RequestCharacteristic::class, 'machine_id', 'id'); return $this->hasMany(RequestCharacteristic::class, 'machine_id', 'id');
} }
public function characteristicApproverMaster()
{
return $this->hasMany(CharacteristicApproverMaster::class, 'machine_id', 'id');
}
public function productionCharacteristics() public function productionCharacteristics()
{ {
return $this->hasMany(ProductionCharacteristic::class, 'machine_id', 'id'); return $this->hasMany(ProductionCharacteristic::class, 'machine_id', 'id');

View File

@@ -49,6 +49,11 @@ class Plant extends Model
return $this->hasMany(StickerMaster::class, 'plant_id', 'id'); return $this->hasMany(StickerMaster::class, 'plant_id', 'id');
} }
public function locators(): HasMany
{
return $this->hasMany(Locator::class, 'plant_id', 'id');
}
public function weightValidations(): HasMany public function weightValidations(): HasMany
{ {
return $this->hasMany(WeightValidation::class, 'plant_id', 'id'); return $this->hasMany(WeightValidation::class, 'plant_id', 'id');
@@ -104,6 +109,11 @@ class Plant extends Model
return $this->hasMany(WorkGroupMaster::class, 'plant_id', 'id'); return $this->hasMany(WorkGroupMaster::class, 'plant_id', 'id');
} }
public function machines()
{
return $this->hasMany(Machine::class, 'plant_id', 'id');
}
public function processOrders() public function processOrders()
{ {
return $this->hasMany(ProcessOrder::class, 'plant_id', 'id'); return $this->hasMany(ProcessOrder::class, 'plant_id', 'id');
@@ -178,4 +188,14 @@ class Plant extends Model
{ {
return $this->hasMany(AsrsItemValidation::class, 'plant_id', 'id'); return $this->hasMany(AsrsItemValidation::class, 'plant_id', 'id');
} }
// public function locatorValidations()
// {
// return $this->hasMany(LocatorValidation::class, 'plant_id', 'id');
// }
public function characteristicApproverMaster()
{
return $this->hasMany(CharacteristicApproverMaster::class, 'plant_id', 'id');
}
} }

View File

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

View File

@@ -30,6 +30,11 @@ class WorkGroupMaster extends Model
return $this->hasMany(ProductCharacteristicsMaster::class); return $this->hasMany(ProductCharacteristicsMaster::class);
} }
public function machines()
{
return $this->hasMany(Machine::class, 'work_group_master_id');
}
// public function rejectReasons() // public function rejectReasons()
// { // {
// return $this->hasMany(RejectReason::class, 'work_group_master_id', 'id'); // return $this->hasMany(RejectReason::class, 'work_group_master_id', 'id');

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 class_characteristics
ADD COLUMN zmm_axial_force TEXT DEFAULT NULL
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('class_characteristics', function (Blueprint $table) {
// //
// });
}
};

View File

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

View File

@@ -91,7 +91,9 @@ class PermissionSeeder extends Seeder
Permission::updateOrCreate(['name' => 'view import serial invoice']); Permission::updateOrCreate(['name' => 'view import serial invoice']);
Permission::updateOrCreate(['name' => 'view import material invoice']); Permission::updateOrCreate(['name' => 'view import material invoice']);
Permission::updateOrCreate(['name' => 'view import invoice']); Permission::updateOrCreate(['name' => 'view import invoice']);
Permission::updateOrCreate(['name' => 'view export invoice']); Permission::updateOrCreate(['name' => 'view import sap invoice']);
Permission::updateOrCreate(['name' => 'view export serial invoice']);
Permission::updateOrCreate(['name' => 'view export material invoice']);
Permission::updateOrCreate(['name' => 'view export asn invoice']); Permission::updateOrCreate(['name' => 'view export asn invoice']);
Permission::updateOrCreate(['name' => 'view import locator invoice validation']); Permission::updateOrCreate(['name' => 'view import locator invoice validation']);
@@ -228,7 +230,14 @@ class PermissionSeeder extends Seeder
Permission::updateOrCreate(['name' => 'view import asrs item validation']); Permission::updateOrCreate(['name' => 'view import asrs item validation']);
Permission::updateOrCreate(['name' => 'view export asrs item validation']); Permission::updateOrCreate(['name' => 'view export asrs item validation']);
Permission::updateOrCreate(['name' => 'view import employee master']);
Permission::updateOrCreate(['name' => 'view export employee master']);
Permission::updateOrCreate(['name' => 'view import visitor entries']);
Permission::updateOrCreate(['name' => 'view export visitor entries']);
Permission::updateOrCreate(['name' => 'view gate entry page']); Permission::updateOrCreate(['name' => 'view gate entry page']);
Permission::updateOrCreate(['name' => 'view import locator validation']);
Permission::updateOrCreate(['name' => 'view export locator validation']);
} }
} }

View File

@@ -18,6 +18,7 @@
<th class="border px-2 py-1 w-2/3">Characteristics</th> <th class="border px-2 py-1 w-2/3">Characteristics</th>
<th class="border px-2 py-1 w-1/6">OK</th> <th class="border px-2 py-1 w-1/6">OK</th>
<th class="border px-2 py-1 w-1/6">Not OK</th> <th class="border px-2 py-1 w-1/6">Not OK</th>
<th class="border px-2 py-1 w-1/6">N/A</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -38,6 +39,12 @@
wire:model="checklist.{{ $record['id'] }}" wire:model="checklist.{{ $record['id'] }}"
value="not_ok"> value="not_ok">
</td> </td>
<td class="border text-center">
<input type="radio"
wire:model="checklist.{{ $record['id'] }}"
value="na">
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>

View File

@@ -103,15 +103,15 @@
{{ !empty($row['eta_date']) ? \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') : '' }} {{ !empty($row['eta_date']) ? \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') : '' }}
</td> </td>
<td class="status-column"> <td class="status-column">
{{ $row['remark'] }} {{ $row['status'] }}
</td> </td>
<td>{{ $row['delivery_location'] }}</td> <td>{{ $row['delivery_location'] }}</td>
{{-- <td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td> --}} {{-- <td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td> --}}
<td> <td>
{{ !empty($row['etd_date']) ? \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') : '' }} {{ !empty($row['etd_date']) ? \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') : '' }}
</td> </td>
<td class="status-column"> <td>
{{ $row['status'] }} {{ $row['remark'] }}
</td> </td>
</tr> </tr>
@endforeach @endforeach

View File

@@ -83,6 +83,15 @@
</td> </td>
</tr> </tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
No of Person
</td>
<td style="border:1px solid #d1d5db;">
{{ $visitor->number_of_person }}
</td>
</tr>
<tr> <tr>
<td style="border:1px solid #d1d5db;font-weight:bold;"> <td style="border:1px solid #d1d5db;font-weight:bold;">
Visit Time Visit Time

View File

@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Visitor Out Notification</title>
</head>
<body style="margin:0;padding:0;background:#ffffff;font-family:Arial,Helvetica,sans-serif;">
<table width="100%" cellpadding="0" cellspacing="0" style="background:#ffffff;">
<tr>
<td align="center">
<table width="700" cellpadding="0" cellspacing="0" style="background:#ffffff;border:1px solid #e5e7eb;">
<!-- Header -->
<tr>
<td style="background:#0f766e;padding:20px;text-align:center;">
<h2 style="margin:0;color:#ffffff;">
Visitor Out Notification
</h2>
</td>
</tr>
<!-- Content -->
<tr>
<td style="padding:25px;">
<p style="margin-top:0;">
{!! $greeting !!}
</p>
<p>
A visitor has checked out. Please find the details below:
</p>
<table width="100%" cellpadding="10" cellspacing="0"
style="border-collapse:collapse;margin-top:15px;">
<tr>
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
Visitor Name
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->name ?? '-' }}
</td>
</tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
Mobile Number
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->mobile_number ?? '-' }}
</td>
</tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
Company
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->company ?? '-' }}
</td>
</tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
Purpose of Visit
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->purpose_of_visit ?? '-' }}
</td>
</tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
No of Persons
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->number_of_person ?? '-' }}
</td>
</tr>
<tr>
<td style="border:1px solid #d1d5db;font-weight:bold;">
Out Time
</td>
<td style="border:1px solid #d1d5db;">
{{ $entry?->out_time?->format('d-m-Y h:i A') ?? '-' }}
</td>
</tr>
</table>
<br>
<p>
{!! $wishes !!}
</p>
</td>
</tr>
<!-- Footer -->
<tr>
<td style="padding:15px;text-align:center;border-top:1px solid #e5e7eb;font-size:12px;color:#666;">
© {{ date('Y') }} {{ $company }}<br>
Visitor Management System
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -26,7 +26,7 @@
$grossWeightHeight = 5; $grossWeightHeight = 5;
$netWeightHeight = 5; $netWeightHeight = 5;
$licenseHeight = 5; $licenseHeight = 5;
$companyInfoHeight = 6.9; $companyInfoHeight = 6.9; //6.9
$logoHeight = $titleHeight * 0.8; $logoHeight = $titleHeight * 0.8;
$logoMaxWidth = 20; $logoMaxWidth = 20;
$isilogoHeight = $titleHeight * 0.9; $isilogoHeight = $titleHeight * 0.9;
@@ -240,8 +240,13 @@
/* Column widths */ /* Column widths */
.col-1 { width: 22%; } .col-1 { width: 22%; }
.col-2 { width: 45%; } .col-2 { width: 45%; }
.col-3 { width: 11%; }
.col-4 { width: 29%; }
/* .col-1 { width: 20%; }
.col-2 { width: 48%; }
.col-3 { width: 15%; } .col-3 { width: 15%; }
.col-4 { width: 25%; } .col-4 { width: 17%; } */
/* Force exact heights for rows - ALL FIXED EXCEPT ITEM ROWS */ /* Force exact heights for rows - ALL FIXED EXCEPT ITEM ROWS */
.title-row { .title-row {