87 Commits

Author SHA1 Message Date
e45c166345 Merge pull request 'Added invoice pending livewire pages' (#235) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #235
2026-01-23 05:13:30 +00:00
dhanabalan
b66216bb90 Added invoice pending livewire pages
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 26s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 3m0s
2026-01-23 10:43:20 +05:30
d53d3dedbb Merge pull request 'Added invoice pending reason import' (#234) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #234
2026-01-23 05:11:02 +00:00
dhanabalan
397bddf8d5 Added invoice pending reason import
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 33s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 47s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 18s
Laravel Pint / pint (pull_request) Successful in 2m11s
Laravel Larastan / larastan (pull_request) Failing after 3m22s
2026-01-23 10:40:49 +05:30
18e74f4a52 Merge pull request 'Added invoice pending reason export' (#233) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #233
2026-01-23 05:08:58 +00:00
dhanabalan
34465a4adf Added invoice pending reason export
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 19s
Laravel Pint / pint (pull_request) Successful in 2m15s
Laravel Larastan / larastan (pull_request) Failing after 3m44s
2026-01-23 10:38:44 +05:30
16c525773b Merge pull request 'Added item code missing logic on new invoice' (#232) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #232
2026-01-22 06:20:30 +00:00
dhanabalan
cd4028abd3 Added item code missing logic on new invoice
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 3m7s
Laravel Larastan / larastan (pull_request) Failing after 3m33s
2026-01-22 11:50:03 +05:30
501cd541b9 Merge pull request 'chnaged logic in sticker reprint controller' (#231) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #231
2026-01-22 05:58:07 +00:00
dhanabalan
21e625e740 chnaged 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 / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 2m47s
Laravel Larastan / larastan (pull_request) Failing after 3m44s
2026-01-22 11:27:53 +05:30
62e14fb3c3 Merge pull request 'Added default value as '-' to material_type on view report' (#230) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #230
2026-01-22 05:38:40 +00:00
dhanabalan
922e76448c Added default value as '-' to material_type on view 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 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m31s
Laravel Larastan / larastan (pull_request) Failing after 3m56s
2026-01-22 11:05:54 +05:30
78f4929e27 Merge pull request 'changed time for invoice data report' (#229) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #229
2026-01-22 04:27:43 +00:00
dhanabalan
755f4e5962 changed time for invoice data report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 4m29s
Laravel Larastan / larastan (pull_request) Failing after 5m52s
2026-01-22 09:57:30 +05:30
b674966886 Merge pull request 'changed proper time for reports in scheduler' (#228) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Reviewed-on: #228
2026-01-21 11:00:36 +00:00
dhanabalan
c42d822dc4 changed proper time for reports in scheduler
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 2m32s
Laravel Larastan / larastan (pull_request) Failing after 3m23s
2026-01-21 16:30:19 +05:30
103515a387 Merge pull request 'changed time in scheduler' (#227) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #227
2026-01-21 10:56:24 +00:00
dhanabalan
36eea799ce changed time in scheduler
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 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Pint / pint (pull_request) Successful in 2m36s
Laravel Larastan / larastan (pull_request) Failing after 3m31s
2026-01-21 16:26:13 +05:30
dd182c6504 Merge pull request 'changed logic in schdeuler' (#226) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #226
2026-01-21 10:48:50 +00:00
dhanabalan
8846df986a changed logic in schdeuler
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 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m33s
Laravel Larastan / larastan (pull_request) Failing after 3m34s
2026-01-21 16:18:37 +05:30
1fed559feb Merge pull request 'changed logic inside the schduler' (#225) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #225
2026-01-21 10:46:24 +00:00
dhanabalan
52ac6157bc changed logic inside the schduler
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 / Gemini PR Review (pull_request) Failing after 15s
Laravel Pint / pint (pull_request) Successful in 2m19s
Laravel Larastan / larastan (pull_request) Failing after 3m30s
2026-01-21 16:16:10 +05:30
312de66a1c Merge pull request 'changed time in invoice transit' (#224) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #224
2026-01-21 10:34:58 +00:00
dhanabalan
2e2c3f6f18 changed time in invoice transit
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 9s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Laravel Pint / pint (pull_request) Successful in 8m39s
Laravel Larastan / larastan (pull_request) Failing after 8m43s
2026-01-21 16:04:46 +05:30
7d8a891f95 Merge pull request 'chnaged time in scheduler' (#223) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #223
2026-01-21 10:31:24 +00:00
dhanabalan
814decda50 chnaged time in scheduler
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 2m34s
Laravel Larastan / larastan (pull_request) Failing after 3m35s
2026-01-21 16:01:12 +05:30
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
20 changed files with 969 additions and 192 deletions

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') == '11:30') {
\Artisan::call('send:invoice-data-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
@@ -209,11 +210,25 @@ class Scheduler extends Command
}
break;
case 'Daily':
if (now()->format('H:i') == '10:00') {
\Artisan::call('send:invoice-transit-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
if (now()->format('H:i') == '10:45') {
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;
}

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,48 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
class InvoicePendingReasonExport implements FromArray, WithHeadings, WithMapping
{
/**
* @return \Illuminate\Support\Collection
*/
protected array $data;
public function __construct(array $data)
{
$this->data = $data;
}
public function array(): array
{
return $this->data;
}
public function headings(): array
{
return [
'Plant Code',
'Document Number',
'Remark',
'Customer Trade Name',
'Location',
];
}
public function map($row): array
{
return [
$row['plant_id'] ?? '',
$row['document_number'] ?? '',
$row['remark'] ?? '',
$row['customer_trade_name'] ?? '',
$row['location'] ?? '',
];
}
}

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

@@ -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

@@ -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();
}
}

View File

@@ -17,9 +17,9 @@ use Filament\Resources\Pages\CreateRecord;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Livewire\Attributes\On;
use Maatwebsite\Excel\Facades\Excel;
use Str;
use Livewire\Attributes\On;
class CreateInvoiceValidation extends CreateRecord
{
@@ -53,6 +53,7 @@ class CreateInvoiceValidation extends CreateRecord
public bool $showCapacitorInput = false;
public $excel_file;
public $mInvoiceNo;
public function getFormActions(): array
@@ -121,8 +122,7 @@ class CreateInvoiceValidation extends CreateRecord
// ..GET SERIAL INVOICE API
if(strlen($invoiceNumber) > 15)
{
if (strlen($invoiceNumber) > 15) {
$payloadJson = base64_decode(strtr($parts[1], '-_', '+/'));
@@ -132,41 +132,44 @@ class CreateInvoiceValidation extends CreateRecord
->danger()
->seconds(1)
->send();
return;
}
$payload = json_decode($payloadJson, true);
if (!isset($payload['data'])) {
if (! isset($payload['data'])) {
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
$documentData = $payload['data'];
if($documentData == '' || $documentData == ''){
if ($documentData == '' || $documentData == '') {
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
// Extract DocNo
// Extract DocNo
preg_match('/"DocNo"\s*:\s*"([^"]+)"/', $documentData, $matches);
if (!isset($matches[1])) {
if (! isset($matches[1])) {
Notification::make()
->title('Invoice number not found.')
->info()
->seconds(1)
->send();
return;
}
@@ -175,7 +178,7 @@ class CreateInvoiceValidation extends CreateRecord
}
}
//dd($invoiceNumber);
// dd($invoiceNumber);
// ..
@@ -1427,6 +1430,7 @@ class CreateInvoiceValidation extends CreateRecord
return;
}
$missingCodes = [];
foreach ($rows as $index => $row) {
if ($index == 0) {
continue;
@@ -1438,8 +1442,8 @@ class CreateInvoiceValidation extends CreateRecord
if (Str::length($materialCode) < 6) {
continue;
} else {
$sticker = StickerMaster::where('plant_id', $plantId)->whereHas('item', function ($query) use ($materialCode) {
$query->where('plant_id', $this->plantId)->where('code', $materialCode); // Check if item.code matches Excel's materialCode
$sticker = StickerMaster::where('plant_id', $plantId)->whereHas('item', function ($query) use ($plantId, $materialCode) {
$query->where('plant_id', $plantId)->where('code', $materialCode); // $this->plantId >> Check if item.code matches Excel's materialCode
});
if ($sticker->exists()) {
if ($sticker->first()->material_type && ! empty($sticker->first()->material_type)) {
@@ -1450,6 +1454,8 @@ class CreateInvoiceValidation extends CreateRecord
break;
}
} else {
$missingCodes[] = $materialCode;
continue;
}
}
@@ -1458,7 +1464,26 @@ class CreateInvoiceValidation extends CreateRecord
}
}
if ($invoiceType == 'M') {
$uniqueCodes = array_unique($missingCodes);
if (! empty($uniqueCodes)) {
$missingCount = count($uniqueCodes);
$message = $missingCount > 10 ? "'$missingCount' item codes are not found in database for choosed plant." : 'The following item codes are not found in database for choosed plant:<br>'.implode(', ', $uniqueCodes);
Notification::make()
->title('Unknown: Item Codes')
->body($message)
->danger()
->seconds(3)
->send();
$this->dispatch('playWarnSound');
// if ($disk->exists($filePath)) {
// $disk->delete($filePath);
// }
return;
} elseif ($invoiceType == 'M') {
$invalidMatCodes = [];
$materialCodes = [];
$missingQuantities = [];
@@ -3195,7 +3220,7 @@ class CreateInvoiceValidation extends CreateRecord
if (! empty($emails)) {
Mail::to($emails)->send(
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode,$mUserName,'NotFoundInvoice')
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, $mUserName, 'NotFoundInvoice')
);
} else {
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");

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');

View File

@@ -30,6 +30,7 @@ use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\Rule;
// use Illuminate\Validation\Rule;
@@ -93,21 +94,33 @@ class StickerMasterResource extends Resource
Forms\Components\Select::make('item_id')
->label('Item Code')
->options(function (callable $get) {
$plantId = $get('plant_id');
if (! $get('plant_id')) {
return [];
}
return \App\Models\Item::where('plant_id', $get('plant_id'))
->pluck('code', 'id')
->toArray();
if (! $get('id')) {
// whereHas
return Item::where('plant_id', $plantId)->whereDoesntHave('stickerMasters')->pluck('code', 'id');
} else {
$itemId = StickerMaster::where('id', $get('id'))->first()?->item_id;
return Item::where('plant_id', $plantId)
->where(function ($query) use ($itemId) {
$query->whereDoesntHave('stickerMasters')
->orWhere('id', $itemId);
})
->pluck('code', 'id');
}
// return Item::where('plant_id', $plantId)->pluck('code', 'id')->toArray();
})
->rule(function (callable $get) {
return Rule::unique('sticker_masters', 'item_id')
->where('plant_id', $get('plant_id'))
->ignore($get('id')); // Ignore current record during updates
})
// ->rule(function (callable $get) {
// return Rule::unique('items', 'code')
// ->where('plant_id', $get('plant_id'))
// ->ignore($get('id')); // Ignore current record during updates
// })
->required()
->nullable()
// ->nullable()
->searchable()
->reactive()
// ->disabled(fn (Get $get) => !empty($get('id')))
@@ -132,7 +145,7 @@ class StickerMasterResource extends Resource
return;
}
$availableItems = \App\Models\Item::where('plant_id', $plantId)->exists();
$availableItems = Item::where('plant_id', $plantId)->exists();
if (! $availableItems) {
$set('item_error', null);
@@ -147,7 +160,7 @@ class StickerMasterResource extends Resource
}
// Check if item exists for the selected plant
$item = \App\Models\Item::where('plant_id', $plantId)
$item = Item::where('plant_id', $plantId)
->where('id', $itemId)
->first();
@@ -161,7 +174,8 @@ class StickerMasterResource extends Resource
->where('item_id', $itemId)
->exists();
if (! $get('id')) {
$set('item_error', $duplicateSticker ? 'Item Code already exists for the selected plant.' : null);
// $set('item_error', $duplicateSticker ? 'Item Code already exists for the selected plant.' : null);
$set('item_error', null);
}
})
->extraAttributes(fn ($get) => [
@@ -177,7 +191,7 @@ class StickerMasterResource extends Resource
if ($get('id')) {
$itemId = StickerMaster::where('id', $get('id'))->first()?->item_id;
if ($itemId) {
$item = \App\Models\Item::where('id', $itemId)->first()?->description;
$item = Item::where('id', $itemId)->first()?->description;
if ($item) {
$set('item_description', $item);
} else {
@@ -525,27 +539,35 @@ class StickerMasterResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('part_validation1')
->label('Part Validation 1')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('part_validation2')
->label('Part Validation 2')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('part_validation3')
->label('Part Validation 3')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('part_validation4')
->label('Part Validation 4')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('part_validation5')
->label('Part Validation 5')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('laser_part_validation1')
->label('Laser Part Validation 1')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('laser_part_validation2')
->label('Laser Part Validation 2')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('panel_box_code')
->label('Panel Box Code')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('load_rate')
->label('Load Rate')
@@ -553,20 +575,22 @@ class StickerMasterResource extends Resource
->sortable(),
Tables\Columns\TextColumn::make('bundle_quantity')
->label('Bundle Quantity')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('material_type')
->label('Material Type')
->default('-')
->alignCenter()
->formatStateUsing(function ($state) {
if (is_null($state) || $state === '') {
return '';
if (is_null($state) || $state == '') {
return '-';
}
return match ($state) {
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
default => '',
default => '-',
};
}),
Tables\Columns\TextColumn::make('created_at')
@@ -587,9 +611,7 @@ class StickerMasterResource extends Resource
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
// ->filters([
// Tables\Filters\TrashedFilter::make(),
// ])
->searchPlaceholder('Search Item Code')
->filters([
Tables\Filters\TrashedFilter::make(),
Filter::make('advanced_filters')
@@ -635,7 +657,7 @@ class StickerMasterResource extends Resource
->searchable()
->reactive(),
Select::make('material_type')
->label('Material Type')
->label('Select Material Type')
->options([
1 => 'Individual',
2 => 'Bundle',
@@ -644,7 +666,7 @@ class StickerMasterResource extends Resource
->reactive(),
TextInput::make('panel_box_code')
->label('Panel Box Code')
->label('Search by Panel Box Code')
->placeholder(placeholder: 'Enter Panel Box Code'),
DateTimePicker::make(name: 'created_from')
->label('Created From')

View File

@@ -80,7 +80,7 @@ class InvoiceChart extends ChartWidget
$completedInvoicesCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $selectedPlant)
->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)"
@@ -99,7 +99,7 @@ class InvoiceChart extends ChartWidget
$completedInvoicesCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $selectedPlant)
->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)"
@@ -142,7 +142,7 @@ class InvoiceChart extends ChartWidget
$query->where('quantity', 1)->whereBetween('created_at', [$dayStart, $dayEnd]);
$completedQuery->where('quantity', 1)
->whereBetween('updated_at', [$dayStart, $dayEnd])
->whereBetween('created_at', [$dayStart, $dayEnd])
->groupBy('invoice_number')
->havingRaw(
"COUNT(*) = SUM(CASE WHEN serial_number IS NOT NULL AND serial_number != '' THEN 1 ELSE 0 END)"
@@ -153,7 +153,7 @@ class InvoiceChart extends ChartWidget
$query->whereNull('quantity')->whereBetween('created_at', [$dayStart, $dayEnd]);
$completedQuery->whereNull('quantity')
->whereBetween('updated_at', [$dayStart, $dayEnd])
->whereBetween('created_at', [$dayStart, $dayEnd])
->groupBy('invoice_number')
->havingRaw(
"COUNT(*) = SUM(CASE WHEN scanned_status = 'Scanned' THEN 1 ELSE 0 END)"
@@ -164,7 +164,7 @@ class InvoiceChart extends ChartWidget
$query->where('quantity', '>', 1)->whereBetween('created_at', [$dayStart, $dayEnd]);
$completedQuery->where('quantity', '>', 1)
->whereBetween('updated_at', [$dayStart, $dayEnd])
->whereBetween('created_at', [$dayStart, $dayEnd])
->groupBy('invoice_number')
->havingRaw(
"COUNT(*) = SUM(CASE WHEN serial_number IS NOT NULL AND serial_number != '' THEN 1 ELSE 0 END)"
@@ -193,22 +193,31 @@ class InvoiceChart extends ChartWidget
}
elseif ($activeFilter == 'this_month') {
$startOfMonth = now()->startOfMonth()->setTime(8, 0, 0);
$endOfMonth = now()->endOfMonth()->addDay()->setTime(8, 0, 0); // include full last day
$endOfMonth = now()->endOfMonth()->addDay()->setTime(23, 59, 59); // include full last day
$monthName = $startOfMonth->format('M');
// Prepare weekly labels like "May(1-7)", "May(8-14)", etc.
$labels = [];
$weekStart = $startOfMonth->copy();
$importedInvoicesPerWeek = [];
$completedInvoicesPerWeek = [];
$weekIndex = 0;
while ($weekStart < $endOfMonth) {
$weekEnd = $weekStart->copy()->addDays(7);
while ($weekStart <= $endOfMonth) {
// $weekEnd = $weekStart->copy()->addDays(6);
$weekEnd = $weekStart->copy()->addDays(6)->endOfDay();
// If week end exceeds end of month, limit it
if ($weekEnd->greaterThan($endOfMonth)) {
$weekEnd = $endOfMonth->copy()->endOfDay();
}
$startDay = $weekStart->format('j');
$weekEndLimit = $weekEnd->copy()->subDay();
$actualEnd = $weekEndLimit->greaterThan($endOfMonth) ? $endOfMonth : $weekEndLimit;
$endDay = $actualEnd->format('j');
$endDay = $weekEnd->format('j');
// $startDay = $weekStart->format('j');
// $weekEndLimit = $weekEnd->copy()->subDay();
// $actualEnd = $weekEndLimit->greaterThan($endOfMonth) ? $endOfMonth : $weekEndLimit;
// $endDay = $actualEnd->format('j');
$labels[] = "{$monthName}({$startDay}-{$endDay})";
@@ -233,7 +242,7 @@ class InvoiceChart extends ChartWidget
// --- Completed ---
$queryCompleted = InvoiceValidation::select('invoice_number')
->where('plant_id', $selectedPlant)
->whereBetween('updated_at', [$weekStart, $weekEnd]);
->whereBetween('created_at', [$weekStart, $weekEnd]);
if ($selectedInvoice == 'individual_material') {
$queryCompleted->where('quantity', 1)
@@ -252,7 +261,8 @@ class InvoiceChart extends ChartWidget
$completedInvoicesPerWeek[$weekIndex] = $queryCompleted->count();
// Move to next week
$weekStart = $weekEnd;
// $weekStart = $weekEnd;
$weekStart = $weekEnd->copy()->addDay(1);
$weekIndex++;
}
@@ -298,6 +308,7 @@ class InvoiceChart extends ChartWidget
{
return 'bar';
}
public static function getDefaultName(): string
{
return 'invoice-chart';

View File

@@ -70,6 +70,10 @@ class ProductionStickerReprintController extends Controller
{
$copies = 2;
}
else
{
$copies = 1;
}
}
else
{

View File

@@ -0,0 +1,133 @@
<?php
namespace App\Imports;
use App\Models\InvoiceDataValidation;
use App\Models\Plant;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\ToCollection;
class InvoicePendingReasonImport implements ToCollection
{
/**
* @param Collection $collection
*/
public array $errors = [];
public array $missingPlantCodes = [];
public array $missingDocNo = [];
public array $plantCodeEmpty = [];
public array $docNoEmpty = [];
public array $remarkEmpty = [];
public array $duplicateExcelDocs = [];
private array $seenExcelKeys = [];
public array $validRows = [];
public function collection(Collection $collection)
{
$rows = $collection;
// foreach ($rows->skip(1) as $row) {
// $plantCode = trim($row[0] ?? '');
// $documentNumber = trim($row[1] ?? '');
// $remark = trim($row[2] ?? '');
// if (! $plantCode || ! $documentNumber || ! $remark) {
// continue;
// }
// $plantId = Plant::where('code', $plantCode)->value('id');
// InvoiceDataValidation::where('plant_id', $plantId)
// ->where('document_number', $documentNumber)
// ->update([
// 'remark' => $remark,
// 'updated_at' => now(),
// ]);
// }
foreach ($rows->skip(1) as $index => $row) {
$rowNo = $index + 2;
$plantCode = trim($row[0] ?? '');
$documentNumber = trim($row[1] ?? '');
$remark = trim($row[2] ?? '');
if (! $plantCode) {
$this->plantCodeEmpty[] = [
'row' => $rowNo,
'reason' => "Plant Code can't be empty!",
];
continue;
}
else if (! $documentNumber) {
$this->docNoEmpty[] = [
'row' => $rowNo,
'reason' => "Document number can't be empty!",
];
continue;
}
else if (! $remark) {
$this->remarkEmpty[] = [
'row' => $rowNo,
'reason' => "Remark can't be empty!",
];
continue;
}
//Excel-level duplicate check
$key = $plantCode . '|' . $documentNumber;
if (isset($this->seenExcelKeys[$key])) {
$this->duplicateExcelDocs[$key][] = $rowNo;
$this->errors[] = [
'row' => $rowNo,
'reason' => "Duplicate Document Number in Excel ({$plantCode} - {$documentNumber})",
];
continue;
}
$this->seenExcelKeys[$key] = true;
$plantId = Plant::where('code', $plantCode)->value('id');
if (! $plantId) {
$this->missingPlantCodes[$plantCode] = true;
$this->errors[] = [
'row' => $rowNo,
'reason' => "Plant code not found: {$plantCode}",
];
continue;
}
$invoiceExists = InvoiceDataValidation::where('plant_id', $plantId)
->where('document_number', $documentNumber)
->first();
if (! $invoiceExists) {
$this->missingDocNo[$documentNumber] = true;
$this->errors[] = [
'row' => $rowNo,
'reason' => "Document number not found: {$documentNumber}",
];
continue;
}
$this->validRows[] = [
'plant_id' => $plantId,
'document_number' => $documentNumber,
'remark' => $remark,
];
}
}
}

View File

@@ -0,0 +1,125 @@
<?php
namespace App\Livewire;
use App\Models\InvoiceDataValidation;
use App\Models\InvoiceOutValidation;
use App\Models\PalletValidation;
use Livewire\Component;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\InvoicePendingReasonExport;
use App\Models\Plant;
class InvoicePending extends Component
{
public $plantId;
public $invoicePending = [];
protected $listeners = [
'loadData' => 'loadInvoiceData',
'emptyData' => 'loadInvoiceEmptyData',
'loadData1' => 'exportPendingReason',
];
public function loadInvoiceEmptyData()
{
$this->invoicePending = [];
}
public function loadInvoiceData($plantId)
{
$this->plantId = $plantId;
$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',
'customer_trade_name',
'location',
'remark',
'created_at',
'created_by',
'updated_at',
'updated_by'
)
->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);
}
$plantCode = Plant::find($this->plantId)->code ?? '';
$this->invoicePending = $pendingInvoices
->unique('document_number')
->map(function ($record) use ($plantCode) {
return [
'plant_id' => $plantCode ?? '',
'document_number' => $record->document_number ?? '',
'customer_trade_name' => $record->customer_trade_name ?? '',
'location' => $record->location ?? '',
'remark' => $record->remark ?? '',
];
})
->values()
->toArray();
}
public function exportPendingReason()
{
return Excel::download(
new InvoicePendingReasonExport($this->invoicePending),
'invoice_pending_reason.xlsx'
);
}
public function render()
{
return view('livewire.invoice-pending');
}
}

View File

@@ -17,7 +17,7 @@
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
"league/flysystem-sftp-v3": "^3.30",
"livewire/livewire": "^4.0",
"livewire/livewire": "^3.6",
"maatwebsite/excel": "^3.1",
"mike42/escpos-php": "^4.0",
"mpdf/mpdf": "^8.2",

View File

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

View File

@@ -161,6 +161,9 @@ class PermissionSeeder extends Seeder
Permission::updateOrCreate(['name' => 'view production data send to sap']);
Permission::updateOrCreate(['name' => 'create production sticker reject reason page']);
Permission::updateOrCreate(['name' => 'create web capture page']);
Permission::updateOrCreate(['name' => 'view invoice pending reason']);
Permission::updateOrCreate(['name' => 'view import invoice out validation']);
Permission::updateOrCreate(['name' => 'view export invoice out validation']);
Permission::updateOrCreate(['name' => 'view import invoice data validation']);

View File

@@ -0,0 +1,15 @@
<x-filament-panels::page>
<div class="space-y-4">
{{-- {{ $this->filtersForm($this->form) }} --}}
{{ $this->filtersForm($this->form) }}
</div>
<div class="flex-row gap-2 mt-4">
<button
type="button"
wire:click="addRemark"
class="px-3 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
>
Save
</button>
</div>
</x-filament-panels::page>

View File

@@ -0,0 +1,45 @@
<div class="p-4">
<h2 class="text-lg font-bold mb-4 text-gray-700 uppercase tracking-wider">
PENDING INVOICE DATA TABLE:
</h2>
<div class="overflow-x-auto rounded-lg shadow">
<table class="w-full divide-y divide-gray-200 text-sm text-center">
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
<tr>
<th class="border px-4 py-2">No</th>
<th class="border px-4 py-2">Plant Code</th>
<th class="border px-4 py-2">Document Number</th>
<th class="border px-4 py-2">Customer Trade Location</th>
<th class="border px-4 py-2">Location</th>
<th class="border px-4 py-2">Remark</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@if (empty($invoicePending))
<tr>
<td colspan="6" class="px-4 py-4 text-center text-gray-500">
Please select plant to load pending invoice.
</td>
</tr>
@else
@forelse ($invoicePending as $index => $locator)
<tr class="hover:bg-gray-50">
<td class="border px-4 py-2">{{ $index + 1 }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $locator['plant_id'] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $locator['document_number'] ?? '-' }}</td>
<td class="border px-4 py-2">{{ $locator['customer_trade_name'] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $locator['location'] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $locator['remark'] ?? '-' }}</td>
</tr>
@empty
<tr>
<td colspan="9" class="px-4 py-4 text-center text-gray-500">
No invoice pending records found.
</td>
</tr>
@endforelse
@endif
</tbody>
</table>
</div>
</div>

View File

@@ -88,6 +88,7 @@
<th>Location</th>
<th>Pending Days</th>
<th>Status</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
@@ -117,6 +118,7 @@
<td class="{{ $row['status_class'] ?? '' }}">
{{ $row['status'] }}
</td>
<td>{{ $row['remark'] ?? '-'}}</td>
</tr>
@endforeach
</tbody>