321 Commits

Author SHA1 Message Date
557c367f4c Merge pull request 'changed time in scheduler' (#222) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #222
2026-01-21 10:22:37 +00:00
dhanabalan
a8261cf0e6 changed time in scheduler
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 3m36s
2026-01-21 15:52:27 +05:30
cef3e17dc7 Merge pull request 'changed time in invoice in transit' (#221) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #221
2026-01-21 10:21:14 +00:00
dhanabalan
1817876af5 changed time in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m33s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2026-01-21 15:51:02 +05:30
f89ad49eff Merge pull request 'changed time in invoice in transit' (#220) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #220
2026-01-21 09:29:47 +00:00
dhanabalan
29a0e480f4 changed time in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
2026-01-21 14:59:34 +05:30
c9006ee0a1 Merge pull request 'change time in invoice transit' (#219) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #219
2026-01-21 09:27:24 +00:00
dhanabalan
05436f278b change time in invoice transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 3m49s
2026-01-21 14:57:08 +05:30
2fa58b587e Merge pull request 'chnaged time in scheduler' (#218) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #218
2026-01-21 07:31:49 +00:00
dhanabalan
3b709c1dc6 chnaged time in scheduler
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2026-01-21 13:01:36 +05:30
bb0a684366 Merge pull request 'Changed time logic in invoice data report' (#217) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #217
2026-01-21 06:30:19 +00:00
dhanabalan
0b45d970b6 Changed time logic in invoice data report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m29s
Laravel Larastan / larastan (pull_request) Failing after 3m18s
2026-01-21 11:59:59 +05:30
16b1802412 Merge pull request 'changed time in invoice transit' (#216) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #216
2026-01-21 06:16:14 +00:00
dhanabalan
cd29fd51b7 changed time in invoice transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 3m39s
Laravel Pint / pint (pull_request) Successful in 2m34s
2026-01-21 11:46:02 +05:30
079ed2eba6 Merge pull request 'changed time in invoice in transit' (#215) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Reviewed-on: #215
2026-01-21 06:09:33 +00:00
dhanabalan
8aacff18be changed time in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 8m43s
2026-01-21 11:39:08 +05:30
f1f6b596a4 Merge pull request 'changed time for invoice in transit' (#214) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #214
2026-01-21 05:58:54 +00:00
dhanabalan
e971ec102f changed time for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 3m9s
Laravel Larastan / larastan (pull_request) Failing after 3m33s
2026-01-21 11:28:40 +05:30
b2aa572994 Merge pull request 'Added customer trade and location in invoice pending reason page' (#213) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #213
2026-01-21 05:55:35 +00:00
dhanabalan
4c9f507d50 Added customer trade and location in invoice pending reason page
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 23s
Laravel Pint / pint (pull_request) Successful in 3m13s
Laravel Larastan / larastan (pull_request) Failing after 3m57s
2026-01-21 11:25:15 +05:30
44bdcba615 Merge pull request 'chnaged logic in invoice chart' (#212) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #212
2026-01-20 13:31:09 +00:00
dhanabalan
d286b5e40d chnaged logic in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 3m2s
Laravel Larastan / larastan (pull_request) Failing after 3m47s
2026-01-20 19:00:55 +05:30
76a5379c02 Merge pull request 'changed logic in invoice report' (#211) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #211
2026-01-20 13:12:35 +00:00
dhanabalan
d04e118bf6 changed logic in invoice report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m24s
Laravel Larastan / larastan (pull_request) Failing after 3m35s
2026-01-20 18:42:19 +05:30
eeeec722ee Merge pull request 'changed logic for this week also in invoice chart' (#210) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #210
2026-01-20 12:50:26 +00:00
dhanabalan
58191aada6 changed logic for this week also in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Laravel Pint / pint (pull_request) Successful in 2m25s
Laravel Larastan / larastan (pull_request) Failing after 3m29s
2026-01-20 18:20:14 +05:30
d8a4ddf6e9 Merge pull request 'changed logic in invoice chart' (#209) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #209
2026-01-20 12:47:42 +00:00
dhanabalan
7e96c3cdbf changed logic in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Laravel Pint / pint (pull_request) Successful in 2m27s
Laravel Larastan / larastan (pull_request) Failing after 3m17s
2026-01-20 18:17:27 +05:30
9493bf5edf Merge pull request 'changed logic in invoice chart' (#208) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #208
2026-01-20 12:18:11 +00:00
dhanabalan
98cafeb5af changed logic in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m17s
2026-01-20 17:47:56 +05:30
feab063017 Merge pull request 'changed logic in invoice chart' (#207) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #207
2026-01-20 11:09:45 +00:00
dhanabalan
d9319b1ec6 changed logic in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2026-01-20 16:39:32 +05:30
b2f5194ef9 Merge pull request 'changed logic in invoice chart' (#206) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #206
2026-01-20 10:59:15 +00:00
dhanabalan
8cb5f5c251 changed logic in invoice chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 3m45s
Laravel Larastan / larastan (pull_request) Failing after 4m13s
2026-01-20 16:28:46 +05:30
3a3322ccc4 Merge pull request 'changed update scenario logic in invoice out validations page' (#205) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #205
2026-01-20 06:24:38 +00:00
dhanabalan
ad143d723a changed update scenario logic in invoice out validations page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m50s
Laravel Larastan / larastan (pull_request) Failing after 3m39s
2026-01-20 11:54:24 +05:30
7a9dac239d Merge pull request 'changed logic in invoice pending reason page' (#204) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #204
2026-01-20 05:30:46 +00:00
dhanabalan
d41371a32d changed logic in invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 3m0s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2026-01-20 11:00:33 +05:30
77d98b16fb Merge pull request 'Added notifications for invoice pending reason page' (#203) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #203
2026-01-20 05:28:39 +00:00
dhanabalan
9c23fb3aca Added notifications for invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m40s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2026-01-20 10:58:24 +05:30
a2554fb4a9 Merge pull request 'Added permission for invoice pending reason page in seeder' (#202) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #202
2026-01-20 05:24:27 +00:00
dhanabalan
6a13a79610 Added permission for invoice pending reason page in seeder
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 3m19s
Laravel Pint / pint (pull_request) Successful in 2m31s
2026-01-20 10:54:15 +05:30
353774b184 Merge pull request 'Added save button in invoice pending reason page' (#201) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #201
2026-01-20 05:22:17 +00:00
dhanabalan
8e1238e719 Added save button in invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m28s
Laravel Larastan / larastan (pull_request) Failing after 4m37s
2026-01-20 10:52:03 +05:30
29fecaea3d Merge pull request 'changed max length in invoice pending reason' (#200) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #200
2026-01-20 05:13:57 +00:00
dhanabalan
88346b9ad8 changed max length in invoice pending reason
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m54s
Laravel Larastan / larastan (pull_request) Failing after 3m19s
2026-01-20 10:43:42 +05:30
a35185e4b1 Merge pull request 'Added max length for remark for invoice pending reason page' (#199) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #199
2026-01-20 05:12:30 +00:00
dhanabalan
e4b39c5b52 Added max length for remark for invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m50s
Laravel Larastan / larastan (pull_request) Failing after 3m27s
2026-01-20 10:42:10 +05:30
f07ba9dd00 Merge pull request 'Added remark column in invoice data validation resource page' (#198) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #198
2026-01-20 05:03:26 +00:00
dhanabalan
771e9351db Added remark column in invoice data validation resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 2m24s
Laravel Larastan / larastan (pull_request) Failing after 3m10s
2026-01-20 10:33:12 +05:30
2a7f48cc75 Merge pull request 'Added remark column in invoice data validations' (#197) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #197
2026-01-20 04:58:03 +00:00
dhanabalan
8032d5e549 Added remark column in invoice data validations
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m35s
Laravel Larastan / larastan (pull_request) Failing after 3m30s
2026-01-20 10:27:49 +05:30
c7f4f49669 Merge pull request 'Added remark column for invoice data report' (#196) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #196
2026-01-20 04:57:05 +00:00
dhanabalan
cf7e0294c4 Added remark column for invoice data report
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 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m59s
Laravel Larastan / larastan (pull_request) Failing after 4m6s
2026-01-20 10:26:38 +05:30
2e9a52a890 Merge pull request 'Added invoice pending reason page' (#195) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #195
2026-01-20 04:53:20 +00:00
dhanabalan
76afd15b3b Added invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m40s
Laravel Larastan / larastan (pull_request) Failing after 3m50s
2026-01-20 10:23:06 +05:30
3c34495048 Merge pull request 'changed report time for invoice transit and invoice data' (#194) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #194
2026-01-19 10:33:34 +00:00
dhanabalan
3788f4cd18 changed report time for invoice transit and invoice data
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 55s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m1s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m48s
2026-01-19 16:03:13 +05:30
b70907cb9f Merge pull request 'ranjith-dev' (#193) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #193
2026-01-19 10:03:28 +00:00
dhanabalan
7dd9f43940 Enhance StickerMasterResource: Update item selection logic, add 1. validation rules, 2. default values, 3. searchPlaceholder, and improve UI labels
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 4m13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 4m21s
Laravel Pint / pint (pull_request) Successful in 3m24s
Laravel Larastan / larastan (pull_request) Failing after 3m58s
2026-01-19 15:29:27 +05:30
dhanabalan
b089ddd75c Add default values, searchPlaceholder and update labels in filters
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m5s
2026-01-19 15:25:54 +05:30
9ee4fe5c7e Merge pull request 'changed name of the column overdue days' (#190) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #190
2026-01-14 06:52:50 +00:00
dhanabalan
a7dee59f75 changed name of the column overdue days
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 2m27s
Laravel Larastan / larastan (pull_request) Failing after 2m56s
2026-01-14 12:21:50 +05:30
6f06319752 Merge pull request 'changed logic in invoice in transit' (#189) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #189
2026-01-14 06:49:00 +00:00
dhanabalan
c10c256ec9 changed logic in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m24s
Laravel Larastan / larastan (pull_request) Failing after 3m28s
2026-01-14 12:18:44 +05:30
785be70629 Merge pull request 'Refactor item code retrieval in WeightValidationResource table method' (#188) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #188
2026-01-14 06:47:41 +00:00
dhanabalan
011632b725 Refactor item code retrieval in WeightValidationResource table method
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m33s
Laravel Larastan / larastan (pull_request) Failing after 3m17s
2026-01-14 12:17:18 +05:30
e5cb7f3d88 Merge pull request 'ranjith-dev' (#187) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #187
2026-01-14 06:37:24 +00:00
dhanabalan
9540fb95c9 Added view rights against plant on view report and Updated alignments and load available item code logic on resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 28s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m37s
2026-01-14 11:59:50 +05:30
dhanabalan
96a8311317 Added weight validation table has many relationship
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 11:46:54 +05:30
dhanabalan
1db254c32b Implement feature X to enhance user experience and optimize performance
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 11:37:04 +05:30
dhanabalan
2604896fd8 Added view rights against plant on view report and Updated alignments on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 11:27:31 +05:30
dhanabalan
0a69d515a4 Added view rights against plant on view report and Updated alignments on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 11:02:25 +05:30
dhanabalan
75d87cda29 Added view rights against plant on view report and Updated alignments on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 10:56:14 +05:30
dhanabalan
f611a81da0 Added view rights against plant on view report and Updated alignments and filter query logic on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-01-14 10:43:14 +05:30
dhanabalan
adb61638c9 Added view rights against plant on view report and Updated alignments on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 10:33:59 +05:30
dhanabalan
8c0676e9b8 Added view rights against plant on view report and Updated alignments and filter query logic on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 10:29:43 +05:30
dhanabalan
f9cb090a25 Added view rights against plant on view report and Updated alignments and load available item code logic on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:56:53 +05:30
dhanabalan
f1c0dc738c Added Product Characteristics Master table has many relationship
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:52:41 +05:30
dhanabalan
58175a245e Added view rights against plant on view report and Updated alignments and load available item code logic on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:46:49 +05:30
dhanabalan
d8e722ab0e Added process order table has many relationship
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:42:31 +05:30
dhanabalan
f4a6496411 Added view rights against plant on view report and Updated alignment on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:31:12 +05:30
dhanabalan
4a4259612b Added view rights against plant on view report and Updated alignment on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:26:35 +05:30
dhanabalan
978a23449a Added view rights against plant on view report and Updated alignment on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:23:07 +05:30
dhanabalan
4ad848054f Implement initial structure for code changes and prepare for future updates and Added view rights against plant on view report
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:20:28 +05:30
dhanabalan
041cc11030 Added view rights against plant on view report
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:14:45 +05:30
dhanabalan
511a491be2 Add reactive behavior to form fields and update options based on plant selection
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-14 09:08:36 +05:30
dhanabalan
a0a10cb668 Updated alignment on resource
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
2026-01-14 09:06:45 +05:30
dhanabalan
13912de584 Updated alignment on export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
2026-01-13 16:47:28 +05:30
dhanabalan
63110298e7 Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:46:43 +05:30
dhanabalan
d59fb00e90 Added plant code instead of plant name on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:45:48 +05:30
dhanabalan
bf6b973fd1 Updated alignment and validation logic on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:44:42 +05:30
dhanabalan
2521c04f03 Updated alignment and validation logic on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
2026-01-13 16:43:48 +05:30
dhanabalan
9bed5f6937 Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:42:30 +05:30
dhanabalan
b7b7f88235 Added plant code instead of plant name on export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:41:08 +05:30
dhanabalan
aa781ccc89 Added view rights against plant on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:39:23 +05:30
dhanabalan
2f8d7615a3 Updated alignment on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:38:42 +05:30
dhanabalan
05f059ece1 Added view rights against plant on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:37:24 +05:30
dhanabalan
b2044bc851 Added view rights against plant on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:35:57 +05:30
dhanabalan
0cb5373312 Added view rights against plant on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:34:49 +05:30
dhanabalan
5a74f9a4ca Added view rights against plant on import and export and Validation logic updated
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:33:57 +05:30
dhanabalan
f592852b77 Updated alignments on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:32:47 +05:30
dhanabalan
b9cb492d37 Updated alignments on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:31:43 +05:30
dhanabalan
5bacc0cba7 Updated alignments on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:29:52 +05:30
dhanabalan
bbd8ff91a2 Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:27:47 +05:30
dhanabalan
f05bb3d5b3 Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:27:00 +05:30
dhanabalan
188e13ab99 Updated alignments on import
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:26:10 +05:30
dhanabalan
e917159486 Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:25:07 +05:30
dhanabalan
7f96d9631a Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:23:05 +05:30
dhanabalan
5a218d688d Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:19:20 +05:30
dhanabalan
1e57326e8e Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:18:10 +05:30
dhanabalan
4de209841a Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:17:03 +05:30
dhanabalan
5cba017b72 Updated alignments on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:15:06 +05:30
dhanabalan
6b40204e35 Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:13:50 +05:30
dhanabalan
49ab5b14ed Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
2026-01-13 16:13:00 +05:30
dhanabalan
79a09e3a59 Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:06:38 +05:30
dhanabalan
ae954e2d7d Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:05:25 +05:30
dhanabalan
4705b3aebb Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:04:11 +05:30
dhanabalan
3c4a09f571 Added view rights against plant on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
2026-01-13 16:02:45 +05:30
dhanabalan
7a988b7280 Added view rights against plant
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 16:00:31 +05:30
dhanabalan
47db04a36c Added view rights against plant
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 15:58:28 +05:30
dhanabalan
22c65c4308 Added view rights against plant
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-13 15:54:01 +05:30
1dbbd53fc9 Merge pull request 'Updated item code filter option against plant from stickerMaster' (#186) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #186
2026-01-13 10:10:36 +00:00
dhanabalan
bec3e9f8bd Updated item code filter option against plant from stickerMaster
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m50s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2026-01-13 15:39:42 +05:30
04d0c2dc82 Merge pull request 'Removed commented notifications' (#185) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #185
2026-01-13 09:22:51 +00:00
dhanabalan
26b4cd9363 Removed commented notifications
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m26s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2026-01-13 14:52:27 +05:30
048977a44b Merge pull request 'ranjith-dev' (#183) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #183
2026-01-13 09:21:33 +00:00
8395599d9d Merge pull request 'Update .github/workflows/gemini-pr-review.yaml' (#184) from jothi-patch-1 into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #184
2026-01-13 09:18:30 +00:00
9a7b42dea5 Update .github/workflows/gemini-pr-review.yaml
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m33s
Laravel Larastan / larastan (pull_request) Failing after 3m38s
2026-01-13 09:18:16 +00:00
dhanabalan
f19765ff7b Added view rights against plant
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Larastan / larastan (pull_request) Failing after 3m8s
Laravel Pint / pint (pull_request) Successful in 3m6s
2026-01-13 13:12:36 +05:30
dhanabalan
18fc1d25ac Added plant code instead of plant name on import and export
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Laravel Larastan / larastan (pull_request) Failing after 3m3s
Laravel Pint / pint (pull_request) Successful in 2m44s
2026-01-13 11:59:15 +05:30
dhanabalan
0cc969f065 changed gemini pr review yaml logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 6m1s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 4m8s
Laravel Pint / pint (pull_request) Successful in 3m1s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 47s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2026-01-12 15:04:48 +05:30
0ce59ebe22 Merge pull request 'changed time in scheduler for invoice in transit' (#178) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #178
2026-01-08 04:26:24 +00:00
dhanabalan
053c07bcfb changed time in scheduler for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 37s
Laravel Pint / pint (pull_request) Successful in 2m15s
Laravel Larastan / larastan (pull_request) Failing after 3m20s
2026-01-08 09:56:12 +05:30
c032cdc58d Merge pull request 'changed time in invoice in transit' (#177) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #177
2026-01-07 04:59:13 +00:00
dhanabalan
b09ed3481a changed time in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 2m40s
Laravel Larastan / larastan (pull_request) Failing after 3m38s
2026-01-07 10:29:01 +05:30
4074374614 Merge pull request 'Added logic for columns missing invoice in transit' (#176) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Reviewed-on: #176
2026-01-07 03:59:10 +00:00
dhanabalan
c2d840d772 Added logic for columns missing invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 42s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 3m49s
2026-01-07 09:28:57 +05:30
15712c44b6 Merge pull request 'changed report time for invoice in transit' (#175) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #175
2026-01-07 02:52:28 +00:00
dhanabalan
119262405c changed report time for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 33s
Laravel Pint / pint (pull_request) Successful in 2m5s
Laravel Larastan / larastan (pull_request) Failing after 3m11s
2026-01-07 08:21:52 +05:30
99f7450e5e Merge pull request 'changed logic in testing temp resource page' (#174) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #174
2026-01-06 13:48:37 +00:00
dhanabalan
84748c5e3d changed logic in testing temp resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 3m49s
Laravel Larastan / larastan (pull_request) Failing after 4m51s
2026-01-06 19:18:22 +05:30
f6f6f0924e Merge pull request 'Added testing temp policy file' (#173) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #173
2026-01-06 13:28:27 +00:00
dhanabalan
4ec781b942 Added testing temp policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / review (pull_request) Failing after 26s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m33s
Laravel Larastan / larastan (pull_request) Failing after 3m35s
2026-01-06 18:58:16 +05:30
3bab0310a1 Merge pull request 'Added testing temp resource files' (#172) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #172
2026-01-06 13:26:55 +00:00
dhanabalan
f0f7bffe74 Added testing temp resource files
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 28s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m25s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2026-01-06 18:56:45 +05:30
6924990ace Merge pull request 'Added testing temp model file' (#171) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #171
2026-01-06 13:25:41 +00:00
dhanabalan
40889f8802 Added testing temp model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 30s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m9s
Laravel Larastan / larastan (pull_request) Failing after 3m28s
2026-01-06 18:55:30 +05:30
ba0b2c2709 Merge pull request 'Added Testing temp migration file' (#170) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #170
2026-01-06 13:24:52 +00:00
dhanabalan
62272df783 Added Testing temp migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 26s
Laravel Pint / pint (pull_request) Successful in 2m19s
Laravel Larastan / larastan (pull_request) Failing after 3m24s
2026-01-06 18:54:39 +05:30
51416cdf37 Merge pull request 'Added 10 am for mauil trigger invoice in transit' (#169) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #169
2026-01-06 12:25:35 +00:00
dhanabalan
53d55555d8 Added 10 am for mauil trigger invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Gemini PR Review / review (pull_request) Failing after 22m14s
Laravel Larastan / larastan (pull_request) Failing after 27m34s
Laravel Pint / pint (pull_request) Successful in 7m16s
2026-01-06 17:54:50 +05:30
a8ff5b5120 Merge pull request 'modified logic for proper pending days in invoice in transit' (#168) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #168
2026-01-06 07:16:55 +00:00
dhanabalan
8c0a404665 modified logic for proper pending days in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 25s
Laravel Larastan / larastan (pull_request) Failing after 3m19s
Laravel Pint / pint (pull_request) Successful in 3m28s
2026-01-06 12:46:41 +05:30
4ca965ccb1 Merge pull request 'chnaged time for invoice in transit' (#167) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #167
2026-01-06 06:36:03 +00:00
dhanabalan
def447e12b chnaged time for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 31s
Laravel Pint / pint (pull_request) Successful in 3m31s
Laravel Larastan / larastan (pull_request) Failing after 13m46s
2026-01-06 12:05:52 +05:30
22cbb6c4d3 Merge pull request 'changed time for invoice transit' (#166) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #166
2026-01-06 04:28:11 +00:00
dhanabalan
f0b80554d2 changed time for invoice transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 26s
Laravel Pint / pint (pull_request) Successful in 2m35s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2026-01-06 09:57:58 +05:30
6db07e1825 Merge pull request 'Added delete logic inside the invoice in transits resource page' (#165) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #165
2026-01-04 10:37:33 +00:00
dhanabalan
469e0e1bbe Added delete logic inside the invoice in transits resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 52s
Laravel Pint / pint (pull_request) Successful in 2m10s
Laravel Larastan / larastan (pull_request) Failing after 2m55s
2026-01-04 16:07:21 +05:30
1bc0a4b01d Merge pull request 'chnaged logic for lr aw br date for pending days' (#164) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #164
2026-01-04 10:30:47 +00:00
dhanabalan
d03b803bae chnaged logic for lr aw br date for pending days
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 50s
Laravel Larastan / larastan (pull_request) Failing after 2m59s
Laravel Pint / pint (pull_request) Successful in 2m35s
2026-01-04 16:00:26 +05:30
dc77a51c3c Merge pull request 'Added permissions to view process order upload and download button' (#163) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #163
2026-01-04 09:59:05 +00:00
dhanabalan
5be689a9c1 Added permissions to view process order upload and download button
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 33s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
2026-01-04 15:28:51 +05:30
b07a9596e5 Merge pull request 'Added order quantity in process order importer' (#162) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #162
2026-01-04 09:26:15 +00:00
dhanabalan
59b94b2b26 Added order quantity in process order importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 55s
Laravel Pint / pint (pull_request) Successful in 2m8s
Laravel Larastan / larastan (pull_request) Failing after 2m56s
2026-01-04 14:56:03 +05:30
b96a54aae5 Merge pull request 'Added alert mail rule exporter file' (#161) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #161
2026-01-04 06:07:42 +00:00
dhanabalan
09b756b35b Added alert mail rule exporter file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 1m24s
Laravel Larastan / larastan (pull_request) Failing after 3m3s
Laravel Pint / pint (pull_request) Successful in 2m14s
2026-01-04 11:37:30 +05:30
fe0e1e139e Merge pull request 'Added alert mail rule importer file' (#160) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #160
2026-01-04 06:06:52 +00:00
dhanabalan
ed26b4c705 Added alert mail rule importer file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 1m7s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m56s
2026-01-04 11:36:41 +05:30
a95766fd45 Merge pull request 'Added import and export inside the alert mail resource page' (#159) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #159
2026-01-04 06:06:04 +00:00
dhanabalan
9789f2828f Added import and export inside the alert mail resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 1m47s
Laravel Larastan / larastan (pull_request) Failing after 3m2s
Laravel Pint / pint (pull_request) Successful in 2m14s
2026-01-04 11:35:51 +05:30
d5d5a6d193 Merge pull request 'Added logic for invoice rule empty invoice in transit' (#158) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #158
2026-01-04 04:24:30 +00:00
dhanabalan
f27ba80475 Added logic for invoice rule empty invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 38s
Laravel Pint / pint (pull_request) Successful in 2m6s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2026-01-04 09:54:18 +05:30
25125cfead Merge pull request 'chnaged report timing to acctual time of invoice in transit' (#157) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #157
2026-01-04 04:23:23 +00:00
dhanabalan
1f657a626a chnaged report timing to acctual time of invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 37s
Laravel Larastan / larastan (pull_request) Failing after 3m3s
Laravel Pint / pint (pull_request) Successful in 2m44s
2026-01-04 09:53:09 +05:30
d6c6cf0c69 Merge pull request 'changed report time for invoice in transit' (#156) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #156
2026-01-04 04:17:22 +00:00
dhanabalan
ca9261d75a changed report time for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m5s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 44s
Gemini PR Review / review (pull_request) Failing after 2m43s
Laravel Larastan / larastan (pull_request) Failing after 3m4s
Laravel Pint / pint (pull_request) Successful in 2m22s
2026-01-04 09:47:10 +05:30
99a95dc150 Merge pull request 'removed manual trigger of invoice data report button from alert mail resource' (#155) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #155
2026-01-03 11:13:49 +00:00
dhanabalan
99afa82c75 removed manual trigger of invoice data report button from alert mail resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 48s
Laravel Pint / pint (pull_request) Successful in 1m58s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2026-01-03 16:43:35 +05:30
6d26307c4a Merge pull request 'Added invoice master id in alert mail rules' (#154) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #154
2026-01-03 11:07:06 +00:00
dhanabalan
efaf876df3 Added invoice master id in alert mail rules
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 46s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 2m51s
2026-01-03 16:36:54 +05:30
8703aec73e Merge pull request 'changed sub group name of all pages for invoice management' (#153) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #153
2026-01-03 10:41:58 +00:00
dhanabalan
d3166eacf5 changed sub group name of all pages for invoice management
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 1m58s
Laravel Larastan / larastan (pull_request) Failing after 2m58s
2026-01-03 16:11:44 +05:30
f8691500cf Merge pull request 'Added export permissions for invoice in transit' (#152) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #152
2026-01-03 10:23:58 +00:00
dhanabalan
cada0added Added export permissions for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / review (pull_request) Failing after 50s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m10s
Laravel Larastan / larastan (pull_request) Failing after 2m47s
2026-01-03 15:53:46 +05:30
12f9cb683f Merge pull request 'Added import and export permissions for invoice in transit' (#151) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #151
2026-01-03 10:22:55 +00:00
dhanabalan
eb62b3a38b Added import and export permissions for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 38s
Laravel Pint / pint (pull_request) Successful in 2m14s
Laravel Larastan / larastan (pull_request) Failing after 3m36s
2026-01-03 15:52:40 +05:30
73c26a649a Merge pull request 'removed report period in invoice in transit' (#150) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #150
2026-01-03 09:48:21 +00:00
dhanabalan
e0d34fbc7b removed report period in invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 42s
Laravel Larastan / larastan (pull_request) Failing after 3m4s
Laravel Pint / pint (pull_request) Successful in 6m57s
2026-01-03 15:18:08 +05:30
80f6aeb3d6 Merge pull request 'remove searchable in alert mail resource' (#149) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #149
2026-01-03 09:25:07 +00:00
dhanabalan
cffb86cde2 remove searchable in alert mail resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 31s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m55s
2026-01-03 14:54:55 +05:30
f633285a57 Merge pull request 'Changed logic for to mail and cc mail for production report' (#148) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #148
2026-01-03 09:12:44 +00:00
dhanabalan
6acdfc30fa Changed logic for to mail and cc mail for production report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 1m2s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
Laravel Pint / pint (pull_request) Successful in 2m34s
2026-01-03 14:42:33 +05:30
841922a4b3 Merge pull request 'changed content in invoice transit and table column structure' (#147) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #147
2026-01-03 09:01:29 +00:00
dhanabalan
0852712dd9 changed content in invoice transit and table column structure
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 41s
Laravel Pint / pint (pull_request) Successful in 2m55s
Laravel Larastan / larastan (pull_request) Failing after 3m58s
2026-01-03 14:31:17 +05:30
3a819737cb Merge pull request 'chnage dposition of lower and middle in table section of product characteritics master' (#146) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #146
2026-01-03 07:37:11 +00:00
dhanabalan
ad91c848e5 chnage dposition of lower and middle in table section of product characteritics master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 50s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 2m49s
2026-01-03 13:07:00 +05:30
18f60ec336 Merge pull request 'changed to plant code for product characteritics master importer and exporter' (#145) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #145
2026-01-03 07:32:56 +00:00
dhanabalan
3b11781132 changed to plant code for product characteritics master importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 30s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
2026-01-03 13:02:44 +05:30
4ab7be97bb Merge pull request 'Added characteristics type in product characteristics master filter' (#144) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #144
2026-01-03 07:25:21 +00:00
dhanabalan
454e6ee431 Added characteristics type in product characteristics master filter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 30s
Laravel Pint / pint (pull_request) Successful in 2m2s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
2026-01-03 12:55:09 +05:30
a643bce1c2 Merge pull request 'Added searchable in product characteristics resource page' (#143) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #143
2026-01-03 07:12:10 +00:00
dhanabalan
aa958eaa2e Added searchable in product characteristics resource page
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 10s
Gemini PR Review / review (pull_request) Failing after 49s
Laravel Pint / pint (pull_request) Successful in 2m20s
Laravel Larastan / larastan (pull_request) Failing after 2m56s
2026-01-03 12:41:59 +05:30
45392419cd Merge pull request 'Added filter options in product characteristics master resource' (#142) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #142
2026-01-03 07:09:49 +00:00
dhanabalan
779ed6a7d6 Added filter options in product characteristics master resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 31s
Laravel Pint / pint (pull_request) Successful in 2m15s
Laravel Larastan / larastan (pull_request) Failing after 3m25s
2026-01-03 12:39:24 +05:30
7b300f63d2 Merge pull request 'added label in invoice in transit exporter' (#141) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #141
2026-01-03 06:44:27 +00:00
dhanabalan
d35e35748f added label in invoice in transit exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / review (pull_request) Failing after 28s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m7s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2026-01-03 12:14:11 +05:30
650314a435 Merge pull request 'Added receiving plant name and transport name in alert mail resource page' (#140) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #140
2026-01-03 06:32:00 +00:00
dhanabalan
dd0d429b3a Added receiving plant name and transport name in alert mail resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 35s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Laravel Pint / pint (pull_request) Successful in 1m52s
Laravel Larastan / larastan (pull_request) Failing after 2m56s
2026-01-03 12:01:46 +05:30
eaefffd51b Merge pull request 'Added send invoice in transit in scheduler' (#139) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #139
2026-01-03 06:30:36 +00:00
dhanabalan
fe03e30aa7 Added send invoice in transit in scheduler
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 35s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m52s
2026-01-03 12:00:26 +05:30
084d9b04f1 Merge pull request 'Added mail pages for invoice in transit' (#138) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #138
2026-01-03 06:29:15 +00:00
dhanabalan
d959a5d4a7 Added mail pages for invoice in transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 43s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 1m57s
Laravel Larastan / larastan (pull_request) Failing after 2m52s
2026-01-03 11:59:01 +05:30
75a3a8641c Merge pull request 'Added send invoice transit report command page' (#137) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #137
2026-01-03 06:27:29 +00:00
dhanabalan
c48bb2aaa9 Added send invoice transit report command page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 44s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m26s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2026-01-03 11:57:04 +05:30
f7f1d3a855 Merge pull request 'Added foreign key invoice_master_id in alert mail rules table' (#136) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #136
2026-01-03 06:25:41 +00:00
dhanabalan
11ce78b664 Added foreign key invoice_master_id in alert mail rules table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 42s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 1m49s
Laravel Larastan / larastan (pull_request) Failing after 3m5s
2026-01-03 11:55:25 +05:30
f00fc8b4d7 Merge pull request 'Added invoice in transit policy file' (#135) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #135
2026-01-03 06:23:10 +00:00
dhanabalan
aec52493f5 Added invoice in transit policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 4m36s
Gemini PR Review / review (pull_request) Failing after 5m41s
Laravel Pint / pint (pull_request) Successful in 2m0s
2026-01-03 11:53:00 +05:30
73eb79a8d0 Merge pull request 'Added invoice in transit exporter' (#134) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #134
2026-01-03 06:21:36 +00:00
dhanabalan
71dad18036 Added invoice in transit exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 43s
Laravel Pint / pint (pull_request) Successful in 2m21s
Laravel Larastan / larastan (pull_request) Failing after 2m44s
2026-01-03 11:51:25 +05:30
5856fe64c1 Merge pull request 'Added invoice in transit resource pages' (#133) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #133
2026-01-03 06:20:13 +00:00
dhanabalan
cc59f4548c Added invoice in transit resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m17s
Laravel Larastan / larastan (pull_request) Failing after 2m53s
2026-01-03 11:50:04 +05:30
4615e45c74 Merge pull request 'Added invoice in transit model file' (#132) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #132
2026-01-03 06:18:53 +00:00
dhanabalan
7f20aa1c99 Added invoice in transit model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 46s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m1s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
2026-01-03 11:48:43 +05:30
486b94bb79 Merge pull request 'Added invoice in transit migration file' (#131) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #131
2026-01-03 06:18:07 +00:00
dhanabalan
abd639e73f Added invoice in transit migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 37s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Larastan / larastan (pull_request) Failing after 2m55s
Laravel Pint / pint (pull_request) Successful in 2m56s
2026-01-03 11:47:55 +05:30
71eda460bd Merge pull request 'Added invoice master policy file' (#130) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #130
2026-01-03 06:14:32 +00:00
dhanabalan
a8c144ae5b Added invoice master policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 34s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m1s
Laravel Larastan / larastan (pull_request) Failing after 3m43s
2026-01-03 11:44:22 +05:30
938f9b9fdf Merge pull request 'Added invoice master exporter' (#129) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #129
2026-01-03 06:12:19 +00:00
dhanabalan
e130e35f40 Added invoice master exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Larastan / larastan (pull_request) Failing after 2m43s
Gemini PR Review / review (pull_request) Failing after 5m33s
Laravel Pint / pint (pull_request) Successful in 2m17s
2026-01-03 11:42:07 +05:30
648551c619 Merge pull request 'Added invoice master resource pages' (#128) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #128
2026-01-03 06:11:15 +00:00
dhanabalan
0d3163165d Added invoice master resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 40s
Laravel Pint / pint (pull_request) Successful in 1m59s
Laravel Larastan / larastan (pull_request) Failing after 2m57s
2026-01-03 11:41:04 +05:30
308e68b79a Merge pull request 'Added invoice master model file' (#127) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #127
2026-01-03 06:09:07 +00:00
dhanabalan
0ec98d2f9f Added invoice master model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 43s
Laravel Pint / pint (pull_request) Successful in 2m8s
Laravel Larastan / larastan (pull_request) Failing after 2m57s
2026-01-03 11:38:55 +05:30
5b9cb33a63 Merge pull request 'Added invoice master migration file' (#126) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #126
2026-01-03 06:08:16 +00:00
dhanabalan
fdd9dbbfb2 Added invoice master migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 34s
Laravel Larastan / larastan (pull_request) Failing after 2m22s
Laravel Pint / pint (pull_request) Failing after 2m18s
2026-01-03 11:37:51 +05:30
8b57518408 Merge pull request 'Updated password for the admin user' (#125) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #125
2026-01-02 04:49:08 +00:00
dhanabalan
723c3c1ebf Updated password for the admin user
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 2m17s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2026-01-02 10:17:24 +05:30
4b68133bf1 Merge pull request 'Updated email and password for the admin user' (#124) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #124
2026-01-02 04:34:01 +00:00
dhanabalan
24b4c14aaf Updated email and password for the admin user
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 2m6s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
2026-01-02 09:48:09 +05:30
a52fc9580a Merge pull request 'ranjith-dev' (#123) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #123
2026-01-01 10:32:08 +00:00
dhanabalan
6cde9fc570 Item Description column added as Optional on view report and Invoice Types loaded based on user rights on report filter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 35s
Laravel Pint / pint (pull_request) Successful in 2m35s
Laravel Larastan / larastan (pull_request) Failing after 3m4s
2026-01-01 15:56:04 +05:30
dhanabalan
ab1daa57e2 Export plant code instead of plant name and description column added in InvoiceValidationExporter
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
2026-01-01 15:48:12 +05:30
94819ccc4f Merge pull request 'removed logic submerisible motor and pump in sticker reprint' (#122) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #122
2025-12-31 03:50:44 +00:00
dhanabalan
f0141c4f7e removed logic submerisible motor and pump in sticker reprint
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 2m29s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
2025-12-31 09:20:15 +05:30
6e51b9fba8 Merge pull request 'Removed production plan logic in sticker reprint page' (#121) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
Reviewed-on: #121
2025-12-27 10:57:00 +00:00
dhanabalan
3bcc351fa6 Removed production plan logic in sticker reprint page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 31s
Laravel Pint / pint (pull_request) Successful in 3m6s
Laravel Larastan / larastan (pull_request) Failing after 3m51s
2025-12-27 16:26:43 +05:30
0a66526a63 Merge pull request 'Added uom in table column in process order resource page' (#120) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #120
2025-12-27 08:01:18 +00:00
dhanabalan
ea16763f33 Added uom in table column in process order resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / review (pull_request) Failing after 44s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m14s
Laravel Larastan / larastan (pull_request) Failing after 3m13s
2025-12-27 13:31:06 +05:30
0398cd5262 Merge pull request 'Added uom in process order resource page' (#119) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #119
2025-12-27 07:59:17 +00:00
dhanabalan
94193d6a47 Added uom in process order resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 26s
Laravel Pint / pint (pull_request) Successful in 2m24s
Laravel Larastan / larastan (pull_request) Failing after 3m28s
2025-12-27 13:29:03 +05:30
cca6fbe428 Merge pull request 'Added observed value in characteristic values resource page' (#118) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #118
2025-12-27 07:50:24 +00:00
dhanabalan
f4c89037f2 Added observed value in characteristic values resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 33s
Laravel Pint / pint (pull_request) Successful in 2m27s
Laravel Larastan / larastan (pull_request) Failing after 3m27s
2025-12-27 13:20:02 +05:30
633c8c89ca Merge pull request 'Added observed value in api method in characteristics controller' (#117) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #117
2025-12-27 07:40:19 +00:00
dhanabalan
e2bb41d1d7 Added observed value in api method in characteristics controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / review (pull_request) Failing after 37s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m48s
Laravel Larastan / larastan (pull_request) Failing after 3m37s
2025-12-27 13:10:04 +05:30
543ab7f44f Merge pull request 'Added observed_value in characteritics model file' (#116) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #116
2025-12-27 07:36:35 +00:00
dhanabalan
c180e098a3 Added observed_value in characteritics model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 36s
Laravel Pint / pint (pull_request) Successful in 2m28s
Laravel Larastan / larastan (pull_request) Failing after 4m5s
2025-12-27 13:06:22 +05:30
09aeff2b96 Merge pull request 'Added observed value column in characteritics value table' (#115) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #115
2025-12-27 07:32:58 +00:00
dhanabalan
b2a06caff0 Added observed value column in characteritics value table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 35s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 3m29s
2025-12-27 13:02:32 +05:30
2f3973f6af Merge pull request 'solved issued for apache url path issue in production' (#114) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #114
2025-12-26 07:11:50 +00:00
dhanabalan
bc1d3190d4 solved issued for apache url path issue in production
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 27s
Laravel Pint / pint (pull_request) Successful in 2m17s
Laravel Larastan / larastan (pull_request) Failing after 3m11s
2025-12-26 12:41:36 +05:30
7f76a604a3 Merge pull request 'Added proper logic in sticker reprint controller' (#113) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #113
2025-12-26 06:57:16 +00:00
dhanabalan
0490516836 Added proper logic in sticker reprint controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 32s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m13s
2025-12-26 12:27:03 +05:30
837ac47120 Merge pull request 'Added api' (#112) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #112
2025-12-26 06:45:56 +00:00
dhanabalan
8d05164215 Added api
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 27s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 3m7s
2025-12-26 12:15:44 +05:30
e6fb2c1bae Merge pull request 'Added proper logic in production sticker reprint controller' (#111) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #111
2025-12-26 06:32:39 +00:00
dhanabalan
f38cc70537 Added proper logic in production sticker reprint controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 32s
Laravel Pint / pint (pull_request) Successful in 2m15s
Laravel Larastan / larastan (pull_request) Failing after 3m23s
2025-12-26 12:02:27 +05:30
a687b8af3b Merge pull request 'Added regex pattern for sticker reprint' (#110) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #110
2025-12-26 06:06:11 +00:00
dhanabalan
5dd212422c Added regex pattern for sticker reprint
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 3m7s
2025-12-26 11:35:53 +05:30
cd45e6658a Merge pull request 'Added without over lapping for auto scheduler' (#109) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #109
2025-12-22 08:58:03 +00:00
dhanabalan
574e244e2f Added without over lapping for auto scheduler
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m1s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 49s
Gemini PR Review / review (pull_request) Failing after 1m11s
Laravel Pint / pint (pull_request) Successful in 2m54s
Laravel Larastan / larastan (pull_request) Failing after 4m4s
2025-12-22 14:26:53 +05:30
0b221c5eae Merge pull request 'added labels in characteristic value exporter' (#108) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #108
2025-12-20 03:07:04 +00:00
dhanabalan
9d8388c221 added labels in characteristic value exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 47s
Laravel Pint / pint (pull_request) Successful in 2m20s
Laravel Larastan / larastan (pull_request) Failing after 3m10s
2025-12-20 08:36:53 +05:30
8c062505c9 Merge pull request 'Added validation in characteristic value importer' (#107) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #107
2025-12-20 03:04:59 +00:00
dhanabalan
87fd2df0f4 Added validation in characteristic value importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 1m3s
Laravel Pint / pint (pull_request) Successful in 2m22s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2025-12-20 08:34:43 +05:30
9411d0b33b Merge pull request 'chnaged logic in sticker reprint logic' (#106) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #106
2025-12-18 10:51:29 +00:00
dhanabalan
7d5e02f491 chnaged logic in sticker reprint logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 2m23s
Laravel Larastan / larastan (pull_request) Failing after 3m49s
2025-12-18 16:21:10 +05:30
ab3a2047bb Merge pull request 'Added jwt qr code scanning functionality for invoice number' (#105) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #105
2025-12-17 10:09:22 +00:00
dhanabalan
810c40b81b Added jwt qr code scanning functionality for invoice number
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 25s
Laravel Pint / pint (pull_request) Successful in 2m21s
Laravel Larastan / larastan (pull_request) Failing after 3m23s
2025-12-17 15:38:59 +05:30
f0ef2dda8e Merge pull request 'changed loadData method in invoice data tabele in livewire' (#102) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #102
2025-12-13 09:15:30 +00:00
dhanabalan
c43bc208b8 changed loadData method in invoice data tabele in livewire
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 31s
Laravel Pint / pint (pull_request) Successful in 3m46s
Laravel Larastan / larastan (pull_request) Failing after 4m50s
2025-12-13 14:45:14 +05:30
968d67d808 Merge pull request 'Changed plant name as plant code in item importer and exporter' (#101) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #101
2025-12-12 11:39:05 +00:00
dhanabalan
a1974ce78c Changed plant name as plant code in item importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 26s
Laravel Pint / pint (pull_request) Successful in 3m19s
Laravel Larastan / larastan (pull_request) Failing after 4m41s
2025-12-12 17:08:52 +05:30
2342c6003d Merge pull request 'Added pump and motor fg serial number regex pattern in sticker reprint' (#100) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #100
2025-12-12 04:25:33 +00:00
dhanabalan
151c563c4b Added pump and motor fg serial number regex pattern in sticker reprint
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 32s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2025-12-12 09:55:08 +05:30
290d218a0d Merge pull request 'Removed unneccessary arguments in part validation image route' (#99) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #99
2025-12-10 11:20:45 +00:00
dhanabalan
e4223e28be Removed unneccessary arguments in part validation image route
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 25s
Laravel Larastan / larastan (pull_request) Failing after 3m4s
Laravel Pint / pint (pull_request) Successful in 6m24s
2025-12-10 16:50:34 +05:30
c455c76715 Merge pull request 'changed part validation uploaded image logic in sticker master' (#98) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #98
2025-12-10 11:13:08 +00:00
dhanabalan
030013f914 changed part validation uploaded image logic in sticker master
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 9s
Gemini PR Review / review (pull_request) Failing after 25s
Laravel Pint / pint (pull_request) Successful in 2m52s
Laravel Larastan / larastan (pull_request) Failing after 3m46s
2025-12-10 16:42:41 +05:30
a1abe537c3 Merge pull request 'Removed image path logic in quality validation resource page' (#97) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #97
2025-12-10 11:11:49 +00:00
dhanabalan
750f8520f5 Removed image path logic in quality validation resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 2m41s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2025-12-10 16:41:32 +05:30
c65265e68e Merge pull request 'changed numeric length in process order' (#96) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 9s
Reviewed-on: #96
2025-12-10 07:02:00 +00:00
dhanabalan
3b0eeda209 changed numeric length in process order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 27s
Laravel Larastan / larastan (pull_request) Failing after 3m20s
Laravel Pint / pint (pull_request) Successful in 3m29s
2025-12-10 12:31:48 +05:30
3da016ae49 Merge pull request 'Added numeric length value for column order_quantity and received quantity in process order' (#95) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #95
2025-12-10 06:58:10 +00:00
dhanabalan
1bc14aac38 Added numeric length value for column order_quantity and received quantity in process order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 2m19s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2025-12-10 12:27:57 +05:30
ea17636670 Merge pull request 'Added characteristic values post method in chracracteristic controller' (#94) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #94
2025-12-09 12:12:22 +00:00
dhanabalan
19b44a6705 Added characteristic values post method in chracracteristic controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 3m0s
2025-12-09 17:42:05 +05:30
31b56ae9b2 Merge pull request 'Added characteristics values post api in routes' (#93) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #93
2025-12-09 12:09:41 +00:00
dhanabalan
364fa1958e Added characteristics values post api in routes
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 4m11s
Laravel Larastan / larastan (pull_request) Failing after 4m36s
2025-12-09 17:39:30 +05:30
9517b38f9b Merge pull request 'Added sub group name in sticker printings' (#92) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #92
2025-12-09 11:45:00 +00:00
dhanabalan
587d91d790 Added sub group name in sticker printings
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 3m12s
2025-12-09 17:14:50 +05:30
2c1caa40a3 Merge pull request 'Added sub group name of the product characteristics' (#91) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #91
2025-12-09 11:42:52 +00:00
dhanabalan
00b566a4ca Added sub group name of the product characteristics
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 32s
Laravel Pint / pint (pull_request) Successful in 3m50s
Laravel Larastan / larastan (pull_request) Failing after 4m31s
2025-12-09 17:12:40 +05:30
c3fef2f3a0 Merge pull request 'Added characteristic value policy file' (#90) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #90
2025-12-09 08:02:13 +00:00
dhanabalan
a0d715c975 Added characteristic value policy file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / review (pull_request) Failing after 29s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m16s
2025-12-09 13:32:03 +05:30
904e18e63a Merge pull request 'Added characteristic value importer and exporter' (#89) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #89
2025-12-09 08:01:03 +00:00
dhanabalan
6c68f2baab Added characteristic value importer and exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 34s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m6s
Laravel Larastan / larastan (pull_request) Failing after 3m10s
2025-12-09 13:30:53 +05:30
27dc2690ca Merge pull request 'Added characteristic values resource file' (#88) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #88
2025-12-09 07:59:56 +00:00
dhanabalan
27a6b2b5e3 Added characteristic values resource file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 33s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m23s
Laravel Larastan / larastan (pull_request) Failing after 3m26s
2025-12-09 13:29:42 +05:30
8e1c4f46e8 Merge pull request 'Added characteristic value model file' (#87) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #87
2025-12-09 07:58:17 +00:00
dhanabalan
35d9419198 Added characteristic value model file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 35s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 4m12s
Laravel Larastan / larastan (pull_request) Failing after 5m7s
2025-12-09 13:27:56 +05:30
d699c043d4 Merge pull request 'Added characteristics values migration file' (#86) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #86
2025-12-09 07:57:20 +00:00
dhanabalan
63d18fd785 Added characteristics values migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 26s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
2025-12-09 13:26:57 +05:30
1806f32a7b Merge pull request 'removed unwanted serial validation mail logic in invoice validation' (#85) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #85
2025-12-09 05:21:01 +00:00
dhanabalan
84b6c45706 removed unwanted serial validation mail logic in invoice validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 34s
Laravel Pint / pint (pull_request) Successful in 2m21s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2025-12-09 10:50:40 +05:30
eb2ae19641 Merge pull request 'changed mail subject for quality validation' (#84) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #84
2025-12-09 03:11:37 +00:00
dhanabalan
84799678eb changed mail subject for quality validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 36s
Laravel Pint / pint (pull_request) Successful in 1m50s
Laravel Larastan / larastan (pull_request) Failing after 2m57s
2025-12-09 08:40:48 +05:30
2dbcc8b859 Merge pull request 'Added livewire changes in invoice validation' (#83) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #83
2025-12-07 08:33:05 +00:00
dhanabalan
db6af9863f Added livewire changes in invoice validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m2s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 42s
Gemini PR Review / review (pull_request) Failing after 1m45s
Laravel Pint / pint (pull_request) Successful in 1m52s
Laravel Larastan / larastan (pull_request) Failing after 3m1s
2025-12-07 14:02:34 +05:30
156 changed files with 13216 additions and 7415 deletions

View File

@@ -5,15 +5,20 @@ name: Gemini PR Review
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
review:
gemini-pr-review:
runs-on: ubuntu-latest
name: Gemini PR Review
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0 # This fetches the full history
@@ -22,7 +27,6 @@ jobs:
with:
node-version: '24'
- name: Get npm cache directory
id: npm-cache-dir
run: |
@@ -36,8 +40,14 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-global-
# - name: Install Gemini CLI globally
# run: npm install -g --loglevel=http @google/gemini-cli
- name: Install Gemini CLI globally (if not already installed)
run: |
if ! command -v gemini &> /dev/null; then
echo "Gemini CLI not found, installing..."
npm install -g --loglevel=http @google/gemini-cli
else
echo "Gemini CLI already installed."
fi
- name: Generate git diff and review with Gemini
id: review
@@ -52,7 +62,6 @@ jobs:
cat /tmp/gemini-client-error*.json || true
- name: Post output to PR comment
id: post_comment
run: |

View File

@@ -39,6 +39,8 @@ class Scheduler extends Command
public function handle()
{
// $this->call('approval:trigger-mails');
// --- Production Rules ---
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
->where('rule_name', 'ProductionMail')
@@ -74,7 +76,6 @@ class Scheduler extends Command
}
}
// --- Invoice Validation Rules ---
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'InvoiceMail')
@@ -174,7 +175,7 @@ class Scheduler extends Command
}
break;
case 'Daily':
if (now()->format('H:i') == '10:00') {
if (now()->format('H:i') == '13:03') {
\Artisan::call('send:invoice-data-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
@@ -183,8 +184,56 @@ class Scheduler extends Command
break;
}
}
}
$invoiceTransitRules = AlertMailRule::where('module', 'InvoiceTransit')
->where('rule_name', 'InvoiceTransitMail')
->select('plant', 'schedule_type')
->distinct()
->get();
foreach ($invoiceTransitRules as $rule) {
switch ($rule->schedule_type) {
case 'Live':
// Run every minute
\Artisan::call('send:invoice-transit-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
break;
case 'Hourly':
if (now()->minute == 0) {
\Artisan::call('send:invoice-transit-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
case 'Daily':
if (now()->format('H:i') == '15:55') {
try {
\Artisan::call('send:invoice-transit-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
Log::info('Invoice Transit executed', [
'plant' => $rule->plant,
'type' => $rule->schedule_type,
]);
}
catch (\Throwable $e) {
Log::error('Invoice Transit FAILED', [
'plant' => $rule->plant,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
}
}
break;
}
}
}
/**
* Helper to call Artisan commands with parameters.

View File

@@ -6,12 +6,8 @@ use App\Mail\InvoiceDataMail;
use App\Models\AlertMailRule;
use App\Models\InvoiceDataValidation;
use App\Models\InvoiceOutValidation;
use App\Models\Line;
use App\Models\Plant;
use App\Models\ProductionPlan;
use App\Models\ProductionQuantity;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SendInvoiceDataReport extends Command
{
@@ -49,7 +45,7 @@ class SendInvoiceDataReport extends Command
$plants = ($plantId == 0) ? Plant::all() : Plant::where('id', $plantId)->get();
if ($plants->isEmpty()) {
$this->error("No valid plant(s) found.");
$this->error('No valid plant(s) found.');
return;
}
@@ -105,7 +101,7 @@ class SendInvoiceDataReport extends Command
->where('distribution_channel_desc', $selectedDistribution)
->whereBetween('document_date', [$startDate, $endDate])
->orderBy('document_date', 'asc')
->select('customer_code', 'document_number', 'document_date', 'customer_trade_name', 'customer_location', 'location')
->select('customer_code', 'document_number', 'document_date', 'customer_trade_name', 'customer_location', 'location', 'remark')
->get()
->unique('document_number')
->values();
@@ -114,7 +110,6 @@ class SendInvoiceDataReport extends Command
continue;
}
// Filter invoices directly — exclude ones with '-' in document_number
$invoices = $invoices->filter(function ($inv) {
return !empty($inv->document_number) && !str_contains($inv->document_number, '-');
});
@@ -134,7 +129,6 @@ class SendInvoiceDataReport extends Command
->map(fn($n) => preg_replace('/\s+/', '', strtoupper((string) $n)))
->toArray();
//where('plant_id', $plant->id)
$wentOutInvoices = InvoiceOutValidation::whereIn('qr_code', $invoiceNumbers)
//->whereBetween('scanned_at', [$startDate, $endDate])
->distinct('qr_code')
@@ -164,7 +158,6 @@ class SendInvoiceDataReport extends Command
return !in_array($doc, $wentOutInvoices, true);
});
if ($pendingInvoices->isEmpty()) {
continue;
}
@@ -182,7 +175,7 @@ class SendInvoiceDataReport extends Command
}
$tableData[] = [
//'no' => $no++,
// 'no' => $no++,
'plant' => $plant->name,
// 'distribution_type' => $selectedDistribution,
'customer_code' => $inv->customer_code,
@@ -194,6 +187,7 @@ class SendInvoiceDataReport extends Command
'no_of_days_pending' => abs((int)now()->diffInDays($documentDate)),
'status' => 'Pending',
'status_class' => $statusColor,
'remark' => $inv->remark,
];
}
}
@@ -203,6 +197,7 @@ class SendInvoiceDataReport extends Command
->values()
->map(function ($item, $index) {
$item['no'] = $index + 1;
return $item;
})
->toArray();
@@ -214,7 +209,7 @@ class SendInvoiceDataReport extends Command
$this->info($contentVars['greeting'] ?? 'Invoice Data Report');
$this->table(
['No', 'Plant', 'Customer Code', 'Document Number', 'Document Date', 'Trade Name', 'Location', 'Pending Days', 'Status'],//'Distribution Type'
['No', 'Plant', 'Customer Code', 'Document Number', 'Document Date', 'Trade Name', 'Location', 'Pending Days', 'Status', 'Remark'],// 'Distribution Type'
$tableData
);
$this->info($contentVars['wishes'] ?? '');
@@ -236,13 +231,13 @@ class SendInvoiceDataReport extends Command
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
$this->info("Skipping rule ID {$rule->id} — no valid To emails found.");
continue;
}
\Mail::to($toEmails)->cc($ccEmails)->send($mail);
$this->info("Mail sent for rule ID {$rule->id} → To: " . implode(', ', $toEmails) . ($ccEmails ? " | CC: " . implode(', ', $ccEmails) : ''));
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}
}

View File

@@ -70,7 +70,7 @@ class SendInvoiceReport extends Command
$scannedSerialCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $plantId)
->whereNull('quantity')
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('invoice_number')
->havingRaw("COUNT(*) = SUM(CASE WHEN scanned_status = 'Scanned' THEN 1 ELSE 0 END)")
->count();
@@ -86,7 +86,7 @@ class SendInvoiceReport extends Command
$query->whereNull('quantity')
->orWhere('quantity', 0);
})
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->count();
$serialTableData[] = [
@@ -108,7 +108,7 @@ class SendInvoiceReport extends Command
$scannedMatCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $plantId)
->where('quantity', 1)
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('invoice_number')
->havingRaw("COUNT(*) = SUM(CASE WHEN serial_number IS NOT NULL AND serial_number != '' THEN 1 ELSE 0 END)")
->count();
@@ -122,7 +122,7 @@ class SendInvoiceReport extends Command
->where('quantity', 1)
->whereNotNull('serial_number')
->where('serial_number', '!=', '')
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->count();
$materialTableData[] = [
@@ -144,7 +144,7 @@ class SendInvoiceReport extends Command
$scannedBundleCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $plantId)
->where('quantity', '>', 1)
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('invoice_number')
->havingRaw("COUNT(*) = SUM(CASE WHEN serial_number IS NOT NULL AND serial_number != '' THEN 1 ELSE 0 END)")
->count();
@@ -158,7 +158,7 @@ class SendInvoiceReport extends Command
->where('quantity', '>', 1)
->whereNotNull('serial_number')
->where('serial_number', '!=', '')
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->count();
$bundleTableData[] = [
@@ -180,25 +180,104 @@ class SendInvoiceReport extends Command
// Send to SerialInvoiceMail recipients
if ($mailRules->has('SerialInvoiceMail')) {
$emails = $mailRules['SerialInvoiceMail']->pluck('email')->unique()->toArray();
foreach ($emails as $email) {
Mail::to($email)->send(new test($serialTableData, [], [], $schedule));
// $emails = $mailRules['SerialInvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test($serialTableData, [], [], $schedule));
// }
foreach ($mailRules->get('SerialInvoiceMail') as $rule) {
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails ?? ''))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
continue;
}
\Mail::to($toEmails)->cc($ccEmails)->send(new test($serialTableData, [], [], $schedule));
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}
// Send to MaterialInvoiceMail recipients (material + bundle table)
if ($mailRules->has('MaterialInvoiceMail')) {
$emails = $mailRules['MaterialInvoiceMail']->pluck('email')->unique()->toArray();
foreach ($emails as $email) {
Mail::to($email)->send(new test([], $materialTableData, $bundleTableData, $schedule));
// $emails = $mailRules['MaterialInvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test([], $materialTableData, $bundleTableData, $schedule));
// }
foreach ($mailRules->get('MaterialInvoiceMail') as $rule) {
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails ?? ''))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
continue;
}
\Mail::to($toEmails)->cc($ccEmails)->send(new test([], $materialTableData, $bundleTableData, $schedule));
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}
// Send to InvoiceMail recipients (all three tables)
if ($mailRules->has('InvoiceMail')) {
$emails = $mailRules['InvoiceMail']->pluck('email')->unique()->toArray();
foreach ($emails as $email) {
Mail::to($email)->send(new test($serialTableData, $materialTableData, $bundleTableData, $schedule));
//$emails = $mailRules['InvoiceMail']->pluck('email')->unique()->toArray();
// foreach ($emails as $email) {
// Mail::to($email)->send(new test($serialTableData, $materialTableData, $bundleTableData, $schedule));
// $this->info("✅ Sent InvoiceMail to: {$email}");
// }
foreach ($mailRules->get('InvoiceMail') as $rule) {
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails ?? ''))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
continue;
}
\Mail::to($toEmails)->cc($ccEmails)->send(new test($serialTableData, $materialTableData, $bundleTableData, $schedule));
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}
@@ -213,5 +292,6 @@ class SendInvoiceReport extends Command
$this->table(['#', 'Plant', 'Total Invoice', 'Scanned Invoice', 'TotalInvoice Quantity', 'ScannedInvoice Quantity'], $bundleTableData);
$this->info($contentVars['wishes'] ?? '');
}
}

View File

@@ -0,0 +1,169 @@
<?php
namespace App\Console\Commands;
use App\Mail\InvoiceTransitMail;
use App\Models\AlertMailRule;
use App\Models\InvoiceMaster;
use App\Models\Plant;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class SendInvoiceTransitReport extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'send:invoice-transit-report {schedule_type} {plant}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
$scheduleType = $this->argument('schedule_type');
$plantId = (int) $this->argument('plant');
$mailRules = AlertMailRule::where('module', 'InvoiceTransit')
->where('rule_name', 'InvoiceTransitMail')
->where('schedule_type', $scheduleType)
->where('plant', $plantId)
->get();
$plants = ($plantId == 0)
? Plant::all()
: Plant::where('id', $plantId)->get();
$plantCodes = $plants->pluck('name', 'id');
if ($plants->isEmpty()) {
$this->error('No valid plant(s) found.');
return;
}
if (strtolower($scheduleType) == 'daily')
{
$results = DB::table('invoice_in_transits as it')
->join('invoice_masters as im', function ($join) {
$join->on('im.receiving_plant_name', '=', 'it.receiving_plant_name')->on('im.transport_name', '=', 'it.transport_name');
})
->select(
'it.invoice_number',
'it.receiving_plant',
'it.plant_id',
'it.receiving_plant_name',
'it.lr_bl_aw_date',
'it.lr_bl_aw_number',
'im.id as invoice_master_id',
'im.transport_name',
DB::raw('CAST(im.transit_days AS INTEGER) as transit_days'),
// DB::raw('(CURRENT_DATE - CAST(it.lr_bl_aw_date AS DATE)) as delayed_days')
// DB::raw('
// GREATEST(
// 0,
// (CURRENT_DATE - CAST(it.lr_bl_aw_date AS DATE) - 1)
// - CAST(im.transit_days AS INTEGER)
// ) AS delayed_days
// ')
DB::raw('
GREATEST(
1,
(CURRENT_DATE - CAST(it.lr_bl_aw_date AS DATE))
- CAST(im.transit_days AS INTEGER)
) AS delayed_days
')
)
->when($plantId != 0, fn($q) => $q->where('it.plant_id', $plantId))
->whereNotNull('it.lr_bl_aw_date')
->whereRaw('
(CURRENT_DATE - CAST(it.lr_bl_aw_date AS DATE))
- CAST(im.transit_days AS INTEGER) > 0
')
->get();
if ($results->isEmpty()) {
$this->info('No invoice transit records found for today.');
return;
}
$tableData = [];
foreach ($mailRules as $rule) {
$ruleInvoices = $results->where('invoice_master_id', $rule->invoice_master_id);
//$ruleInvoices = $results->filter(fn($item) => $item->invoice_master_id == (int)$rule->invoice_master_id);
if ($ruleInvoices->isEmpty()) {
$this->info("Skipping rule {$rule->id} — no invoice transit data.");
continue; // ❌ DO NOT SEND MAIL
}
$invoiceMaster = InvoiceMaster::find($rule->invoice_master_id);
$mailSubject = $invoiceMaster
? "Despatch Invoice In Transit ({$invoiceMaster->receiving_plant_name} - {$invoiceMaster->transport_name})"
: "Despatch Invoice In Transit";
if ($ruleInvoices->isEmpty()) {
$tableData = [];
$this->info("No despatch invoices in transit found for rule {$rule->id}.");
} else {
$tableData = $ruleInvoices->values()->map(function ($item, $index) use ($plantCodes) {
return [
'no' => $index + 1,
'plant' => $plantCodes[$item->plant_id],
'receiving_plant' => $item->receiving_plant,
'receiving_plant_name' => $item->receiving_plant_name,
'invoice_number' => $item->invoice_number,
'transport_name' => $item->transport_name,
'lr_bl_aw_date' => $item->lr_bl_aw_date,
'lr_bl_aw_number' => $item->lr_bl_aw_number,
'transit_days' => $item->transit_days,
'status' => $item->delayed_days . ' Days',
];
})->toArray();
}
$mail = new InvoiceTransitMail($scheduleType, $tableData, $mailSubject);
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule {$rule->id} — no To emails.");
continue;
}
\Mail::to($toEmails)->cc($ccEmails)->send($mail);
$this->info(
"Mail sent → Rule {$rule->id} | Invoice Master ID: {$rule->invoice_master_id} | To: " . implode(', ', $toEmails)
);
}
}
}
}

View File

@@ -2,15 +2,13 @@
namespace App\Console\Commands;
use App\Models\InvoiceValidation;
use App\Models\Plant;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
use App\Mail\ProductionMail;
use App\Models\Line;
use App\Models\Plant;
use App\Models\ProductionPlan;
use App\Models\ProductionQuantity;
use DB;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SendProductionReport extends Command
{
@@ -19,7 +17,7 @@ class SendProductionReport extends Command
*
* @var string
*/
//protected $signature = 'send:production-report';
// protected $signature = 'send:production-report';
protected $signature = 'send:production-report {schedule_type} {plant}';
/**
@@ -32,11 +30,10 @@ class SendProductionReport extends Command
/**
* Execute the console command.
*/
public function handle()
{
ini_set('max_execution_time', 0); // disable limit
set_time_limit(0);
// ini_set('max_execution_time', 0); // disable limit
// set_time_limit(0);
$scheduleType = $this->argument('schedule_type');
$plantId = (int) $this->argument('plant'); // cast to int for safety
@@ -55,33 +52,30 @@ class SendProductionReport extends Command
: Plant::where('id', $plantId)->get();
if ($plants->isEmpty()) {
$this->error("No valid plant(s) found.");
$this->error('No valid plant(s) found.');
return;
}
// $startDate = now()->setTime(8, 0, 0);
// $endDate = now()->copy()->addDay()->setTime(8, 0, 0);
if (strtolower($scheduleType) == 'daily')
{
if (strtolower($scheduleType) == 'daily') {
$startDate = now()->subDay()->setTime(8, 0, 0);
$endDate = now()->setTime(8, 0, 0);
}
else
{
} else {
$startDate = now()->setTime(8, 0, 0);
$endDate = now()->copy()->addDay()->setTime(8, 0, 0);
}
$PlanstartDate = now()->setTime(8, 0, 0);
$planendDate = now()->copy()->addDay()->setTime(7, 59, 0);
$PlanstartDate = now()->subDay()->setTime(8, 0, 0);
$planendDate = now()->setTime(7, 59, 0);
$tableData = [];
$no = 1;
//.
// .
foreach ($plants as $plant)
{
foreach ($plants as $plant) {
$lines = Line::where('plant_id', $plant->id)->get();
foreach ($lines as $line) {
@@ -90,6 +84,7 @@ class SendProductionReport extends Command
->whereBetween('created_at', [$PlanstartDate, $planendDate])
->sum('plan_quantity');
/** @phpstan-ignore property.notFound */
if (strtolower($line->type) == 'fg line') {
$productionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
->where('line_id', $line->id)
@@ -113,9 +108,7 @@ class SendProductionReport extends Command
}
}
//$this->table(['No', 'Plant', 'Line', 'Target Quantity', 'Production Quantity'], $fgTableData);
// $this->table(['No', 'Plant', 'Line', 'Target Quantity', 'Production Quantity'], $fgTableData);
// $this->table(['No', 'Plant', 'Line', 'Target Quantity', 'Production Quantity'], $tableData);
@@ -128,7 +121,7 @@ class SendProductionReport extends Command
// }
// $this->info("Production report sent to " . count($emails) . " recipient(s).");
// Preview in console
// Preview in console
$mail = new ProductionMail($scheduleType, $tableData);
$contentVars = $mail->content()->with;
@@ -140,13 +133,39 @@ class SendProductionReport extends Command
$this->info($contentVars['wishes'] ?? '');
// Send mails
if (!empty($emails)) {
foreach ($emails as $email) {
Mail::to($email)->send(new ProductionMail($scheduleType, $tableData));
// if (! empty($emails)) {
// foreach ($emails as $email) {
// Mail::to($email)->send(new ProductionMail($scheduleType, $tableData));
// }
// $this->info('Production report sent to '.count($emails).' recipient(s).');
// } else {
// $this->warn('No recipients found for ProductionMailAlert.');
// }
foreach ($mailRules as $rule)
{
$toEmails = collect(explode(',', $rule->email))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
$ccEmails = collect(explode(',', $rule->cc_emails))
->map(fn ($e) => trim($e))
->filter()
->unique()
->values()
->toArray();
if (empty($toEmails)) {
$this->warn("Skipping rule ID {$rule->id} — no valid To emails found.");
continue;
}
$this->info("Production report sent to " . count($emails) . " recipient(s).");
} else {
$this->warn('No recipients found for ProductionMailAlert.');
\Mail::to($toEmails)->cc($ccEmails)->send($mail);
$this->info("Mail sent for rule ID {$rule->id} → To: ".implode(', ', $toEmails).($ccEmails ? ' | CC: '.implode(', ', $ccEmails) : ''));
}
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Filament\Exports;
use App\Models\AlertMailRule;
use App\Models\Plant;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class AlertMailRuleExporter extends Exporter
{
protected static ?string $model = AlertMailRule::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('module')
->label('MODULE'),
ExportColumn::make('rule_name')
->label('RULE NAME'),
ExportColumn::make('email')
->label('EMAIL'),
ExportColumn::make('schedule_type')
->label('SCHEDULE TYPE'),
ExportColumn::make('plant')
->label('PLANT CODE')
->formatStateUsing(function ($state) {
// $state is the plant ID from the database
if ($state == 0) {
return 'All Plants';
}
$plant = Plant::find($state);
return $plant ? $plant->code : 'Unknown';
}),
ExportColumn::make('cc_emails')
->label('CC EMAILS'),
ExportColumn::make('invoiceMaster.receiving_plant_name')
->label('RECEIVING PLANT NAME'),
ExportColumn::make('invoiceMaster.transport_name')
->label('TRANSPORT NAME'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your alert mail rule 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

@@ -24,26 +24,27 @@ class BlockExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('NAME'),
->label('BLOCK NAME'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT')
->enabledByDefault(true),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your block export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your block 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -0,0 +1,64 @@
<?php
namespace App\Filament\Exports;
use App\Models\CharacteristicValue;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class CharacteristicValueExporter extends Exporter
{
protected static ?string $model = CharacteristicValue::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('line.name')
->label('LINE NAME'),
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('machine.name')
->label('WORK CENTER'),
ExportColumn::make('process_order')
->label('PROCESS ORDER'),
ExportColumn::make('coil_number')
->label('COIL NUMBER'),
ExportColumn::make('status')
->label('STATUS'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your characteristic value 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

@@ -24,8 +24,8 @@ class CheckPointNameExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('CHECK POINT NAME'),
ExportColumn::make('created_at')
@@ -42,10 +42,10 @@ class CheckPointNameExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your check point name export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your check point name 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class CheckPointTimeExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('checkPointNames1.name')
->label('CHECK POINT 1'),
ExportColumn::make('checkPointNames2.name')
@@ -50,10 +50,10 @@ class CheckPointTimeExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your check point time export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your check point time 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -17,11 +17,11 @@ class ConfigurationExporter extends Exporter
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT'),
ExportColumn::make('line.name')
@@ -46,10 +46,10 @@ class ConfigurationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your configuration export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your configuration 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,6 +14,7 @@ class DeviceMasterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
@@ -21,32 +22,32 @@ class DeviceMasterExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('DEVICE NAME'),
->label('DEVICE NAME'),
ExportColumn::make('mac_address')
->label('MAC ADDRESS'),
->label('MAC ADDRESS'),
ExportColumn::make('ip_address')
->label('IP ADDRESS'),
->label('IP ADDRESS'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
->enabledByDefault(false)
->label('DELETED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
->label('CREATED BY'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your device master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your device master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -10,116 +10,118 @@ use Filament\Actions\Exports\Models\Export;
class EbReadingExporter extends Exporter
{
protected static ?string $model = EbReading::class;
static $rowNumber = 0;
public static $rowNumber = 0;
public static function getColumns(): array
{
return [
ExportColumn::make('no')
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('lcd_segment_check')
->label('LCD SEGMENT CHECK'),
->label('LCD SEGMENT CHECK'),
ExportColumn::make('meter_serial_no')
->label('METER SERIAL NO'),
->label('METER SERIAL NO'),
ExportColumn::make('eb_date_time')
->label('EB DATE TIME'),
->label('EB DATE TIME'),
ExportColumn::make('ph_seq_of_volt')
->label('PH SEQ OF VOLT'),
->label('PH SEQ OF VOLT'),
ExportColumn::make('ph_assoc_conn_check')
->label('PH ASSOC CONN CHECK'),
->label('PH ASSOC CONN CHECK'),
ExportColumn::make('instantaneous_ph_volt')
->label('INSTANTANEOUS PH VOLT'),
->label('INSTANTANEOUS PH VOLT'),
ExportColumn::make('instantaneous_curr')
->label('INSTANTANEOUS CURR'),
->label('INSTANTANEOUS CURR'),
ExportColumn::make('instantaneous_freq')
->label('INSTANTANEOUS FREQ'),
->label('INSTANTANEOUS FREQ'),
ExportColumn::make('instantaneous_kw_with_sign')
->label('INSTANTANEOUS KW WITH SIGN'),
->label('INSTANTANEOUS KW WITH SIGN'),
ExportColumn::make('instantaneous_kva')
->label('INSTANTANEOUS KVA'),
->label('INSTANTANEOUS KVA'),
ExportColumn::make('instantaneous_kv_ar')
->label('INSTANTANEOUS KV AR'),
->label('INSTANTANEOUS KV AR'),
ExportColumn::make('instantaneous_pf_with_sign')
->label('INSTANTANEOUS PF WITH SIGN'),
->label('INSTANTANEOUS PF WITH SIGN'),
ExportColumn::make('rd_with_elapsed_time_kva')
->label('RD WITH ELAPSED TIME KVA'),
->label('RD WITH ELAPSED TIME KVA'),
ExportColumn::make('cum_active_import_energy')
->label('CUM ACTIVE IMPORT ENERGY'),
->label('CUM ACTIVE IMPORT ENERGY'),
ExportColumn::make('tod1_active_energy_6_9')
->label('TOD1 ACTIVE ENERGY 6-9'),
->label('TOD1 ACTIVE ENERGY 6-9'),
ExportColumn::make('tod2_active_energy_18_21')
->label('TOD2 ACTIVE ENERGY 18-21'),
->label('TOD2 ACTIVE ENERGY 18-21'),
ExportColumn::make('tod3_active_energy_21_22')
->label('TOD3 ACTIVE ENERGY 21-22'),
->label('TOD3 ACTIVE ENERGY 21-22'),
ExportColumn::make('tod4_active_energy_5_6_9_18')
->label('TOD4 ACTIVE ENERGY 5-6-9-18'),
->label('TOD4 ACTIVE ENERGY 5-6-9-18'),
ExportColumn::make('tod5_active_energy_22_5')
->label('TOD5 ACTIVE ENERGY 22-5'),
->label('TOD5 ACTIVE ENERGY 22-5'),
ExportColumn::make('cum_reac_lag_energy')
->label('CUM REAC LAG ENERGY'),
->label('CUM REAC LAG ENERGY'),
ExportColumn::make('cum_reac_lead_energy')
->label('CUM REAC LEAD ENERGY'),
->label('CUM REAC LEAD ENERGY'),
ExportColumn::make('cum_appar_energy')
->label('CUM APPAR ENERGY'),
->label('CUM APPAR ENERGY'),
ExportColumn::make('tod1_appar_energy_6_9')
->label('TOD1 APPAR ENERGY 6-9'),
->label('TOD1 APPAR ENERGY 6-9'),
ExportColumn::make('tod2_appar_energy_18_21')
->label('TOD2 APPAR ENERGY 18-21'),
->label('TOD2 APPAR ENERGY 18-21'),
ExportColumn::make('tod3_appar_energy_21_22')
->label('TOD3 APPAR ENERGY 21-22'),
->label('TOD3 APPAR ENERGY 21-22'),
ExportColumn::make('tod4_appar_energy_5_6_9_18')
->label('TOD4 APPAR ENERGY 5-6-9-18'),
->label('TOD4 APPAR ENERGY 5-6-9-18'),
ExportColumn::make('tod5_appar_energy_22_5')
->label('TOD5 APPAR ENERGY 22-5'),
->label('TOD5 APPAR ENERGY 22-5'),
ExportColumn::make('avg_pow_factor')
->label('AVG POW FACTOR'),
->label('AVG POW FACTOR'),
ExportColumn::make('avg_freq_15min_last_ip')
->label('AVG FREQ 15MIN LAST IP'),
->label('AVG FREQ 15MIN LAST IP'),
ExportColumn::make('net_kv_arh_high')
->label('NET KV ARH HIGH'),
->label('NET KV ARH HIGH'),
ExportColumn::make('net_kv_arh_low')
->label('NET KV ARH LOW'),
->label('NET KV ARH LOW'),
ExportColumn::make('cum_md_kva')
->label('CUM MD KVA'),
->label('CUM MD KVA'),
ExportColumn::make('present_md_kva')
->label('PRESENT MD KVA'),
->label('PRESENT MD KVA'),
ExportColumn::make('present_md_kva_date_time')
->label('PRESENT MD KVA DATE TIME'),
->label('PRESENT MD KVA DATE TIME'),
ExportColumn::make('tod1_md_kva_6_9')
->label('TOD1 MD KVA 6-9'),
->label('TOD1 MD KVA 6-9'),
ExportColumn::make('tod2_md_kva_18_21')
->label('TOD2 MD KVA 18-21'),
->label('TOD2 MD KVA 18-21'),
ExportColumn::make('tod3_md_kva_21_22')
->label('TOD3 MD KVA 21-22'),
->label('TOD3 MD KVA 21-22'),
ExportColumn::make('tod4_md_kva_5_6_9_18')
->label('TOD4 MD KVA 5-6-9-18'),
->label('TOD4 MD KVA 5-6-9-18'),
ExportColumn::make('tod5_md_kva_22_5')
->label('TOD5 MD KVA 22-5'),
->label('TOD5 MD KVA 22-5'),
ExportColumn::make('total_pow_off_hours')
->label('TOTAL POW OFF HOURS'),
->label('TOTAL POW OFF HOURS'),
ExportColumn::make('programming_count')
->label('PROGRAMMING COUNT'),
->label('PROGRAMMING COUNT'),
ExportColumn::make('last_occ_res_event_type')
->label('LAST OCC RES EVENT TYPE'),
->label('LAST OCC RES EVENT TYPE'),
ExportColumn::make('last_occ_res_event_date_time')
->label('LAST OCC RES EVENT DATE TIME'),
->label('LAST OCC RES EVENT DATE TIME'),
ExportColumn::make('tamper_count')
->label('TAMPER COUNT'),
->label('TAMPER COUNT'),
ExportColumn::make('reset_count')
->label('RESET COUNT'),
->label('RESET COUNT'),
ExportColumn::make('last_md_reset_date_time')
->label('LAST MD RESET DATE TIME'),
->label('LAST MD RESET DATE TIME'),
ExportColumn::make('electrician_sign')
->label('ELECTRICIAN SIGN'),
->label('ELECTRICIAN SIGN'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->enabledByDefault(false),
ExportColumn::make('updated_by')
@@ -129,10 +131,10 @@ class EbReadingExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your eb reading export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your eb reading export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,59 +14,60 @@ class EquipmentMasterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('machine.name')
->label('MACHINE NAME'),
->label('MACHINE NAME'),
ExportColumn::make('name')
->label('NAME'),
->label('NAME'),
ExportColumn::make('description')
->label('DESCRIPTION'),
->label('DESCRIPTION'),
ExportColumn::make('make')
->label('MAKE'),
->label('MAKE'),
ExportColumn::make('model')
->label('MODEL'),
->label('MODEL'),
ExportColumn::make('equipment_number')
->label('EQUIPMENT NUMBER'),
->label('EQUIPMENT NUMBER'),
ExportColumn::make('instrument_serial_number')
->label('INSTRUMENT SERIAL NUMBER'),
->label('INSTRUMENT SERIAL NUMBER'),
ExportColumn::make('calibrated_on')
->label('CALIBRATED ON'),
->label('CALIBRATED ON'),
ExportColumn::make('frequency')
->label('FREQUENCY'),
->label('FREQUENCY'),
ExportColumn::make('next_calibration_date')
->label('NEXT CALIBRATION DATE'),
->label('NEXT CALIBRATION DATE'),
ExportColumn::make('calibrated_by')
->label('CALIBRATED BY'),
->label('CALIBRATED BY'),
ExportColumn::make('calibration_certificate')
->label('CALIBRATION CERTIFICATE'),
->label('CALIBRATION CERTIFICATE'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your equipment master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your equipment master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,6 +14,7 @@ class GrMasterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
@@ -21,36 +22,36 @@ class GrMasterExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item.code')
->label('ITEM'),
->label('ITEM CODE'),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
->label('SERIAL NUMBER'),
ExportColumn::make('gr_number')
->label('GR NUMBER'),
->label('GR NUMBER'),
ExportColumn::make('status')
->label('STATUS'),
->label('STATUS'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your gr master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your gr master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class GuardNameExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('GUARD NAME'),
ExportColumn::make('identification1')
@@ -46,10 +46,10 @@ class GuardNameExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your guard name export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your guard name 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class GuardPatrolEntryExporter extends Exporter
}),
// ExportColumn::make('id')
// ->label('ID'),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('guardNames.name')
->label('GUARD NAME'),
ExportColumn::make('checkPointNames.name')
@@ -54,10 +54,10 @@ class GuardPatrolEntryExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your guard patrol entry export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your guard patrol entry export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -0,0 +1,92 @@
<?php
namespace App\Filament\Exports;
use App\Models\InvoiceInTransit;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class InvoiceInTransitExporter extends Exporter
{
protected static ?string $model = InvoiceInTransit::class;
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT'),
ExportColumn::make('receiving_plant')
->label('RECEIVING PLANT'),
ExportColumn::make('receiving_plant_name')
->label('RECEIVING PLANT NAME'),
ExportColumn::make('invoice_number')
->label('INVOICE NUMBER'),
ExportColumn::make('invoice_date')
->label('INVOICE DATE'),
ExportColumn::make('item_code')
->label('ITEM CODE'),
ExportColumn::make('description')
->label('DESCRIPTION'),
ExportColumn::make('quantity')
->label('QUANTITY'),
ExportColumn::make('transport_name')
->label('TRANSPORT NAME'),
ExportColumn::make('lr_bl_aw_number')
->label('LR_BL_AW NUMBER'),
ExportColumn::make('lr_bl_aw_date')
->label('LR_BL_AW DATE'),
ExportColumn::make('pending_days')
->label('PENDING DAYS'),
ExportColumn::make('obd_number')
->label('OBD NUMBER'),
ExportColumn::make('obd_date')
->label('OBD DATE'),
ExportColumn::make('shipment_weight')
->label('SHIPMENT WEIGHT'),
ExportColumn::make('unit_price')
->label('UNIT PRICE'),
ExportColumn::make('net_value')
->label('NET VALUE'),
ExportColumn::make('total_item_amount')
->label('TOTAL ITEM AMOUNT'),
ExportColumn::make('tax_amount')
->label('TAX AMOUNT'),
ExportColumn::make('transport_mode')
->label('TRANSPORT MODE'),
ExportColumn::make('vehicle_number')
->label('VEHICLE NUMBER'),
ExportColumn::make('e_waybill_number')
->label('E_WAYBILL NUMBER'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
ExportColumn::make('created_by')
->label('CREATED BY'),
ExportColumn::make('updated_by')
->label('UPDATED BY'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your invoice in transit export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}
return $body;
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Filament\Exports;
use App\Models\InvoiceMaster;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;
class InvoiceMasterExporter extends Exporter
{
protected static ?string $model = InvoiceMaster::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('receiving_plant')
->label('Receiving Plant'),
ExportColumn::make('receiving_plant_name')
->label('Receiving Plant Name'),
ExportColumn::make('transit_days')
->label('Transit Days'),
ExportColumn::make('transport_name')
->label('Transport Name'),
ExportColumn::make('created_at')
->label('Created At'),
ExportColumn::make('updated_at')
->label('Updated At'),
ExportColumn::make('created_by')
->label('Created By'),
ExportColumn::make('updated_by')
->label('Updated By'),
ExportColumn::make('deleted_at')
->label('Deleted At')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your invoice master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}
return $body;
}
}

View File

@@ -24,14 +24,16 @@ class InvoiceValidationExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('invoice_number')
->label('INVOICE NUMBER'),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
ExportColumn::make('stickerMaster.item.code')
->label('ITEM CODE'),
ExportColumn::make('stickerMaster.item.description')
->label('ITEM DESCRIPTION'),
ExportColumn::make('motor_scanned_status')
->label('MOTOR SCANNED STATUS'),
ExportColumn::make('pump_scanned_status')
@@ -58,23 +60,23 @@ class InvoiceValidationExporter extends Exporter
->label('OPERATOR ID'),
ExportColumn::make('created_at')
->label('CREATED AT'),
//->dateTimeFormat('d-m-Y H:i:s'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
//->dateTimeFormat('d-m-Y H:i:s'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
//->dateTimeFormat('d-m-Y H:i:s'),
// ->dateTimeFormat('d-m-Y H:i:s'),
];
}
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 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class ItemExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('category')
->label('CATEGORY'),
ExportColumn::make('code')

View File

@@ -24,12 +24,12 @@ class LineExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('NAME'),
->label('LINE NAME'),
ExportColumn::make('type')
->label('TYPE'),
->label('LINE TYPE'),
ExportColumn::make('no_of_operation')
->label('NO OF OPERATION'),
ExportColumn::make('workGroup1.name')
@@ -84,10 +84,10 @@ class LineExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your line export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your line 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -22,12 +22,12 @@ class MachineExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('name')
->label('MACHINE'),
->label('MACHINE NAME'),
ExportColumn::make('work_center')
->label('WORK CENTER'),
ExportColumn::make('workGroupMaster.name')
@@ -44,10 +44,10 @@ class MachineExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your machine export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your machine 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,39 +14,40 @@ class MfmMeterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('device.name')
->label('DEVICE NAME'),
->label('DEVICE NAME'),
ExportColumn::make('sequence')
->label('SEQUENCE'),
->label('SEQUENCE'),
ExportColumn::make('name')
->label('NAME'),
->label('METER NAME'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
->label('DELETED AT')
->enabledByDefault(false),
ExportColumn::make('created_by')
->label('CREATED BY'),
->label('CREATED BY'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your mfm meter export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your mfm meter 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,48 +14,49 @@ class MfmParameterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('deviceName.name')
->label('Device Name'),
->label('Device Name'),
ExportColumn::make('name')
->label('NAME'),
->label('PARAMETER NAME'),
ExportColumn::make('mfmMeter.name')
->label('MFM METER'),
->label('MFM METER'),
ExportColumn::make('register_id')
->label('REGISTER ID'),
->label('REGISTER ID'),
ExportColumn::make('identifier')
->label('IDENTIFIER'),
->label('IDENTIFIER'),
ExportColumn::make('byte_to_convert')
->label('BYTE TO CONVERT'),
->label('BYTE TO CONVERT'),
ExportColumn::make('type_to_convert')
->label('TYPE TO CONVERT'),
->label('TYPE TO CONVERT'),
ExportColumn::make('decimal_to_display')
->label('DECIMAL TO DISPLAY'),
->label('DECIMAL TO DISPLAY'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your mfm parameter export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your mfm parameter 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -17,13 +17,13 @@ class MotorTestingMasterExporter extends Exporter
return [
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.code')
->label('PLANT'),
->label('PLANT CODE'),
ExportColumn::make('item.category')
->label('CATEGORY'),
ExportColumn::make('item.code')
@@ -106,10 +106,10 @@ class MotorTestingMasterExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your motor testing master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your motor testing master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,6 +14,7 @@ class ProductCharacteristicsMasterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
@@ -21,12 +22,12 @@ class ProductCharacteristicsMasterExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('line.name')
->label('LINE NAME'), //machine.workGroupMaster.name
->label('LINE NAME'), // machine.workGroupMaster.name
ExportColumn::make('machine.workGroupMaster.name')
->label('WORK GROUP MASTER'),
ExportColumn::make('machine.work_center')
@@ -34,15 +35,15 @@ class ProductCharacteristicsMasterExporter extends Exporter
ExportColumn::make('characteristics_type')
->label('CHARACTERISTICS TYPE'),
ExportColumn::make('name')
->label('NAME'),
->label('CHARACTERISTICS NAME'),
ExportColumn::make('inspection_type')
->label('INSPECTION TYPE'),
ExportColumn::make('upper')
->label('UPPER'),
ExportColumn::make('lower')
->label('LOWER'),
ExportColumn::make('middle')
->label('MIDDLE'),
ExportColumn::make('upper')
->label('UPPER'),
ExportColumn::make('created_at')
->label('CREATED AT'),
ExportColumn::make('updated_at')
@@ -59,10 +60,10 @@ class ProductCharacteristicsMasterExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your product characteristics master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your product characteristics master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -37,13 +37,13 @@ class ProductionLineStopExporter extends Exporter
ExportColumn::make('stop_min')
->label('STOP MINUTE'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('shift.block.name')
->label('BLOCK'),
->label('BLOCK NAME'),
ExportColumn::make('shift.name')
->label('SHIFT'),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('SHIFT NAME'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('operator_id')
->label('OPERATOR ID'),
ExportColumn::make('created_at')
@@ -58,10 +58,10 @@ class ProductionLineStopExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your production line stop export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your production line stop 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -29,13 +29,13 @@ class ProductionPlanExporter extends Exporter
ExportColumn::make('production_quantity')
->label('PRODUCTION QUANTITY'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('shift.block.name')
->label('BLOCK'),
->label('BLOCK NAME'),
ExportColumn::make('shift.name')
->label('SHIFT'),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('SHIFT NAME'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('operator_id')
->label('OPERATOR ID'),
ExportColumn::make('created_at')
@@ -50,10 +50,10 @@ class ProductionPlanExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your production plan export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your production plan 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -33,13 +33,13 @@ class ProductionQuantityExporter extends Exporter
ExportColumn::make('item.uom')
->label('UNIT OF MEASURE'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('shift.block.name')
->label('BLOCK'),
->label('BLOCK NAME'),
ExportColumn::make('shift.name')
->label('SHIFT'),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('SHIFT NAME'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('sap_msg_status')
->label('SAP MESSAGE STATUS'),
ExportColumn::make('sap_msg_description')
@@ -58,10 +58,10 @@ class ProductionQuantityExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your production quantity export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your production quantity 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,10 +24,10 @@ class QualityValidationExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('production_order')
->label('PRODUCTION ORDER'),
ExportColumn::make('serial_number')
@@ -54,14 +54,14 @@ class QualityValidationExporter extends Exporter
->label('NAME PLATE PUMP'),
ExportColumn::make('name_plate_pumpset')
->label('NAME PLATE PUMPSET'),
ExportColumn::make('warranty_card')
->label('WARRANTY CARD'),
ExportColumn::make('tube_sticker_motor')
->label('TUBE STICKER MOTOR'),
ExportColumn::make('tube_sticker_pump')
->label('TUBE STICKER PUMP'),
ExportColumn::make('tube_sticker_pumpset')
->label('TUBE STICKER PUMPSET'),
ExportColumn::make('warranty_card')
->label('WARRANTY CARD'),
ExportColumn::make('part_validation1')
->label('PART VALIDATION 1'),
ExportColumn::make('part_validation2')
@@ -90,10 +90,10 @@ class QualityValidationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your quality validation export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your quality 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,15 +14,16 @@ class SerialValidationExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
ExportColumn::make('no')
->label('NO')
->state(function ($record) use (&$rowNumber) {
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('invoice_number')
->label('INVOICE NUMBER'),
ExportColumn::make('serial_number')
@@ -55,10 +56,10 @@ class SerialValidationExporter extends Exporter
->label('OPERATOR ID'),
ExportColumn::make('created_at')
->label('CREATED AT'),
//->dateTimeFormat('d-m-Y H:i:s'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
//->dateTimeFormat('d-m-Y H:i:s'),
// ->dateTimeFormat('d-m-Y H:i:s'),
ExportColumn::make('deleted_at')
->enabledByDefault(false)
->label('DELETED AT'),
@@ -67,10 +68,10 @@ class SerialValidationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your serial validation export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your serial 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -25,11 +25,11 @@ class ShiftExporter extends Exporter
return ++$rowNumber;
}),
ExportColumn::make('block.name')
->label('BLOCK'),
ExportColumn::make('plant.name')
->label('PLANT'),
->label('BLOCK NAME'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('NAME'),
->label('SHIFT NAME'),
ExportColumn::make('start_time')
->label('START TIME'),
ExportColumn::make('duration')
@@ -50,10 +50,10 @@ class ShiftExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your shift export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your shift 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class StickerMasterExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT NAME'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('serial_number_motor')
@@ -88,10 +88,10 @@ class StickerMasterExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your sticker master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your sticker master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,18 +24,18 @@ class TestingPanelReadingExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('machine.name')
->label('MACHINE'),
->label('MACHINE NAME'),
ExportColumn::make('motorTestingMaster.item.code')
->label('ITEM CODE'),
ExportColumn::make('motorTestingMaster.item.description')
->label('MODEL'),
->label('MODEL DESCRIPTION'),
ExportColumn::make('output')
->label('OUTPUT'),
->label('OUTPUT NAME'),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
ExportColumn::make('winded_serial_number')
@@ -125,7 +125,7 @@ class TestingPanelReadingExporter extends Exporter
ExportColumn::make('rework_count')
->label('REWORK COUNT'),
ExportColumn::make('update_count')
->label('UPDATE COUNT'),
->label('UPDATED COUNT'),
ExportColumn::make('output_flag')
->label('OUTPUT FLAG'),
ExportColumn::make('tested_by')
@@ -146,10 +146,10 @@ class TestingPanelReadingExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your testing panel reading export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your testing panel reading export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -24,8 +24,8 @@ class WeightValidationExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('item.code')
->label('ITEM CODE'),
ExportColumn::make('obd_number')
@@ -58,10 +58,10 @@ class WeightValidationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your weight validation export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your weight 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -14,6 +14,7 @@ class WorkGroupMasterExporter extends Exporter
public static function getColumns(): array
{
static $rowNumber = 0;
return [
ExportColumn::make('no')
->label('NO')
@@ -21,32 +22,32 @@ class WorkGroupMasterExporter extends Exporter
// Increment and return the row number
return ++$rowNumber;
}),
ExportColumn::make('plant.name')
->label('PLANT'),
ExportColumn::make('plant.code')
->label('PLANT CODE'),
ExportColumn::make('name')
->label('NAME'),
->label('WORK GROUP NAME'),
ExportColumn::make('description')
->label('DESCRIPTION'),
->label('WORK GROUP DESCRIPTION'),
ExportColumn::make('operation_number')
->label('OPERATION NUMBER'),
->label('OPERATION NUMBER'),
ExportColumn::make('created_by')
->label('CREATED BY'),
->label('CREATED BY'),
ExportColumn::make('created_at')
->label('CREATED AT'),
->label('CREATED AT'),
ExportColumn::make('updated_at')
->label('UPDATED AT'),
->label('UPDATED AT'),
ExportColumn::make('deleted_at')
->label('DELETED AT')
->enabledByDefault(false),
->label('DELETED AT')
->enabledByDefault(false),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your work group master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your work group master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -0,0 +1,141 @@
<?php
namespace App\Filament\Imports;
use App\Models\AlertMailRule;
use App\Models\Plant;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Facades\Filament;
use Str;
class AlertMailRuleImporter extends Importer
{
protected static ?string $model = AlertMailRule::class;
public static function getColumns(): array
{
return [
ImportColumn::make('module')
->requiredMapping()
->exampleHeader('Module')
->example('ProductionQuantities/InvoiceValidation/QualityValidation/InvoiceDataReport/InvoiceTransit')
->label('Module')
->rules(['required']),
ImportColumn::make('rule_name')
->requiredMapping()
->exampleHeader('Rule Name')
->example('ProductionMail/InvoiceMail/QualityMail/InvoiceDataMail/InvoiceTransitMail')
->label('Rule Name')
->rules(['required']),
ImportColumn::make('email')
->requiredMapping()
->exampleHeader('Email')
->example('admin@cripumps.com,ranjith.bala@cripumps.com')
->label('Email')
->rules(['required']),
ImportColumn::make('schedule_type')
->exampleHeader('Schedule Type')
->example('Daily/Live/Hourly')
->label('Schedule Type'),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Code')
->example('1000 or All Plants')
->label('Plant Code')
->rules(['required']),
ImportColumn::make('cc_emails')
->exampleHeader('CC Email')
->example('admin@cripumps.com,ranjith.bala@cripumps.com')
->label('CC Email')
->rules(['nullable', 'string']),
//->rules(['cc_emails']),
// ImportColumn::make('invoiceMaster')
// ->relationship(),
ImportColumn::make('receiving_plant_name')
->exampleHeader('Receiving Plant Name')
->example('BANGALORE')
->label('Receiving Plant Name')
->requiredMapping(),
ImportColumn::make('transporter_name')
->exampleHeader('Transporter Name')
->example('SAFEXPRESS PRIVATE LIMITED')
->label('Transporter Name')
->requiredMapping(),
];
}
public function resolveRecord(): ?AlertMailRule
{
$warnMsg = [];
$user = Filament::auth()->user();
$operatorName = $user->name;
if (strtolower($this->data['plant']) == 'all plants') {
$this->data['plant'] = 0;
} else {
$plant = Plant::where('code', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant code '{$this->data['plant']}' not found.";
$this->data['plant'] = null;
} else {
$this->data['plant'] = $plant->id;
}
}
$receivingPlantName = $this->data['receiving_plant_name'] ?? null;
$transporterName = $this->data['transporter_name'] ?? null;
if (!$receivingPlantName || !$transporterName)
{
$warnMsg [] = 'Both Receiving Plant Name and Transporter Name are required.';
}
$invoiceMaster = \App\Models\InvoiceMaster::where('receiving_plant_name', $receivingPlantName)
->where('transport_name', $transporterName)
->first();
if (!$invoiceMaster) {
$warnMsg [] = "Invoice Master not found for Receiving Plant '{$receivingPlantName}' and Transporter '{$transporterName}'.";
}
$this->data['invoice_master_id'] = $invoiceMaster->id;
unset($this->data['receiving_plant_name'], $this->data['transporter_name']);
if(! empty($warnMsg)){
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return AlertMailRule::Create([
'module' => $this->data['module'],
'rule_name' => $this->data['rule_name'],
'email' => $this->data['email'],
'schedule_type' => $this->data['schedule_type'],
'plant' => $this->data['plant'],
'cc_emails' => $this->data['cc_emails'] ?? null,
'invoice_master_id' => $invoiceMaster->id,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
//return new AlertMailRule();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your alert mail rule 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

@@ -8,7 +8,6 @@ use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Notification;
use Str;
class BlockImporter extends Importer
@@ -20,16 +19,16 @@ class BlockImporter extends Importer
return [
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Block Name')
->exampleHeader('BLOCK NAME')
->example('Block A')
->label('Block Name')
->label('BLOCK NAME')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('PLANT CODE')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
];
}
@@ -37,21 +36,28 @@ class BlockImporter extends Importer
public function resolveRecord(): ?Block
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
// $warnMsg[] = "Plant '" . $this->data['plant'] . "' not found";
$plantCod = $this->data['plant'];
$plant = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
// $warnMsg[] = "Plant '" . $plantCod . "' not found";
}
}
if (Str::length($this->data['name']) < 0) {
$warnMsg[] = "Block name not found";
$warnMsg[] = 'Block name not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return Block::updateOrCreate([
'name' => $this->data['name'],
'plant_id' => $plant->id
'plant_id' => $plant->id,
]);
// return Block::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
@@ -63,10 +69,10 @@ class BlockImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your block import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your block 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -0,0 +1,260 @@
<?php
namespace App\Filament\Imports;
use App\Models\CharacteristicValue;
use App\Models\Item;
use App\Models\Line;
use App\Models\Machine;
use App\Models\Plant;
use App\Models\ProcessOrder;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Str;
class CharacteristicValueImporter extends Importer
{
protected static ?string $model = CharacteristicValue::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('line')
->requiredMapping()
->exampleHeader('Line Name')
->example('4 inch pump line')
->label('Line Name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('item')
->requiredMapping()
->exampleHeader('Item Code')
->example('123456')
->label('Item Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('machine')
->requiredMapping()
->exampleHeader('Work Center')
->example('RMGS09745')
->label('Work Center')
->relationship(resolveUsing: 'work_center')
->rules(['required']),
ImportColumn::make('process_order')
->requiredMapping()
->exampleHeader('Process Order')
->example('23455256352')
->label('Process Order'),
ImportColumn::make('coil_number')
->requiredMapping()
->exampleHeader('Coil Number')
->example('0')
->label('Coil Number'),
ImportColumn::make('status')
->requiredMapping()
->exampleHeader('Status')
->example('Ok')
->label('Status'),
ImportColumn::make('created_by')
->requiredMapping()
->exampleHeader('Created By')
->example('RAW01234')
->label('Created By'),
];
}
public function resolveRecord(): ?CharacteristicValue
{
// return CharacteristicValue::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
$warnMsg = [];
$plantId = null;
$itemId = null;
$LineId = null;
$machineId = null;
$itemAgainstPlant = null;
$plantCode = $this->data['plant'];
$processOrder = trim($this->data['process_order'] ?? '');
$iCode = trim($this->data['item']);
$workCenter = trim($this->data['machine']);
$lineName = trim($this->data['line']);
$status = trim($this->data['status']);
$createdBy = trim($this->data['created_by']);
$coilNo = trim($this->data['coil_number']);
if ($plantCode == null || $plantCode == '') {
$warnMsg[] = 'Plant code cannot be empty';
} elseif ($iCode == null || $iCode == '') {
$warnMsg[] = 'Process Order cannot be empty';
} elseif ($workCenter == null || $workCenter == '') {
$warnMsg[] = 'Work center cannot be empty';
} elseif ($lineName == null || $lineName == '') {
$warnMsg[] = 'Line cannot be empty';
}
if (Str::length($plantCode) < 4 || ! is_numeric($plantCode) || ! preg_match('/^[1-9]\d{3,}$/', $plantCode)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$plantId = $plant->id;
}
}
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} else {
$itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found';
} else {
if ($plantId) {
$itemAgainstPlant = Item::where('code', $iCode)->where('plant_id', $plantId)->first();
if (! $itemAgainstPlant) {
$warnMsg[] = 'Item code not found for the given plant';
} else {
$itemId = $itemAgainstPlant->id;
}
}
}
}
$lineExists = Line::where('name', $lineName)->first();
if (! $lineExists) {
$warnMsg[] = 'Line name not found';
} else {
if ($plantId) {
$lineAgainstPlant = Line::where('name', $lineName)->where('plant_id', $plantId)->first();
if (! $lineAgainstPlant) {
$warnMsg[] = 'Line name not found for the given plant';
} else {
$LineId = $lineAgainstPlant->id;
}
}
}
$workCenterExist = Machine::where('work_center', $workCenter)->first();
if (! $workCenterExist) {
$warnMsg[] = 'Work Center not found';
}
// $workCenterAgainstPlant = Machine::where('work_center', $workCenter)
// ->where('plant_id', $plantId)
// ->first();
// if (!$workCenterAgainstPlant) {
// $warnMsg[] = 'Work center not found for the given plant';
// } else {
// $MachineId = $workCenterAgainstPlant->id;
// }
if ($plantId != null && $LineId != null) {
$machineAgaPlantLine = Machine::where('plant_id', $plantId)
->where('line_id', $LineId)
->where('work_center', $workCenter)
->first();
if (! $machineAgaPlantLine) {
$warnMsg[] = 'Work center not found for the given plant and line';
} else {
$machineId = $machineAgaPlantLine->id;
}
}
if ($processOrder == null || $processOrder == '') {
$warnMsg[] = 'Process Order cannot be empty';
}
if ($coilNo == null || $coilNo == '') {
$warnMsg[] = 'Coil No cannot be empty';
} elseif (! is_numeric($coilNo)) {
$warnMsg[] = 'Coil number should contain only numeric values!';
}
if ($status == null || $status == '' || ! $status) {
$warnMsg[] = 'Status cannot be empty';
} elseif (! in_array($status, ['Ok', 'NotOk'], true)) {
$warnMsg[] = "Status must be either 'Ok' or 'NotOk'!";
}
if ($createdBy == null || $createdBy == '' || ! $createdBy) {
$warnMsg[] = 'Created By cannot be empty';
}
// $existing = CharacteristicValue::where('plant_id', $plantId)
// ->where('process_order', $processOrder)
// ->where('coil_number', $coilNo)
// ->first();
// if ($existing) {
// $warnMsg[] = "Process order '{$processOrder}' with coil number '{$coilNo}' already exist for the plant code '{$plantCode}'!";
// }
if ($plantId && $processOrder) {
$existing = CharacteristicValue::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('coil_number', $coilNo)
->first();
if ($existing) {
$warnMsg[] = "Coil number '{$coilNo}' already exists for Plant '{$plantCode}' and Process Order '{$processOrder}'.";
}
}
if ($plant && $itemCode && $processOrder != '') {
$existingOrder = ProcessOrder::where('plant_id', $plant->id)
->where('process_order', $processOrder)
->first();
if ($existingOrder && $existingOrder->item_id !== ($itemCode->id ?? null)) {
$warnMsg[] = 'Same Process Order already exists for this Plant with a different Item Code';
}
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return CharacteristicValue::create([
'plant_id' => $plantId,
'item_id' => $itemId,
'line_id' => $LineId,
'machine_id' => $machineId,
'process_order' => trim($this->data['process_order']),
'coil_number' => trim($this->data['coil_number']),
'status' => trim($this->data['status']),
'created_by' => trim($this->data['created_by']),
]);
// return null;
// return new CharacteristicValue;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your characteristic value 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

@@ -20,10 +20,10 @@ class CheckPointNameImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
@@ -43,27 +43,33 @@ class CheckPointNameImporter extends Importer
public function resolveRecord(): ?CheckPointName
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
$plantCod = $this->data['plant'];
$plant = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
}
}
if (Str::length($this->data['name']) < 3) { // || !ctype_alnum($this->data['name'])
$warnMsg[] = "Invalid check point name found";
$warnMsg[] = 'Invalid check point name found';
}
$createdBy = $this->data['created_by'];
if (Str::length($createdBy) < 3) { // || !ctype_alnum($createdBy)
$warnMsg[] = "Invalid created by name found";
$warnMsg[] = 'Invalid created by name found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return CheckPointName::updateOrCreate([
'name' => $this->data['name'],
'plant_id' => $plant->id
],
[
'created_by' => $this->data['created_by']
'plant_id' => $plant->id,
],
[
'created_by' => $this->data['created_by'],
]
);
// // return CheckPointName::firstOrNew([
@@ -76,10 +82,10 @@ class CheckPointNameImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your check point name import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your check point name 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -21,10 +21,10 @@ class CheckPointTimeImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('checkPointNames1')
->requiredMapping()
@@ -73,50 +73,51 @@ class CheckPointTimeImporter extends Importer
public function resolveRecord(): ?CheckPointTime
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$checkPointNames1 = null;
$checkPointNames2 = null;
if (!$plant) {
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
}
else
{
$checkPointNames1 = CheckPointName::where('name', $this->data['checkPointNames1'])->first();
if (!$checkPointNames1) {
$warnMsg[] = "Check point 1 not found";
}
else
{
$checkPointNames2 = CheckPointName::where('name', $this->data['checkPointNames2'])->first();
if (!$checkPointNames2) {
$warnMsg[] = "Check point 2 not found";
}
else
{
if ($checkPointNames1->id === $checkPointNames2->id) {
$warnMsg[] = "Check point 1 and 2 can't be the same";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
} else {
$checkPointNames1 = CheckPointName::where('name', $this->data['checkPointNames1'])->first();
if (! $checkPointNames1) {
$warnMsg[] = 'Check point 1 not found';
} else {
$checkPointNames2 = CheckPointName::where('name', $this->data['checkPointNames2'])->first();
if (! $checkPointNames2) {
$warnMsg[] = 'Check point 2 not found';
} else {
if ($checkPointNames1->id === $checkPointNames2->id) {
$warnMsg[] = "Check point 1 and 2 can't be the same";
}
}
}
}
}
if (Str::length($this->data['sequence_number']) < 1 || !is_numeric($this->data['sequence_number']) || $this->data['sequence_number'] <= 0) {
$warnMsg[] = "Invalid sequence number found";
if (Str::length($this->data['sequence_number']) < 1 || ! is_numeric($this->data['sequence_number']) || $this->data['sequence_number'] <= 0) {
$warnMsg[] = 'Invalid sequence number found';
}
if (Str::length($this->data['time_lapse']) < 1 || !is_numeric($this->data['time_lapse']) || $this->data['time_lapse'] <= 0) {
$warnMsg[] = "Invalid time lapse found";
if (Str::length($this->data['time_lapse']) < 1 || ! is_numeric($this->data['time_lapse']) || $this->data['time_lapse'] <= 0) {
$warnMsg[] = 'Invalid time lapse found';
}
if (Str::length($this->data['time_lapse_cushioning']) < 1 || !is_numeric($this->data['time_lapse_cushioning']) || $this->data['time_lapse_cushioning'] <= 0) {
$warnMsg[] = "Invalid time lapse cushioning found";
if (Str::length($this->data['time_lapse_cushioning']) < 1 || ! is_numeric($this->data['time_lapse_cushioning']) || $this->data['time_lapse_cushioning'] <= 0) {
$warnMsg[] = 'Invalid time lapse cushioning found';
}
$createdBy = $this->data['created_by'];
if (Str::length($createdBy) < 3) { // || !ctype_alnum($createdBy)
$warnMsg[] = "Invalid created by name found";
$warnMsg[] = 'Invalid created by name found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -124,12 +125,12 @@ class CheckPointTimeImporter extends Importer
'plant_id' => $plant->id,
'check_point1_id' => $checkPointNames1->id,
'check_point2_id' => $checkPointNames2->id,
'sequence_number' => $this->data['sequence_number']
'sequence_number' => $this->data['sequence_number'],
],
[
'time_lapse' => $this->data['time_lapse'],
'time_lapse_cushioning' => $this->data['time_lapse_cushioning'],
'created_by' => $this->data['created_by']
[
'time_lapse' => $this->data['time_lapse'],
'time_lapse_cushioning' => $this->data['time_lapse_cushioning'],
'created_by' => $this->data['created_by'],
]
);
// // return CheckPointTime::firstOrNew([
@@ -142,10 +143,10 @@ class CheckPointTimeImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your check point time import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your check point time 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -62,15 +62,15 @@ class ConfigurationImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new Configuration();
return new Configuration;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your configuration import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your configuration 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -16,10 +16,10 @@ class DeviceMasterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
@@ -53,15 +53,15 @@ class DeviceMasterImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new DeviceMaster();
return new DeviceMaster;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your device master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your device master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -16,10 +16,10 @@ class EbReadingImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('lcd_segment_check')
->label('LCD Segment Check')
@@ -227,15 +227,15 @@ class EbReadingImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new EbReading();
return new EbReading;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your eb reading import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your eb reading 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -16,17 +16,17 @@ class EquipmentMasterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('machine')
->requiredMapping()
->exampleHeader('Machine Name')
->example('1006378')
->label('Machine Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('name')
->label('Name')
@@ -93,15 +93,15 @@ class EquipmentMasterImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new EquipmentMaster();
return new EquipmentMaster;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your equipment master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your equipment master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -3,14 +3,14 @@
namespace App\Filament\Imports;
use App\Models\GrMaster;
use App\Models\Item;
use App\Models\Plant;
use App\Models\User;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use App\Models\Plant;
use App\Models\Item;
use Str;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use App\Models\User;
class GrMasterImporter extends Importer
{
@@ -21,17 +21,17 @@ class GrMasterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->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')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('serial_number')
->requiredMapping()
@@ -51,7 +51,7 @@ class GrMasterImporter extends Importer
->example('Admin')
->label('Created By')
->rules(['required']),
//ImportColumn::make('updated_by'),
// ImportColumn::make('updated_by'),
];
}
@@ -63,44 +63,47 @@ class GrMasterImporter extends Importer
// ]);
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
$plantCod = $this->data['plant'];
$plant = null;
$item = null;
if ($plant) {
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
}
if (! $item) {
$warnMsg[] = 'Item not found';
}
}
if (!$item) {
$warnMsg[] = "Item not found";
}
if (Str::length($this->data['serial_number']) < 9 || !ctype_alnum($this->data['serial_number'])) {
$warnMsg[] = "Invalid serial number found";
if (Str::length($this->data['serial_number']) < 9 || ! ctype_alnum($this->data['serial_number'])) {
$warnMsg[] = 'Invalid serial number found';
}
if (empty($this->data['gr_number'])) {
$warnMsg[] = "GR Number cannot be empty.";
$warnMsg[] = 'GR Number cannot be empty.';
}
$user = User::where('name', $this->data['created_by'])->first();
if (!$user) {
$warnMsg[] = "User not found";
if (! $user) {
$warnMsg[] = 'User not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else { //if (empty($warnMsg))
} else { // if (empty($warnMsg))
$grMaster = GrMaster::where('plant_id', $plant->id)
->where('serial_number', $this->data['serial_number'])
->latest()
->first();
->where('serial_number', $this->data['serial_number'])
->latest()
->first();
if ($grMaster) {
throw new RowImportFailedException("Serial number already exist!");
throw new RowImportFailedException('Serial number already exist!');
}
}
@@ -113,15 +116,15 @@ class GrMasterImporter extends Importer
]);
return null;
//return new GrMaster();
// return new GrMaster();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your gr master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your gr master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -20,10 +20,10 @@ class GuardNameImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
@@ -54,32 +54,38 @@ class GuardNameImporter extends Importer
public function resolveRecord(): ?GuardName
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
$plantCod = $this->data['plant'];
$plant = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
}
}
if (Str::length($this->data['name']) < 3) { // || !ctype_alnum($this->data['name'])
$warnMsg[] = "Invalid guard name found";
$warnMsg[] = 'Invalid guard name found';
}
if (Str::length($this->data['identification1']) < 5) {
$warnMsg[] = "Invalid identification-1 found";
$warnMsg[] = 'Invalid identification-1 found';
}
$createdBy = $this->data['created_by'];
if (Str::length($createdBy) < 3) { // || !ctype_alnum($createdBy)
$warnMsg[] = "Invalid created by name found";
$warnMsg[] = 'Invalid created by name found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return GuardName::updateOrCreate([
'name' => $this->data['name'],
'plant_id' => $plant->id
'plant_id' => $plant->id,
],
[
'identification1' => $this->data['identification1'],
'identification2' => $this->data['identification2'],
'created_by' => $this->data['created_by']
[
'identification1' => $this->data['identification1'],
'identification2' => $this->data['identification2'],
'created_by' => $this->data['created_by'],
]
);
@@ -87,15 +93,15 @@ class GuardNameImporter extends Importer
// // // Update existing records, matching them by `$this->data['column_name']`
// // 'email' => $this->data['email'],
// // ]);
//return new GuardName();
// return new GuardName();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your guard name import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your guard name 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -23,10 +23,10 @@ class GuardPatrolEntryImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('guardNames')
->requiredMapping()
@@ -68,61 +68,60 @@ class GuardPatrolEntryImporter extends Importer
public function resolveRecord(): ?GuardPatrolEntry
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$guardNames = null;
$checkPointNames = null;
$patrolDateTime = null; //$fdateTime = null;
if (!$plant) {
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
}
else
{
$guardNames = GuardName::where('plant_id', $plant->id)->where('name', $this->data['guardNames'])->first();
if (!$guardNames) {
$warnMsg[] = "Guard name not found";
}
else
{
$checkPointNames = CheckPointName::where('plant_id', $plant->id)->where('name', $this->data['checkPointNames'])->first();
if (!$checkPointNames) {
$warnMsg[] = "Check point name not found";
}
else
{
$patrolTime = $this->data['patrol_time'];//$fromDate = $this->data['from_datetime'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$patrolDateTime = null; // $fdateTime = null;
foreach ($formats as $format) {
try {
$patrolDateTime = Carbon::createFromFormat($format, $patrolTime);
break;
} catch (\Exception $e) {
// Optionally collect warning messages
// $warnMsg[] = "Date format mismatch with format: $format";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
} else {
$guardNames = GuardName::where('plant_id', $plant->id)->where('name', $this->data['guardNames'])->first();
if (! $guardNames) {
$warnMsg[] = 'Guard name not found';
} else {
$checkPointNames = CheckPointName::where('plant_id', $plant->id)->where('name', $this->data['checkPointNames'])->first();
if (! $checkPointNames) {
$warnMsg[] = 'Check point name not found';
} else {
$patrolTime = $this->data['patrol_time']; // $fromDate = $this->data['from_datetime'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
foreach ($formats as $format) {
try {
$patrolDateTime = Carbon::createFromFormat($format, $patrolTime);
break;
} catch (\Exception $e) {
// Optionally collect warning messages
// $warnMsg[] = "Date format mismatch with format: $format";
}
}
}
if (!isset($patrolDateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Patrol DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else
{
$guardEntryFound = GuardPatrolEntry::where('plant_id', $plant->id)->where('guard_name_id', $guardNames->id)->where('check_point_name_id', $checkPointNames->id)->where('patrol_time', $patrolDateTime->format('Y-m-d H:i:s'))->first();
if ($guardEntryFound) {
$warnMsg[] = "Duplicate guard patrol entry found";
if (! isset($patrolDateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Patrol DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
} else {
$guardEntryFound = GuardPatrolEntry::where('plant_id', $plant->id)->where('guard_name_id', $guardNames->id)->where('check_point_name_id', $checkPointNames->id)->where('patrol_time', $patrolDateTime->format('Y-m-d H:i:s'))->first();
if ($guardEntryFound) {
$warnMsg[] = 'Duplicate guard patrol entry found';
}
}
}
}
}
}
$createdBy = Filament::auth()->user()->name;// ?? 'Admin'
if (!$createdBy) {
$warnMsg[] = "Invalid created by name found";
$createdBy = Filament::auth()->user()->name; // ?? 'Admin'
if (! $createdBy) {
$warnMsg[] = 'Invalid created by name found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -130,14 +129,15 @@ class GuardPatrolEntryImporter extends Importer
'plant_id' => $plant->id,
'guard_name_id' => $guardNames->id,
'check_point_name_id' => $checkPointNames->id,
'patrol_time' => $patrolDateTime->format('Y-m-d H:i:s')
'patrol_time' => $patrolDateTime->format('Y-m-d H:i:s'),
],
[
'reader_code' => null,
'created_by' => $createdBy,
'updated_by' => $createdBy
[
'reader_code' => null,
'created_by' => $createdBy,
'updated_by' => $createdBy,
]
);
return null;
// // return GuardPatrolEntry::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
@@ -149,10 +149,10 @@ class GuardPatrolEntryImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your guard patrol entry import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your guard patrol entry import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -8,7 +8,8 @@ use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Str;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class ItemImporter extends Importer
{
@@ -48,10 +49,10 @@ class ItemImporter extends Importer
->label('Unit of Measure'),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code') // Lookup Plant by code column
->rules(['required']),
];
}
@@ -59,36 +60,46 @@ class ItemImporter extends Importer
public function resolveRecord(): ?Item
{
$warnMsg = [];
$plantCod = $this->data['plant'];
$plant = null;
Log::info('ResolveRecord triggered', $this->data);
$iCode = trim($this->data['code']);
$description = trim($this->data['description']);
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
}
}
if (Str::length($iCode) < 6 || !ctype_alnum($iCode)) {
$warnMsg[] = "Invalid item code found";
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
}
// if (Str::length($this->data['uom']) <= 0) {
// $warnMsg[] = "Invalid unit of measure found";
// }
if (Str::length($description) < 5) {
$warnMsg[] = "Invalid description found";
$warnMsg[] = 'Invalid description found';
}
if (Str::length($this->data['hourly_quantity']) < 0 || !is_numeric($this->data['hourly_quantity']) || $this->data['hourly_quantity'] <= 0) {
$warnMsg[] = "Invalid hourly quantity found";
if (Str::length($this->data['hourly_quantity']) < 0 || ! is_numeric($this->data['hourly_quantity']) || $this->data['hourly_quantity'] <= 0) {
$warnMsg[] = 'Invalid hourly quantity found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return Item::updateOrCreate([
'code' => $iCode,
'plant_id' => $plant->id
],
'code' => $iCode,
'plant_id' => $plant->id,
],
[
'category' => trim($this->data['category']),
'description' => $description,
'hourly_quantity' => $this->data['hourly_quantity'],
'uom' => trim($this->data['uom'])
'uom' => trim($this->data['uom']),
]
);
// return new Item;

View File

@@ -87,10 +87,10 @@ class LineImporter extends Importer
->label('Work Group Center 10'),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
];
}
@@ -98,28 +98,33 @@ class LineImporter extends Importer
public function resolveRecord(): ?Line
{
$warnMsg = [];
$plantCod = $this->data['plant'];
$plant = null;
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
throw new RowImportFailedException("Plant '{$this->data['plant']}' not found");
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
throw new RowImportFailedException('Plant not found');
}
}
if (Str::length($this->data['name'] ?? '') <= 0) {
throw new RowImportFailedException("Line name not found");
throw new RowImportFailedException('Line name not found');
}
if (Str::length($this->data['type'] ?? '') <= 0) {
throw new RowImportFailedException("Line type not found");
throw new RowImportFailedException('Line type not found');
}
$noOfOps = (int) ($this->data['no_of_operation'] ?? 0);
if (($noOfOps == null || $noOfOps == '' || !is_numeric($noOfOps)) && $noOfOps != 0) {
if (($noOfOps == null || $noOfOps == '' || ! is_numeric($noOfOps)) && $noOfOps != 0) {
throw new RowImportFailedException("'No of Operation' is required and must be a number $noOfOps");
}
if ($noOfOps > 10)
{
if ($noOfOps > 10) {
throw new RowImportFailedException("Invalid 'No Of Operation' value: {$noOfOps}, maximum allowed is 10");
}
@@ -130,28 +135,28 @@ class LineImporter extends Importer
$missingGroups[] = "work_group{$i}_id";
}
}
if (!empty($missingGroups)) {
if (! empty($missingGroups)) {
throw new RowImportFailedException(
"Invalid data: Required work groups missing values in: " . implode(', ', $missingGroups)
'Invalid data: Required work groups missing values in: '.implode(', ', $missingGroups)
);
}
// Ensure no extra work groups are filled
$invalidGroups = [];
for ($i = $noOfOps + 1; $i <= 10; $i++) {
if (!empty($this->data["work_group{$i}_id"])) {
if (! empty($this->data["work_group{$i}_id"])) {
$invalidGroups[] = "work_group{$i}_id";
}
}
if (!empty($invalidGroups)) {
if (! empty($invalidGroups)) {
throw new RowImportFailedException(
"Invalid data: Only first {$noOfOps} work groups should be filled, but values found in: " . implode(', ', $invalidGroups)
"Invalid data: Only first {$noOfOps} work groups should be filled, but values found in: ".implode(', ', $invalidGroups)
);
}
for ($i = 1; $i <= 10; $i++) {
$workGroupName = $this->data["work_group{$i}_id"] ?? null;
if (!$workGroupName) {
if (! $workGroupName) {
continue;
}
@@ -159,8 +164,8 @@ class LineImporter extends Importer
->where('plant_id', $plant->id)
->first();
if (!$workGroupRecord) {
throw new RowImportFailedException("Work group '{$workGroupName}' not found in plant '{$this->data['plant']}'");
if (! $workGroupRecord) {
throw new RowImportFailedException("Work group '{$workGroupName}' not found in plant '{$plantCod}'");
}
$existsInLines = Line::where('plant_id', $plant->id)
@@ -169,35 +174,34 @@ class LineImporter extends Importer
->first();
if ($existsInLines) {
$warnMsg[] = "Work group '{$workGroupName}' is already assigned to another line in plant '{$this->data['plant']}'";
$warnMsg[] = "Work group '{$workGroupName}' is already assigned to another line in plant '{$plantCod}'";
}
$this->data["work_group{$i}_id"] = $workGroupRecord->id;
}
if (!empty($warnMsg))
{
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
Line::updateOrCreate(
[
'name' => $this->data['name'],
'plant_id' => $plant->id
'plant_id' => $plant->id,
],
[
'type' => $this->data['type'],
'no_of_operation' => $noOfOps,
'work_group1_id' => $this->data['work_group1_id'] ?? null,
'work_group2_id' => $this->data['work_group2_id'] ?? null,
'work_group3_id' => $this->data['work_group3_id'] ?? null,
'work_group4_id' => $this->data['work_group4_id'] ?? null,
'work_group5_id' => $this->data['work_group5_id'] ?? null,
'work_group6_id' => $this->data['work_group6_id'] ?? null,
'work_group7_id' => $this->data['work_group7_id'] ?? null,
'work_group8_id' => $this->data['work_group8_id'] ?? null,
'work_group9_id' => $this->data['work_group9_id'] ?? null,
'work_group10_id' => $this->data['work_group10_id'] ?? null,
'work_group1_id' => $this->data['work_group1_id'] ?? null,
'work_group2_id' => $this->data['work_group2_id'] ?? null,
'work_group3_id' => $this->data['work_group3_id'] ?? null,
'work_group4_id' => $this->data['work_group4_id'] ?? null,
'work_group5_id' => $this->data['work_group5_id'] ?? null,
'work_group6_id' => $this->data['work_group6_id'] ?? null,
'work_group7_id' => $this->data['work_group7_id'] ?? null,
'work_group8_id' => $this->data['work_group8_id'] ?? null,
'work_group9_id' => $this->data['work_group9_id'] ?? null,
'work_group10_id' => $this->data['work_group10_id'] ?? null,
]
);
@@ -206,10 +210,10 @@ class LineImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your line import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your line 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -10,7 +10,6 @@ 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 LocatorInvoiceValidationImporter extends Importer
@@ -115,53 +114,49 @@ class LocatorInvoiceValidationImporter extends Importer
$scannedBy = $this->data['scanned_by'];
$updatedBy = $this->data['updated_by'];
if (Str::length($plantCod) < 4 || !is_numeric($plantCod) || !preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = "Invalid plant code found";
}
else
{
$plant = Plant::where('code', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else
{
if (Str::length($invoiceNo) < 5 || !ctype_alnum($invoiceNo)) {
$warnMsg[] = "Invalid invoice number found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
if (Str::length($invoiceNo) < 5 || ! ctype_alnum($invoiceNo)) {
$warnMsg[] = 'Invalid invoice number found';
}
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || !ctype_alnum($serialNo)) {
$warnMsg[] = "Invalid serial number found";
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || ! ctype_alnum($serialNo)) {
$warnMsg[] = 'Invalid serial number found';
}
if (Str::length($palletNo) > 0 && Str::length($palletNo) < 10) {
$warnMsg[] = "Invalid pallet number found";
$warnMsg[] = 'Invalid pallet number found';
}
if (Str::length($locatorNo) > 0 && Str::length($locatorNo) < 7) {
$warnMsg[] = "Invalid locator number found";
$warnMsg[] = 'Invalid locator number found';
}
if (Str::length($scannedStat) > 0 && $scannedStat != 'Scanned') {
$warnMsg[] = "Invalid scanned status found";
$warnMsg[] = 'Invalid scanned status found';
}
if ($uploadStat != 'Y' && $uploadStat != 'N') {
$warnMsg[] = "Invalid upload status found";
$warnMsg[] = 'Invalid upload status found';
}
$created = User::where('name', $createdBy)->first();
if (!$created) {
$warnMsg[] = "Created by not found";
if (! $created) {
$warnMsg[] = 'Created by not found';
}
if (Str::length($scannedBy) > 0) {
$scanned = User::where('name', $scannedBy)->first();
if (!$scanned) {
$warnMsg[] = "Scanned by not found";
if (! $scanned) {
$warnMsg[] = 'Scanned by not found';
}
}
if (Str::length($updatedBy) > 0) {
$updated = User::where('name', $updatedBy)->first();
if (!$updated) {
$warnMsg[] = "Updated by not found";
if (! $updated) {
$warnMsg[] = 'Updated by not found';
}
}
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
foreach ($formats as $format) {
try {
@@ -173,13 +168,12 @@ class LocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($cDateTime)) {
if (! isset($cDateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
if (Str::length($scannedAt) > 0)
{
if (Str::length($scannedAt) > 0) {
foreach ($formats as $format) {
try {
$sDateTime = Carbon::createFromFormat($format, $scannedAt);
@@ -190,13 +184,12 @@ class LocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($sDateTime)) {
if (! isset($sDateTime)) {
$warnMsg[] = "Invalid 'Scanned DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
}
if (Str::length($updatedAt) > 0)
{
if (Str::length($updatedAt) > 0) {
foreach ($formats as $format) {
try {
$uDateTime = Carbon::createFromFormat($format, $updatedAt);
@@ -207,11 +200,9 @@ class LocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($uDateTime)) {
if (! isset($uDateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else
{
} else {
if (isset($cDateTime) && isset($uDateTime)) {
if ($cDateTime->greaterThan($uDateTime)) {
$warnMsg[] = "'Created DataTime' is greater than 'Updated DateTime'.";
@@ -226,14 +217,14 @@ class LocatorInvoiceValidationImporter extends Importer
// $warnMsg[] = "Invalid locator quantity found";
// }
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
LocatorInvoiceValidation::updateOrCreate(
[
'plant_id' => $plant->id,
'serial_number' => $serialNo
'serial_number' => $serialNo,
],
[
'invoice_number' => $invoiceNo,
@@ -246,9 +237,10 @@ class LocatorInvoiceValidationImporter extends Importer
'updated_at' => (Str::length($updatedAt) > 0) ? $uDateTime->format('Y-m-d H:i:s') : null,
'created_by' => $createdBy,
'scanned_by' => $scannedBy,
'updated_by' => $updatedBy
'updated_by' => $updatedBy,
]
);
return null;
// // return LocatorInvoiceValidation::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
@@ -260,10 +252,10 @@ class LocatorInvoiceValidationImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your locator invoice validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your locator 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -21,9 +21,9 @@ class MachineImporter extends Importer
return [
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Machine')
->exampleHeader('Machine Name')
->example(['1600251'])
->label('Machine')
->label('Machine Name')
->rules(['required']),
ImportColumn::make('work_center')
->requiredMapping()
@@ -41,16 +41,16 @@ class MachineImporter extends Importer
ImportColumn::make('line')
->requiredMapping()
->relationship(resolveUsing: 'name')
->exampleHeader('Line')
->exampleHeader('Line Name')
->example(['4 inch pump line'])
->label('Line')
->label('Line Name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->relationship(resolveUsing: 'name')
->exampleHeader('Plant')
->example(['Ransar Industries-I'])
->label('Plant')
->relationship(resolveUsing: 'code')
->exampleHeader('Plant Code')
->example(['1000'])
->label('Plant Code')
->rules(['required']),
];
}
@@ -58,74 +58,74 @@ class MachineImporter extends Importer
public function resolveRecord(): ?Machine
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$line = null;
$machine = $this->data['name'];
$workCenter = $this->data['work_center'];
$groupWorkCenter = WorkGroupMaster::where('name', $this->data['workGroupMaster'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found!";
}
else {
$groupWorkCenter = WorkGroupMaster::where('name', $this->data['workGroupMaster'])->where('plant_id', $plant->id)->first();
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
if ($line) {
$grpWrkCnr = $line->no_of_operation;
if (!$grpWrkCnr || $grpWrkCnr < 1)//Str::length($grpWrkCnr) < 1)
{
$warnMsg[] = "Group work center line not found!";
}
else if (!$groupWorkCenter) {
$warnMsg[] = "Group work center not found!";
}
else {
$dupMachine = Machine::where('plant_id', $plant->id)->where('work_center', '!=', $workCenter)->where('name', $machine)->first();
if ($dupMachine) {
$warnMsg[] = "Duplicate machine name found!";
}
else {
$isValidGroupWork = false;
for ($i = 1; $i <= $line->no_of_operation; $i++) {
$column = "work_group{$i}_id";
if (!empty($line->$column)) {
if ($line->$column == $groupWorkCenter->id) {
$isValidGroupWork = true;
break;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found!';
} else {
$groupWorkCenter = WorkGroupMaster::where('name', $this->data['workGroupMaster'])->where('plant_id', $plant->id)->first();
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
if ($line) {
$grpWrkCnr = $line->no_of_operation;
if (! $grpWrkCnr || $grpWrkCnr < 1) {// Str::length($grpWrkCnr) < 1)
$warnMsg[] = 'Group work center line not found!';
} elseif (! $groupWorkCenter) {
$warnMsg[] = 'Group work center not found!';
} else {
$dupMachine = Machine::where('plant_id', $plant->id)->where('work_center', '!=', $workCenter)->where('name', $machine)->first();
if ($dupMachine) {
$warnMsg[] = 'Duplicate machine name found!';
} else {
$isValidGroupWork = false;
for ($i = 1; $i <= $line->no_of_operation; $i++) {
$column = "work_group{$i}_id";
if (! empty($line->$column)) {
if ($groupWorkCenter->id == $line->$column) {
$isValidGroupWork = true;
break;
}
}
}
}
if (!$isValidGroupWork) {
$warnMsg[] = "Group work center does not match with line!";
if (! $isValidGroupWork) {
$warnMsg[] = 'Group work center does not match with line!';
}
}
}
} else {
$warnMsg[] = 'Line not found!';
}
}
else
{
$warnMsg[] = "Line not found!";
}
}
if (Str::length($machine) <= 0) {
$warnMsg[] = "Machine name not found!";
$warnMsg[] = 'Machine name not found!';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
Machine::updateOrCreate(
[
'plant_id' => $plant->id,
'work_center' => $workCenter
'work_center' => $workCenter,
],
[
'line_id' => $line->id,
'name' => $machine,
'work_group_master_id' => $groupWorkCenter->id
'work_group_master_id' => $groupWorkCenter->id,
]
);
return null;
// // return Machine::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
@@ -137,10 +137,10 @@ class MachineImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your machine import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your machine 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -15,18 +15,18 @@ class MfmMeterImporter extends Importer
{
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->requiredMapping()
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('Device Name')
->requiredMapping()
->exampleHeader('Device Name')
->example('REG001')
->label('Device Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('sequence')
->requiredMapping()
@@ -56,15 +56,15 @@ class MfmMeterImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new MfmMeter();
return new MfmMeter;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your mfm meter import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your mfm meter 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -16,24 +16,24 @@ class MfmParameterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('deviceName')
->requiredMapping()
->exampleHeader('Device Name')
->example('REG001')
->label('Device Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('mfmMeter')
->requiredMapping()
->exampleHeader('Mfm Meter Sequence')
->example('1')
->label('Mfm Meter Sequence')
->relationship(resolveUsing:'sequence')
->relationship(resolveUsing: 'sequence')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
@@ -82,15 +82,15 @@ class MfmParameterImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new MfmParameter();
return new MfmParameter;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your mfm parameter import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your mfm parameter 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -24,7 +24,7 @@ class MotorTestingMasterImporter extends Importer
ImportColumn::make('item')
->requiredMapping()
->exampleHeader('Item Code')
->example(['123456','123457','123458'])
->example(['123456', '123457', '123458'])
->label('Item Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
@@ -38,181 +38,181 @@ class MotorTestingMasterImporter extends Importer
->requiredMapping()
->boolean()
->exampleHeader('ISI Model')
->example(['Y','N','Y'])
->example(['Y', 'N', 'Y'])
->label('ISI Model')
->rules(['boolean']),
ImportColumn::make('phase')
->requiredMapping()
->exampleHeader('Phase')
->example(['Single','Three','Single'])
->example(['Single', 'Three', 'Single'])
->label('Phase')
->rules(['required']),
ImportColumn::make('hp')
->requiredMapping()
->exampleHeader('HP')
->example(['5','10','5'])
->example(['5', '10', '5'])
->label('HP')
->rules(['required']),
ImportColumn::make('kw')
->requiredMapping()
->exampleHeader('KW')
->example(['5','7.5','5'])
->example(['5', '7.5', '5'])
->label('KW')
->rules(['required']),
ImportColumn::make('volt')
->requiredMapping()
->exampleHeader('Volt')
->example(['230','380','230'])
->example(['230', '380', '230'])
->label('Volt')
->rules(['required']),
ImportColumn::make('current')
->requiredMapping()
->exampleHeader('Current')
->example(['7','21.8','7'])
->example(['7', '21.8', '7'])
->label('Current')
->rules(['required']),
ImportColumn::make('rpm')
->requiredMapping()
->exampleHeader('RPM')
->example(['2500','3420','2500'])
->example(['2500', '3420', '2500'])
->label('RPM')
->rules(['required']),
ImportColumn::make('torque')
->requiredMapping()
->exampleHeader('Torque')
->example(['0.5','1.25','0.5'])
->example(['0.5', '1.25', '0.5'])
->label('Torque')
->rules(['required']),
ImportColumn::make('frequency')
->requiredMapping()
->exampleHeader('Frequency')
->label('Frequency')
->example(['50','60','50'])
->example(['50', '60', '50'])
->rules(['required']),
ImportColumn::make('connection')
->requiredMapping()
->exampleHeader('Connection')
->label('Connection')
->example(['Star','Star-Delta','Delta'])
->example(['Star', 'Star-Delta', 'Delta'])
->rules(['required']),
ImportColumn::make('ins_res_limit')
->requiredMapping()
->exampleHeader('Insulation Resistance Limit')
->label('Insulation Resistance Limit')
->example(['1000','2','1000'])
->example(['1000', '2', '1000'])
->rules(['required']),
ImportColumn::make('ins_res_type')
->requiredMapping()
->exampleHeader('Insulation Resistance Type')
->label('Insulation Resistance Type')
->example(['O','G','O'])
->example(['O', 'G', 'O'])
->rules(['required']),
ImportColumn::make('routine_test_time')
->requiredMapping()
->exampleHeader('Routine Test Time')
->label('Routine Test Time')
->example(['00:40:00','00:40:00','00:40:00'])
->example(['00:40:00', '00:40:00', '00:40:00'])
->rules(['required']),
ImportColumn::make('res_ry_ll')
->requiredMapping()
->exampleHeader('Resistance RY LL')
->label('Resistance RY LL')
->example(['0.05','0.05','0.05'])
->example(['0.05', '0.05', '0.05'])
->rules(['required']),
ImportColumn::make('res_ry_ul')
->requiredMapping()
->exampleHeader('Resistance RY UL')
->label('Resistance RY UL')
->example(['99','99','99'])
->example(['99', '99', '99'])
->rules(['required']),
ImportColumn::make('res_yb_ll')
->requiredMapping()
->exampleHeader('Resistance YB LL')
->label('Resistance YB LL')
->example(['0.05','0.05','0.05'])
->example(['0.05', '0.05', '0.05'])
->rules(['required']),
ImportColumn::make('res_yb_ul')
->requiredMapping()
->exampleHeader('Resistance YB UL')
->label('Resistance YB UL')
->example(['99','99','99'])
->example(['99', '99', '99'])
->rules(['required']),
ImportColumn::make('res_br_ll')
->requiredMapping()
->exampleHeader('Resistance BR LL')
->label('Resistance BR LL')
->example(['0.05','0.05','0.05'])
->example(['0.05', '0.05', '0.05'])
->rules(['required']),
ImportColumn::make('res_br_ul')
->requiredMapping()
->exampleHeader('Resistance BR UL')
->label('Resistance BR UL')
->example(['99','99','99'])
->example(['99', '99', '99'])
->rules(['required']),
ImportColumn::make('lock_volt_limit')
->requiredMapping()
->exampleHeader('Lock Volt Limit')
->label('Lock Volt Limit')
->example(['80','100','80'])
->example(['80', '100', '80'])
->rules(['required']),
ImportColumn::make('leak_cur_limit')
->requiredMapping()
->exampleHeader('Leak Current Limit')
->label('Leak Current Limit')
->example(['50','50','50'])
->example(['50', '50', '50'])
->rules(['required']),
ImportColumn::make('lock_cur_ll')
->requiredMapping()
->exampleHeader('Lock Current LL')
->label('Lock Current LL')
->example(['10','12.5','10'])
->example(['10', '12.5', '10'])
->rules(['required']),
ImportColumn::make('lock_cur_ul')
->requiredMapping()
->exampleHeader('Lock Current UL')
->label('Lock Current UL')
->example(['15','14.6','15'])
->example(['15', '14.6', '15'])
->rules(['required']),
ImportColumn::make('noload_cur_ll')
->requiredMapping()
->exampleHeader('No Load Current LL')
->label('No Load Current LL')
->example(['3','5.9','3'])
->example(['3', '5.9', '3'])
->rules(['required']),
ImportColumn::make('noload_cur_ul')
->requiredMapping()
->exampleHeader('No Load Current UL')
->label('No Load Current UL')
->example(['15','6.9','15'])
->example(['15', '6.9', '15'])
->rules(['required']),
ImportColumn::make('noload_pow_ll')
->requiredMapping()
->exampleHeader('No Load Power LL')
->label('No Load Power LL')
->example(['250','850','250'])
->example(['250', '850', '250'])
->rules(['required']),
ImportColumn::make('noload_pow_ul')
->requiredMapping()
->exampleHeader('No Load Power UL')
->label('No Load Power UL')
->example(['500','1200','500'])
->example(['500', '1200', '500'])
->rules(['required']),
ImportColumn::make('noload_spd_ll')
->requiredMapping()
->exampleHeader('No Load Speed LL')
->label('No Load Speed LL')
->example(['2000','2500','2000'])
->example(['2000', '2500', '2000'])
->rules(['required']),
ImportColumn::make('noload_spd_ul')
->requiredMapping()
->exampleHeader('No Load Speed UL')
->label('No Load Speed UL')
->example(['4000','3500','4000'])
->example(['4000', '3500', '4000'])
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant')
->example(['1000','1010','1020'])
->example(['1000', '1010', '1020'])
->label('Plant')
->relationship(resolveUsing: 'code')
->rules(['required']),
@@ -237,7 +237,7 @@ class MotorTestingMasterImporter extends Importer
$plantCod = trim($this->data['plant']);
$iCode = trim($this->data['item']);
$sCode = trim($this->data['subassembly_code']);
$isiModel = (trim($this->data['isi_model']) == "1") ? true : false;
$isiModel = (trim($this->data['isi_model']) == '1') ? true : false;
$phase = trim($this->data['phase']);
$kw = trim($this->data['kw']);
$hp = trim($this->data['hp']);
@@ -270,40 +270,25 @@ class MotorTestingMasterImporter extends Importer
$updatedBy = trim($this->data['updated_by']);
$plant = null;
if (Str::length($plantCod) < 4 || !is_numeric($plantCod) || !preg_match('/^[1-9]\d{3,}$/', $plantCod))
{
$warnMsg[] = "Invalid plant code found";
}
else if (Str::length($iCode) < 6 || !ctype_alnum($iCode))
{
$warnMsg[] = "Invalid item code found";
}
else if (Str::length($sCode) < 6 || !ctype_alnum($sCode))
{
$warnMsg[] = "Invalid sub-assembly code found";
}
else
{
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} elseif (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} elseif (Str::length($sCode) < 6 || ! ctype_alnum($sCode)) {
$warnMsg[] = 'Invalid sub-assembly code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
$codeExist = Item::where('code', $iCode)->first();
if ($plant)
{
if ($plant) {
$iCode = Item::where('code', $iCode)->where('plant_id', $plant->id)->first();
}
if (!$plant)
{
$warnMsg[] = "Plant not found";
}
else if (!$codeExist)
{
$warnMsg[] = "Item code not found";
}
else if (!$iCode)
{
$warnMsg[] = "Item code not found for choosed plant";
}
else
{
if (! $plant) {
$warnMsg[] = 'Plant not found';
} elseif (! $codeExist) {
$warnMsg[] = 'Item code not found';
} elseif (! $iCode) {
$warnMsg[] = 'Item code not found for choosed plant';
} else {
// if (Str::length($isiModel) <= 0 || $isiModel == "0" || $isiModel == "1") {
// $warnMsg[] = "Invalid ISI Model found";
// }
@@ -311,125 +296,123 @@ class MotorTestingMasterImporter extends Importer
// {
// $isiModel = ($isiModel == "1");
// }
if (Str::length($phase) <= 0 || ($phase != "Single" && $phase != "Three")) {//!is_string($phase) ||
$warnMsg[] = "Invalid phase found";
if (Str::length($phase) <= 0 || ($phase != 'Single' && $phase != 'Three')) {// !is_string($phase) ||
$warnMsg[] = 'Invalid phase found';
}
if (Str::length($hp) <= 0 || !is_numeric($hp)) {
$warnMsg[] = "Invalid HP found";
if (Str::length($hp) <= 0 || ! is_numeric($hp)) {
$warnMsg[] = 'Invalid HP found';
}
if (Str::length($kw) <= 0 || !is_numeric($kw)) {
$warnMsg[] = "Invalid KW found";
if (Str::length($kw) <= 0 || ! is_numeric($kw)) {
$warnMsg[] = 'Invalid KW found';
}
if (Str::length($volt) <= 0 || !is_numeric($volt)) {
$warnMsg[] = "Invalid volt found";
if (Str::length($volt) <= 0 || ! is_numeric($volt)) {
$warnMsg[] = 'Invalid volt found';
}
if (Str::length($current) <= 0 || !is_numeric($current)) {
$warnMsg[] = "Invalid current found";
if (Str::length($current) <= 0 || ! is_numeric($current)) {
$warnMsg[] = 'Invalid current found';
}
if (Str::length($rpm) <= 0 || !is_numeric($rpm)) {
$warnMsg[] = "Invalid RPM found";
if (Str::length($rpm) <= 0 || ! is_numeric($rpm)) {
$warnMsg[] = 'Invalid RPM found';
}
if (Str::length($torque) <= 0 || !is_numeric($torque)) {
$warnMsg[] = "Invalid torque found";
if (Str::length($torque) <= 0 || ! is_numeric($torque)) {
$warnMsg[] = 'Invalid torque found';
}
if (Str::length($frequency) <= 0 || !is_numeric($frequency)) {
$warnMsg[] = "Invalid frequency found";
if (Str::length($frequency) <= 0 || ! is_numeric($frequency)) {
$warnMsg[] = 'Invalid frequency found';
}
if (Str::length($connection) <= 0 || ($connection != "Star-Delta" && $connection != "Star" && $connection != "Delta")) {
$warnMsg[] = "Invalid connection found";
if (Str::length($connection) <= 0 || ($connection != 'Star-Delta' && $connection != 'Star' && $connection != 'Delta')) {
$warnMsg[] = 'Invalid connection found';
}
if (Str::length($insResLimit) <= 0 || !is_numeric($insResLimit)) {
$warnMsg[] = "Invalid insulation resistance limit found";
if (Str::length($insResLimit) <= 0 || ! is_numeric($insResLimit)) {
$warnMsg[] = 'Invalid insulation resistance limit found';
}
if (Str::length($insResType) <= 0 || ($insResType != "O" && $insResType != "M" && $insResType != "G")) {
$warnMsg[] = "Invalid insulation resistance type found";
if (Str::length($insResType) <= 0 || ($insResType != 'O' && $insResType != 'M' && $insResType != 'G')) {
$warnMsg[] = 'Invalid insulation resistance type found';
}
if (Str::length($routineTestTime) <= 0 || !isValidTimeFormat($routineTestTime)) {
$warnMsg[] = "Invalid routine test time found";
if (Str::length($routineTestTime) <= 0 || ! isValidTimeFormat($routineTestTime)) {
$warnMsg[] = 'Invalid routine test time found';
}
if (Str::length($resRyLl) <= 0 || !is_numeric($resRyLl)) {
$warnMsg[] = "Invalid resistance RY lower limit found";
if (Str::length($resRyLl) <= 0 || ! is_numeric($resRyLl)) {
$warnMsg[] = 'Invalid resistance RY lower limit found';
}
if (Str::length($resRyUl) <= 0 || !is_numeric($resRyUl)) {
$warnMsg[] = "Invalid resistance RY upper limit found";
if (Str::length($resRyUl) <= 0 || ! is_numeric($resRyUl)) {
$warnMsg[] = 'Invalid resistance RY upper limit found';
}
if (Str::length($resYbLl) <= 0 || !is_numeric($resYbLl)) {
$warnMsg[] = "Invalid resistance YB lower limit found";
if (Str::length($resYbLl) <= 0 || ! is_numeric($resYbLl)) {
$warnMsg[] = 'Invalid resistance YB lower limit found';
}
if (Str::length($resYbUl) <= 0 || !is_numeric($resYbUl)) {
$warnMsg[] = "Invalid resistance YB upper limit found";
if (Str::length($resYbUl) <= 0 || ! is_numeric($resYbUl)) {
$warnMsg[] = 'Invalid resistance YB upper limit found';
}
if (Str::length($resBrLl) <= 0 || !is_numeric($resBrLl)) {
$warnMsg[] = "Invalid resistance BR lower limit found";
if (Str::length($resBrLl) <= 0 || ! is_numeric($resBrLl)) {
$warnMsg[] = 'Invalid resistance BR lower limit found';
}
if (Str::length($resBrUl) <= 0 || !is_numeric($resBrUl)) {
$warnMsg[] = "Invalid resistance BR upper limit found";
if (Str::length($resBrUl) <= 0 || ! is_numeric($resBrUl)) {
$warnMsg[] = 'Invalid resistance BR upper limit found';
}
if (Str::length($lockVoltLimit) <= 0 || !is_numeric($lockVoltLimit)) {
$warnMsg[] = "Invalid locked volt limit found";
if (Str::length($lockVoltLimit) <= 0 || ! is_numeric($lockVoltLimit)) {
$warnMsg[] = 'Invalid locked volt limit found';
}
if (Str::length($leakCurLimit) <= 0 || !is_numeric($leakCurLimit)) {
$warnMsg[] = "Invalid leakage current limit found";
if (Str::length($leakCurLimit) <= 0 || ! is_numeric($leakCurLimit)) {
$warnMsg[] = 'Invalid leakage current limit found';
}
if (Str::length($lockCurLl) <= 0 || !is_numeric($lockCurLl)) {
$warnMsg[] = "Invalid locked current lower limit found";
if (Str::length($lockCurLl) <= 0 || ! is_numeric($lockCurLl)) {
$warnMsg[] = 'Invalid locked current lower limit found';
}
if (Str::length($lockCurUl) <= 0 || !is_numeric($lockCurUl)) {
$warnMsg[] = "Invalid locked current upper limit found";
if (Str::length($lockCurUl) <= 0 || ! is_numeric($lockCurUl)) {
$warnMsg[] = 'Invalid locked current upper limit found';
}
if (Str::length($noloadCurLl) <= 0 || !is_numeric($noloadCurLl)) {
$warnMsg[] = "Invalid no load current lower limit found";
if (Str::length($noloadCurLl) <= 0 || ! is_numeric($noloadCurLl)) {
$warnMsg[] = 'Invalid no load current lower limit found';
}
if (Str::length($noloadCurUl) <= 0 || !is_numeric($noloadCurUl)) {
$warnMsg[] = "Invalid no load current upper limit found";
if (Str::length($noloadCurUl) <= 0 || ! is_numeric($noloadCurUl)) {
$warnMsg[] = 'Invalid no load current upper limit found';
}
if (Str::length($noloadPowLl) <= 0 || !is_numeric($noloadPowLl)) {
$warnMsg[] = "Invalid no load power lower limit found";
if (Str::length($noloadPowLl) <= 0 || ! is_numeric($noloadPowLl)) {
$warnMsg[] = 'Invalid no load power lower limit found';
}
if (Str::length($noloadPowUl) <= 0 || !is_numeric($noloadPowUl)) {
$warnMsg[] = "Invalid no load power upper limit found";
if (Str::length($noloadPowUl) <= 0 || ! is_numeric($noloadPowUl)) {
$warnMsg[] = 'Invalid no load power upper limit found';
}
if (Str::length($noloadSpdLl) <= 0 || !is_numeric($noloadSpdLl)) {
$warnMsg[] = "Invalid no load speed lower limit found";
if (Str::length($noloadSpdLl) <= 0 || ! is_numeric($noloadSpdLl)) {
$warnMsg[] = 'Invalid no load speed lower limit found';
}
if (Str::length($noloadSpdUl) <= 0 || !is_numeric($noloadSpdUl)) {
$warnMsg[] = "Invalid no load speed upper limit found";
if (Str::length($noloadSpdUl) <= 0 || ! is_numeric($noloadSpdUl)) {
$warnMsg[] = 'Invalid no load speed upper limit found';
}
$oldCode = MotorTestingMaster::where('item_id', $iCode->id)->where('plant_id', $plant->id)->first();
if ($oldCode) {
$created = $oldCode->created_by ? User::where('name', $oldCode->created_by)->first() : null;
if (!$created) {
$warnMsg[] = "Created by not found on update";
if (! $created) {
$warnMsg[] = 'Created by not found on update';
}
$updated = User::where('name', $updatedBy)->first();
if (!$updated) {
$warnMsg[] = "Updated by not found on update";
if (! $updated) {
$warnMsg[] = 'Updated by not found on update';
}
}
else
{
} else {
$created = User::where('name', $createdBy)->first();
if (!$created) {
$warnMsg[] = "Created by not found";
if (! $created) {
$warnMsg[] = 'Created by not found';
}
$updated = User::where('name', $updatedBy)->first();
if (!$updated) {
$warnMsg[] = "Updated by not found";
if (! $updated) {
$warnMsg[] = 'Updated by not found';
}
}
}
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
MotorTestingMaster::updateOrCreate([
'plant_id' => $plant->id,
'item_id' => $iCode->id
],
'item_id' => $iCode->id,
],
[
'subassembly_code' => $sCode,
'isi_model' => $isiModel,
@@ -465,6 +448,7 @@ class MotorTestingMasterImporter extends Importer
'updated_by' => $updated->name,
]
);
return null;
// // return MotorTestingMaster::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
@@ -476,22 +460,24 @@ class MotorTestingMasterImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your motor testing master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your motor testing master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;
}
}
function isValidTimeFormat($time) {
function isValidTimeFormat($time)
{
// If time starts with a single digit hour without leading zero, pad it
if (preg_match('/^\d(:\d{2}:\d{2})$/', $time, $matches)) {
$time = '0' . $time;
$time = '0'.$time;
}
$dateTime = DateTime::createFromFormat('H:i:s', $time);
return $dateTime && $dateTime->format('H:i:s') === $time;
}

View File

@@ -12,7 +12,6 @@ use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Str;
class PalletValidationImporter extends Importer
{
protected static ?string $model = PalletValidation::class;
@@ -122,49 +121,45 @@ class PalletValidationImporter extends Importer
$scannedBy = $this->data['scanned_by'];
$updatedBy = $this->data['updated_by'];
if (Str::length($plantCod) < 4 || !is_numeric($plantCod) || !preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = "Invalid plant code found";
}
else
{
$plant = Plant::where('code', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else
{
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || !ctype_alnum($serialNo)) {
$warnMsg[] = "Invalid serial number found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || ! ctype_alnum($serialNo)) {
$warnMsg[] = 'Invalid serial number found';
}
if (Str::length($palletNo) > 0 && Str::length($palletNo) < 10) {
$warnMsg[] = "Invalid pallet number found";
$warnMsg[] = 'Invalid pallet number found';
}
if (Str::length($palletStat) > 0 && $palletStat != 'Completed') {
$warnMsg[] = "Invalid pallet status found";
$warnMsg[] = 'Invalid pallet status found';
}
if (Str::length($locatorNo) > 0 && Str::length($locatorNo) < 7) {
$warnMsg[] = "Invalid locator number found";
$warnMsg[] = 'Invalid locator number found';
}
if (Str::length($palletNo) <= 0 && Str::length($locatorNo) <= 0) {
$warnMsg[] = "Pallet and locator number found";
$warnMsg[] = 'Pallet and locator number found';
}
if (Str::length($locatorQty) < 0 || !is_numeric($locatorQty) || $locatorQty < 0 || $locatorQty > 2) {
$warnMsg[] = "Invalid locator quantity found";
if (Str::length($locatorQty) < 0 || ! is_numeric($locatorQty) || $locatorQty < 0 || $locatorQty > 2) {
$warnMsg[] = 'Invalid locator quantity found';
}
$created = User::where('name', $createdBy)->first();
if (!$created) {
$warnMsg[] = "Created by not found";
if (! $created) {
$warnMsg[] = 'Created by not found';
}
$scanned = User::where('name', $scannedBy)->first();
if (!$scanned) {
$warnMsg[] = "Scanned by not found";
if (! $scanned) {
$warnMsg[] = 'Scanned by not found';
}
$updated = User::where('name', $updatedBy)->first();
if (!$updated) {
$warnMsg[] = "Updated by not found";
if (! $updated) {
$warnMsg[] = 'Updated by not found';
}
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
foreach ($formats as $format) {
try {
@@ -176,7 +171,7 @@ class PalletValidationImporter extends Importer
}
}
if (!isset($cDateTime)) {
if (! isset($cDateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -191,13 +186,12 @@ class PalletValidationImporter extends Importer
}
}
if (!isset($sDateTime)) {
if (! isset($sDateTime)) {
$warnMsg[] = "Invalid 'Scanned DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
foreach ($formats as $format) {
try
{
try {
$uDateTime = Carbon::createFromFormat($format, $updatedAt);
break;
} catch (\Exception $e) {
@@ -206,11 +200,9 @@ class PalletValidationImporter extends Importer
}
}
if (!isset($uDateTime)) {
if (! isset($uDateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else
{
} else {
if (isset($cDateTime) && isset($uDateTime)) {
if ($cDateTime->greaterThan($uDateTime)) {
$warnMsg[] = "'Created DataTime' is greater than 'Updated DateTime'.";
@@ -224,14 +216,14 @@ class PalletValidationImporter extends Importer
// $warnMsg[] = "Invalid locator quantity found";
// }
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
PalletValidation::updateOrCreate(
[
'plant_id' => $plant->id,
'serial_number' => $serialNo
'serial_number' => $serialNo,
],
[
'pallet_number' => $palletNo,
@@ -243,9 +235,10 @@ class PalletValidationImporter extends Importer
'updated_at' => $uDateTime->format('Y-m-d H:i:s'),
'created_by' => $createdBy,
'scanned_by' => $scannedBy,
'updated_by' => $updatedBy
'updated_by' => $updatedBy,
]
);
return null;
// // return PalletValidation::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
@@ -257,10 +250,10 @@ class PalletValidationImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your pallet validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your pallet 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -23,7 +23,7 @@ class PlantImporter extends Importer
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->rules(['required']), //, 'integer'
->rules(['required']), // , 'integer'
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Plant Name')
@@ -41,7 +41,7 @@ class PlantImporter extends Importer
->exampleHeader('Company Name')
->example('C.R.I. Pumps Private Limited')
->label('Company Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
];
}
@@ -50,41 +50,40 @@ class PlantImporter extends Importer
{
$warnMsg = [];
$company = Company::where('name', $this->data['company'])->first();
if (!$company) {
$warnMsg[] = "Company name not found";
if (! $company) {
$warnMsg[] = 'Company name not found';
}
if (Str::length($this->data['name']) < 0) {
$warnMsg[] = "Plant name not found";
$warnMsg[] = 'Plant name not found';
}
if (Str::length($this->data['code']) < 4 || !is_numeric($this->data['code']) || !preg_match('/^[1-9]\d{3,}$/', $this->data['code'])) {
$warnMsg[] = "Invalid plant code found";
if (Str::length($this->data['code']) < 4 || ! is_numeric($this->data['code']) || ! preg_match('/^[1-9]\d{3,}$/', $this->data['code'])) {
$warnMsg[] = 'Invalid plant code found';
}
if (Str::length($this->data['address']) < 3) {
$warnMsg[] = "Invalid address found";
$warnMsg[] = 'Invalid address found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
$plantCN = Plant::where('code', $this->data['code'])->where('name', $this->data['name'])->first();
if (!$plantCN) {
if (! $plantCN) {
$plantCode = Plant::where('code', $this->data['code'])->first();
$plantName = Plant::where('name', $this->data['name'])->first();
if ($plantName) {
throw new RowImportFailedException("Duplicate plant name found");
}
else if ($plantCode) {
throw new RowImportFailedException("Duplicate plant code found");
throw new RowImportFailedException('Duplicate plant name found');
} elseif ($plantCode) {
throw new RowImportFailedException('Duplicate plant code found');
}
}
return Plant::updateOrCreate([
'code' => $this->data['code'],
'name' => $this->data['name'],
],
'code' => $this->data['code'],
'name' => $this->data['name'],
],
[
'address' => $this->data['address'],
'company_id' => $company->id
'company_id' => $company->id,
]
);
// return Plant::firstOrNew([
@@ -97,10 +96,10 @@ class PlantImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your plant import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your plant 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -10,6 +10,7 @@ use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Str;
class ProcessOrderImporter extends Importer
@@ -38,41 +39,57 @@ class ProcessOrderImporter extends Importer
->example('202500123456')
->label('PROCESS ORDER')
->rules(['required']),
ImportColumn::make('created_by')
->exampleHeader('CREATED BY')
->example('RAW01234')
->label('CREATED BY')
ImportColumn::make('order_quantity')
->exampleHeader('ORDER QUANTITY')
->example('100')
->label('ORDER QUANTITY')
->rules(['required']),
// ImportColumn::make('created_by')
// ->exampleHeader('CREATED BY')
// ->example('RAW01234')
// ->label('CREATED BY')
// ->rules(['required']),
];
}
public function resolveRecord(): ?ProcessOrder
{
$warnMsg = [];
$plant = Plant::where('code', $this->data['plant'])->first();
$itemCode = Item::where('code', $this->data['item'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$iCode = trim($this->data['item']);
$processOrder = trim($this->data['process_order'] ?? '');
$user = Filament::auth()->user();
$operatorName = $user->name;
if (! $plant) {
$warnMsg[] = 'Plant not found';
} elseif (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} elseif (! $itemCode) {
$warnMsg[] = 'Item Code not found';
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
}
}
$processOrder = trim($this->data['process_order'] ?? '');
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} else {
$itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) {
$warnMsg[] = 'Item Code not found';
}
}
if ($processOrder == '') {
$warnMsg[] = 'Process Order cannot be empty';
}
$user = User::where('name', $this->data['created_by'])->first();
if (! $user) {
$warnMsg[] = 'User not found';
}
// $user = User::where('name', $this->data['created_by'])->first();
// if (! $user) {
// $warnMsg[] = 'User not found';
// }
if ($plant && $processOrder != '') {
if ($plant && $itemCode && $processOrder != '') {
$existingOrder = ProcessOrder::where('plant_id', $plant->id)
->where('process_order', $processOrder)
@@ -94,7 +111,7 @@ class ProcessOrderImporter extends Importer
'coil_number' => '0',
'order_quantity' => 0,
'received_quantity' => 0,
'created_by' => $user->name,
'created_by' => $operatorName,
]);
// return new ProcessOrder();

View File

@@ -9,12 +9,12 @@ use App\Models\Plant;
use App\Models\ProductCharacteristicsMaster;
use App\Models\User;
use App\Models\WorkGroupMaster;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Str;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Illuminate\Support\Facades\Auth;
use Str;
class ProductCharacteristicsMasterImporter extends Importer
{
@@ -25,38 +25,38 @@ class ProductCharacteristicsMasterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->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')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('line')
->requiredMapping()
->exampleHeader('Line')
->exampleHeader('Line Name')
->example('4 inch pump line')
->label('Line')
->relationship(resolveUsing:'name')
->label('Line Name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('work_group_master_id')
->label('Group Work Center')
->requiredMapping()
->exampleHeader('Group Work Center')
->example('RMGCGABC')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('machine')
->requiredMapping()
->exampleHeader('Work Center')
->example('RMGCE001')
->label('Work Center')
->relationship(resolveUsing:'work_center')
->relationship(resolveUsing: 'work_center')
->rules(['required']),
ImportColumn::make('characteristics_type')
->exampleHeader('Characteristics Type')
@@ -64,9 +64,9 @@ class ProductCharacteristicsMasterImporter extends Importer
->label('Characteristics Type')
->rules(['required']),
ImportColumn::make('name')
->exampleHeader('Name')
->exampleHeader('Characteristics Name')
->example('Body')
->label('Name')
->label('Characteristics Name')
->rules(['required']),
ImportColumn::make('inspection_type')
->exampleHeader('Inspection Type')
@@ -93,7 +93,7 @@ class ProductCharacteristicsMasterImporter extends Importer
->exampleHeader('Created By')
->example('Admin')
->label('Created By'),
//ImportColumn::make('updated_by'),
// ImportColumn::make('updated_by'),
];
}
@@ -102,132 +102,127 @@ class ProductCharacteristicsMasterImporter extends Importer
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
$plantCod = $this->data['plant'];
$plant = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$itemExists = Item::where('code', $this->data['item'])->first();
if (! $itemExists) {
$warnMsg[] = 'Item not found';
}
$itemExists = Item::where('code', $this->data['item'])->first();
if (!$itemExists) {
$warnMsg[] = "Item not found";
}
$itemAgainstPlant = Item::where('code', $this->data['item'])
->where('plant_id', $plant->id)
->first();
if (! $itemAgainstPlant) {
$warnMsg[] = 'Item code not found for the given plant';
} else {
$itemId = $itemAgainstPlant->id;
}
$itemAgainstPlant = Item::where('code', $this->data['item'])
->where('plant_id', $plant->id)
->first();
if (!$itemAgainstPlant) {
$warnMsg[] = "Item code not found for the given plant";
}
else {
$itemId = $itemAgainstPlant->id;
}
$lineExists = Line::where('name', $this->data['line'])->first();
if (! $lineExists) {
$warnMsg[] = 'Line not found';
}
$lineExists = Line::where('name', $this->data['line'])->first();
if (!$lineExists) {
$warnMsg[] = "Line not found";
}
$lineAgainstPlant = Line::where('name', $this->data['line'])
->where('plant_id', $plant->id)
->first();
$lineAgainstPlant = Line::where('name', $this->data['line'])
->where('plant_id', $plant->id)
->first();
if (! $lineAgainstPlant) {
$warnMsg[] = 'Line not found for the given plant';
} else {
$LineId = $lineAgainstPlant->id;
}
if (!$lineAgainstPlant) {
$warnMsg[] = "Line not found for the given plant";
}
else
{
$LineId = $lineAgainstPlant->id;
}
$WorkgroupMaster = WorkGroupMaster::where('name', $this->data['work_group_master_id'])->where('plant_id', $plant->id)->first();
if (! $WorkgroupMaster) {
$warnMsg[] = 'Work Group Master value not found';
} else {
$WorkgroupMaster = WorkGroupMaster::where('name', $this->data['work_group_master_id'])->where('plant_id', $plant->id)->first();
if (!$WorkgroupMaster) {
$warnMsg[] = "Work Group Master value not found";
}
else {
$workGroupMasterId = $WorkgroupMaster->id;
$workGroupMasterId = $WorkgroupMaster->id;
// 2. Now check if this WorkGroupMaster id exists in ANY of the 10 columns
$existsInLine = Line::where('plant_id', $plant->id)
->where(function ($q) use ($workGroupMasterId) {
for ($i = 1; $i <= 10; $i++) {
$q->orWhere("work_group{$i}_id", $workGroupMasterId);
}
})
->exists();
// 2. Now check if this WorkGroupMaster id exists in ANY of the 10 columns
$existsInLine = Line::where('plant_id', $plant->id)
->where(function ($q) use ($workGroupMasterId) {
for ($i = 1; $i <= 10; $i++) {
$q->orWhere("work_group{$i}_id", $workGroupMasterId);
if (! $existsInLine) {
$warnMsg[] = "Work Group Master '{$WorkgroupMaster->name}' is not mapped to any line in this plant";
} else {
$workGroupMasterId = $WorkgroupMaster->id;
}
})
->exists();
}
if (!$existsInLine) {
$warnMsg[] = "Work Group Master '{$WorkgroupMaster->name}' is not mapped to any line in this plant";
}
else {
$workGroupMasterId = $WorkgroupMaster->id;
$machine = Machine::where('work_center', $this->data['machine'])->first();
if (! $machine) {
$warnMsg[] = 'Work Center not found';
} else {
$machineId = $machine->id;
}
$machineAgainstPlant = Machine::where('work_center', $this->data['machine'])
->where('plant_id', $plant->id)
->first();
if (! $machineAgainstPlant) {
$warnMsg[] = 'Work Center not found for the given plant';
} else {
$machineId = $machineAgainstPlant->id;
}
$user = User::where('name', $this->data['created_by'])->first();
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
if (($this->data['inspection_type'] ?? null) == 'Value') {
$upper = $this->data['upper'] ?? null;
$lower = $this->data['lower'] ?? null;
$middle = $this->data['middle'] ?? null;
if (is_null($upper) || is_null($lower) || is_null($middle)) {
$warnMsg[] = "For 'Value' inspection type, Upper, Lower, and Middle values are required.";
} elseif (! is_numeric($upper) || ! is_numeric($lower) || ! is_numeric($middle)) {
$warnMsg[] = 'Upper, Lower, and Middle values must be numeric.';
} elseif (! ($lower <= $middle && $middle <= $upper)) {
$warnMsg[] = "For 'Value' inspection type, values must satisfy: Lower ≤ Middle ≤ Upper.";
}
}
}
}
$machine = Machine::where('work_center', $this->data['machine'])->first();
if (!$machine) {
$warnMsg[] = "Work Center not found";
}
else {
$machineId = $machine->id;
}
$machineAgainstPlant = Machine::where('work_center', $this->data['machine'])
->where('plant_id', $plant->id)
->first();
if (!$machineAgainstPlant) {
$warnMsg[] = "Work Center not found for the given plant";
}
else
{
$machineId = $machineAgainstPlant->id;
}
$user = User::where('name', $this->data['created_by'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
}
if (($this->data['inspection_type'] ?? null) == 'Value') {
$upper = $this->data['upper'] ?? null;
$lower = $this->data['lower'] ?? null;
$middle = $this->data['middle'] ?? null;
if (is_null($upper) || is_null($lower) || is_null($middle)) {
$warnMsg[] = "For 'Value' inspection type, Upper, Lower, and Middle values are required.";
} elseif (!is_numeric($upper) || !is_numeric($lower) || !is_numeric($middle)) {
$warnMsg[] = "Upper, Lower, and Middle values must be numeric.";
} elseif (!($lower <= $middle && $middle <= $upper)) {
$warnMsg[] = "For 'Value' inspection type, values must satisfy: Lower ≤ Middle ≤ Upper.";
}
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else
{
} else {
$record = ProductCharacteristicsMaster::firstOrNew([
'plant_id' => $plant->id,
'item_id' => $itemId,
'line_id' => $LineId,
'plant_id' => $plant->id,
'item_id' => $itemId,
'line_id' => $LineId,
'work_group_master_id' => $workGroupMasterId,
'machine_id' => $machineId,
'machine_id' => $machineId,
]);
$currentUser = Auth::check() ? Auth::user()->name : ($this->data['created_by'] ?? 'System');
// If record is new, fill all fields
if (!$record->exists) {
$record->name = $this->data['name'];
if (! $record->exists) {
$record->name = $this->data['name'];
$record->characteristics_type = $this->data['characteristics_type'];
$record->inspection_type = $this->data['inspection_type'];
$record->upper = $this->data['upper'] ?? null;
$record->lower = $this->data['lower'] ?? null;
$record->middle = $this->data['middle'] ?? null;
$record->created_by = $currentUser;
$record->inspection_type = $this->data['inspection_type'];
$record->upper = $this->data['upper'] ?? null;
$record->lower = $this->data['lower'] ?? null;
$record->middle = $this->data['middle'] ?? null;
$record->created_by = $currentUser;
} else {
// Record exists → update only updated_by and updated_at
$record->updated_by = $currentUser;
@@ -264,17 +259,17 @@ class ProductCharacteristicsMasterImporter extends Importer
// return null;
// }
//return new WorkGroupMaster();
// return new WorkGroupMaster();
// return new ProductCharacteristicsMaster();
// return new ProductCharacteristicsMaster();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your product characteristics master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your product characteristics master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -15,6 +15,7 @@ use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Str;
class ProductionLineStopImporter extends Importer
{
@@ -28,7 +29,7 @@ class ProductionLineStopImporter extends Importer
->exampleHeader('From DateTime')
->example(['01-01-2025 00:00:00', '01-01-2025 20:00:00'])
->label('From DateTime')
->rules(['required']), //, 'date_format:"d-m-Y H:i:s"'
->rules(['required']), // , 'date_format:"d-m-Y H:i:s"'
ImportColumn::make('to_datetime')
->requiredMapping()
->exampleHeader('To DateTime')
@@ -45,7 +46,7 @@ class ProductionLineStopImporter extends Importer
ImportColumn::make('stop_min')
->requiredMapping()
->exampleHeader('Stop Min')
->example(['25','0'])
->example(['25', '0'])
->label('Stop Min')
->numeric()
->rules(['required', 'integer']),
@@ -54,14 +55,14 @@ class ProductionLineStopImporter extends Importer
->exampleHeader('Line Stop Code')
->example(['A7R', 'A1R'])
->label('Line Stop Code')
->relationship(resolveUsing:'code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('line')
->requiredMapping()
->exampleHeader('Line Name')
->example(['4 inch pump line', '4 inch pump line'])
->label('Line Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('block_reference')
->requiredMapping() // Or optionalMapping() if not always present
@@ -78,10 +79,10 @@ class ProductionLineStopImporter extends Importer
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example(['Ransar Industries-I', 'Ransar Industries-I'])
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example(['1000', '1000'])
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('operator_id')
->requiredMapping()
@@ -95,61 +96,62 @@ class ProductionLineStopImporter extends Importer
public function resolveRecord(): ?ProductionLineStop
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$line = null;
$block = null;
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
//block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
}
if (!$line) {
$warnMsg[] = "Line not found";
}
$shift = null;
if (!$block) {
$warnMsg[] = "Block not found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
// block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
}
}
else {
if (! $line) {
$warnMsg[] = 'Line not found';
}
if (! $block) {
$warnMsg[] = 'Block not found';
} elseif ($plant) {
$shift = Shift::where('name', $this->data['shift'])->where('plant_id', $plant->id)->where('block_id', $block->id)->first();
}
//$shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (!$shift) {
$warnMsg[] = "Shift not found";
// $shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (! $shift) {
$warnMsg[] = 'Shift not found';
}
$linestop = LineStop::where('code', $this->data['linestop'])->first();
if (!$linestop) {
$warnMsg[] = "Line stop code not found";
if (! $linestop) {
$warnMsg[] = 'Line stop code not found';
}
$stophour = is_numeric($this->data['stop_hour']) && $this->data['stop_hour'] >= 0;
$stopmin = is_numeric($this->data['stop_min']) && $this->data['stop_min'] >= 0 && $this->data['stop_min'] <= 60;
if (!$stophour && !$stopmin) {
$warnMsg[] = "Invalid stop hour/minute found";
}
else if (!$stophour) {
$warnMsg[] = "Invalid stop hour found";
}
else if (!$stopmin) {
$warnMsg[] = "Invalid stop min found";
}
else {
$stophour = (int)$this->data['stop_hour'];
$stopmin = (int)$this->data['stop_min'];
if (! $stophour && ! $stopmin) {
$warnMsg[] = 'Invalid stop hour/minute found';
} elseif (! $stophour) {
$warnMsg[] = 'Invalid stop hour found';
} elseif (! $stopmin) {
$warnMsg[] = 'Invalid stop min found';
} else {
$stophour = (int) $this->data['stop_hour'];
$stopmin = (int) $this->data['stop_min'];
if ($stophour == 0 && $stopmin == 0) {
$warnMsg[] = "Invalid stop hour/minute found";
$warnMsg[] = 'Invalid stop hour/minute found';
}
}
$validHourMin = ($stophour == 0 && $stopmin == 0) ? false : true;
if (!$validHourMin) {
$warnMsg[] = "Invalid stop hour/minute found";
if (! $validHourMin) {
$warnMsg[] = 'Invalid stop hour/minute found';
}
$fromDate = $this->data['from_datetime'];
$toDate = $this->data['to_datetime'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$fdateTime = null;
$tdateTime = null;
@@ -175,14 +177,14 @@ class ProductionLineStopImporter extends Importer
}
// $fDateOnly = '';
if (!isset($fdateTime)) {
if (! isset($fdateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'From DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
// else {
// $fDateOnly = $fdateTime->toDateString();
// }
if (!isset($tdateTime)) {
if (! isset($tdateTime)) {
$warnMsg[] = "Invalid 'To DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -200,11 +202,11 @@ class ProductionLineStopImporter extends Importer
// }
$user = User::where('name', $this->data['operator_id'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -213,12 +215,13 @@ class ProductionLineStopImporter extends Importer
'line_id' => $line->id,
'shift_id' => $shift->id,
'linestop_id' => $linestop->id,
'from_datetime' => $fdateTime->format('Y-m-d H:i:s'),//$this->data['from_datetime'],
'to_datetime' => $tdateTime->format('Y-m-d H:i:s'),//$this->data['to_datetime'],
'stop_hour' => (int)$this->data['stop_hour'],
'stop_min' => (int)$this->data['stop_min'],
'from_datetime' => $fdateTime->format('Y-m-d H:i:s'), // $this->data['from_datetime'],
'to_datetime' => $tdateTime->format('Y-m-d H:i:s'), // $this->data['to_datetime'],
'stop_hour' => (int) $this->data['stop_hour'],
'stop_min' => (int) $this->data['stop_min'],
'operator_id' => $this->data['operator_id'],
]);
return null;
// return ProductionLineStop::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
@@ -230,10 +233,10 @@ class ProductionLineStopImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your production line stop import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your production line stop 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -48,7 +48,7 @@ class ProductionPlanImporter extends Importer
->exampleHeader('Line Name')
->example(['4 inch pump line', '4 inch pump line'])
->label('Line Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('block_reference')
->requiredMapping() // Or optionalMapping() if not always present
@@ -58,17 +58,17 @@ class ProductionPlanImporter extends Importer
->rules(['required']), // Or remove if not required
ImportColumn::make('shift')
->requiredMapping()
->exampleHeader('Shift Name') //ID
->example(['Day', 'Night']) //'2', '7'
->exampleHeader('Shift Name') // ID
->example(['Day', 'Night']) // '2', '7'
->label('Shift Name') // ID
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example(['Ransar Industries-I', 'Ransar Industries-I'])
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example(['1000', '1000'])
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('updated_at')
->requiredMapping()
@@ -88,42 +88,51 @@ class ProductionPlanImporter extends Importer
public function resolveRecord(): ?ProductionPlan
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$line = null;
$block = null;
if (!$plant) {
$warnMsg[] = "Plant not found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
else {
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
//block_reference
// block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
}
if (!$line) {
$warnMsg[] = "Line not found";
if (! $line) {
$warnMsg[] = 'Line not found';
}
$shift = null;
if (!$block) {
$warnMsg[] = "Block not found";
}
else {
if (! $block) {
$warnMsg[] = 'Block not found';
} elseif ($plant) {
$shift = Shift::where('name', $this->data['shift'])->where('plant_id', $plant->id)->where('block_id', $block->id)->first();
}
//$shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (!$shift) {
$warnMsg[] = "Shift not found";
// $shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (! $shift) {
$warnMsg[] = 'Shift not found';
}
if (Str::length($this->data['plan_quantity']) < 0 || !is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
$warnMsg[] = "Invalid plan quantity found";
if (Str::length($this->data['plan_quantity']) < 0 || ! is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
$warnMsg[] = 'Invalid plan quantity found';
}
if (Str::length($this->data['production_quantity']) < 0 || !is_numeric($this->data['production_quantity']) || $this->data['production_quantity'] < 0) {
$warnMsg[] = "Invalid production quantity found";
if (Str::length($this->data['production_quantity']) < 0 || ! is_numeric($this->data['production_quantity']) || $this->data['production_quantity'] < 0) {
$warnMsg[] = 'Invalid production quantity found';
}
$fromDate = $this->data['created_at'];
$toDate = $this->data['updated_at'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$fdateTime = null;
$tdateTime = null;
@@ -149,14 +158,13 @@ class ProductionPlanImporter extends Importer
}
$fDateOnly = '';
if (!isset($fdateTime)) {
if (! isset($fdateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else {
} else {
$fDateOnly = $fdateTime->toDateString();
}
if (!isset($tdateTime)) {
if (! isset($tdateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -174,21 +182,20 @@ class ProductionPlanImporter extends Importer
// }
$user = User::where('name', $this->data['operator_id'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else { //if (empty($warnMsg))
} else { // if (empty($warnMsg))
$productionPlan = ProductionPlan::where('plant_id', $plant->id)
->where('shift_id', $shift->id)
->where('line_id', $line->id)
->whereDate('created_at', $fDateOnly)
->where('shift_id', $shift->id)
->where('line_id', $line->id)
->whereDate('created_at', $fDateOnly)
// ->where('plan_quantity', $productionQuantity->plan_quantity)
->latest()
->first();
->latest()
->first();
if ($productionPlan) {
// if($productionPlan->production_quantity)
@@ -205,6 +212,7 @@ class ProductionPlanImporter extends Importer
'operator_id' => $this->data['operator_id'],
]);
$productionPlan->save();
return null;
}
}
@@ -215,10 +223,11 @@ class ProductionPlanImporter extends Importer
'shift_id' => $shift->id,
'plan_quantity' => $this->data['plan_quantity'],
'production_quantity' => $this->data['production_quantity'],
'created_at' => $fdateTime->format('Y-m-d H:i:s'),//$this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'),//$this->data['updated_at'],
'created_at' => $fdateTime->format('Y-m-d H:i:s'), // $this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'), // $this->data['updated_at'],
'operator_id' => $this->data['operator_id'],
]);
return null;
// return ProductionPlan::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
@@ -230,10 +239,10 @@ class ProductionPlanImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your production plan import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your production plan 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -42,7 +42,7 @@ class ProductionQuantityImporter extends Importer
->exampleHeader('Item Code')
->example(['123456', '123456'])
->label('Item Code')
->relationship(resolveUsing:'code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('serial_number')
->requiredMapping()
@@ -55,27 +55,27 @@ class ProductionQuantityImporter extends Importer
->exampleHeader('Line Name')
->example(['4 inch pump line', '4 inch pump line'])
->label('Line Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('block_reference')
->requiredMapping() // Or optionalMapping() if not always present
->exampleHeader('Block')
->exampleHeader('Block Name')
->example(['Block A', 'Block A'])
->label('Block')
->label('Block Name')
->rules(['required']), // Or remove if not required
ImportColumn::make('shift')
->requiredMapping()
->exampleHeader('Shift Name')
->example(['Day', 'Night'])
->label('Shift Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example(['Ransar Industries-I', 'Ransar Industries-I'])
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example(['1000', '1000'])
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('updated_at')
->requiredMapping()
@@ -95,49 +95,57 @@ class ProductionQuantityImporter extends Importer
public function resolveRecord(): ?ProductionQuantity
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$line = null;
$block = null;
if (!$plant) {
$warnMsg[] = "Plant not found";
$shift = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
else {
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
//block_reference
// block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
}
if (!$line) {
$warnMsg[] = "Line not found";
if (! $line) {
$warnMsg[] = 'Line not found';
}
$shift = null;
if (!$block) {
$warnMsg[] = "Block not found";
}
else {
if (! $block) {
$warnMsg[] = 'Block not found';
} elseif ($plant) {
$shift = Shift::where('name', $this->data['shift'])->where('plant_id', $plant->id)->where('block_id', $block->id)->first();
}
//$shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (!$shift) {
$warnMsg[] = "Shift not found";
// $shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
if (! $shift) {
$warnMsg[] = 'Shift not found';
}
$item = null;
if ($plant) {
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
}
if (!$item) {
$warnMsg[] = "Item not found";
if (! $item) {
$warnMsg[] = 'Item not found';
}
if (Str::length($this->data['serial_number']) < 9 || !ctype_alnum($this->data['serial_number'])) {
$warnMsg[] = "Invalid serial number found";
if (Str::length($this->data['serial_number']) < 9 || ! ctype_alnum($this->data['serial_number'])) {
$warnMsg[] = 'Invalid serial number found';
}
if (Str::length($this->data['production_order']) > 0 && (Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14 || !is_numeric($this->data['production_order']))) {
$warnMsg[] = "Invalid production order found";
if (Str::length($this->data['production_order']) > 0 && (Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14 || ! is_numeric($this->data['production_order']))) {
$warnMsg[] = 'Invalid production order found';
}
$fromDate = $this->data['created_at'];
$toDate = $this->data['updated_at'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$fdateTime = null;
$tdateTime = null;
@@ -163,14 +171,14 @@ class ProductionQuantityImporter extends Importer
}
// $fDateOnly = '';
if (!isset($fdateTime)) {
if (! isset($fdateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
// else {
// $fDateOnly = $fdateTime->toDateString();
// }
if (!isset($tdateTime)) {
if (! isset($tdateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -187,21 +195,20 @@ class ProductionQuantityImporter extends Importer
// }
$user = User::where('name', $this->data['operator_id'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else { //if (empty($warnMsg))
} else { // if (empty($warnMsg))
$productionQuan = ProductionQuantity::where('plant_id', $plant->id)
->where('serial_number', $this->data['serial_number'])
->latest()
->first();
->where('serial_number', $this->data['serial_number'])
->latest()
->first();
if ($productionQuan) {
throw new RowImportFailedException("Serial number already exist!");
throw new RowImportFailedException('Serial number already exist!');
}
}
@@ -212,10 +219,11 @@ class ProductionQuantityImporter extends Importer
'line_id' => $line->id,
'item_id' => $item->id,
'production_order' => $this->data['production_order'] ?? null,
'created_at' => $fdateTime->format('Y-m-d H:i:s'),//$this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'),//$this->data['updated_at'],
'created_at' => $fdateTime->format('Y-m-d H:i:s'), // $this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'), // $this->data['updated_at'],
'operator_id' => $this->data['operator_id'],
]);
// ProductionQuantity::updateOrCreate([
// 'serial_number' => $this->data['serial_number'],
// 'plant_id' => $plant->id,
@@ -236,10 +244,10 @@ class ProductionQuantityImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your production quantity import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your production quantity 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;
@@ -259,7 +267,7 @@ class ProductionQuantityImporter extends Importer
'line_id' => $this->resolveLineId($row['line']),
'shift_id' => $this->resolveShiftId($row['shift']),
'plant_id' => $this->resolvePlantId($row['plant']),
'updated_at' => $row['updated_at']
'updated_at' => $row['updated_at'],
]);
} finally {
// Always disable flag even if errors occur

View File

@@ -14,7 +14,6 @@ use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Facades\Filament;
use Illuminate\Validation\Rule;
use Str;
class QualityValidationImporter extends Importer
@@ -35,16 +34,16 @@ class QualityValidationImporter extends Importer
->exampleHeader('Item Code')
->example('123456')
->label('Item Code'),
// ->relationship(
// name: 'stickerMaster',
// resolveUsing: function ($state) {
// $state = trim($state);
// $item = Item::where('code', $state)->first();
// return $item
// ? StickerMaster::where('item_id', $item->id)->value('id')
// : null;
// }
// ),
// ->relationship(
// name: 'stickerMaster',
// resolveUsing: function ($state) {
// $state = trim($state);
// $item = Item::where('code', $state)->first();
// return $item
// ? StickerMaster::where('item_id', $item->id)->value('id')
// : null;
// }
// ),
ImportColumn::make('production_order')
->requiredMapping()
->exampleHeader('Production Order')
@@ -101,6 +100,11 @@ class QualityValidationImporter extends Importer
->exampleHeader('Name Plate PumpSet')
->example('1')
->label('Name Plate PumpSet'),
ImportColumn::make('warranty_card')
->requiredMapping()
->exampleHeader('Warranty Card')
->example('1')
->label('Warranty Card'),
ImportColumn::make('tube_sticker_motor')
->requiredMapping()
->exampleHeader('Tube Sticker Motor')
@@ -116,11 +120,6 @@ class QualityValidationImporter extends Importer
->exampleHeader('Tube Sticker PumpSet')
->example('1')
->label('Tube Sticker PumpSet'),
ImportColumn::make('warranty_card')
->requiredMapping()
->exampleHeader('Warranty Card')
->example('1')
->label('Warranty Card'),
ImportColumn::make('part_validation1')
->requiredMapping()
->exampleHeader('Part Validation 1')
@@ -156,14 +155,14 @@ class QualityValidationImporter extends Importer
->exampleHeader('Line Name')
->example('4 inch pump line')
->label('Line Name')
->relationship(resolveUsing:'name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('updated_at')
->requiredMapping()
@@ -183,35 +182,41 @@ class QualityValidationImporter extends Importer
public function resolveRecord(): ?QualityValidation
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$plantCod = $this->data['plant'];
$plant = null;
$line = null;
$stickMaster = null;
if (!$plant) {
$warnMsg[] = "Plant not found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
else {
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
$uniqueCode = trim($this->data['sticker_master_id_code']);// stickerMaster.item
$uniqueCode = trim($this->data['sticker_master_id_code']); // stickerMaster.item
$stickMaster = StickerMaster::select('id')->with('item')
->whereHas('item', function ($query) use ($uniqueCode, $plant) {
$query->where('code', $uniqueCode)->where('plant_id', $plant->id);
})->value('id');
}
if (!$line) {
$warnMsg[] = "Line not found";
if (! $line) {
$warnMsg[] = 'Line not found';
}
if (!$stickMaster) {
$warnMsg[] = "Sticker item code not found";
if (! $stickMaster) {
$warnMsg[] = 'Sticker item code not found';
}
if (!is_numeric($this->data['production_order']) || Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14) {
$warnMsg[] = "Invalid production order found";
if (! is_numeric($this->data['production_order']) || Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14) {
$warnMsg[] = 'Invalid production order found';
}
if (!ctype_alnum($this->data['serial_number']) || Str::length($this->data['serial_number']) < 9) {
$warnMsg[] = "Invalid serial number found";
if (! ctype_alnum($this->data['serial_number']) || Str::length($this->data['serial_number']) < 9) {
$warnMsg[] = 'Invalid serial number found';
}
// dd($stickMaster);
@@ -220,13 +225,13 @@ class QualityValidationImporter extends Importer
// }
$user = User::where('name', $this->data['operator_id'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
$fromDate = $this->data['created_at'];
$toDate = $this->data['updated_at'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$fdateTime = null;
$tdateTime = null;
@@ -252,14 +257,14 @@ class QualityValidationImporter extends Importer
}
// $fDateOnly = '';
if (!isset($fdateTime)) {
if (! isset($fdateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
// else {
// $fDateOnly = $fdateTime->toDateString();
// }
if (!isset($tdateTime)) {
if (! isset($tdateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -275,41 +280,41 @@ class QualityValidationImporter extends Importer
// $warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
// }
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
QualityValidation::updateOrCreate([
'plant_id' => $plant->id,
'sticker_master_id' => $stickMaster,//->id
'serial_number' => $this->data['serial_number']
'sticker_master_id' => $stickMaster, // ->id
'serial_number' => $this->data['serial_number'],
],
[
'line_id' => $line->id,
'uom' => $this->data['uom'],
'production_order' => $this->data['production_order'],
'serial_number_motor' => $this->data['serial_number_motor'],
'serial_number_pump' => $this->data['serial_number_pump'],
'serial_number_pumpset' => $this->data['serial_number_pumpset'],
'pack_slip_motor' => $this->data['pack_slip_motor'],
'pack_slip_pump' => $this->data['pack_slip_pump'],
'pack_slip_pumpset' => $this->data['pack_slip_pumpset'],
'name_plate_motor' => $this->data['name_plate_motor'],
'name_plate_pump' => $this->data['name_plate_pump'],
'name_plate_pumpset' => $this->data['name_plate_pumpset'],
'tube_sticker_motor' => $this->data['tube_sticker_motor'],
'tube_sticker_pump' => $this->data['tube_sticker_pump'],
'tube_sticker_pumpset' => $this->data['tube_sticker_pumpset'],
'warranty_card' => $this->data['warranty_card'],
'part_validation1' => $this->data['part_validation1'],
'part_validation2' => $this->data['part_validation2'],
'part_validation3' => $this->data['part_validation3'],
'part_validation4' => $this->data['part_validation4'],
'part_validation5' => $this->data['part_validation5'],
'created_at' => $fdateTime->format('Y-m-d H:i:s'),//$this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'),//$this->data['updated_at'],
'operator_id' => $this->data['operator_id'],
]);
[
'line_id' => $line->id,
'uom' => $this->data['uom'],
'production_order' => $this->data['production_order'],
'serial_number_motor' => $this->data['serial_number_motor'],
'serial_number_pump' => $this->data['serial_number_pump'],
'serial_number_pumpset' => $this->data['serial_number_pumpset'],
'pack_slip_motor' => $this->data['pack_slip_motor'],
'pack_slip_pump' => $this->data['pack_slip_pump'],
'pack_slip_pumpset' => $this->data['pack_slip_pumpset'],
'name_plate_motor' => $this->data['name_plate_motor'],
'name_plate_pump' => $this->data['name_plate_pump'],
'name_plate_pumpset' => $this->data['name_plate_pumpset'],
'tube_sticker_motor' => $this->data['tube_sticker_motor'],
'tube_sticker_pump' => $this->data['tube_sticker_pump'],
'tube_sticker_pumpset' => $this->data['tube_sticker_pumpset'],
'warranty_card' => $this->data['warranty_card'],
'part_validation1' => $this->data['part_validation1'],
'part_validation2' => $this->data['part_validation2'],
'part_validation3' => $this->data['part_validation3'],
'part_validation4' => $this->data['part_validation4'],
'part_validation5' => $this->data['part_validation5'],
'created_at' => $fdateTime->format('Y-m-d H:i:s'), // $this->data['created_at'],
'updated_at' => $tdateTime->format('Y-m-d H:i:s'), // $this->data['updated_at'],
'operator_id' => $this->data['operator_id'],
]);
return null;
// return QualityValidation::firstOrNew([
@@ -322,10 +327,10 @@ class QualityValidationImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your quality validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your quality 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -134,55 +134,51 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
$updatedBy = $this->data['updated_by'];
$reworkedBy = $this->data['reworked_by'];
if (Str::length($plantCod) < 4 || !is_numeric($plantCod) || !preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = "Invalid plant code found";
}
else
{
$plant = Plant::where('code', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else
{
if (Str::length($invoiceNo) < 5 || !ctype_alnum($invoiceNo)) {
$warnMsg[] = "Invalid invoice number found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
if (Str::length($invoiceNo) < 5 || ! ctype_alnum($invoiceNo)) {
$warnMsg[] = 'Invalid invoice number found';
}
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || !ctype_alnum($serialNo)) {
$warnMsg[] = "Invalid serial number found";
if (Str::length($serialNo) < 9 || Str::length($serialNo) > 20 || ! ctype_alnum($serialNo)) {
$warnMsg[] = 'Invalid serial number found';
}
if (Str::length($palletNo) > 0 && Str::length($palletNo) < 10) {
$warnMsg[] = "Invalid pallet number found";
$warnMsg[] = 'Invalid pallet number found';
}
if (Str::length($locatorNo) > 0 && Str::length($locatorNo) < 7) {
$warnMsg[] = "Invalid locator number found";
$warnMsg[] = 'Invalid locator number found';
}
if ($scannedStat != 'Scanned') {
$warnMsg[] = "Invalid scanned status found";
$warnMsg[] = 'Invalid scanned status found';
}
if ($uploadStat != 'Y' && $uploadStat != 'N') {
$warnMsg[] = "Invalid upload status found";
$warnMsg[] = 'Invalid upload status found';
}
$created = User::where('name', $createdBy)->first();
if (!$created) {
$warnMsg[] = "Created by not found";
if (! $created) {
$warnMsg[] = 'Created by not found';
}
$scanned = User::where('name', $scannedBy)->first();
if (!$scanned) {
$warnMsg[] = "Scanned by not found";
if (! $scanned) {
$warnMsg[] = 'Scanned by not found';
}
if (Str::length($updatedBy) > 0) {
$updated = User::where('name', $updatedBy)->first();
if (!$updated) {
$warnMsg[] = "Updated by not found";
if (! $updated) {
$warnMsg[] = 'Updated by not found';
}
}
$reworked = User::where('name', $reworkedBy)->first();
if (!$reworked) {
$warnMsg[] = "Reworked by not found";
if (! $reworked) {
$warnMsg[] = 'Reworked by not found';
}
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
foreach ($formats as $format) {
try {
@@ -194,7 +190,7 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($cDateTime)) {
if (! isset($cDateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -209,7 +205,7 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($sDateTime)) {
if (! isset($sDateTime)) {
$warnMsg[] = "Invalid 'Scanned DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
@@ -223,11 +219,9 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($uDateTime)) {
if (! isset($uDateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else
{
} else {
if (isset($cDateTime) && isset($uDateTime)) {
if ($cDateTime->greaterThan($uDateTime)) {
$warnMsg[] = "'Created DataTime' is greater than 'Updated DateTime'.";
@@ -245,11 +239,9 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
}
}
if (!isset($rDateTime)) {
if (! isset($rDateTime)) {
$warnMsg[] = "Invalid 'Reworked DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else
{
} else {
if (isset($cDateTime) && isset($rDateTime)) {
if ($cDateTime->greaterThan($rDateTime)) {
$warnMsg[] = "'Created DataTime' is greater than 'Reworked DateTime'.";
@@ -260,10 +252,10 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
}
// if (!is_numeric($locatorQuantity) || $locatorQuantity < 0 || $locatorQuantity > 2) {
// $warnMsg[] = "Invalid locator quantity found";
// $warnMsg[] = "Invalid locator quantity found";
// }
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -283,10 +275,11 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
'created_by' => $createdBy,
'scanned_by' => $scannedBy,
'updated_by' => $updatedBy,
'reworked_by' => $reworkedBy
]
);
return null;
'reworked_by' => $reworkedBy,
]
);
return null;
// // return ReworkLocatorInvoiceValidation::firstOrNew([
// // // Update existing records, matching them by `$this->data['column_name']`
// // 'email' => $this->data['email'],
@@ -297,10 +290,10 @@ class ReworkLocatorInvoiceValidationImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your rework locator invoice validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your rework locator 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -18,79 +18,89 @@ class ShiftImporter extends Importer
public static function getColumns(): array
{
return [
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Shift Name')
->example('Day')
->label('Shift Name')
->rules(['required']),
ImportColumn::make('start_time')
->requiredMapping()
->exampleHeader('Start Time')
->example('08:00:00')
->label('Start Time')
->rules(['required']),
ImportColumn::make('duration')
->requiredMapping()
->numeric()
->exampleHeader('Shift Duration')
->example('11.30')
->label('Shift Duration')
->rules(['required']),
ImportColumn::make('end_time')
->requiredMapping()
->exampleHeader('End Time')
->example('19:30:00')
->label('End Time')
->rules(['required']),
ImportColumn::make('block')
->requiredMapping()
->exampleHeader('Block Name')
->example('Block A')
->label('Block Name')
->relationship(resolveUsing:'name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->rules(['required']),
ImportColumn::make('status')
->requiredMapping()
->exampleHeader('Active Status')
->example('Active')
->label('Active Status')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Shift Name')
->example('Day')
->label('Shift Name')
->rules(['required']),
ImportColumn::make('start_time')
->requiredMapping()
->exampleHeader('Start Time')
->example('08:00:00')
->label('Start Time')
->rules(['required']),
ImportColumn::make('duration')
->requiredMapping()
->numeric()
->exampleHeader('Shift Duration')
->example('11.30')
->label('Shift Duration')
->rules(['required']),
ImportColumn::make('end_time')
->requiredMapping()
->exampleHeader('End Time')
->example('19:30:00')
->label('End Time')
->rules(['required']),
ImportColumn::make('block')
->requiredMapping()
->exampleHeader('Block Name')
->example('Block A')
->label('Block Name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('status')
->requiredMapping()
->exampleHeader('Active Status')
->example('Active')
->label('Active Status')
->rules(['required']),
];
}
public function resolveRecord(): ?Shift
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
$block = Block::where('name', $this->data['block'])->where('plant_id', $plant->id)->first();
if (!$block) {
$warnMsg[] = "Block not found";
}
if (Str::length($this->data['duration']) < 0 || !is_numeric($this->data['duration'])) {
$warnMsg[] = "Invalid duration found";
}
if (Str::length($this->data['start_time']) < 0) {
$warnMsg[] = "Invalid start time found";
}
if (Str::length($this->data['end_time']) < 0) {
$warnMsg[] = "Invalid end time found";
}
if (Str::length($this->data['status']) < 0 || $this->data['status'] != 'Active') {
$warnMsg[] = "Invalid shift status found";
$plantCod = $this->data['plant'];
$plant = null;
$block = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
if (!empty($warnMsg)) {
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$block = Block::where('name', $this->data['block'])->where('plant_id', $plant->id)->first();
}
if (! $block) {
$warnMsg[] = 'Block not found';
}
if (Str::length($this->data['duration']) < 0 || ! is_numeric($this->data['duration'])) {
$warnMsg[] = 'Invalid duration found';
}
if (Str::length($this->data['start_time']) < 0) {
$warnMsg[] = 'Invalid start time found';
}
if (Str::length($this->data['end_time']) < 0) {
$warnMsg[] = 'Invalid end time found';
}
if (Str::length($this->data['status']) < 0 || $this->data['status'] != 'Active') {
$warnMsg[] = 'Invalid shift status found';
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -105,8 +115,9 @@ class ShiftImporter extends Importer
'start_time' => $this->data['start_time'],
'duration' => $this->data['duration'],
'end_time' => $this->data['end_time'],
'status' => $this->data['status']
'status' => $this->data['status'],
]);
return $shift;
} else {
// Safe to create new
@@ -117,7 +128,7 @@ class ShiftImporter extends Importer
'start_time' => $this->data['start_time'],
'duration' => $this->data['duration'],
'end_time' => $this->data['end_time'],
'status' => $this->data['status']
'status' => $this->data['status'],
]);
}
// return Shift::firstOrNew([
@@ -130,10 +141,10 @@ class ShiftImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your shift import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your shift 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -151,10 +151,10 @@ class StickerMasterImporter extends Importer
->example(''),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('PLANT NAME')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
];
}
@@ -162,107 +162,111 @@ class StickerMasterImporter extends Importer
public function resolveRecord(): ?StickerMaster
{
$warnMsg = [];
$plantCod = $this->data['plant'];
$plant = null;
$item = null;
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
else
{
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
if (!$item) {
$warnMsg[] = "Item code not found";
}
else
{
if (! $item) {
$warnMsg[] = 'Item code not found';
} else {
if (Str::length($this->data['serial_number_motor']) > 0 && $this->data['serial_number_motor'] != '1') {
$warnMsg[] = "Serial number motor must be 1 or empty";
$warnMsg[] = 'Serial number motor must be 1 or empty';
}
if (Str::length($this->data['serial_number_pump']) > 0 && $this->data['serial_number_pump'] != '1') {
$warnMsg[] = "Serial number pump must be 1 or empty";
$warnMsg[] = 'Serial number pump must be 1 or empty';
}
if (Str::length($this->data['serial_number_pumpset']) > 0 && $this->data['serial_number_pumpset'] != '1') {
$warnMsg[] = "Serial number pumpset must be 1 or empty";
$warnMsg[] = 'Serial number pumpset must be 1 or empty';
}
if (Str::length($this->data['pack_slip_motor']) > 0 && $this->data['pack_slip_motor'] != '1') {
$warnMsg[] = "Pack slip motor must be 1 or empty";
$warnMsg[] = 'Pack slip motor must be 1 or empty';
}
if (Str::length($this->data['pack_slip_pump']) > 0 && $this->data['pack_slip_pump'] != '1') {
$warnMsg[] = "Pack slip pump must be 1 or empty";
$warnMsg[] = 'Pack slip pump must be 1 or empty';
}
if (Str::length($this->data['pack_slip_pumpset']) > 0 && $this->data['pack_slip_pumpset'] != '1') {
$warnMsg[] = "Pack slip pumpset must be 1 or empty";
$warnMsg[] = 'Pack slip pumpset must be 1 or empty';
}
if (Str::length($this->data['name_plate_motor']) > 0 && $this->data['name_plate_motor'] != '1') {
$warnMsg[] = "Name plate motor must be 1 or empty";
$warnMsg[] = 'Name plate motor must be 1 or empty';
}
if (Str::length($this->data['name_plate_pump']) > 0 && $this->data['name_plate_pump'] != '1') {
$warnMsg[] = "Name plate pump must be 1 or empty";
$warnMsg[] = 'Name plate pump must be 1 or empty';
}
if (Str::length($this->data['name_plate_pumpset']) > 0 && $this->data['name_plate_pumpset'] != '1') {
$warnMsg[] = "Name plate pumpset must be 1 or empty";
$warnMsg[] = 'Name plate pumpset must be 1 or empty';
}
if (Str::length($this->data['tube_sticker_motor']) > 0 && $this->data['tube_sticker_motor'] != '1') {
$warnMsg[] = "Tube sticker motor must be 1 or empty";
$warnMsg[] = 'Tube sticker motor must be 1 or empty';
}
if (Str::length($this->data['tube_sticker_pump']) > 0 && $this->data['tube_sticker_pump'] != '1') {
$warnMsg[] = "Tube sticker pump must be 1 or empty";
$warnMsg[] = 'Tube sticker pump must be 1 or empty';
}
if (Str::length($this->data['tube_sticker_pumpset']) > 0 && $this->data['tube_sticker_pumpset'] != '1') {
$warnMsg[] = "Tube sticker pumpset must be 1 or empty";
$warnMsg[] = 'Tube sticker pumpset must be 1 or empty';
}
if (Str::length($this->data['warranty_card']) > 0 && $this->data['warranty_card'] != '1') {
$warnMsg[] = "Warranty card must be 1 or empty";
$warnMsg[] = 'Warranty card must be 1 or empty';
}
if (Str::length($this->data['panel_box_code']) > 0 && (Str::length($this->data['panel_box_code']) < 6 || !ctype_alnum($this->data['panel_box_code']))) {
$warnMsg[] = "Invalid panel box code found";
if (Str::length($this->data['panel_box_code']) > 0 && (Str::length($this->data['panel_box_code']) < 6 || ! ctype_alnum($this->data['panel_box_code']))) {
$warnMsg[] = 'Invalid panel box code found';
}
if (Str::length($this->data['load_rate']) < 0 || !is_numeric($this->data['load_rate']) || $this->data['load_rate'] < 0) {
$warnMsg[] = "Load rate must be greater than or equal to 0";
if (Str::length($this->data['load_rate']) < 0 || ! is_numeric($this->data['load_rate']) || $this->data['load_rate'] < 0) {
$warnMsg[] = 'Load rate must be greater than or equal to 0';
}
if (Str::length($this->data['bundle_quantity']) > 0 && (!is_numeric($this->data['bundle_quantity']) || $this->data['bundle_quantity'] <= 1)) {
if (Str::length($this->data['bundle_quantity']) > 0 && (! is_numeric($this->data['bundle_quantity']) || $this->data['bundle_quantity'] <= 1)) {
$warnMsg[] = "Bundle quantity must be greater than or equal to '2' or empty";
}
if (Str::length($this->data['material_type']) > 0 && $this->data['material_type'] != '1' && $this->data['material_type'] != '2' && $this->data['material_type'] != '3') { //($this->data['material_type'] != null) &&
$warnMsg[] = "Material type must be 1 or 2 or 3 or empty";
if (Str::length($this->data['material_type']) > 0 && $this->data['material_type'] != '1' && $this->data['material_type'] != '2' && $this->data['material_type'] != '3') { // ($this->data['material_type'] != null) &&
$warnMsg[] = 'Material type must be 1 or 2 or 3 or empty';
}
}
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
StickerMaster::updateOrCreate([
'item_id' => $item->id,
'plant_id' => $plant->id
'plant_id' => $plant->id,
],
[
'serial_number_motor' => $this->data['serial_number_motor'],
'serial_number_pump' => $this->data['serial_number_pump'],
'serial_number_pumpset' => $this->data['serial_number_pumpset'],
'pack_slip_motor' => $this->data['pack_slip_motor'],
'pack_slip_pump' => $this->data['pack_slip_pump'],
'pack_slip_pumpset' => $this->data['pack_slip_pumpset'],
'name_plate_motor' => $this->data['name_plate_motor'],
'name_plate_pump' => $this->data['name_plate_pump'],
'name_plate_pumpset' => $this->data['name_plate_pumpset'],
'tube_sticker_motor' => $this->data['tube_sticker_motor'],
'tube_sticker_pump' => $this->data['tube_sticker_pump'],
'tube_sticker_pumpset' => $this->data['tube_sticker_pumpset'],
'warranty_card' => $this->data['warranty_card'],
'part_validation1' => $this->data['part_validation1'],
'part_validation2' => $this->data['part_validation2'],
'part_validation3' => $this->data['part_validation3'],
'part_validation4' => $this->data['part_validation4'],
'part_validation5' => $this->data['part_validation5'],
'laser_part_validation1' => $this->data['laser_part_validation1'],
'laser_part_validation2' => $this->data['laser_part_validation2'],
'panel_box_code' => $this->data['panel_box_code'],
'load_rate' => $this->data['load_rate'],
'bundle_quantity' => $this->data['bundle_quantity'],
'material_type' => $this->data['material_type']
]);
[
'serial_number_motor' => $this->data['serial_number_motor'],
'serial_number_pump' => $this->data['serial_number_pump'],
'serial_number_pumpset' => $this->data['serial_number_pumpset'],
'pack_slip_motor' => $this->data['pack_slip_motor'],
'pack_slip_pump' => $this->data['pack_slip_pump'],
'pack_slip_pumpset' => $this->data['pack_slip_pumpset'],
'name_plate_motor' => $this->data['name_plate_motor'],
'name_plate_pump' => $this->data['name_plate_pump'],
'name_plate_pumpset' => $this->data['name_plate_pumpset'],
'tube_sticker_motor' => $this->data['tube_sticker_motor'],
'tube_sticker_pump' => $this->data['tube_sticker_pump'],
'tube_sticker_pumpset' => $this->data['tube_sticker_pumpset'],
'warranty_card' => $this->data['warranty_card'],
'part_validation1' => $this->data['part_validation1'],
'part_validation2' => $this->data['part_validation2'],
'part_validation3' => $this->data['part_validation3'],
'part_validation4' => $this->data['part_validation4'],
'part_validation5' => $this->data['part_validation5'],
'laser_part_validation1' => $this->data['laser_part_validation1'],
'laser_part_validation2' => $this->data['laser_part_validation2'],
'panel_box_code' => $this->data['panel_box_code'],
'load_rate' => $this->data['load_rate'],
'bundle_quantity' => $this->data['bundle_quantity'],
'material_type' => $this->data['material_type'],
]);
return null;
// return StickerMaster::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
@@ -274,10 +278,10 @@ class StickerMasterImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your sticker master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your sticker master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -2,15 +2,14 @@
namespace App\Filament\Imports;
use App\Models\Plant;
use App\Models\StickerPrinting;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
use App\Models\Plant;
use App\Models\User;
use Str;
use Filament\Facades\Filament;
use Str;
class StickerPrintingImporter extends Importer
{
@@ -49,33 +48,29 @@ class StickerPrintingImporter extends Importer
// ]);
$warnMsg = [];
$plant = Plant::where('code', $this->data['plant'])->first();
if (Str::length($this->data['serial_number']) < 9 || !ctype_alnum($this->data['serial_number'])) {
$warnMsg[] = "Invalid serial number found";
}
$existing = StickerPrinting::where('plant_id', $plant->id)
->where('serial_number', $this->data['serial_number'])
->first();
if ($existing) {
$warnMsg[] = "Serial number already exists for this plant!";//throw new RowImportFailedException("Serial number already exists for this plant!");
}
$plantCod = $this->data['plant'];
$plant = null;
$serial = $this->data['serial_number'];
// --- Check duplicate in DB ---
$existsInDB = StickerPrinting::where('plant_id', $plant->id)
->where('serial_number', $serial)
->first();
if ($existsInDB) {
//throw new RowImportFailedException("Serial number '{$serial}' already exists in DB for this plant!");
$warnMsg[] = "Serial number '{$serial}' already exists in DB for this plant!";
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found!';
}
}
if (!empty($warnMsg)) {
if (Str::length($serial) < 9 || ! ctype_alnum($serial)) {
$warnMsg[] = 'Invalid serial number found';
} elseif ($plant) {
$existing = StickerPrinting::where('plant_id', $plant->id)->where('serial_number', $serial)->first();
if ($existing) {
$warnMsg[] = "Serial number '{$serial}' already exists for plant '{$plantCod}'!"; // throw new RowImportFailedException("Serial number already exists for this plant!");
}
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
@@ -84,21 +79,21 @@ class StickerPrintingImporter extends Importer
'reference_number' => $this->data['reference_number'],
'serial_number' => $this->data['serial_number'],
'created_at' => now(),
'updated_at' =>now(),
'updated_at' => now(),
'created_by' => Filament::auth()->user()?->name,
]);
return null;
//return new StickerPrinting();
// return new StickerPrinting();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your sticker printing import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your sticker printing 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -80,11 +80,17 @@ class TestingPanelReadingImporter extends Importer
->rules(['required']),
ImportColumn::make('line')
->requiredMapping()
->relationship()
->relationship(resolveUsing: 'name')
->exampleHeader('Line Name')
->example(['4 inch pump line'])
->label('Line Name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->relationship()
->relationship(resolveUsing: 'code')
->exampleHeader('Plant Code')
->example(['1000'])
->label('Plant Code')
->rules(['required']),
ImportColumn::make('tested_by'),
ImportColumn::make('updated_by'),
@@ -101,15 +107,15 @@ class TestingPanelReadingImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new TestingPanelReading();
return new TestingPanelReading;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your testing panel reading import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your testing panel reading 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -29,19 +29,19 @@ class UserImporter extends Importer
->exampleHeader('Name')
->example('RAW00001')
->label('Name')
->rules(['required']),//, 'max:255'
->rules(['required']), // , 'max:255'
ImportColumn::make('email')
->requiredMapping()
->exampleHeader('E-Mail')
->example('RAW00001@cripumps.com')
->label('E-Mail')
->rules(['required', 'email']),//, 'max:255'
->rules(['required', 'email']), // , 'max:255'
ImportColumn::make('password')
->requiredMapping()
->exampleHeader('Password')
->example('RAW00001')
->label('Password')
->rules(['required']),//, 'max:255'
->rules(['required']), // , 'max:255'
ImportColumn::make('roles')
->requiredMapping()
->exampleHeader('Roles')
@@ -54,65 +54,61 @@ class UserImporter extends Importer
public function resolveRecord(): ?User
{
$warnMsg = [];
$plantCod = $this->data['plant'];
$plant = null;
if (Str::length($this->data['plant']) > 0) {
if (Str::length($this->data['plant']) < 4 || !is_numeric($this->data['plant']) || !preg_match('/^[1-9]\d{3,}$/', $this->data['plant'])) {
$warnMsg[] = "Invalid plant code found!";
}
else {
$plant = Plant::where('code', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else {
$plant = $plant->id ?? null;
}
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found!';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$plant = $plant->id ?? null;
}
}
if (Str::length($this->data['name']) < 1) {
$warnMsg[] = "User name not found!";
if (Str::length($this->data['name']) < 3) {
$warnMsg[] = 'Invalid user name found!';
}
// || !is_numeric($this->data['code']) || !preg_match('/^[1-9]\d{3,}$/', $this->data['code'])
if (Str::length($this->data['email']) < 5) {
$warnMsg[] = "Invalid email found!";
$warnMsg[] = 'Invalid email found!';
}
if (Str::length($this->data['password']) < 3) {
$warnMsg[] = "Invalid password found!";
$warnMsg[] = 'Invalid password found!';
}
// Validate roles if provided
$roles = [];
if (!empty($this->data['roles'])) {
if (! empty($this->data['roles'])) {
$roles = collect(explode(',', $this->data['roles']))
->map(fn($role) => trim($role))
->map(fn ($role) => trim($role))
->filter()
->toArray();
foreach ($roles as $roleName) {
if (!Role::where('name', $roleName)->exists()) {
if (! Role::where('name', $roleName)->exists()) {
$warnMsg[] = "Role : '{$roleName}' does not exist!";
}
}
}
else {
$warnMsg[] = "User roles not found!";
} else {
$warnMsg[] = 'User roles not found!';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
$user = User::updateOrCreate([
'email' => $this->data['email'],
],
[
'name' => $this->data['name'],
'password' => $this->data['password'],
'plant_id' => $plant,
]);
[
'name' => $this->data['name'],
'password' => $this->data['password'],
'plant_id' => $plant,
]);
// Assign roles
if (!empty($roles)) {
if (! empty($roles)) {
$user->syncRoles($roles);
}
@@ -122,15 +118,15 @@ class UserImporter extends Importer
// 'email' => $this->data['email'],
// ]);
//return new User();
// return new User();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your user import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your user 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -75,10 +75,10 @@ class WeightValidationImporter extends Importer
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('PLANT NAME')
->relationship(resolveUsing: 'name')
->exampleHeader('Plant Code')
->example('1000')
->label('PLANT CODE')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('scanned_by')
->requiredMapping()
@@ -92,82 +92,95 @@ class WeightValidationImporter extends Importer
public function resolveRecord(): ?WeightValidation
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
}
$item = null;
if ($plant) {
if (Str::length($this->data['item']) < 6 || !ctype_alnum($this->data['item'])) {
$warnMsg[] = "Invalid item code found";
$plantCod = $this->data['plant'];
$iCode = $this->data['item'];
$plantId = null;
$itemId = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$plantId = $plant->id;
}
else
{
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
if (!$item) {
$warnMsg[] = "Item code not found";
}
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
$warnMsg[] = 'Invalid item code found';
} else {
$itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) {
$warnMsg[] = 'Item code not found';
} else {
if ($plantId) {
$itemAgainstPlant = Item::where('code', $iCode)->where('plant_id', $plantId)->first();
if (! $itemAgainstPlant) {
$warnMsg[] = 'Item code not found for the given plant';
} else {
$itemId = $itemAgainstPlant->id;
}
}
}
}
else { //if (!$item)
$warnMsg[] = "Item code not found";
}
$obdNum = $this->data['obd_number'];
if (Str::length($obdNum) < 8 || !ctype_alnum($obdNum)) {
$warnMsg[] = "Invalid OBD number found";
if (Str::length($obdNum) < 8 || ! ctype_alnum($obdNum)) {
$warnMsg[] = 'Invalid OBD number found';
}
$lineNum = $this->data['line_number'];
if (Str::length($lineNum) < 1 || !is_numeric($lineNum)) {
$warnMsg[] = "Invalid line number found";
if (Str::length($lineNum) < 1 || ! is_numeric($lineNum)) {
$warnMsg[] = 'Invalid line number found';
}
$batchNum = $this->data['batch_number'];
if (Str::length($batchNum) < 8 || !is_numeric($batchNum)) {
$warnMsg[] = "Invalid batch number found";
if (Str::length($batchNum) < 8 || ! is_numeric($batchNum)) {
$warnMsg[] = 'Invalid batch number found';
}
$heatNum = $this->data['heat_number'];
if (Str::length($heatNum) < 4) {
$warnMsg[] = "Invalid heat number found";
$warnMsg[] = 'Invalid heat number found';
}
$actWeight = $this->data['obd_weight'];
if (Str::length($actWeight) < 1 || !is_numeric($actWeight)) {
$warnMsg[] = "Invalid actual weight found";
if (Str::length($actWeight) < 1 || ! is_numeric($actWeight)) {
$warnMsg[] = 'Invalid actual weight found';
}
$vehicleNum = $this->data['vehicle_number'];
if (Str::length($vehicleNum) < 10 || !ctype_alnum($vehicleNum)) {
$warnMsg[] = "Invalid vehicle number found";
if (Str::length($vehicleNum) < 10 || ! ctype_alnum($vehicleNum)) {
$warnMsg[] = 'Invalid vehicle number found';
}
$bundleNum = $this->data['bundle_number'];
if (Str::length($bundleNum) < 1 || !is_numeric($bundleNum)) {
$warnMsg[] = "Invalid bundle number found";
if (Str::length($bundleNum) < 1 || ! is_numeric($bundleNum)) {
$warnMsg[] = 'Invalid bundle number found';
}
$pickWeight = $this->data['picked_weight'];
if (Str::length($pickWeight) < 1 || !is_numeric($pickWeight)) {
$warnMsg[] = "Invalid picked weight found";
if (Str::length($pickWeight) < 1 || ! is_numeric($pickWeight)) {
$warnMsg[] = 'Invalid picked weight found';
}
$scanBy = $this->data['scanned_by'];
if (Str::length($scanBy) < 3 || !ctype_alnum($scanBy)) {
$warnMsg[] = "Invalid scanned by name found";
if (Str::length($scanBy) < 3 || ! ctype_alnum($scanBy)) {
$warnMsg[] = 'Invalid scanned by name found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
return WeightValidation::updateOrCreate([
'plant_id' => $plant->id,
'obd_number' => $obdNum,
'line_number' => $lineNum
],
'plant_id' => $plantId,
'obd_number' => $obdNum,
'line_number' => $lineNum,
],
[
'item_id' => $item->id,
'item_id' => $itemId,
'batch_number' => $batchNum,
'heat_number' => $heatNum,
'obd_weight' => $actWeight,
'vehicle_number' => $vehicleNum,
'bundle_number' => $bundleNum,
'picked_weight' => $pickWeight,
'scanned_by' => $scanBy
'scanned_by' => $scanBy,
]
);
// return WeightValidation::firstOrNew([
@@ -180,10 +193,10 @@ class WeightValidationImporter extends Importer
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your weight validation import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your weight 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.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -20,22 +20,22 @@ class WorkGroupMasterImporter extends Importer
return [
ImportColumn::make('plant')
->requiredMapping()
->exampleHeader('Plant Name')
->example('Ransar Industries-I')
->label('Plant Name')
->relationship(resolveUsing:'name')
->exampleHeader('Plant Code')
->example('1000')
->label('Plant Code')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('name')
->requiredMapping()
->exampleHeader('Name')
->exampleHeader('Work Group Name')
->example('RMGCEABC')
->label('Name')
->label('Work Group Name')
->rules(['required']),
ImportColumn::make('description')
->requiredMapping()
->exampleHeader('Description')
->exampleHeader('Work Group Description')
->example('Testing Model 1')
->label('Description')
->label('Work Group Description')
->rules(['required']),
ImportColumn::make('operation_number')
->requiredMapping()
@@ -52,8 +52,6 @@ class WorkGroupMasterImporter extends Importer
];
}
public function resolveRecord(): ?WorkGroupMaster
{
// return WorkGroupMaster::firstOrNew([
@@ -61,75 +59,81 @@ class WorkGroupMasterImporter extends Importer
// 'email' => $this->data['email'],
// ]);
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
$warnMsg[] = "Plant not found";
$plantCod = $this->data['plant'];
$plantId = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
if (! $plant) {
$warnMsg[] = 'Plant not found';
} else {
$plantId = $plant->id;
}
}
if (Str::length($this->data['name']) <= 0) { //|| !ctype_alnum($this->data['description'])
$warnMsg[] = "Invalid name found";
if (Str::length($this->data['name']) <= 0) { // || !ctype_alnum($this->data['description'])
$warnMsg[] = 'Invalid work group name found';
}
if (Str::length(trim($this->data['description'])) <= 0) {
$warnMsg[] = "Invalid description found";
$warnMsg[] = 'Invalid work group description found';
}
$desc = trim($this->data['description']);
if (Str::length($desc) > 44) {
$warnMsg[] = "Description should be less than 44 digits.";
$warnMsg[] = ' work group description should be less than 44 digits.';
}
if (Str::length($this->data['operation_number']) <= 0) {
$warnMsg[] = "Invalid operation number found";
$warnMsg[] = 'Invalid operation number found';
}
if(!is_numeric($this->data['operation_number']))
{
$warnMsg[] = "Invalid operation number found must be numeric";
if (! is_numeric($this->data['operation_number'])) {
$warnMsg[] = 'Invalid operation number found must be numeric';
}
$user = User::where('name', $this->data['created_by'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
if (! $user) {
$warnMsg[] = 'Operator ID not found';
}
if (!empty($warnMsg)) {
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
else
{
//Check (plant_id, name)
$existingByName = WorkGroupMaster::where('plant_id', $plant->id)
} else {
// Check (plant_id, name)
$existingByName = WorkGroupMaster::where('plant_id', $plantId)
->where('name', $this->data['name'])
->first();
if ($existingByName) {
throw new RowImportFailedException("Work group name already exists for this plant!");
throw new RowImportFailedException('Work group name already exists for this plant!');
}
//Check (plant_id, operation_number)
$existingByOpNum = WorkGroupMaster::where('plant_id', $plant->id)
// Check (plant_id, operation_number)
$existingByOpNum = WorkGroupMaster::where('plant_id', $plantId)
->where('operation_number', $this->data['operation_number'])
->where('name', $this->data['name'])
->first();
if ($existingByOpNum) {
throw new RowImportFailedException("Operation number already exists for this plant!");
throw new RowImportFailedException('Operation number already exists for this plant!');
}
//Check (plant_id)
$existingByOperator = WorkGroupMaster::where('plant_id', $plant->id)
// Check (plant_id)
$existingByOperator = WorkGroupMaster::where('plant_id', $plantId)
->where('name', $this->data['name'])
->first();
if ($existingByOperator) {
throw new RowImportFailedException("Already work group name assigned to another plant!");
throw new RowImportFailedException('Already work group name assigned to another plant!');
}
}
WorkGroupMaster::updateOrCreate([
'plant_id' => $plant->id,
'plant_id' => $plantId,
'name' => $this->data['name'],
'description' => $this->data['description'],
'operation_number' => $this->data['operation_number'],
@@ -138,15 +142,15 @@ class WorkGroupMasterImporter extends Importer
return null;
//return new WorkGroupMaster();
// return new WorkGroupMaster();
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your work group master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your work group master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;

View File

@@ -20,7 +20,7 @@ class InvoiceDataDashboard extends Page
protected static string $view = 'filament.pages.invoice-data-dashboard';
protected static ?string $navigationGroup = 'Invoice Management';
protected static ?string $navigationGroup = 'Manufacturing SD';
public function mount(): void
{

View File

@@ -0,0 +1,231 @@
<?php
namespace App\Filament\Pages;
use App\Models\InvoiceDataValidation;
use App\Models\InvoiceOutValidation;
use App\Models\Plant;
use Filament\Pages\Page;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;
use Filament\Facades\Filament;
use Filament\Forms\Components\Hidden;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Illuminate\Support\Facades\Auth;
class InvoicePendingReason extends Page
{
use HasFiltersForm;
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.invoice-pending-reason';
protected static ?string $navigationGroup = 'Manufacturing SD';
public function mount(): void
{
$this->filtersForm->fill([
'plant_id' => null,
'document_number' => null,
'remark' => null,
]);
}
public function filtersForm(Form $form): Form
{
return $form
->statePath('filters')
->schema([
Select::make('plant_id')
->label('Plant')
->reactive()
->required()
->columnSpan(1)
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->afterStateUpdated(function ($state, $set, callable $get,$livewire) {
$plantId = $get('plant_id');
$set('document_number', null);
$set('customer_trade_name', null);
$set('location', null);
})
->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null)
->hintColor('danger'),
Select::make('document_number')
->label('Document Number')
->required()
->reactive()
->columnSpan(1)
->options(function (callable $get) {
$plantId = $get('plant_id');
if (empty($plantId)) {
return [];
}
$distributions = InvoiceDataValidation::whereNotNull('distribution_channel_desc')
->distinct()
->pluck('distribution_channel_desc')
->filter(fn ($v) => trim($v) !== '')
->values()
->toArray();
$distributions[] = '';
$pendingInvoices = collect();
foreach ($distributions as $distribution) {
$invoices = InvoiceDataValidation::where('plant_id', $plantId)
->where('distribution_channel_desc', $distribution)
->select('id', 'document_number')
->get()
->unique('document_number')
->filter(fn ($inv) =>
! empty($inv->document_number) &&
! str_contains($inv->document_number, '-')
);
if (trim($distribution) == '') {
$invoices = $invoices->filter(fn ($inv) =>
str_starts_with($inv->document_number, '7')
);
}
if ($invoices->isEmpty()) {
continue;
}
$invoiceNumbers = $invoices->pluck('document_number')
->map(fn ($n) => preg_replace('/\s+/', '', strtoupper($n)))
->toArray();
$wentOut = InvoiceOutValidation::whereIn('qr_code', $invoiceNumbers)
->distinct()
->pluck('qr_code')
->map(fn ($n) => preg_replace('/\s+/', '', strtoupper($n)))
->toArray();
$pending = $invoices->filter(function ($inv) use ($wentOut) {
$doc = preg_replace('/\s+/', '', strtoupper($inv->document_number));
return ! in_array($doc, $wentOut, true);
});
$pendingInvoices = $pendingInvoices->merge($pending);
}
return $pendingInvoices
->unique('document_number')
->pluck('document_number', 'document_number')
->toArray();
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id');
if (empty($plantId)) {
return [];
}
$documentNumber = $get('document_number');
$customers = InvoiceDataValidation::where('plant_id', $plantId)
->where('document_number', $documentNumber)
->value('customer_trade_name');
$location = InvoiceDataValidation::where('plant_id', $plantId)
->where('document_number', $documentNumber)
->value('location');
$set('customer_trade_name', $customers);
$set('location', $location);
})
->extraAttributes(fn ($get) => [
'class' => $get('pqBlockError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('pqBlockError') ? $get('pqBlockError') : null)
->hintColor('danger'),
TextInput::make('customer_trade_name')
->label('Customer Trade Name')
->required()
->readOnly()
->reactive()
->columnSpan(1),
TextInput::make('location')
->label('Location')
->required()
->readOnly()
->reactive()
->columnSpan(1),
TextInput::make('remark')
->label('Remark')
->reactive()
->maxLength(40)
->helperText('Max 40 characters allowed.')
->extraAttributes([
'wire:keydown.enter.prevent' => 'addRemark($event.target.value)',
])
->autofocus()
->required(),
])
->columns(3);
}
public function addRemark(){
$plantId = $this->filters['plant_id'] ?? null;
$documentNumber = $this->filters['document_number'] ?? null;
$remark = $this->filters['remark'] ?? null;
if (! $plantId) {
Notification::make()
->title('Plant')
->body("please select plant first..!")
->danger()
->send();
return;
}
if (! $documentNumber) {
Notification::make()
->title('Document Number')
->body("please select document number..!")
->danger()
->send();
return;
}
if ($remark == '') {
Notification::make()
->title('Remark')
->body("Remark can't be empty..!")
->danger()
->send();
return;
}
InvoiceDataValidation::where('plant_id', $plantId)
->where('document_number', $documentNumber)
->update([
'remark' => $remark,
'updated_at' => now(),
]);
$this->filtersForm->fill([
'plant_id' => $plantId,
'document_number' => $documentNumber,
'remark' => null,
]);
Notification::make()
->title('Remark updated successfully')
->success()
->send();
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view invoice pending reason');
}
}

View File

@@ -641,322 +641,322 @@ class StickerReprint extends Page implements HasForms
// ********************************
$exists = \App\Models\ProductionPlan::where('plant_id', $this->pId)
->where('shift_id', $this->sId)
->where('line_id', $this->lId)
->whereDate('created_at', today())
->latest()
->exists();
// $exists = \App\Models\ProductionPlan::where('plant_id', $this->pId)
// ->where('shift_id', $this->sId)
// ->where('line_id', $this->lId)
// ->whereDate('created_at', today())
// ->latest()
// ->exists();
if ($exists)
{
$currentDate = date('Y-m-d');
// if ($exists)
// {
// $currentDate = date('Y-m-d');
$shiftId = Shift::where('id', $this->sId)
->first();
// $shiftId = Shift::where('id', $this->sId)
// ->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
//$miNs = (int) $miNs;-*/
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// //$miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
// $totalMinutes = $hRs * 60 + $miNs;
$from_dt = $currentDate . ' ' . $shiftId->start_time;
// $from_dt = $currentDate . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// $currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if (!($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// // Check if current date time is within the range
// if (!($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Shift')
->body("Please select a valid shift.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
}
}
else
{
$existShifts = \App\Models\ProductionPlan::where('plant_id', $this->pId)
->where('shift_id', $this->sId)
->where('line_id', $this->lId)
->whereDate('created_at', Carbon::yesterday())
->latest()
->exists();
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Shift')
// ->body("Please select a valid shift.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// else
// {
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// }
// }
// else
// {
// $existShifts = \App\Models\ProductionPlan::where('plant_id', $this->pId)
// ->where('shift_id', $this->sId)
// ->where('line_id', $this->lId)
// ->whereDate('created_at', Carbon::yesterday())
// ->latest()
// ->exists();
if ($existShifts) //if ($existShifts->count() > 0)
{ // record exist on yesterday
//$currentDate = date('Y-m-d');
$yesterday = date('Y-m-d', strtotime('-1 days'));
// if ($existShifts) //if ($existShifts->count() > 0)
// { // record exist on yesterday
// //$currentDate = date('Y-m-d');
// $yesterday = date('Y-m-d', strtotime('-1 days'));
$shiftId = Shift::where('id', $this->sId)
->first();
// $shiftId = Shift::where('id', $this->sId)
// ->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
// $totalMinutes = $hRs * 60 + $miNs;
$from_dt = $yesterday . ' ' . $shiftId->start_time;
// $from_dt = $yesterday . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// $currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
}
else
{
$currentDate = date('Y-m-d');
// // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// }
// else
// {
// $currentDate = date('Y-m-d');
$shiftId = Shift::where('id', $this->sId)
->first();
// $shiftId = Shift::where('id', $this->sId)
// ->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
// $totalMinutes = $hRs * 60 + $miNs;
$from_dt = $currentDate . ' ' . $shiftId->start_time;
// $from_dt = $currentDate . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// $currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Plan Not Found')
->body("Please set production plan first.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Plan Not Found')
// ->body("Please set production plan first.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// else
// {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Shift')
->body("Please select a valid shift.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
}
}
else
{ // record not exist on yesterday
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Shift')
// ->body("Please select a valid shift.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// }
// }
// else
// { // record not exist on yesterday
//$currentDate = date('Y-m-d');
$yesterday = date('Y-m-d', strtotime('-1 days'));
// //$currentDate = date('Y-m-d');
// $yesterday = date('Y-m-d', strtotime('-1 days'));
$shiftId = Shift::where('id', $this->sId)
->first();
// $shiftId = Shift::where('id', $this->sId)
// ->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
// $totalMinutes = $hRs * 60 + $miNs;
$from_dt = $yesterday . ' ' . $shiftId->start_time;
// $from_dt = $yesterday . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// $currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Plan Not Found')
->body("Please set production plan first.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
$currentDate = date('Y-m-d');
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Plan Not Found')
// ->body("Please set production plan first.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// else
// {
// $currentDate = date('Y-m-d');
$shiftId = Shift::where('id', $this->sId)
->first();
// $shiftId = Shift::where('id', $this->sId)
// ->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
// $totalMinutes = $hRs * 60 + $miNs;
$from_dt = $currentDate . ' ' . $shiftId->start_time;
// $from_dt = $currentDate . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// $currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Plan Not Found')
->body("Please set production plan first.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
//echo "Choosed a valid shift...";
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Plan Not Found')
// ->body("Please set production plan first.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// else
// {
// //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Shift')
->body("Please select a valid shift.")
->danger()
->send();
//$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
}
}
}
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Shift')
// ->body("Please select a valid shift.")
// ->danger()
// ->send();
// //$set('validationError', 'Curr.'.$currentDateTime.' (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// }
// }
// }
// ********************************
@@ -976,7 +976,9 @@ class StickerReprint extends Page implements HasForms
]);
}
if (!preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $formQRData)) {
// if (!preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $formQRData))
// {
if (!preg_match('/^[A-Za-z0-9]{6,}\|[1-9][A-Za-z0-9]{7,}(\/[A-Za-z0-9]*)?(\|)?$/', $formQRData)) {
if (strpos($formQRData, '|') === false) {
$this->form->fill([
'plant_id'=> $this->pId,
@@ -1004,7 +1006,14 @@ class StickerReprint extends Page implements HasForms
{
$splits = explode('|', $formQRData);
$iCode = trim($splits[0]);
$sNumber = isset($splits[1]) ? trim($splits[1]) : null;
$sNumberRaw = isset($splits[1]) ? trim($splits[1]) : null;
if ($sNumberRaw !== null) {
$sNumber = preg_replace('/\/.*/', '', $sNumberRaw);
$sNumber = trim($sNumber);
} else {
$sNumber = null;
}
if (!ctype_alnum($iCode)) {
$this->form->fill([
@@ -1052,6 +1061,7 @@ class StickerReprint extends Page implements HasForms
->send();
return;
}
else if (!ctype_alnum($sNumber)) {
$this->form->fill([
'plant_id'=> $this->pId,
@@ -1145,9 +1155,33 @@ class StickerReprint extends Page implements HasForms
// Only search when all parent IDs are selected
$parts = explode('|', $formQRData);
$itemCode = trim($parts[0]);
$serialNumber = isset($parts[1]) ? trim($parts[1]) : null;
$serialNumberRaw = isset($parts[1]) ? trim($parts[1]) : null;
// // Remove slash and everything after it
// if ($serialNumberRaw != null) {
// $serialNumber = preg_replace('/\/.*/', '', $serialNumberRaw);
// $serialNumber = trim($serialNumber);
// } else {
// $serialNumber = null;
// }
if ($serialNumberRaw != null) {
if (strpos($serialNumberRaw, '/') !== false) {
$serialNumber = strstr($serialNumberRaw, '/', true); // gets text before slash
} else {
$serialNumber = $serialNumberRaw; // keep original
}
$serialNumber = trim($serialNumber);
} else {
$serialNumber = null;
}
$item = Item::where('code', $itemCode)->first();
if (!$item) {
// Handle unknown item code
$this->form->fill([
@@ -1250,86 +1284,86 @@ class StickerReprint extends Page implements HasForms
return;
}
$line = Line::find($this->lId);
$lineName = $line ? $line->name : null;
//$line = Line::find($this->lId);
//$lineName = $line ? $line->name : null;
$categoryName = (Str::length($item->category) > 0) ? $item->category : "";
// $categoryName = (Str::length($item->category) > 0) ? $item->category : "";
if ($categoryName == 'Submersible Motor')
{
if ($lineName != '6 inch motor line')
{
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Line Found')
->body("Choose '6 inch motor line' to proceed..!")
->danger()
->send();
return;
}
}
else if ($categoryName == 'Submersible Pump')
{
if ($lineName != '6 inch pump line')
{
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Line Found')
->body("Choose '6 inch pump line' to proceed..!")
->danger()
->send();
return;
}
}
else
{
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
'line_id'=> $this->lId,
'item_id'=> null,
'serial_number'=> null,
'success_msg'=> null,
'production_order'=> $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
Notification::make()
->title('Invalid Category Found')
->body("Set proper category to proceed..!")
->danger()
->send();
return;
}
// if ($categoryName == 'Submersible Motor')
// {
// if ($lineName != '6 inch motor line')
// {
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Line Found')
// ->body("Choose '6 inch motor line' to proceed..!")
// ->danger()
// ->send();
// return;
// }
// }
// else if ($categoryName == 'Submersible Pump')
// {
// if ($lineName != '6 inch pump line')
// {
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Line Found')
// ->body("Choose '6 inch pump line' to proceed..!")
// ->danger()
// ->send();
// return;
// }
// }
// else
// {
// $this->form->fill([
// 'plant_id'=> $this->pId,
// 'block_name'=> $this->bId,
// 'shift_id'=> $this->sId,
// 'line_id'=> $this->lId,
// 'item_id'=> null,
// 'serial_number'=> null,
// 'success_msg'=> null,
// 'production_order'=> $this->prodOrder,
// 'sap_msg_status' => null,
// 'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
// 'recent_qr' => $this->recQr,
// ]);
// Notification::make()
// ->title('Invalid Category Found')
// ->body("Set proper category to proceed..!")
// ->danger()
// ->send();
// return;
// }
if ($this->succId == null) {
$this->form->fill([
@@ -1364,6 +1398,42 @@ class StickerReprint extends Page implements HasForms
$itemCode = trim($parts[0]);
$this->sNoId = isset($parts[1]) ? trim($parts[1]) : null;
$originalQR = $this->qrData;
if (strpos($originalQR, '/') != false)
{
// Allowed endings
$allowed = ['/m', '/M', '/p', '/P', '/m|', '/M|', '/p|', '/P|'];
$foundValidEnding = false;
foreach ($allowed as $end) {
if (str_ends_with($originalQR, $end)) {
$foundValidEnding = true;
break;
}
}
if (!$foundValidEnding) {
Notification::make()
->title('Invalid QR Code')
->body("Invalid QR format: '$originalQR'")
->danger()
->send();
return;
}
}
if ($this->sNoId != null) {
$this->sNoId = preg_replace('/\/.*/', '', $serialNumberRaw);
$this->sNoId = trim($this->sNoId);
} else {
$this->sNoId = null;
}
//$this->qrData = preg_replace('/\/.*/', '', $this->qrData);
ProductionQuantity::create([
'plant_id'=> $this->pId,
'shift_id'=> $this->sId,
@@ -1378,7 +1448,6 @@ class StickerReprint extends Page implements HasForms
// after success insertion
$this->form->fill([
'plant_id'=> $this->pId,
'block_name'=> $this->bId,
'shift_id'=> $this->sId,
@@ -1401,7 +1470,7 @@ class StickerReprint extends Page implements HasForms
->duration(1000)
->send();
$url = route('download-qr1-pdf', ['palletNo' => $this->qrData]);
$url = route('download-qr1-pdf', ['palletNo' => urlencode($originalQR)]);
$this->js(<<<JS
window.dispatchEvent(new CustomEvent('open-pdf', {
detail: {
@@ -1418,11 +1487,16 @@ class StickerReprint extends Page implements HasForms
// Save the form data to the database or perform other operations
// For example:
$model = ProductionQuantity::create($formValues);
// $formValues['serial_number'] = $this->serialNumber;
// ProductionQuantity::create($formValues);
// dd('Production Updated Event Dispatched');
$this->dispatch('productionUpdated');
// // Optionally, you can emit an event or perform a redirect after saving
// $this->emit('formSaved', $model->id);
}

View File

@@ -2,9 +2,12 @@
namespace App\Filament\Resources;
use App\Filament\Exports\AlertMailRuleExporter;
use App\Filament\Imports\AlertMailRuleImporter;
use App\Filament\Resources\AlertMailRuleResource\Pages;
use App\Filament\Resources\AlertMailRuleResource\RelationManagers;
use App\Models\AlertMailRule;
use App\Models\InvoiceMaster;
use App\Models\Plant;
use Dotenv\Exception\ValidationException;
use Filament\Facades\Filament;
@@ -17,7 +20,13 @@ use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException as ValidationValidationException;
use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Actions\ExportAction;
class AlertMailRuleResource extends Resource
{
@@ -51,6 +60,7 @@ class AlertMailRuleResource extends Resource
'InvoiceDataReport' => 'InvoiceDataReport',
'ProductionQuantities' => 'ProductionQuantities',
'QualityValidation' => 'QualityValidation',
'InvoiceTransit' => 'InvoiceTransit',
]),
Forms\Components\Select::make('rule_name')
->label('Rule Name')
@@ -61,6 +71,7 @@ class AlertMailRuleResource extends Resource
'ProductionMail' => 'Production Mail',
'InvoiceDataMail' => 'Invoice Data Mail',
'QualityMail' => 'Quality Mail',
'InvoiceTransitMail' => 'Invoice Transit Mail',
])
->required(),
Forms\Components\TextInput::make('email')
@@ -75,29 +86,76 @@ class AlertMailRuleResource extends Resource
'Hourly' => 'Hourly',
'Daily' => 'Daily',
]),
Forms\Components\Select::make('receiving_plant_name')
->label('Receiving Plant')
->options(
InvoiceMaster::query()
->whereNotNull('receiving_plant_name')
->select('receiving_plant_name')
->distinct()
->pluck('receiving_plant_name', 'receiving_plant_name')
)
->searchable()
->reactive()
->afterStateUpdated(function (callable $set) {
$set('invoice_master_id', null);
}),
Forms\Components\Select::make('invoice_master_id')
->label('Transporter Name')
->options(function (callable $get) {
$recPlant = $get('receiving_plant_name');
if (! $recPlant) {
return [];
}
return InvoiceMaster::query()
->where('receiving_plant_name', $recPlant)
->whereNotNull('transport_name')
->where('transport_name', '!=', '')
->orderBy('transport_name')
->pluck('transport_name', 'id')
->toArray();
})
->searchable(),
Checkbox::make('is_active')
->label('All Plants Reports')
->afterStateUpdated(fn ($state, callable $set) => $state ? $set('plant', null) : null)
->reactive(),
// Forms\Components\Actions::make([
// Action::make('sendInvoiceData')
// ->label('Invoice Data Report')
// ->action(function ($get) {
// $plantIds = AlertMailRule::where('module', 'InvoiceDataReport')
// ->orderBy('plant')
// ->pluck('plant')
// ->toArray();
// foreach ($plantIds as $plantId) {
// Artisan::call('send:invoice-data-report', [
// 'schedule_type' => 'Daily',
// 'plant' => $plantId,
// ]);
// }
// // Notify user in Filament
// Notification::make()
// ->title('Invoice data report sent successfully!')
// ->success()
// ->send();
// }),
// ]),
Forms\Components\Hidden::make('created_by')
->default(fn () => Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by')
->default(fn () => Filament::auth()->user()?->name),
])
->columns(6),
->columns(2),
]);
}
// Optionally, also override for update/editing
// public static function mutateFormDataBeforeSave(array $data): array
// {
// dd('test');
// if ($data['is_active']) {
// $data['plant'] = 'All Plants';
// }
// return $data;
// }
public static function table(Table $table): Table
{
return $table
@@ -132,6 +190,14 @@ class AlertMailRuleResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('invoiceMaster.receiving_plant_name')
->label('Receiving Plant')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('invoiceMaster.transport_name')
->label('Transporter')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('email')
->label('TO Emails')
->searchable()
@@ -188,6 +254,22 @@ class AlertMailRuleResource extends Resource
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->label('Import Alert Mail Rule')
->color('warning')
->importer(AlertMailRuleImporter::class)
->visible(function() {
return Filament::auth()->user()->can('view import alert mail rule');
}),
ExportAction::make()
->label('Export Alert Mail Rule')
->color('warning')
->exporter(AlertMailRuleExporter::class)
->visible(function() {
return Filament::auth()->user()->can('view export alert mail rule');
}),
]);
}

View File

@@ -0,0 +1,536 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\CharacteristicValueExporter;
use App\Filament\Imports\CharacteristicValueImporter;
use App\Filament\Resources\CharacteristicValueResource\Pages;
use App\Models\CharacteristicValue;
use App\Models\Item;
use App\Models\Line;
use App\Models\Machine;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CharacteristicValueResource extends Resource
{
protected static ?string $model = CharacteristicValue::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Process Order';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('plant_id')
->label('Plant')
->relationship('plant', 'name')
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->reactive()
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('item_id', null);
$set('line_id', null);
$set('machine_id', null);
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
}
})
->extraAttributes(fn ($get) => [
'class' => $get('poPlantError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('poPlantError') ? $get('poPlantError') : null)
->hintColor('danger')
->required(),
Forms\Components\Select::make('line_id')
->label('Line')
->options(function (callable $get) {
if (! $get('plant_id')) {
return [];
}
return Line::where('plant_id', $get('plant_id'))
->pluck('name', 'id')
->toArray();
})
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('item_id', null);
$set('machine_id', null);
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
}
})
->reactive()
->required(),
Forms\Components\Select::make('item_id')
->label('Item')
->options(function (callable $get) {
if (! $get('plant_id') || ! $get('line_id')) {
return [];
}
return Item::where('plant_id', $get('plant_id'))
->pluck('code', 'id')
->toArray();
})
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('machine_id', null);
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
}
})
->reactive()
->required()
->searchable(),
Forms\Components\Select::make('machine_id')
->label('Machine')
->options(function (callable $get) {
if (! $get('plant_id') || ! $get('line_id') || ! $get('item_id')) {
return [];
}
return Machine::where('plant_id', $get('plant_id'))
->where('line_id', $get('line_id'))
->pluck('work_center', 'id')
->toArray();
})
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('process_order', null);
$set('coil_number', null);
$set('status', null);
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
}
})
->reactive()
->required(),
Forms\Components\TextInput::make('process_order')
->label('Process Order')
->reactive()
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('coil_number', null);
$set('status', null);
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
}
})
->required(),
Forms\Components\TextInput::make('coil_number')
->label('Coil Number')
// ->reactive()
// ->afterStateUpdated(function ($state, $set, callable $get) {
// $plantId = $get('plant_id');
// $set('status', null);
// if (! $plantId) {
// $set('poPlantError', 'Please select a plant first.');
// }
// })
// ->required(),
->label('Coil Number')
->default('0')
->reactive()
->afterStateUpdated(function ($state, $set, callable $get, $livewire) {
$plantId = $get('plant_id');
$processOrder = $get('process_order');
$coilNo = $get('coil_number');
if (! $plantId) {
$set('poPlantError', 'Please select a plant first.');
} elseif (! $processOrder) {
$set('coil_number', null);
$set('poPlantError', null);
} elseif ($coilNo || $coilNo == '0') {
$existing = CharacteristicValue::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('coil_number', $coilNo)
->first();
if ($existing) {
$set('poPlantError', null);
$set('coil_number', null);
$set('coilNumberError', "Duplicate Coil : '{$coilNo}' found!");
} else {
$set('poPlantError', null);
$set('coilNumberError', null);
}
}
})
->extraAttributes(fn ($get) => [
'class' => $get('coilNumberError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('coilNumberError') ? $get('coilNumberError') : null)
->hintColor('danger')
->required(),
Forms\Components\TextInput::make('observed_value')
->label('Observed Value')
->reactive()
->required(),
Forms\Components\Select::make('status')
->label('Status')
->options([
'Ok' => 'OK',
'NotOk' => 'Not Ok',
])
->reactive()
->required(),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by')
->label('Updated By')
->default(Filament::auth()->user()?->name),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('No.')
->label('No.')
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
Tables\Columns\TextColumn::make('plant.name')
->label('Plant')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('line.name')
->label('Line')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('item.code')
->label('Item')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('machine.work_center')
->label('Machine')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('process_order')
->label('Process Order')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('coil_number')
->label('Coil Number')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('observed_value')
->label('Observed value')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('status')
->label('Status')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->searchable()
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
// ->filters([
// Tables\Filters\TrashedFilter::make(),
// ])
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
->label('Advanced Filters')
->form([
Select::make('Plant')
->label('Select Plant')
->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::pluck('name', 'id')->toArray();
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Item', null);
}),
Select::make('Line')
->label('Select Line')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (empty($plantId)) {
return [];
}
return Line::where('plant_id', $plantId)->pluck('name', 'id');
// return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('Item', null);
}),
Select::make('Item')
->label('Item Code')
->nullable()
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
if (empty($plantId)) {
return [];
}
return Item::where('plant_id', $plantId)->pluck('code', 'id');
// return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('process_order', null);
}),
Select::make('Machine')
->label('Select Machine')
->nullable()
->options(function (callable $get) {
$plantId = $get('Plant');
$lineId = $get('Line');
if (empty($plantId) || empty($lineId)) {
return [];
}
return Machine::where('plant_id', $plantId)->where('line_id', $lineId)->pluck('work_center', 'id');
// return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('process_order', null);
}),
TextInput::make('process_order')
->label('Process Order')
->placeholder('Enter Process Order'),
TextInput::make('coil_number')
->label('Coil Number')
->placeholder(placeholder: 'Enter Coil Number'),
Select::make('status')
->label('Status')
->options([
'Ok' => 'OK',
'NotOk' => 'Not Ok',
]),
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['Item']) && empty($data['Machine']) && empty($data['process_order']) && empty($data['coil_number']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
return $query->whereRaw('1 = 0');
}
if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (! empty($data['Line'])) {
$query->where('line_id', $data['Line']);
}
if (! empty($data['Item'])) {
$query->where('item_id', $data['Item']);
}
if (! empty($data['Machine'])) {
$query->where('machine_id', $data['Machine']);
}
if (! empty($data['process_order'])) {
$query->where('process_order', $data['process_order']);
}
if (! empty($data['coil_number'])) {
$query->where('coil_number', $data['coil_number']);
}
if (! empty($data['status'])) {
$query->where('status', $data['status']);
}
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
// $query->orderBy('created_at', 'asc');
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['Plant'])) {
$indicators[] = 'Plant: '.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: '.Line::where('id', $data['Line'])->value('name');
}
if (! empty($data['Item'])) {
$indicators[] = 'Item: '.Item::where('id', $data['Item'])->value('code');
}
if (! empty($data['Machine'])) {
$indicators[] = 'Machine: '.Machine::where('id', $data['Machine'])->value('work_center');
}
if (! empty($data['process_order'])) {
$indicators[] = 'Process Order: '.$data['process_order'];
}
if (! empty($data['coil_number'])) {
$indicators[] = 'Coil Number: '.$data['coil_number'];
}
if (! empty($data['status'])) {
$indicators[] = 'Status: '.$data['status'];
}
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
ImportAction::make()
->importer(CharacteristicValueImporter::class)
->label('Import Characteristic Value')
->color('warning')
->visible(function () {
return Filament::auth()->user()->can('view import characteristic value');
}),
ExportAction::make()
->exporter(CharacteristicValueExporter::class)
->label('Export Characteristic Value')
->color('warning')
->visible(function () {
return Filament::auth()->user()->can('view export characteristic value');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListCharacteristicValues::route('/'),
'create' => Pages\CreateCharacteristicValue::route('/create'),
'view' => Pages\ViewCharacteristicValue::route('/{record}'),
'edit' => Pages\EditCharacteristicValue::route('/{record}/edit'),
];
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,23 +5,22 @@ namespace App\Filament\Resources;
use App\Filament\Exports\EbReadingExporter;
use App\Filament\Imports\EbReadingImporter;
use App\Filament\Resources\EbReadingResource\Pages;
use App\Filament\Resources\EbReadingResource\RelationManagers;
use App\Models\EbReading;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Actions\ExportAction;
use Filament\Facades\Filament;
use Filament\Tables\Filters\Filter;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\DateTimePicker;
class EbReadingResource extends Resource
{
@@ -39,6 +38,7 @@ class EbReadingResource extends Resource
->relationship('plant', 'name')
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->required(),
@@ -154,6 +154,7 @@ class EbReadingResource extends Resource
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
Tables\Columns\TextColumn::make('plant.name')
@@ -334,6 +335,7 @@ class EbReadingResource extends Resource
// })
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->reactive()
@@ -359,19 +361,25 @@ class EbReadingResource extends Resource
return $query->whereRaw('1 = 0');
}
if (!empty($data['Plant'])) {
if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (!empty($data['created_from'])) {
if (! empty($data['created_from'])) {
$query->where('created_at', '>=', $data['created_from']);
}
if (!empty($data['created_to'])) {
if (! empty($data['created_to'])) {
$query->where('created_at', '<=', $data['created_to']);
}
if (!empty($data['electrician_sign'])) {
if (! empty($data['electrician_sign'])) {
$query->where('electrician_sign', $data['electrician_sign']);
}
@@ -379,24 +387,30 @@ class EbReadingResource extends Resource
->indicateUsing(function (array $data) {
$indicators = [];
if (!empty($data['Plant'])) {
$indicators[] = 'Plant: ' . Plant::where('id', $data['Plant'])->value('name');
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['electrician_sign'])) {
$indicators[] = 'Created By: ' . $data['electrician_sign'];
if (! empty($data['electrician_sign'])) {
$indicators[] = 'Created By: '.$data['electrician_sign'];
}
if (!empty($data['created_from'])) {
$indicators[] = 'From: ' . $data['created_from'];
if (! empty($data['created_from'])) {
$indicators[] = 'From: '.$data['created_from'];
}
if (!empty($data['created_to'])) {
$indicators[] = 'To: ' . $data['created_to'];
if (! empty($data['created_to'])) {
$indicators[] = 'To: '.$data['created_to'];
}
return $indicators;
})
}),
])
->filtersFormMaxHeight('280px')
->actions([
@@ -415,14 +429,14 @@ class EbReadingResource extends Resource
->label('Import EB Readings')
->color('warning')
->importer(EbReadingImporter::class)
->visible(function() {
->visible(function () {
return Filament::auth()->user()->can('view import eb reading');
}),
ExportAction::make()
->label('Export EB Readings')
->color('warning')
->exporter(EbReadingExporter::class)
->visible(function() {
->visible(function () {
return Filament::auth()->user()->can('view export eb reading');
}),
]);

View File

@@ -5,7 +5,6 @@ namespace App\Filament\Resources;
use App\Filament\Exports\GuardPatrolEntryExporter;
use App\Filament\Imports\GuardPatrolEntryImporter;
use App\Filament\Resources\GuardPatrolEntryResource\Pages;
use App\Filament\Resources\GuardPatrolEntryResource\RelationManagers;
use App\Models\CheckPointName;
use App\Models\Configuration;
use App\Models\GuardName;
@@ -17,7 +16,6 @@ use Filament\Forms;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Tabs\Tab;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Forms\Get;
@@ -54,21 +52,21 @@ class GuardPatrolEntryResource extends Resource
->reactive()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->default(function () {
return optional(GuardPatrolEntry::where('created_by', Filament::auth()->user()?->name)->latest()->first())->plant_id;
})
->disabled(fn (Get $get) => !empty($get('id')))
->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id');
if (!$plantId) {
if (! $plantId) {
// $set('gPePlantError', 'Please select a plant first.');
$set('gPePlantError', 'Please select a plant first.');
return;
}
else
{
} else {
$set('patrol_time', now()->format('Y-m-d H:i:s'));
$set('updated_by', Filament::auth()->user()?->name);
$set('gPePlantError', null);
@@ -84,7 +82,7 @@ class GuardPatrolEntryResource extends Resource
// ->relationship('guardNames', 'name')
->options(function (callable $get) {
$plantId = $get('plant_id');
if (!$plantId) {
if (! $plantId) {
return [];
}
@@ -97,15 +95,14 @@ class GuardPatrolEntryResource extends Resource
->default(function () {
return optional(GuardPatrolEntry::where('created_by', Filament::auth()->user()?->name)->latest()->first())->guard_name_id;
})
->disabled(fn (Get $get) => !empty($get('id')))
->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$guardName = $get('guard_name_id');
if (!$guardName) {
if (! $guardName) {
$set('gPeGuardNameError', 'Please select a guard name first.');
return;
}
else
{
} else {
$set('patrol_time', now()->format('Y-m-d H:i:s'));
$set('updated_by', Filament::auth()->user()?->name);
$set('gPeGuardNameError', null);
@@ -116,7 +113,7 @@ class GuardPatrolEntryResource extends Resource
])
->hint(fn ($get) => $get('gPeGuardNameError') ? $get('gPeGuardNameError') : null)
->hintColor('danger'),
Forms\Components\Hidden::make('check_point_name')//TextInput
Forms\Components\Hidden::make('check_point_name')// TextInput
->label('Check Point Name')
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -131,7 +128,7 @@ class GuardPatrolEntryResource extends Resource
// ->relationship('checkPointNames', 'name')
->options(function (callable $get) {
$plantId = $get('plant_id');
if (!$plantId) {
if (! $plantId) {
return [];
}
@@ -144,16 +141,15 @@ class GuardPatrolEntryResource extends Resource
// ->default(function () {
// return optional(GuardPatrolEntry::where('created_by', Filament::auth()->user()?->name)->latest()->first())->check_point_name_id;
// })
->disabled(fn (Get $get) => !empty($get('id')))
->disabled(fn (Get $get) => ! empty($get('id')))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$checkPointName = $get('check_point_name_id');
if (!$checkPointName) {
if (! $checkPointName) {
$set('check_point_name_id', null);
$set('gPeCheckPointNameError', 'Please select a check point name first.');
return;
}
else
{
} else {
$set('patrol_time', now()->format('Y-m-d H:i:s'));
$set('updated_by', Filament::auth()->user()?->name);
$set('gPeCheckPointNameError', null);
@@ -173,11 +169,10 @@ class GuardPatrolEntryResource extends Resource
}),
Forms\Components\TextInput::make('reader_code')
->label('Reader Code')
->hidden(fn (Get $get) => !$get('id'))
->hidden(fn (Get $get) => ! $get('id'))
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
if(!$get('id'))
{
if (! $get('id')) {
$set('patrol_time', now()->format('Y-m-d H:i:s'));
}
$set('updated_by', Filament::auth()->user()?->name);
@@ -186,7 +181,7 @@ class GuardPatrolEntryResource extends Resource
->label('Patrol Time')
->reactive()
->default(fn () => now())
->readOnly(fn (Get $get) => !$get('id'))
->readOnly(fn (Get $get) => ! $get('id'))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('updated_by', Filament::auth()->user()?->name);
})
@@ -225,6 +220,7 @@ class GuardPatrolEntryResource extends Resource
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
// Tables\Columns\TextColumn::make('id')
@@ -235,11 +231,11 @@ class GuardPatrolEntryResource extends Resource
->label('Plant')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('guardNames.name') //guard_name_id
Tables\Columns\TextColumn::make('guardNames.name') // guard_name_id
->label('Guard Name')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('checkPointNames.name') //check_point_name_id
Tables\Columns\TextColumn::make('checkPointNames.name') // check_point_name_id
->label('Check Point Name')
->alignCenter()
->sortable(),
@@ -288,18 +284,19 @@ class GuardPatrolEntryResource extends Resource
// })
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->reactive(),
// ->afterStateUpdated(function ($state, callable $set, callable $get) {
// $set('sticker_master_id', null);
// $set('sap_msg_status', null);
// }),
// ->afterStateUpdated(function ($state, callable $set, callable $get) {
// $set('sticker_master_id', null);
// $set('sap_msg_status', null);
// }),
Select::make('Guard Name')
->label('Select Guard Name')
->options(function (callable $get) {
$plantId = $get('Plant');
if (!$plantId) {
if (! $plantId) {
return [];
}
@@ -310,7 +307,7 @@ class GuardPatrolEntryResource extends Resource
->label('Select Check Point Name')
->options(function (callable $get) {
$plantId = $get('Plant');
if (!$plantId) {
if (! $plantId) {
return [];
}
@@ -322,11 +319,11 @@ class GuardPatrolEntryResource extends Resource
->placeholder('Select Created By')
->options(function (callable $get) {
$plantId = $get('Plant');
if (!$plantId) {
if (! $plantId) {
return [];
}
return GuardPatrolEntry::where('plant_id', $plantId)->orderBy('patrol_time', 'asc')->get()->unique('created_by')->pluck('created_by', 'created_by')->toArray();//, 'id'
return GuardPatrolEntry::where('plant_id', $plantId)->orderBy('patrol_time', 'asc')->get()->unique('created_by')->pluck('created_by', 'created_by')->toArray(); // , 'id'
})
->reactive(),
DateTimePicker::make(name: 'From Patrol Time')
@@ -341,66 +338,78 @@ class GuardPatrolEntryResource extends Resource
->placeholder(placeholder: 'Select To Patrol Time')
->reactive()
->native(false),
])
->query(function ($query, array $data) {
//Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Guard Name']) && empty($data['Check Point Name']) && empty($data['Created By']) && empty($data['From Patrol Time']) && empty($data['To Patrol Time'])) {
return $query->whereRaw('1 = 0');
}
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['Guard Name']) && empty($data['Check Point Name']) && empty($data['Created By']) && empty($data['From Patrol Time']) && empty($data['To Patrol Time'])) {
return $query->whereRaw('1 = 0');
}
if (!empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']);
}
if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']);
} else {
$userHas = Filament::auth()->user()->plant_id;
if (!empty($data['Guard Name'])) {
$query->where('guard_name_id', $data['Guard Name']);
}
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
}
if (!empty($data['Check Point Name'])) {
$query->where('check_point_name_id', $data['Check Point Name']);
}
if (! empty($data['Guard Name'])) {
$query->where('guard_name_id', $data['Guard Name']);
}
if (!empty($data['Created By'])) {
$query->where('created_by', $data['Created By']);
}
if (! empty($data['Check Point Name'])) {
$query->where('check_point_name_id', $data['Check Point Name']);
}
if (!empty($data['From Patrol Time'])) {
$query->where('patrol_time', '>=', $data['From Patrol Time']);
}
if (! empty($data['Created By'])) {
$query->where('created_by', $data['Created By']);
}
if (!empty($data['To Patrol Time'])) {
$query->where('patrol_time', '<=', $data['To Patrol Time']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
if (! empty($data['From Patrol Time'])) {
$query->where('patrol_time', '>=', $data['From Patrol Time']);
}
if (!empty($data['Plant'])) {
$indicators[] = 'Plant: ' . Plant::where('id', $data['Plant'])->value('name');
}
if (! empty($data['To Patrol Time'])) {
$query->where('patrol_time', '<=', $data['To Patrol Time']);
}
})
->indicateUsing(function (array $data) {
$indicators = [];
if (!empty($data['Guard Name'])) {
$indicators[] = 'Guard Name: ' . GuardName::where('plant_id', $data['Plant'])->where('id', $data['Guard Name'])->value('name');
}
if (! empty($data['Plant'])) {
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
} else {
$userHas = Filament::auth()->user()->plant_id;
if (!empty($data['Check Point Name'])) {
$indicators[] = 'Check Point Name: ' . CheckPointName::where('plant_id', $data['Plant'])->where('id', $data['Check Point Name'])->value('name');
}
if ($userHas && strlen($userHas) > 0) {
return 'Plant: Choose plant to filter records.';
}
}
if (!empty($data['Created By'])) {
$indicators[] = 'Created By: ' . $data['Created By'];
}
if (! empty($data['Guard Name'])) {
$indicators[] = 'Guard Name: '.GuardName::where('plant_id', $data['Plant'])->where('id', $data['Guard Name'])->value('name');
}
if (!empty($data['From Patrol Time'])) {
$indicators[] = 'From: ' . $data['From Patrol Time'];
}
if (! empty($data['Check Point Name'])) {
$indicators[] = 'Check Point Name: '.CheckPointName::where('plant_id', $data['Plant'])->where('id', $data['Check Point Name'])->value('name');
}
if (!empty($data['To Patrol Time'])) {
$indicators[] = 'To: ' . $data['To Patrol Time'];
}
if (! empty($data['Created By'])) {
$indicators[] = 'Created By: '.$data['Created By'];
}
return $indicators;
})
if (! empty($data['From Patrol Time'])) {
$indicators[] = 'From: '.$data['From Patrol Time'];
}
if (! empty($data['To Patrol Time'])) {
$indicators[] = 'To: '.$data['To Patrol Time'];
}
return $indicators;
}),
])
->filtersFormMaxHeight('280px')
->actions([
@@ -422,6 +431,7 @@ class GuardPatrolEntryResource extends Resource
// ->options(Plant::pluck('name', 'id')->toArray())
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->label('Select Plant')
@@ -433,12 +443,11 @@ class GuardPatrolEntryResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id');
$set('guard_patrol_entry', null);
if (!$plantId) {
if (! $plantId) {
$set('gPeSelectPlantError', 'Please select a plant first.');
return;
}
else
{
} else {
$set('gPeSelectPlantError', null);
}
})
@@ -455,7 +464,7 @@ class GuardPatrolEntryResource extends Resource
->reactive()
->required()
->disk('local')
->visible(fn (Get $get) => !empty($get('plant_id')))
->visible(fn (Get $get) => ! empty($get('plant_id')))
->directory('uploads/temp')
// Allow only .xlsx and .xls
->acceptedFileTypes(['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel'])
@@ -465,7 +474,7 @@ class GuardPatrolEntryResource extends Resource
])
// Server-side validation for extra safety
->rules(['mimes:xlsx,xls']),
])
])
->action(function (array $data) {
$uploadedFile = $data['guard_patrol_entry'];
@@ -482,21 +491,20 @@ class GuardPatrolEntryResource extends Resource
$folderPath = Configuration::where('c_name', 'GUARD_PATROL_ENTRY_FOLDER_PATH')->where('plant_id', $plantId)->value('c_value');
if(!$folderPath)
{
if (! $folderPath) {
Notification::make()
->title('Upload Folder Path Not Found!')
->body('Please set the folder path in configuration for Guard Patrol Entry.')
->danger()
->send();
return;
}
$fullFolderPath = "uploads/$folderPath";
// Check if the folder exists, if not, create it
if (!Storage::disk('local')->exists($fullFolderPath))
{
if (! Storage::disk('local')->exists($fullFolderPath)) {
Storage::disk('local')->makeDirectory($fullFolderPath);
}
@@ -504,12 +512,10 @@ class GuardPatrolEntryResource extends Resource
$fullPath = Storage::disk('local')->path($path);
if ($fullPath && file_exists($fullPath))
{
if ($fullPath && file_exists($fullPath)) {
$rows = Excel::toArray(null, $fullPath)[0];
if((count($rows) - 1) <= 0)
{
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Invalid Guard Patrol Entry Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.')
@@ -519,19 +525,21 @@ class GuardPatrolEntryResource extends Resource
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$invalidRows=[];
$invalidGuardCheckPoints=[];
$unknownGuards=[];
$unknownCheckPoints=[];
$invalidPatrolTimes=[];
$invalidRows = [];
$invalidGuardCheckPoints = [];
$unknownGuards = [];
$unknownCheckPoints = [];
$invalidPatrolTimes = [];
$validRowsFound = false;
foreach ($rows as $index => $row)
{
if ($index === 0) continue; // Skip header
foreach ($rows as $index => $row) {
if ($index === 0) {
continue;
} // Skip header
$rowNumber = trim($row[0]);
$guardName = trim($row[1]);
@@ -539,35 +547,34 @@ class GuardPatrolEntryResource extends Resource
$readerCode = trim($row[3]);
$patrolTime = trim($row[4]);
if (empty($rowNumber)) { continue; }
if (empty($rowNumber)) {
continue;
}
if (empty($guardName) || empty($checkPointName) || empty($readerCode) || empty($patrolTime)) {
$invalidRows[] = $rowNumber;
continue;
}
else
{
if(Str::length($guardName) < 3 || Str::length($checkPointName) < 3 || Str::length($readerCode) < 3 || Str::length($patrolTime) < 3)
{
} else {
if (Str::length($guardName) < 3 || Str::length($checkPointName) < 3 || Str::length($readerCode) < 3 || Str::length($patrolTime) < 3) {
$invalidGuardCheckPoints[] = $rowNumber;
continue;
}
else
{
} else {
$isValidRow = true;
$guardNames = GuardName::where('plant_id', $plantId)->where('name', $guardName)->first();
if (!$guardNames) {
if (! $guardNames) {
$unknownGuards[] = $guardName;
$isValidRow = false;
}
$checkPointNames = CheckPointName::where('plant_id', $plantId)->where('name', $checkPointName)->first();
if (!$checkPointNames) {
if (! $checkPointNames) {
$unknownCheckPoints[] = $checkPointName;
$isValidRow = false;
}
$formats = ['d-m-Y H:i:s', 'd-m-Y H:i']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i:s', 'd-m-Y H:i']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$patrolDateTime = null;
foreach ($formats as $format) {
try {
@@ -579,13 +586,13 @@ class GuardPatrolEntryResource extends Resource
}
}
if (!isset($patrolDateTime)) {
if (! isset($patrolDateTime)) {
$invalidPatrolTimes[] = $rowNumber;
$isValidRow = false;
//$warnMsg[] = "Invalid 'Patrol DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
// $warnMsg[] = "Invalid 'Patrol DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
if ($isValidRow && !$validRowsFound) {
if ($isValidRow && ! $validRowsFound) {
$validRowsFound = true;
}
}
@@ -593,38 +600,40 @@ class GuardPatrolEntryResource extends Resource
}
$uniqueInvalidRows = array_unique($invalidRows);
if (!empty($uniqueInvalidRows)) {
if (! empty($uniqueInvalidRows)) {
Notification::make()
->title('Invalid Guard Patrol Entry Found')
->body('The following rows contain empty values (Guard name or Check point name or Reader code or Patrol time):<br>' . implode(', ', $uniqueInvalidRows))
->body('The following rows contain empty values (Guard name or Check point name or Reader code or Patrol time):<br>'.implode(', ', $uniqueInvalidRows))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
//should contain minimum 13 digit alpha numeric values
// should contain minimum 13 digit alpha numeric values
$uniqueInvalidGuardCheckPoints = array_unique($invalidGuardCheckPoints);
if (!empty($uniqueInvalidGuardCheckPoints)) {
if (! empty($uniqueInvalidGuardCheckPoints)) {
Notification::make()
->title('Invalid Guard Patrol Entry Found')
->body('The following rows contain invalid values (Guard name or Check point name or Reader code or Patrol time):<br>' . implode(', ', $uniqueInvalidGuardCheckPoints))
->body('The following rows contain invalid values (Guard name or Check point name or Reader code or Patrol time):<br>'.implode(', ', $uniqueInvalidGuardCheckPoints))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$invalidDataFound = false;
$uniqueUnknownGuards = array_unique($unknownGuards);
if (!empty($uniqueUnknownGuards)) {
if (! empty($uniqueUnknownGuards)) {
Notification::make()
->title('Unknown Guard Names Found')
->body("The following guard names aren't exist in master data:<br>" . implode(', ', $uniqueUnknownGuards))
->body("The following guard names aren't exist in master data:<br>".implode(', ', $uniqueUnknownGuards))
->danger()
->send();
if ($disk->exists($path)) {
@@ -634,10 +643,10 @@ class GuardPatrolEntryResource extends Resource
}
$uniqueUnknownCheckPoints = array_unique($unknownCheckPoints);
if (!empty($uniqueUnknownCheckPoints)) {
if (! empty($uniqueUnknownCheckPoints)) {
Notification::make()
->title('Unknown Check Point Names Found')
->body("The following check point names aren't exist in master data:<br>" . implode(', ', $uniqueUnknownCheckPoints))
->body("The following check point names aren't exist in master data:<br>".implode(', ', $uniqueUnknownCheckPoints))
->danger()
->send();
if ($disk->exists($path)) {
@@ -647,10 +656,10 @@ class GuardPatrolEntryResource extends Resource
}
$uniqueInvalidPatrolTimes = array_unique($invalidPatrolTimes);
if (!empty($uniqueInvalidPatrolTimes)) {
if (! empty($uniqueInvalidPatrolTimes)) {
Notification::make()
->title('Invalid Patrol Time Format Found')
->body("The following rows contains invalid patrol time format (Expected 'DD-MM-YYYY HH:MM:SS'):<br>" . implode(', ', $uniqueInvalidPatrolTimes))
->body("The following rows contains invalid patrol time format (Expected 'DD-MM-YYYY HH:MM:SS'):<br>".implode(', ', $uniqueInvalidPatrolTimes))
->danger()
->send();
if ($disk->exists($path)) {
@@ -663,24 +672,26 @@ class GuardPatrolEntryResource extends Resource
return;
}
if (!$validRowsFound) {
if (! $validRowsFound) {
Notification::make()
->title('Invalid Guard Patrol Entry Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$validCnt = 0;
$dupCnt = 0;
$validRowsFound = false;
foreach ($rows as $index => $row)
{
if ($index === 0) continue; // Skip header
foreach ($rows as $index => $row) {
if ($index === 0) {
continue;
} // Skip header
$rowNumber = trim($row[0]);
$guardName = trim($row[1]);
@@ -688,7 +699,9 @@ class GuardPatrolEntryResource extends Resource
$readerCode = trim($row[3]);
$patrolTime = trim($row[4]);
if (empty($rowNumber)) { continue; }
if (empty($rowNumber)) {
continue;
}
if (empty($guardName) || empty($checkPointName) || empty($readerCode) || empty($patrolTime)) {
continue;
@@ -696,7 +709,7 @@ class GuardPatrolEntryResource extends Resource
$isValidRow = true;
$formats = ['d-m-Y H:i:s', 'd-m-Y H:i']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$formats = ['d-m-Y H:i:s', 'd-m-Y H:i']; // '07-05-2025 08:00' or '07-05-2025 08:00:00'
$patrolDateTime = null;
foreach ($formats as $format) {
try {
@@ -707,7 +720,7 @@ class GuardPatrolEntryResource extends Resource
}
}
if (!isset($patrolDateTime)) {
if (! isset($patrolDateTime)) {
$isValidRow = false;
}
@@ -718,23 +731,22 @@ class GuardPatrolEntryResource extends Resource
$guardEntryFound = GuardPatrolEntry::where('plant_id', $plantId)->where('guard_name_id', $guardNames->id)->where('check_point_name_id', $checkPointNames->id)->where('patrol_time', $patrolDateTime->format('Y-m-d H:i:s'))->first();
if ($guardEntryFound) {
//$warnMsg[] = "Duplicate guard patrol entry found";
// $warnMsg[] = "Duplicate guard patrol entry found";
$dupCnt++;
continue;
}
else
{
} else {
$validCnt++;
GuardPatrolEntry::updateOrCreate([
'plant_id' => $plantId,
'guard_name_id' => $guardNames->id,
'check_point_name_id' => $checkPointNames->id,
'patrol_time' => $patrolDateTime->format('Y-m-d H:i:s')
'patrol_time' => $patrolDateTime->format('Y-m-d H:i:s'),
],
[
'reader_code' => $readerCode,
'created_by' => $user,
'updated_by' => $user
[
'reader_code' => $readerCode,
'created_by' => $user,
'updated_by' => $user,
]
);
$validRowsFound = true;
@@ -742,31 +754,25 @@ class GuardPatrolEntryResource extends Resource
}
}
if (!$validRowsFound && $dupCnt > 0) {
if (! $validRowsFound && $dupCnt > 0) {
Notification::make()
->title('Duplicate Guard Patrol Entry Found')
->body("Uploaded excel sheet contains '{$dupCnt}' duplicate entries!<br>Please check the uploaded file and try again.")
->danger()
->send();
if ($disk->exists($path))
{
if ($disk->exists($path)) {
$disk->delete($path);
}
}
else if ($validRowsFound && $validCnt > 0)
{
//session(['guard_patrol_entry_path' => $fullPath]);
} elseif ($validRowsFound && $validCnt > 0) {
// session(['guard_patrol_entry_path' => $fullPath]);
Notification::make()
->title("Success: '{$validCnt}' guard patrol entries imported successfully.")
->success()
->send();
if ($disk->exists($path))
{
if ($disk->exists($path)) {
$disk->delete($path);
}
}
else
{
} else {
Notification::make()
->title('Failed: Something went wrong while uploading guard patrol entries!')
->danger()
@@ -777,7 +783,7 @@ class GuardPatrolEntryResource extends Resource
}
}
})
->visible(function() {
->visible(function () {
return Filament::auth()->user()->can('view import guard patrol entries');
}),
ImportAction::make()
@@ -785,14 +791,14 @@ class GuardPatrolEntryResource extends Resource
// ->hidden()
->color('warning')
->importer(GuardPatrolEntryImporter::class)
->visible(function() {
->visible(function () {
return Filament::auth()->user()->can('view import guard patrol entry');
}),
ExportAction::make()
->label('Export Guard Patrol Entry')
->color('warning')
->exporter(GuardPatrolEntryExporter::class)
->visible(function() {
->visible(function () {
return Filament::auth()->user()->can('view export guard patrol entry');
}),
]);

View File

@@ -28,7 +28,7 @@ class InvoiceDataValidationResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Invoice Management';
protected static ?string $navigationGroup = 'Manufacturing SD';
public static function form(Form $form): Form
{
@@ -59,6 +59,8 @@ class InvoiceDataValidationResource extends Resource
Forms\Components\TextInput::make('location')
->label('Location')
->required(),
Forms\Components\TextInput::make('remark')
->label('Remark'),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
@@ -123,6 +125,11 @@ class InvoiceDataValidationResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('remark')
->label('Remark')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()

View File

@@ -0,0 +1,630 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\InvoiceInTransitExporter;
use App\Filament\Resources\InvoiceInTransitResource\Pages;
use App\Filament\Resources\InvoiceInTransitResource\RelationManagers;
use App\Models\InvoiceInTransit;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Forms\Components\FileUpload;
use Storage;
use Maatwebsite\Excel\Facades\Excel;
use Filament\Tables\Actions\ExportAction;
use Carbon\Carbon;
use PhpOffice\PhpSpreadsheet\Shared\Date as ExcelDate;
class InvoiceInTransitResource extends Resource
{
protected static ?string $model = InvoiceInTransit::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Manufacturing SD';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('plant_id')
->relationship('plant', 'name')
->required(),
Forms\Components\TextInput::make('receiving_plant')
->label('Receiving Plant'),
Forms\Components\TextInput::make('receiving_plant_name')
->label('Receiving Plant Name'),
Forms\Components\TextInput::make('invoice_number')
->label('Invoice Number'),
Forms\Components\TextInput::make('invoice_date')
->label('Invoice Date'),
Forms\Components\TextInput::make('item_code')
->label('Item Code'),
Forms\Components\TextInput::make('description')
->label('Description'),
Forms\Components\TextInput::make('quantity')
->label('Quantity')
->numeric()
->default(null),
Forms\Components\TextInput::make('transport_name')
->label('Transport Name'),
Forms\Components\TextInput::make('lr_bl_aw_number')
->label('LR/BL/AW Number'),
Forms\Components\TextInput::make('lr_bl_aw_date')
->label('LR/BL/AW Date'),
Forms\Components\TextInput::make('pending_days')
->label('Pending Days'),
Forms\Components\TextInput::make('obd_number')
->label('OBD Number'),
Forms\Components\TextInput::make('obd_date')
->label('OBD Date'),
Forms\Components\TextInput::make('shipment_weight')
->label('Shipment Weight'),
Forms\Components\TextInput::make('unit_price')
->label('Unit Price'),
Forms\Components\TextInput::make('net_value')
->label('Net value'),
Forms\Components\TextInput::make('total_item_amount')
->label('Total Item Amount'),
Forms\Components\TextInput::make('tax_amount')
->label('Tax Amount'),
Forms\Components\TextInput::make('transport_mode')
->label('Transport Mode'),
Forms\Components\TextInput::make('vehicle_number')
->label('Vehicle Number'),
Forms\Components\TextInput::make('e_waybill_number')
->label('E Way Bill Number'),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by')
->label('Updated By')
->default(Filament::auth()->user()?->name),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('No.')
->label('No.')
->alignCenter()
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
Tables\Columns\TextColumn::make('plant.name')
->label('Plant')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('receiving_plant')
->label('Receiving Plant')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('receiving_plant_name')
->label('Receiving Plant Name')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('invoice_number')
->label('Invoice Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('invoice_date')
->label('Invoice Date')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item_code')
->label('Item Code')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('description')
->label('Description')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('quantity')
->label('Quantity')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('transport_name')
->label('Transport Name')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('lr_bl_aw_number')
->label('LR/BL/AW Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('lr_bl_aw_date')
->label('LR/BL/AW Date')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('pending_days')
->label('Pending Days')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('obd_number')
->label('OBD Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('obd_date')
->label('OBD Date')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('shipment_weight')
->label('Shipment Weight')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('unit_price')
->label('Unit Price')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('net_value')
->label('Net value')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('total_item_amount')
->label('Total Item Amount')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('tax_amount')
->label('Tax Amount')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('transport_mode')
->label('Transport Mode')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('vehicle_number')
->label('Vehicle Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('e_waybill_number')
->label('E Way Bill Number')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
Tables\Actions\Action::make('Import Invoice In Transit')
->label('Import Invoice In Transit')
->form([
FileUpload::make('invoice_in_transit_file')
->label('Import Invoice In Transit')
->preserveFilenames()
->storeFiles(false)
->reactive()
->required()
->disk('local')
->directory('uploads/temp'),
])
->action(function (array $data) {
InvoiceInTransit::truncate();
$uploadedFile = $data['invoice_in_transit_file'];
$disk = Storage::disk('local');
$user = Filament::auth()->user();
$operatorName = $user->name;
// Get original filename
$originalName = $uploadedFile->getClientOriginalName();
$path = $uploadedFile->storeAs('uploads/temp', $originalName, 'local'); // returns relative path
$fullPath = Storage::disk('local')->path($path);
if ($fullPath && file_exists($fullPath))
{
$rows = Excel::toArray(null, $fullPath)[0];
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Records Not Found')
->body("Import the valid 'Invoice Master Data' file to proceed..!")
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$invalidPlantCode = [];
$invalidPlantCo = [];
$invalidPlaCoFound = [];
$invalidRecPlant = [];
$invalidRecPlantName = [];
$invalidInvNo = [];
$invalidInvDt = [];
$invalidICode = [];
$invalidDesc = [];
$invalidQty = [];
$invalidTransportName = [];
$invalidLRBLAWNo = [];
$invalidLRBLAWDt = [];
$invalidPenDay = [];
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
}
$plantCode = trim($row[0]);
$receivingPlant = trim($row[2]);
$receivingPlantName = trim($row[3]);
$invoiceNo = trim($row[4]);
$invoiceDt = trim($row[5]);
$itemCode = trim($row[6]);
$des = trim($row[7]);
$quantity = trim($row[8]);
$transportName = trim($row[9]);
$LRBAWNo = trim($row[10]);
$LRBAWDt = trim($row[11]);
$pendingDays = trim($row[12]);
if (empty($plantCode)) {
$invalidPlantCode[] = "Row {$index}";
}
if (empty($receivingPlant)) {
$invalidRecPlant[] = "Row {$index}";
}
if (empty($receivingPlantName)) {
$invalidRecPlantName[] = "Row {$index}";
}
if (empty($invoiceNo)) {
$invalidInvNo[] = "Row {$index}";
}
if (empty($invoiceDt)) {
$invalidInvDt[] = "Row {$index}";
}
if (empty($itemCode)) {
$invalidICode[] = "Row {$index}";
}
if (empty($des)) {
$invalidDesc[] = "Row {$index}";
}
if (empty($quantity)) {
$invalidQty[] = "Row {$index}";
}
if (empty($transportName)) {
$invalidTransportName[] = "Row {$index}";
}
if (empty($LRBAWNo)) {
$invalidLRBLAWNo[] = "Row {$index}";
}
if (empty($LRBAWDt)) {
$invalidLRBLAWDt[] = "Row {$index}";
}
if (empty($pendingDays)) {
$invalidPenDay[] = "Row {$index}";
}
if (strlen($plantCode) < 4) {
$invalidPlantCo[] = $plantCode;
} elseif (! Plant::where('code', $plantCode)->first()) {
$invalidPlaCoFound[] = $plantCode;
}
$plant = Plant::where('code', $plantCode)->first();
//$plantId = $plant->id;
}
if (! empty($invalidPlantCode) || ! empty($invalidRecPlant) || ! empty($invalidRecPlantName) || ! empty($invalidInvNo) || ! empty($invalidInvDt) || ! empty($invalidICode) || ! empty($invalidDesc) || ! empty($invalidQty) || ($invalidTransportName) || ! empty($invalidLRBLAWNo) || ! empty($invalidLRBLAWDt) || ! empty($invalidPenDay)) {
$errorMsg = '';
if (! empty($invalidPlantCode)) {
$errorMsg .= 'Missing Receiving Plant in rows: '.implode(', ', $invalidPlantCode).'<br>';
}
if (! empty($invalidRecPlant)) {
$errorMsg .= 'Missing Receiving Plant Name in rows: '.implode(', ', $invalidRecPlant).'<br>';
}
if (! empty($invalidRecPlantName)) {
$errorMsg .= 'Missing Transit Days in rows: '.implode(', ', $invalidRecPlantName).'<br>';
}
if (! empty($invalidInvNo)) {
$errorMsg .= 'Missing Transport Name in rows: '.implode(', ', $invalidInvNo).'<br>';
}
if (! empty($invalidInvDt)) {
$errorMsg .= 'Missing Receiving Plant in rows: '.implode(', ', $invalidInvDt).'<br>';
}
if (! empty($invalidICode)) {
$errorMsg .= 'Missing Receiving Plant Name in rows: '.implode(', ', $invalidICode).'<br>';
}
if (! empty($invalidDesc)) {
$errorMsg .= 'Missing Transit Days in rows: '.implode(', ', $invalidDesc).'<br>';
}
if (! empty($invalidQty)) {
$errorMsg .= 'Missing Transport Name in rows: '.implode(', ', $invalidQty).'<br>';
}
if (! empty($invalidTransportName)) {
$errorMsg .= 'Missing Receiving Plant in rows: '.implode(', ', $invalidTransportName).'<br>';
}
if (! empty($invalidLRBLAWNo)) {
$errorMsg .= 'Missing Receiving Plant Name in rows: '.implode(', ', $invalidLRBLAWNo).'<br>';
}
if (! empty($invalidLRBLAWDt)) {
$errorMsg .= 'Missing Transit Days in rows: '.implode(', ', $invalidLRBLAWDt).'<br>';
}
if (! empty($invalidPenDay)) {
$errorMsg .= 'Missing Transport Name in rows: '.implode(', ', $invalidPenDay).'<br>';
}
Notification::make()
->title('Missing Mandatory Fields')
->body($errorMsg)
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
if (! empty($invalidPlantCo)) {
$invalidPlantCode = array_unique($invalidPlantCo);
Notification::make()
->title('Invalid Plant Codes')
->body('The following plant codes should contain minimum 4 digits:<br>'.implode(', ', $invalidPlantCode))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
if (! empty($invalidPlaCoFound)) {
$invalidPlaCoFound = array_unique($invalidPlaCoFound);
Notification::make()
->title('Invalid Plant Codes')
->body('The following plant codes not found in plants:<br>'.implode(', ', $invalidPlaCoFound))
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$mandatoryColumns = 23;
$firstRow = $rows[0] ?? [];
if (count($firstRow) < $mandatoryColumns) {
Notification::make()
->title('Invalid Excel Format')
->body('Few columns not found. Columns A to W are mandatory.')
->danger()
->persistent()
->send();
return;
}
foreach ($rows as $index => $row)
{
if ($index == 0) {
continue;
}
$plantCode = trim($row[0]);
$receivingPlant = trim($row[2]);
$receivingPlantName = trim($row[3]);
$invoiceNo = trim($row[4]);
$invoiceDt = trim($row[5]);
$itemCode = trim($row[6]);
$des = trim($row[7]);
$quantity = trim($row[8]);
$transportName = trim($row[9]);
$LRBAWNo = trim($row[10]);
$LRBAWDt = trim($row[11]);
$pendingDays = trim($row[12]);
$OBDNumber = trim($row[13]);
$OBDDate = trim($row[14]);
$ShipmentWeight = trim($row[15]);
$UnitPrice = trim($row[16]);
$NetValue = trim($row[17]);
$TotalItemAmount = trim($row[18]);
$TaxAmount = trim($row[19]);
$TransportMode = trim($row[20]);
$VehicleNumber = trim($row[21]);
$EWayBillNumber = trim($row[22]);
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
throw new \Exception("Invalid plant code : '{$plantCode}'");
}
if (! empty($invoiceDt))
{
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $invoiceDt)) {
[$day, $month, $year] = preg_split('/[-\/]/', $invoiceDt);
$formattedDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($invoiceDt)) {
$formattedDate = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($invoiceDt)->format('Y-m-d');
} else {
$formattedDate = date('Y-m-d', strtotime($invoiceDt));
}
} else {
$formattedDate = null;
}
if (! empty($LRBAWDt))
{
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $LRBAWDt)) {
[$day, $month, $year] = preg_split('/[-\/]/', $LRBAWDt);
$formattedDt = "{$year}-{$month}-{$day}";
} elseif (is_numeric($LRBAWDt)) {
$formattedDt = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($LRBAWDt)->format('Y-m-d');
} else {
$formattedDt = date('Y-m-d', strtotime($LRBAWDt));
}
} else {
$formattedDt = null;
}
if (! empty($OBDDate))
{
if (preg_match('/^\d{2}[-\/]\d{2}[-\/]\d{4}$/', $OBDDate)) {
[$day, $month, $year] = preg_split('/[-\/]/', $OBDDate);
$formattedDate = "{$year}-{$month}-{$day}";
} elseif (is_numeric($OBDDate)) {
$formatted = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($OBDDate)->format('Y-m-d');
} else {
$formatted = date('Y-m-d', strtotime($OBDDate));
}
} else {
$formatted = null;
}
$inserted = InvoiceInTransit::create([
'plant_id' => $plant->id,
'receiving_plant' => $receivingPlant,
'receiving_plant_name' => $receivingPlantName,
'invoice_number' => $invoiceNo,
'invoice_date' => $formattedDate,
'item_code' => $itemCode,
'description' => $des,
'quantity' => $quantity,
'transport_name' => $transportName,
'lr_bl_aw_number' => $LRBAWNo,
'lr_bl_aw_date' => $formattedDt,
'pending_days' => $pendingDays,
'obd_number' => $OBDNumber,
'obd_date' => $formatted,
'shipment_weight' => $ShipmentWeight,
'unit_price' => $UnitPrice,
'net_value' => $NetValue,
'total_item_amount' => $TotalItemAmount,
'tax_amount' => $TaxAmount,
'transport_mode' => $TransportMode,
'vehicle_number' => $VehicleNumber,
'e_waybill_number' => $EWayBillNumber,
'created_at' => now(),
'created_by' => $operatorName,
]);
}
if ($inserted) {
Notification::make()
->title('Upload Success')
->body('Invoice in transit uploaded successfully!')
->success()
->send();
return;
}
else
{
Notification::make()
->title('Insertion Failed')
->body('Invoice in transit upload failed!')
->success()
->send();
return;
}
}
})
->visible(function () {
return Filament::auth()->user()->can('view import invoice in transit');
}),
ExportAction::make()
->label('Export Invoice In Transit')
->color('warning')
->exporter(InvoiceInTransitExporter::class)
->visible(function () {
return Filament::auth()->user()->can('view export invoice in transit');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListInvoiceInTransits::route('/'),
'create' => Pages\CreateInvoiceInTransit::route('/create'),
'view' => Pages\ViewInvoiceInTransit::route('/{record}'),
'edit' => Pages\EditInvoiceInTransit::route('/{record}/edit'),
];
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,301 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Exports\InvoiceMasterExporter;
use App\Filament\Resources\InvoiceMasterResource\Pages;
use App\Filament\Resources\InvoiceMasterResource\RelationManagers;
use App\Models\InvoiceMaster;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Actions\ExportAction;
use Storage;
use Maatwebsite\Excel\Facades\Excel;
use Filament\Forms\Components\FileUpload;
class InvoiceMasterResource extends Resource
{
protected static ?string $model = InvoiceMaster::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Manufacturing SD';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('receiving_plant')
->label('Receiving Plant'),
Forms\Components\TextInput::make('receiving_plant_name')
->label('Receiving Plant Name'),
Forms\Components\TextInput::make('transit_days')
->label('Transit Days'),
Forms\Components\TextInput::make('transport_name')
->label('Transport Name'),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
Forms\Components\Hidden::make('updated_by')
->label('Updated By')
->default(Filament::auth()->user()?->name),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('No.')
->label('No.')
->alignCenter()
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
$paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}),
Tables\Columns\TextColumn::make('receiving_plant')
->label('Receiving Plant')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('receiving_plant_name')
->label('Receiving Plant Name')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('transit_days')
->label('Transit Days')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('transport_name')
->label('Transport Name')
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('Created At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label('Updated At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At')
->alignCenter()
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->headerActions([
Tables\Actions\Action::make('Import Invoice Master')
->label('Import Invoice Master')
->form([
FileUpload::make('invoice_master_file')
->label('Import Invoice Master')
->preserveFilenames()
->storeFiles(false)
->reactive()
->required()
->disk('local')
->directory('uploads/temp'),
])
->action(function (array $data) {
$uploadedFile = $data['invoice_master_file'];
$disk = Storage::disk('local');
$user = Filament::auth()->user();
$operatorName = $user->name;
// Get original filename
$originalName = $uploadedFile->getClientOriginalName();
$path = $uploadedFile->storeAs('uploads/temp', $originalName, 'local'); // returns relative path
$fullPath = Storage::disk('local')->path($path);
if ($fullPath && file_exists($fullPath))
{
$rows = Excel::toArray(null, $fullPath)[0];
if ((count($rows) - 1) <= 0) {
Notification::make()
->title('Records Not Found')
->body("Import the valid 'Invoice Master Data' file to proceed..!")
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
$invalidReceivePlant = [];
$invalidReceivePlantName = [];
$invalidTransitDays = [];
$invalidTransportName = [];
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
}
$receivingPlant = trim($row[0]);
$receivingPlantName = trim($row[1]);
$transitDays = trim($row[2]);
$transportName = trim($row[3]);
if (empty($receivingPlant)) {
$invalidReceivePlant[] = "Row {$index}";
}
if (empty($receivingPlantName)) {
$invalidReceivePlantName[] = "Row {$index}";
}
if (empty($transitDays)) {
$invalidTransitDays[] = "Row {$index}";
}
if (empty($transportName)) {
$invalidTransportName[] = "Row {$index}";
}
}
if (! empty($invalidReceivePlant) || ! empty($invalidReceivePlantName) || ! empty($invalidTransitDays) || ! empty($invalidTransportName)) {
$errorMsg = '';
if (! empty($invalidReceivePlant)) {
$errorMsg .= 'Missing Receiving Plant in rows: '.implode(', ', $invalidReceivePlant).'<br>';
}
if (! empty($invalidReceivePlantName)) {
$errorMsg .= 'Missing Receiving Plant Name in rows: '.implode(', ', $invalidReceivePlantName).'<br>';
}
if (! empty($invalidTransitDays)) {
$errorMsg .= 'Missing Transit Days in rows: '.implode(', ', $invalidTransitDays).'<br>';
}
if (! empty($invalidTransportName)) {
$errorMsg .= 'Missing Transport Name in rows: '.implode(', ', $invalidTransportName).'<br>';
}
Notification::make()
->title('Missing Mandatory Fields')
->body($errorMsg)
->danger()
->send();
if ($disk->exists($path)) {
$disk->delete($path);
}
return;
}
foreach ($rows as $index => $row)
{
if ($index == 0) {
continue;
}
$receivingPlant = trim($row[0]);
$receivingPlantName = trim($row[1]);
$transitDays = trim($row[2]);
$transportName = trim($row[3]);
$inserted = InvoiceMaster::create([
'receiving_plant' => $receivingPlant,
'receiving_plant_name' => $receivingPlantName,
'transit_days' => $transitDays,
'transport_name' => $transportName,
'created_at' => now(),
'created_by' => $operatorName,
]);
}
if ($inserted) {
Notification::make()
->title('Upload Success')
->body('Invoice master uploaded successfully!')
->success()
->send();
return;
}
else
{
Notification::make()
->title('Insertion Failed')
->body('Invoice master upload failed!')
->success()
->send();
return;
}
}
})
->visible(function () {
return Filament::auth()->user()->can('view import invoice master');
}),
ExportAction::make()
->label('Export Invoice Master')
->color('warning')
->exporter(InvoiceMasterExporter::class)
->visible(function () {
return Filament::auth()->user()->can('view export invoice master');
}),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListInvoiceMasters::route('/'),
'create' => Pages\CreateInvoiceMaster::route('/create'),
'view' => Pages\ViewInvoiceMaster::route('/{record}'),
'edit' => Pages\EditInvoiceMaster::route('/{record}/edit'),
];
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -30,7 +30,7 @@ class InvoiceOutValidationResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationGroup = 'Invoice Management';
protected static ?string $navigationGroup = 'Manufacturing SD';
public static function form(Form $form): Form
{
@@ -398,122 +398,104 @@ class InvoiceOutValidationResource extends Resource
// }
$successCount = 0;
$updateCount = 0;
$insertCount = 0;
$failedRecords = [];
DB::beginTransaction();
try {
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
}
$rowNumber = $index + 1;
try {
$qrcode = trim($row[1]);
$plantCode = trim($row[2]);
$scannedAt = trim($row[3]);
$scannedBy = trim($row[4]);
if (empty($qrcode)) {
throw new \Exception("Row '{$rowNumber}' Missing QR Code");
}
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
throw new \Exception("Invalid plant code : '{$plantCode}'");
}
$formattedDate = null;
if (! empty($scannedAt)) {
try {
// $formattedDate = Carbon::createFromFormat('d-m-Y H:i:s', $scannedAt)
// ->format('Y-m-d H:i:s');
if (is_numeric($scannedAt)) {
$formattedDate = ExcelDate::excelToDateTimeObject($scannedAt)
->format('Y-m-d H:i:s');
} else {
// Or handle as manual string date (d-m-Y H:i:s)
$formattedDate = Carbon::createFromFormat('d-m-Y H:i:s', $scannedAt)
->format('Y-m-d H:i:s');
}
} catch (\Exception $e) {
throw new \Exception("Invalid date format : '{$scannedAt}'");
}
}
$record = InvoiceOutValidation::where('plant_id', $plant->id)
->where('qr_code', $qrcode)
->first();
$curStat = $record ? 'Updation' : 'Insertion';
if ($record) {
$record->update([
'scanned_at' => $formattedDate,
'scanned_by' => $scannedBy,
'updated_by' => $operatorName,
]);
$inserted = $record;
} else {
// Record does not exist, create with 'created_by'
$inserted = InvoiceOutValidation::create([
'plant_id' => $plant->id,
'qr_code' => $qrcode,
'scanned_at' => $formattedDate,
'scanned_by' => $scannedBy,
'created_by' => $operatorName,
]);
}
// $inserted = InvoiceOutValidation::create([
// 'plant_id' => $plant->id,
// 'qr_code' => $qrcode,
// 'scanned_at' => $formattedDate,
// 'scanned_by' => $scannedBy,
// 'created_by' => $operatorName
// ]);
if (! $inserted) {
throw new \Exception("{$curStat} failed for QR : {$qrcode}");
}
$successCount++;
} catch (\Exception $e) {
$failedRecords[] = [
'row' => $rowNumber,
'qrcode' => $qrcode ?? null,
'error' => $e->getMessage(),
];
}
foreach ($rows as $index => $row)
{
if ($index == 0) {
continue;
}
DB::commit();
$rowNumber = $index + 1;
if (count($failedRecords) > 0) {
try {
$qrcode = trim($row[1]);
$plantCode = trim($row[2]);
$scannedAt = trim($row[3]);
$scannedBy = trim($row[4]);
if (empty($qrcode)) {
throw new \Exception("Row '{$rowNumber}' Missing QR Code");
}
$plant = Plant::where('code', $plantCode)->first();
if (! $plant) {
throw new \Exception("Invalid plant code : '{$plantCode}'");
}
$formattedDate = null;
if (! empty($scannedAt)) {
try {
// $formattedDate = Carbon::createFromFormat('d-m-Y H:i:s', $scannedAt)
// ->format('Y-m-d H:i:s');
if (is_numeric($scannedAt)) {
$formattedDate = ExcelDate::excelToDateTimeObject($scannedAt)
->format('Y-m-d H:i:s');
} else {
// Or handle as manual string date (d-m-Y H:i:s)
$formattedDate = Carbon::createFromFormat('d-m-Y H:i:s', $scannedAt)
->format('Y-m-d H:i:s');
}
} catch (\Exception $e) {
throw new \Exception("Invalid date format : '{$scannedAt}'");
}
}
$exists = InvoiceOutValidation::where('plant_id', $plant->id)
->where('qr_code', $qrcode)
->first();
InvoiceOutValidation::updateOrCreate(
[
'plant_id' => $plant->id,
'qr_code' => $qrcode,
],
[
'scanned_at' => $formattedDate,
'scanned_by' => $scannedBy,
'updated_by' => $operatorName,
'created_by' => $operatorName,
]
);
$exists ? $updateCount++ : $insertCount++;
$successCount++;
}
catch (\Exception $e) {
$failedRecords[] = [
'row' => $rowNumber,
'qrcode' => $qrcode ?? null,
'error' => $e->getMessage(),
];
}
}
if (count($failedRecords) > 0) {
$failedSummary = collect($failedRecords)
->map(fn ($f) => "Row {$f['row']} ({$f['qrcode']}) : {$f['error']}")
->take(5) // limit preview to first 5 errors
->take(5)
->implode("\n");
Notification::make()
->title('Partial Import Warning')
->body("'{$successCount}' records inserted. ".count($failedRecords)." failed.\n\n{$failedSummary}")
->warning()
->send();
} else {
Notification::make()
->title('Import Success')
->body("Successfully imported '{$successCount}' records.")
->success()
->send();
}
} catch (\Exception $e) {
DB::rollBack();
Notification::make()
->title('Partial Import Warning')
->body(
"Total Success: {$successCount}\n" .
"Inserted: {$insertCount}\n" .
"Updated: {$updateCount}\n" .
"Failed: " . count($failedRecords) . "\n\n" .
$failedSummary
)
->warning()
->send();
}
else
{
Notification::make()
->title('Import Failed')
->body("No records were inserted. Error : {$e->getMessage()}")
->danger()
->title('Import Success')
->body("Successfully imported '{$successCount}' records.")
->success()
->send();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -53,6 +53,7 @@ class CreateInvoiceValidation extends CreateRecord
public bool $showCapacitorInput = false;
public $excel_file;
public $mInvoiceNo;
public function getFormActions(): array
{
@@ -103,6 +104,8 @@ class CreateInvoiceValidation extends CreateRecord
{
$invoiceNumber = trim($invoiceNumber);
$parts = explode('.', $invoiceNumber);
$this->showCapacitorInput = false;
$user = Filament::auth()->user();
@@ -118,6 +121,62 @@ class CreateInvoiceValidation extends CreateRecord
// ..GET SERIAL INVOICE API
if(strlen($invoiceNumber) > 15)
{
$payloadJson = base64_decode(strtr($parts[1], '-_', '+/'));
if (empty($payloadJson)) {
Notification::make()
->title('Invalid payload for scanned qr code.')
->danger()
->seconds(1)
->send();
return;
}
$payload = json_decode($payloadJson, true);
if (!isset($payload['data'])) {
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
$documentData = $payload['data'];
if($documentData == '' || $documentData == ''){
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
// Extract DocNo
preg_match('/"DocNo"\s*:\s*"([^"]+)"/', $documentData, $matches);
if (!isset($matches[1])) {
Notification::make()
->title('Invoice number not found.')
->info()
->seconds(1)
->send();
return;
}
if (isset($matches[1])) {
$invoiceNumber = $matches[1];
}
}
//dd($invoiceNumber);
// ..
$updateStatus = $this->form->getState()['update_invoice'] ?? null;
@@ -2261,7 +2320,7 @@ class CreateInvoiceValidation extends CreateRecord
];
}
public function processSerial($serNo)
public function processSer($serNo)
{
$serNo = trim($serNo);
$mSerNo = $serNo;
@@ -2742,19 +2801,6 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ItemNotValidMaterialType')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
@@ -2784,19 +2830,6 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ItemNotInvoice')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
@@ -2825,19 +2858,6 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'Item')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
@@ -3171,9 +3191,11 @@ class CreateInvoiceValidation extends CreateRecord
$mPlantName = $mailData['plant_name'];
$emails = $mailData['emails'];
$mUserName = Filament::auth()->user()->name;
if (! empty($emails)) {
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'NotFoundInvoice')
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode,$mUserName,'NotFoundInvoice')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
@@ -3379,19 +3401,6 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playNotificationSound');
$mInvoiceType = 'Serial';
$mailData = $this->getMail();
$mPlantName = $mailData['plant_name'];
$emails = $mailData['emails'];
if (! empty($emails)) {
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CompletedSerialInvoice')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
}
$filename = $invoiceNumber.'.xlsx';
$directory = 'uploads/temp';
$disk = Storage::disk('local');
@@ -3509,20 +3518,6 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('playNotificationSound');
$mInvoiceType = 'Serial';
$mailData = $this->getMail();
$mPlantName = $mailData['plant_name'];
$emails = $mailData['emails'];
if (! empty($emails)) {
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CSerialInvoice')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
}
$filename = $invoiceNumber.'.xlsx';
$directory = 'uploads/temp';
$disk = Storage::disk('local');
@@ -3582,20 +3577,6 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('playWarnSound');
$mInvoiceType = 'Serial';
$mailData = $this->getMail();
$mPlantName = $mailData['plant_name'];
$emails = $mailData['emails'];
if (! empty($emails)) {
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'DuplicateCapacitorQR')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
}
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
@@ -3719,19 +3700,19 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('playNotificationSound');
$mInvoiceType = 'Serial';
$mailData = $this->getMail();
$mPlantName = $mailData['plant_name'];
$emails = $mailData['emails'];
// $mInvoiceType = 'Serial';
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
if (! empty($emails)) {
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ComSerInv')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
}
// if (! empty($emails)) {
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
// Mail::to($emails)->send(
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ComSerInv')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$filename = $invoiceNumber.'.xlsx';
$directory = 'uploads/temp';
@@ -3765,11 +3746,11 @@ class CreateInvoiceValidation extends CreateRecord
}
}
// #[On('process-scan')]
// public function processSerial($serial)
// {
// $this->processSer($serial); // Your duplicate check + mail logic
// }
#[On('process-scan')]
public function processSerial($serial)
{
$this->processSer($serial);
}
public function getHeading(): string
{

View File

@@ -197,6 +197,7 @@ class ItemResource extends Resource
->searchable(),
Tables\Columns\TextColumn::make('category')
->label('Category')
->default('-')
->alignCenter()
->sortable()
->searchable(),
@@ -217,6 +218,7 @@ class ItemResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('uom')
->label('Unit of Measure')
->default('-')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
@@ -237,6 +239,7 @@ class ItemResource extends Resource
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->searchPlaceholder('Search Item Code')
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
@@ -256,7 +259,7 @@ class ItemResource extends Resource
$set('operator_id', null);
}),
Select::make('code')
->label('Search by Item Code')
->label('Search by Code')
->nullable()
// ->options(function (callable $get) {
// $plantId = $get('Plant');
@@ -293,20 +296,18 @@ class ItemResource extends Resource
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (
empty($data['Plant']) &&
empty($data['code']) &&
empty($data['description']) &&
empty($data['uom']) &&
empty($data['category']) &&
empty($data['created_from']) &&
empty($data['created_to'])
) {
if (empty($data['Plant']) && empty($data['code']) && empty($data['description']) && empty($data['uom']) && empty($data['category']) && empty($data['created_from']) && empty($data['created_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['code'])) {
@@ -338,6 +339,12 @@ class ItemResource extends Resource
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['code'])) {

File diff suppressed because it is too large Load Diff

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