Compare commits

...

1105 Commits

Author SHA1 Message Date
Martin Kiragu 0b30357568 selenium json file 2023-03-03 07:23:50 +03:00
Martin Kiragu 034e9da69e conception acceptance test configurations 2023-03-03 07:23:13 +03:00
Martin Kiragu 4b25764fb3 Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-03 06:29:16 +03:00
Martin Kiragu 422a0af465 move all UI related tests to codeception tets 2023-03-03 06:28:45 +03:00
edmondlang c73d65343b Merge branch 'update-create-dilivery-address' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 23:38:33 +08:00
edmondlang 9e5784b6ec update force create order delivery address 2023-03-02 23:38:12 +08:00
edmondlang 9a863e2143 Merge branch 'update-create-dilivery-address' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 23:18:12 +08:00
edmondlang 8024865d5d create order with force enter billing address 2023-03-02 23:17:42 +08:00
edmondlang 579dd02ebf update allow user to edit billing address 2023-03-02 22:20:08 +08:00
Martin Kiragu 66abe81e73 Merge remote-tracking branch 'origin/development' into development 2023-03-02 12:24:07 +03:00
Martin Kiragu ca178e1b31 add HasFactory facade to Users model 2023-03-02 12:23:49 +03:00
edmondlang e52a27aedb Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 17:06:55 +08:00
edmondlang 1e6ac000ac fix invoice command 2023-03-02 17:06:29 +08:00
Martin Kiragu 6c2c28fb31 rerun UI build on the test job 2023-03-02 11:58:09 +03:00
Martin Kiragu 049da351ef Merge remote-tracking branch 'origin/development' into development 2023-03-02 11:28:03 +03:00
Martin Kiragu 0ce8709f70 reduplicate mysql service for unit test job 2023-03-02 11:27:25 +03:00
edmondlang 1e5609bb1b Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 16:26:11 +08:00
edmondlang 0802198c97 update allow user to edit billing address 2023-03-02 16:25:51 +08:00
edmondlang 8e7970a925 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 16:16:23 +08:00
edmondlang 2421f6dcf0 allow user to edit billing address 2023-03-02 16:15:51 +08:00
Martin Kiragu 06b2c5166d remove dependencies test and add reruns 2023-03-02 11:01:10 +03:00
Martin Kiragu 6ba3b873a2 add building assets and dependencies test 2023-03-02 10:47:45 +03:00
Martin Kiragu 623fb1609b switch dependencies with an installation rerun 2023-03-02 10:29:40 +03:00
Martin Kiragu 24be20a60d switch dependencies with an installation rerun 2023-03-02 10:17:30 +03:00
Martin Kiragu 3535201481 remove test dependency injection 2023-03-02 10:04:09 +03:00
Martin Kiragu cdefd48d26 remove pdo echo 2023-03-02 09:50:44 +03:00
Martin Kiragu 45fbcf1447 pdo addition 2023-03-02 09:42:49 +03:00
Martin Kiragu 53805f3608 add database test 2023-03-02 09:20:02 +03:00
Martin Kiragu 99e90ad357 update remove pdo and mysql extension 2023-03-02 09:03:28 +03:00
Martin Kiragu 5edb9b5cfe add node and gulp builds 2023-03-02 08:58:23 +03:00
Martin Kiragu 86a5a3b2d9 add migration and seeder 2023-03-02 08:37:38 +03:00
Martin Kiragu a6590e3b81 test set up on the set up job 2023-03-02 08:31:14 +03:00
Martin Kiragu b1bb2b9f33 add .env.example to the env file 2023-03-02 08:25:04 +03:00
omair saleh 127a13c59c Merge branch 'dillon/crm-create-task' into 'master'
Add new tasks post payment into CRM + Add task append to lead

See merge request CIEFWorldwideSdnBhd/shipping-portal!146
2023-03-02 00:25:56 +00:00
Dillon 9318e7471f Merge branch 'dillon/crm-create-task' into development 2023-03-01 12:36:15 +08:00
Dillon ba2bd59b04 Add new tasks post payment into CRM + Add task append to lead 2023-03-01 12:29:47 +08:00
Martin Maina Kiragu e19ba1c9f3 Merge branch 'feature/TDD' into 'development'
Feature/tdd

See merge request CIEFWorldwideSdnBhd/shipping-portal!140
2023-03-01 03:54:54 +00:00
edmondlang 8cffae079b test approve invoice 2023-02-28 14:46:04 +08:00
edmondlang 594b25b71b temporary disable all other cron on development server 2023-02-28 14:29:04 +08:00
edmondlang d142a86683 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-28 14:23:11 +08:00
edmondlang 981ec9bbeb approve invoice function for testing 2023-02-28 14:22:32 +08:00
edmondlang b293542321 disable user to generate invoice on web link 2023-02-28 14:12:24 +08:00
Omair Saleh 18593cb959 fix duplicated invoices 2023-02-28 12:58:53 +08:00
Omair Saleh e2d1426d19 fix duplicated invoices 2023-02-28 12:58:18 +08:00
Omair Saleh d31deeb112 fix duplicated invoices 2023-02-28 12:50:52 +08:00
Omair Saleh d61a0c2104 fix duplicated invoices 2023-02-28 12:03:17 +08:00
edmondlang cbda7aa6ba delete duplicated invoice 2023-02-27 19:29:24 +08:00
edmondlang b5027c81f8 delete duplicated invoice 2023-02-27 19:26:26 +08:00
edmondlang e83e53a1d7 delete duplicated invoice 2023-02-27 19:21:25 +08:00
edmondlang 4058456797 delete duplicated invoice 2023-02-27 19:18:43 +08:00
edmondlang d03e34a1f4 delete duplicated invoice 2023-02-27 19:15:36 +08:00
edmondlang 5d79d5808a delete duplicated invoice for order marking 165005587 only 2023-02-27 16:17:47 +08:00
edmondlang 935f3e9bf5 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-27 15:59:49 +08:00
edmondlang e4464c3eb4 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal 2023-02-27 15:57:08 +08:00
edmondlang e227abac59 check duplicated invoice 2023-02-27 15:56:29 +08:00
omair saleh 997a9da276 Merge branch 'dillon/crm-integration' into 'master'
Dockerising shipping-portal usign the same setting from exchange-2.0.

See merge request CIEFWorldwideSdnBhd/shipping-portal!145
2023-02-27 05:14:32 +00:00
edmondlang a810fcad59 show duplicated invoice 2023-02-27 13:07:54 +08:00
edmondlang 9f4b04b9fb update show duplicated invoice 2023-02-27 12:57:46 +08:00
edmondlang 085692485a show duplicated invoice 2023-02-27 12:42:35 +08:00
edmondlang dedd6464f4 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-24 18:08:22 +08:00
edmondlang 6b5ae9b0b7 export invoice for PAID INVOICE and PENDING PAYMENT 2023-02-24 18:06:39 +08:00
edmondlang 38aba65178 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-23 14:53:41 +08:00
edmondlang eb92a76a0b update invoice search function 2023-02-23 14:53:21 +08:00
Dillon 091119c244 Merge branch 'dillon/crm-integration' into development 2023-02-22 18:09:51 +08:00
Dillon 2b20160334 User feedback fix and enhancement on crm integration 2023-02-22 18:09:34 +08:00
Dillon 4d095b5459 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-22 17:10:08 +08:00
Dillon 1c50181132 Merge branch 'dillon/crm-integration' into development 2023-02-22 10:37:19 +08:00
Dillon 8a29f10ef3 Include company name and phone number into lead during regirstration 2023-02-22 10:36:35 +08:00
edmondlang 9e26c470f5 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:54:08 +08:00
edmondlang a1bc3aa652 update PAYMENT AND BILLING invoice per_page to 5 2023-02-21 23:53:49 +08:00
edmondlang 4c0bf164a0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:43:18 +08:00
edmondlang e5af2bf171 Merge branch 'auto-generate-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal 2023-02-21 23:42:58 +08:00
edmondlang 2443575744 correct typo 2023-02-21 23:42:37 +08:00
edmondlang 8ab7f72e90 reverse invoice search function 2023-02-21 23:42:00 +08:00
edmondlang 5772e30575 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:41:19 +08:00
edmondlang 864bbc70b6 update invoice search function 2023-02-21 23:40:02 +08:00
edmondlang c439bb5d61 invoice search function 2023-02-21 23:31:20 +08:00
edmondlang 82b99a40cf update admin payments billing section component 2023-02-21 19:57:08 +08:00
edmondlang 4b2daa62d7 test auto generate invoice function 2023-02-21 17:32:20 +08:00
edmondlang 2bd8700a61 Merge branch 'auto-generate-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 16:50:42 +08:00
edmondlang 272ce5fa39 auto generate invoice 2023-02-21 16:50:14 +08:00
edmondlang c16a49d55c update regenerate invoice by web route 2023-02-21 16:07:32 +08:00
edmondlang ad7e77c169 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 15:01:09 +08:00
edmondlang c85b603b81 Nana from the Digital marketing department has requested to remove the wechat_id in registration 2023-02-21 15:00:52 +08:00
Omair Saleh 6c6b104dff fix bug when container schedule has issue 2023-02-21 14:19:28 +08:00
Omair Saleh 430b26def0 Merge remote-tracking branch 'origin/master' 2023-02-21 14:15:07 +08:00
Omair Saleh 2d9482feb6 fix bug when container schedule has issue 2023-02-21 14:14:38 +08:00
edmondlang 615e3e7683 update export-customer-order 2023-02-21 09:58:47 +08:00
edmondlang 32936af538 update export-customer-order 2023-02-20 22:14:09 +08:00
edmondlang 7f4fdf0191 update export-customer-order 2023-02-20 20:31:52 +08:00
edmondlang 1c4d9520f9 update export-customer-order 2023-02-20 20:23:02 +08:00
edmondlang 6c7685dac2 update export-customer-order 2023-02-20 20:17:48 +08:00
edmondlang e95c41bd3e Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-20 19:51:11 +08:00
edmondlang 4653e8403b export-customer-order 2023-02-20 19:50:53 +08:00
edmondlang 903269e714 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-20 18:22:48 +08:00
edmondlang a648a11567 Nana from the Digital marketing department has requested to remove the text 2023-02-20 18:22:21 +08:00
edmondlang 4120a50559 commented on the web routes and api routes to test on the crm 2023-02-18 23:09:24 +08:00
Dillon 88b31f2d3f Merge branch 'dillon/crm-integration' into development 2023-02-18 21:08:08 +08:00
Dillon cb8d808562 done debugging, undo changes 2023-02-18 21:07:50 +08:00
Dillon a2f9bf83ce Merge branch 'dillon/crm-integration' into development 2023-02-18 20:29:57 +08:00
Dillon 130aca262a debug 2023-02-18 20:29:49 +08:00
Dillon dd2ac4c966 Merge branch 'dillon/crm-integration' into development 2023-02-18 20:09:08 +08:00
Dillon 06ab1be86e debug 2023-02-18 20:08:53 +08:00
Omair Saleh a78ed8271f auto generate invoices 2023-02-17 13:56:42 +08:00
Omair Saleh 16ce06ba7e auto generate invoices 2023-02-17 13:49:02 +08:00
Omair Saleh 5335b8affb auto generate invoices 2023-02-17 13:48:26 +08:00
Omair Saleh 6d1153298c auto generate invoices 2023-02-17 13:47:34 +08:00
Omair Saleh 8f65767996 auto generate invoices 2023-02-17 13:47:02 +08:00
Omair Saleh 4bba550b9e auto generate invoices 2023-02-17 13:46:16 +08:00
Omair Saleh b33b780563 auto generate invoices 2023-02-17 13:45:00 +08:00
Omair Saleh 342285247a auto generate invoices 2023-02-17 13:41:04 +08:00
Omair Saleh 0c82aa17fc auto generate invoices 2023-02-17 13:40:13 +08:00
Omair Saleh ed36b85a3d auto generate invoices 2023-02-17 13:20:55 +08:00
Omair Saleh 4f8e9fbd5f auto generate invoices 2023-02-17 13:10:02 +08:00
Omair Saleh ee575c21ea auto generate invoices 2023-02-17 13:06:52 +08:00
Omair Saleh f4f8c34cb9 auto generate invoices 2023-02-17 13:04:05 +08:00
Omair Saleh 7cb27a6114 auto generate invoices 2023-02-17 13:02:18 +08:00
Omair Saleh 2f4b568c9a auto generate invoices 2023-02-17 12:53:35 +08:00
Omair Saleh a23e0b35a2 auto generate invoices 2023-02-17 12:53:10 +08:00
Omair Saleh 598ca3807e auto generate invoices 2023-02-17 12:52:39 +08:00
Omair Saleh 0654f0335b auto generate invoices 2023-02-17 12:51:15 +08:00
Omair Saleh e4610e1a53 auto generate invoices 2023-02-17 12:50:37 +08:00
Omair Saleh 38ae8f72eb auto generate invoices 2023-02-17 12:49:55 +08:00
Omair Saleh cbdd4e8137 auto generate invoices 2023-02-17 12:49:27 +08:00
Omair Saleh c4d2b4e476 auto generate invoices 2023-02-17 12:48:48 +08:00
Omair Saleh 7eab58b45e auto generate invoices 2023-02-17 12:47:58 +08:00
Omair Saleh a9b21e9566 auto generate invoices 2023-02-17 12:47:19 +08:00
Omair Saleh 9aec5a71f1 auto generate invoices 2023-02-17 12:46:37 +08:00
Omair Saleh 771b10ffc9 auto generate invoices 2023-02-17 12:35:12 +08:00
Omair Saleh a9d4806a4a auto generate invoices 2023-02-17 12:34:06 +08:00
Omair Saleh 0d0048eb6c debug yd api 2023-02-17 11:11:51 +08:00
Omair Saleh d5f3e9ba71 debug yd api 2023-02-17 11:04:32 +08:00
Omair Saleh 5144e940f2 debug yd api 2023-02-17 10:58:35 +08:00
Omair Saleh 8dac196cb9 debug yd api 2023-02-17 10:58:02 +08:00
Omair Saleh e1bc996efb debug yd api 2023-02-17 10:56:53 +08:00
Omair Saleh ed7019f75e debug yd api 2023-02-17 10:56:25 +08:00
Omair Saleh 0f0a32488a debug yd api 2023-02-17 10:55:46 +08:00
Omair Saleh b3cc805e78 debug yd api 2023-02-17 10:55:00 +08:00
Omair Saleh fd8a09d443 debug yd api 2023-02-17 10:54:22 +08:00
Omair Saleh 8d5603c756 debug yd api 2023-02-17 10:53:58 +08:00
Omair Saleh c3de10f676 debug yd api 2023-02-17 10:53:06 +08:00
Omair Saleh 80a47f05f7 debug yd api 2023-02-17 10:52:18 +08:00
Omair Saleh 53cc2ee493 debug yd api 2023-02-17 10:49:30 +08:00
Omair Saleh fadef468bb debug yd api 2023-02-17 10:46:37 +08:00
Omair Saleh 3f0028aaf1 debug yd api 2023-02-17 10:43:47 +08:00
Omair Saleh 7ea7db9f49 debug yd api 2023-02-17 10:41:41 +08:00
Omair Saleh 7a95741af9 debug yd api 2023-02-17 10:39:36 +08:00
Omair Saleh 75c7772d98 debug yd api 2023-02-17 10:38:03 +08:00
Omair Saleh 851489bd12 debug yd api 2023-02-17 10:36:38 +08:00
Omair Saleh 666b5a7791 debug yd api 2023-02-17 10:35:07 +08:00
Omair Saleh a1461f899b debug yd api 2023-02-17 10:34:32 +08:00
Omair Saleh 2fda9e0c46 debug yd api 2023-02-17 10:33:58 +08:00
Omair Saleh ec2b46b192 debug yd api 2023-02-17 10:33:38 +08:00
Omair Saleh 833c4c5905 debug yd api 2023-02-17 10:33:05 +08:00
Omair Saleh 1aea633375 debug yd api 2023-02-17 10:32:41 +08:00
Omair Saleh cc90c16d9a debug yd api 2023-02-17 10:32:09 +08:00
Omair Saleh 10af83056a debug yd api 2023-02-17 10:31:39 +08:00
Omair Saleh cd930dbaf0 debug yd api 2023-02-17 10:30:46 +08:00
Omair Saleh 2bf3e38ced debug yd api 2023-02-17 10:07:17 +08:00
Omair Saleh 5f4010bb50 debug yd api 2023-02-17 10:03:54 +08:00
Dillon c88f6890d6 Merge branch 'dillon/crm-integration' into development 2023-02-17 09:24:38 +08:00
Dillon 53d076c7e5 CRM integration MVP Phase 1 - minor cleanup 2023-02-17 09:24:13 +08:00
Dillon 1b84ccf60e CRM integration MVP Phase 1 2023-02-17 09:06:18 +08:00
Omair Saleh 5955c1a633 debug yd api 2023-02-17 08:26:13 +08:00
Omair Saleh 7ece4f6470 debug yd api 2023-02-17 06:49:26 +08:00
Omair Saleh e0e82634d3 debug yd api 2023-02-17 06:47:16 +08:00
Omair Saleh 988e798cf1 debug yd api 2023-02-17 06:46:36 +08:00
Omair Saleh 4ce8440724 debug yd api 2023-02-17 06:45:35 +08:00
Omair Saleh e2f5097882 debug yd api 2023-02-17 06:44:56 +08:00
Omair Saleh 9f96caad7c debug yd api 2023-02-17 06:44:33 +08:00
Omair Saleh 3046530f71 debug yd api 2023-02-17 06:43:25 +08:00
Omair Saleh 84a6cb85dd debug yd api 2023-02-17 06:42:33 +08:00
Omair Saleh c86ea9cee4 debug yd api 2023-02-17 06:38:21 +08:00
Omair Saleh ac15f76c4f debug yd api 2023-02-17 06:36:26 +08:00
Omair Saleh 1fc176296e debug yd api 2023-02-17 06:35:29 +08:00
Omair Saleh 3f911f145a debug yd api 2023-02-17 05:45:19 +08:00
Omair Saleh d5c28df748 debug yd api 2023-02-17 05:19:04 +08:00
Omair Saleh 9bfe943898 debug yd api 2023-02-17 05:02:39 +08:00
Omair Saleh dbcbabec93 Merge remote-tracking branch 'origin/master' 2023-02-17 03:39:22 +08:00
Omair Saleh e24cdd82d4 debug yd api 2023-02-17 03:35:43 +08:00
edmondlang bf4b3fa97f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-16 23:13:22 +08:00
edmondlang 01854a3292 update change company name 2023-02-16 23:09:47 +08:00
edmondlang 6bcea5a8f1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-16 16:53:12 +08:00
Omair Saleh 679bae6fe8 debug yd api 2023-02-16 16:41:17 +08:00
Omair Saleh f567995202 debug yd api 2023-02-16 16:40:17 +08:00
Omair Saleh 35b3cb4515 debug yd api 2023-02-16 16:39:17 +08:00
Omair Saleh 196cf3d58a debug yd api 2023-02-16 16:32:20 +08:00
Omair Saleh b12a862903 debug yd api 2023-02-16 16:27:53 +08:00
Omair Saleh f586314cd8 debug yd api 2023-02-16 16:24:42 +08:00
Omair Saleh 16f41482ad debug yd api 2023-02-16 16:19:47 +08:00
Omair Saleh 95866b0789 debug yd api 2023-02-14 14:50:45 +08:00
Omair Saleh fb2ba2a3c7 debug yd api 2023-02-14 14:50:03 +08:00
Omair Saleh 3041144968 debug yd api 2023-02-14 14:47:59 +08:00
Omair Saleh 2efdb33b71 debug yd api 2023-02-14 14:47:21 +08:00
Omair Saleh 5716050694 debug yd api 2023-02-14 14:46:51 +08:00
Omair Saleh e22c7c7e8b debug yd api 2023-02-14 14:46:31 +08:00
Omair Saleh d9972a8a95 debug yd api 2023-02-14 14:45:49 +08:00
Omair Saleh 6dbafde89c debug yd api 2023-02-14 14:45:06 +08:00
Omair Saleh 680ddd5066 debug yd api 2023-02-14 14:44:19 +08:00
Omair Saleh f6b5eb3098 debug yd api 2023-02-14 14:43:15 +08:00
Omair Saleh 82f8cae4a8 debug yd api 2023-02-14 14:41:22 +08:00
Omair Saleh 4c868de356 debug yd api 2023-02-14 14:40:30 +08:00
Omair Saleh c44278fe26 debug yd api 2023-02-14 14:38:59 +08:00
Omair Saleh 43c8530e6d debug yd api 2023-02-14 14:37:32 +08:00
Martin Maina Kiragu 2704ec1665 Merge branch 'feature/pipeline' into 'development'
Update .gitlab-ci.yml file

See merge request CIEFWorldwideSdnBhd/shipping-portal!144
2023-02-13 07:28:57 +00:00
Martin Maina Kiragu 0c636d2156 remove spaces on Export warehouse service 2023-02-13 05:17:03 +00:00
Martin Kiragu 1270ba3f43 delete the code ide-helper file 2023-02-13 08:08:06 +03:00
Martin Kiragu f2c32c5024 fix more spaces 2023-02-13 08:07:11 +03:00
Martin Kiragu ccb3bde260 clean up spaces on my branch 2023-02-13 08:01:23 +03:00
Martin Kiragu a7eb14c2b7 Merge branch 'feature/TDD' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-02-13 07:37:01 +03:00
Martin Kiragu abac96b1e5 revert all models changes 2023-02-13 07:36:40 +03:00
Martin Maina Kiragu ecb48c8897 Merge branch 'master' into 'feature/TDD'
# Conflicts:
#   config/app.php
2023-02-13 04:24:32 +00:00
Martin Maina Kiragu 2686229a0f Merge branch 'master' into 'feature/pipeline'
# Conflicts:
#   config/app.php
2023-02-13 04:12:19 +00:00
Martin Kiragu 558fa7ae52 remove migration and seeder 2023-02-13 06:49:08 +03:00
Martin Kiragu 88e2136c07 add cp .env 2023-02-13 06:47:58 +03:00
Martin Kiragu 70cdcded9b generate key, run migration and database seeder 2023-02-13 06:40:02 +03:00
Martin Kiragu 4022b640f9 test by rerunning the install 2023-02-13 06:31:05 +03:00
Martin Kiragu 0d780074b8 vender test to php 2023-02-13 06:23:53 +03:00
Martin Kiragu 078f675a7f add codeception and change vender test to php 2023-02-13 06:20:42 +03:00
Martin Kiragu 2b48a86f98 comment the Meneses\LaravelMpdf\LaravelMpdfServiceProvider 2023-02-13 06:11:41 +03:00
Martin Maina Kiragu 19f3aa18fc Update .gitlab-ci.yml file
add libzip
2023-02-13 03:07:34 +00:00
Martin Maina Kiragu 2b4c932fc8 Update .gitlab-ci.yml file
add libzip
2023-02-13 03:05:29 +00:00
Martin Maina Kiragu 89f0ca651a Update .gitlab-ci.yml file
add libzip
2023-02-13 03:01:07 +00:00
Martin Maina Kiragu c9fc5938c6 Update .gitlab-ci.yml file
add libzip
2023-02-13 02:55:41 +00:00
Martin Maina Kiragu 2ad8235c1b Update .gitlab-ci.yml file
add libzip
2023-02-13 02:53:22 +00:00
Martin Maina Kiragu dbf8301cb9 Update .gitlab-ci.yml file
add libzip
2023-02-13 02:49:27 +00:00
Martin Maina Kiragu 7d582c6bca Update .gitlab-ci.yml file
add libzip
2023-02-13 02:48:30 +00:00
Martin Maina Kiragu 3c4b6afcb2 Update .gitlab-ci.yml file
add zip
2023-02-13 02:46:21 +00:00
Martin Maina Kiragu e4bc56d188 Update .gitlab-ci.yml file 2023-02-13 02:44:10 +00:00
Martin Maina Kiragu 9a448d5a3d Update .gitlab-ci.yml file 2023-02-13 02:41:24 +00:00
Martin Maina Kiragu 5c1074b244 Update .gitlab-ci.yml file 2023-02-13 02:38:49 +00:00
Martin Maina Kiragu 49fcdfd89e Update .gitlab-ci.yml file 2023-02-13 02:36:51 +00:00
Martin Maina Kiragu c900759234 Update .gitlab-ci.yml file 2023-02-13 02:30:15 +00:00
Martin Maina Kiragu cd3b47ab1a Update .gitlab-ci.yml file 2023-02-13 02:26:31 +00:00
Martin Maina Kiragu c5f95cdf61 Update .gitlab-ci.yml file 2023-02-13 02:22:31 +00:00
Martin Maina Kiragu cc428a92b8 Update .gitlab-ci.yml file 2023-02-13 02:08:09 +00:00
Martin Maina Kiragu 97bac45612 Update .gitlab-ci.yml file 2023-02-13 02:03:30 +00:00
Martin Maina Kiragu 8048396a88 Update .gitlab-ci.yml file 2023-02-13 01:59:14 +00:00
Martin Maina Kiragu 400ec31235 Update .gitlab-ci.yml file 2023-02-13 01:54:53 +00:00
Martin Maina Kiragu 4d9346c62c Update .gitlab-ci.yml file 2023-02-13 01:49:47 +00:00
Martin Maina Kiragu 94fd2069e8 Update .gitlab-ci.yml file 2023-02-13 01:43:41 +00:00
Martin Maina Kiragu 1f401eb347 Update .gitlab-ci.yml file 2023-02-13 01:39:09 +00:00
Martin Maina Kiragu 80e282bda0 Update .gitlab-ci.yml file 2023-02-13 01:35:00 +00:00
Martin Maina Kiragu 65cd6aae3c Update .gitlab-ci.yml file 2023-02-13 01:33:05 +00:00
Martin Maina Kiragu eba2a30024 Update .gitlab-ci.yml file 2023-02-13 01:28:16 +00:00
Martin Maina Kiragu c103deb2a7 Update .gitlab-ci.yml file 2023-02-13 01:25:16 +00:00
Martin Maina Kiragu dcef782587 Update .gitlab-ci.yml file
--update to php 7.4
2023-02-13 01:22:54 +00:00
Martin Maina Kiragu 10e7da4673 Update .gitlab-ci.yml file 2023-02-13 01:15:20 +00:00
Martin Kiragu faff35f241 update the pipeline with master branch code 2023-02-13 04:07:33 +03:00
Martin Maina Kiragu e2c1562f19 Update .gitlab-ci.yml file 2023-02-13 00:57:12 +00:00
Martin Maina Kiragu df35ceb798 Update .gitlab-ci.yml file 2023-02-13 00:51:03 +00:00
Martin Maina Kiragu cdb81a0bf4 Update .gitlab-ci.yml file 2023-02-13 00:48:41 +00:00
Martin Maina Kiragu f1b1955190 Update .gitlab-ci.yml file 2023-02-13 00:42:05 +00:00
Martin Maina Kiragu 860632b7a3 Update .gitlab-ci.yml file 2023-02-13 00:39:49 +00:00
Martin Maina Kiragu bde7a61fb4 Update .gitlab-ci.yml file 2023-02-13 00:35:42 +00:00
edmondlang 198e0674bd Merge branch 'update-laravelmpdf' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal 2023-02-10 23:10:34 +08:00
edmondlang b6600c5168 Merge branch 'update-laravelmpdf' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-10 20:56:42 +08:00
edmondlang 7d09205817 update laravel mpdf 2023-02-10 20:55:32 +08:00
edmondlang 5f5dbeb3d1 update ExportsWarehousePackingList to only johor state 2023-02-08 18:59:09 +08:00
edmondlang 67a877ca15 update laravel mpdf 2023-02-07 23:54:33 +08:00
edmondlang 25f38ef7fe Merge branches 'development' and 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-07 23:40:38 +08:00
edmondlang 88e7bf44b5 update code on the prefix 'NX' 2023-02-07 23:40:24 +08:00
edmondlang ddeb44b920 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-07 23:32:35 +08:00
edmondlang 86461c19a1 add export function - export/packing-list-warehouse/guangzhou2-to-johor
add warehouse prefix 'NX/'
2023-02-07 23:32:18 +08:00
Martin Maina Kiragu 02be710203 Update .gitlab-ci.yml file try php 7.3 2023-02-06 16:14:50 +00:00
Martin Maina Kiragu 2ffbfc9f1c Update .gitlab-ci.yml file 2023-02-06 16:12:41 +00:00
Martin Maina Kiragu 7b34f8116c Update .gitlab-ci.yml file 2023-02-06 16:09:41 +00:00
Martin Maina Kiragu 8a9b6df255 Update .gitlab-ci.yml file 2023-02-06 16:04:42 +00:00
Martin Kiragu c881dd44d6 updated action file 2023-02-06 18:38:12 +03:00
Martin Kiragu 1cfaeaf8bb add triggers 2023-02-06 18:28:46 +03:00
Martin Kiragu 914f29184d simple pipeline configuration 2023-02-06 18:23:51 +03:00
edmondlang 18d1841a30 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal 2023-02-06 23:10:00 +08:00
edmondlang f510d57463 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 23:08:03 +08:00
edmondlang 990508501d revert testing code 2023-02-06 23:07:41 +08:00
edmondlang 7833c17938 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 23:02:43 +08:00
edmondlang dfec2073b0 update change company and debtor code 2023-02-06 23:02:02 +08:00
edmondlang 97fdffe6eb Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 22:46:53 +08:00
edmondlang 2300d237d3 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal 2023-02-06 22:43:24 +08:00
edmondlang a62e5d95fb add debtor in company resource folder 2023-02-06 22:33:57 +08:00
edmondlang b1f2900f1c Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 22:25:33 +08:00
edmondlang ddf015dc71 Revert "work on combine invoices"
This reverts commit 2a9d4fd212.
2023-02-06 22:24:48 +08:00
edmondlang 2d8535b7f5 change company name and debtor code 2023-02-06 22:24:00 +08:00
Sheikh Ahmer 2a9d4fd212 work on combine invoices 2023-02-04 16:36:09 +05:00
Martin Kiragu 2cacc23a38 login acceptance test 2023-02-04 10:04:34 +03:00
Martin Kiragu a7fd5a038e Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-02-04 07:53:45 +03:00
edmondlang 626b31084f Merge branch 'wip-invoice-tab' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-03 16:11:48 +08:00
edmondlang 3f21802090 update customer payment billing section component 2023-02-03 16:10:57 +08:00
Martin Kiragu 4f3c25d5bd Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-01-29 10:51:30 +03:00
Martin Kiragu 8da942e41e updated list of all user, passwords and emails unit tests 2023-01-28 12:56:41 +03:00
edmondlang e8191df0e9 update company invoice endpoint and customer payment-and-billing page design 2023-01-28 02:19:51 +08:00
edmondlang 02064ad68e reverse commit on app.php - Meneses\LaravelMpdf\LaravelMpdfServiceProvider::class 2023-01-28 01:15:46 +08:00
Wafie 13319aacff wip-invoice-tab 2023-01-26 21:36:52 +08:00
edmondlang 996ef4205f update multi invoice combined summary 2023-01-20 17:50:19 +08:00
edmondlang b599c8a151 Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-20 17:15:25 +08:00
edmondlang 0aaa7f486a debug multi invoicve combines ui 2023-01-20 17:14:59 +08:00
Martin Kiragu d41f796825 fix access_token issue 2023-01-20 10:39:39 +03:00
Martin Kiragu dd612e2660 fix issues 2023-01-19 12:12:54 +03:00
Martin Kiragu c503b5e677 acceptance test set up and demo 2023-01-19 12:03:09 +03:00
Martin Kiragu 0b433cfa18 ed debug 2023-01-19 09:39:16 +03:00
Martin Kiragu 75aba8c4ac remove password related tests on auth test class 2023-01-19 09:39:16 +03:00
Martin Kiragu 81c65874a3 added the Auth tdd and a modal property autogenerator helpers 2023-01-19 09:39:15 +03:00
Martin Kiragu 79d29d9c7b Authentication TDD 2023-01-19 09:39:15 +03:00
Martin Kiragu 1e558b93af set up testig env codeception laravela and phpunit 2023-01-19 09:39:15 +03:00
edmondlang 6d3d52639e Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-19 00:33:37 +08:00
edmondlang 35dc74c3bb update shipping invoice 2023-01-19 00:33:09 +08:00
edmondlang a1d460aa6c Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-19 00:20:38 +08:00
edmondlang 0310138644 add href link to payment and billing page 2023-01-19 00:20:16 +08:00
edmondlang 5a0bc7aaea Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/views/pages/pdfs/shipping_invoices_combined.blade.php
2023-01-18 23:59:58 +08:00
edmondlang 7e439a38fd multi invoice combined ui 2023-01-18 23:58:26 +08:00
Martin Kiragu c7962b4231 ed debug 2023-01-18 18:34:18 +03:00
edmondlang 1c800b70ec Merge branch 'multiple-payment-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into multi-invoice-combined-ui 2023-01-18 23:17:57 +08:00
edmondlang c614190de8 combine multi invoice with summary 2023-01-18 23:13:32 +08:00
Martin Kiragu d14bb39ae8 remove password related tests on auth test class 2023-01-18 09:11:30 +03:00
Martin Kiragu 5cc2f51c02 added the Auth tdd and a modal property autogenerator helpers 2023-01-18 08:17:05 +03:00
Martin Kiragu a185f73e8a Authentication TDD 2023-01-16 14:40:57 +03:00
edmondlang 551fb7deaa update search customer by email component - enable search by pressing enter 2023-01-16 00:03:28 +08:00
edmondlang f9a9598210 Merge branch 'dillon/search-marking-by-email' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-15 14:20:38 +08:00
sharifcse57 d91e0e56c3 Create option: Update customer name by pop up modal 2023-01-12 22:37:59 +06:00
Dillon 2248e76bd4 Allow admin to search a customer by email address to open in new window 2023-01-11 22:44:04 +08:00
edmondlang 9976ccec41 Merge branch 'ChangeCompanie' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-11 22:39:58 +08:00
edmondlang 8bfb2d749a Merge branch 'dillon/multiple-invoices-combined' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-11 18:25:28 +08:00
Martin Kiragu 7bf9a570a1 set up testig env codeception laravela and phpunit 2023-01-11 12:44:32 +03:00
Cleison Freitas df283e54a2 Company rename endpoint. 2023-01-10 23:03:35 -03:00
edmondlang b38df170e8 Merge branch 'multiple-payment-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-09 22:58:10 +08:00
edmondlang 769b5dd050 multi payment ui 2023-01-09 22:57:30 +08:00
Dillon bf38ace70c Multiple invoices into one 2023-01-07 11:51:27 +08:00
Omair Saleh 4c023aa393 export customer total yearly cbm 2023-01-05 10:41:38 +08:00
Omair Saleh 7922c10e2c export customer total yearly cbm 2023-01-05 10:39:04 +08:00
Omair Saleh 742fdf307b export customer total yearly cbm 2023-01-05 10:37:27 +08:00
Omair Saleh df993fe491 export customer total yearly cbm 2023-01-04 12:17:44 +08:00
Omair Saleh 5f5707718f show reference number for package 2023-01-04 11:29:40 +08:00
Omair Saleh d7d9a065fd show reference number for package 2023-01-04 11:23:16 +08:00
edmondlang 66c008f97e Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-03 13:49:15 +08:00
EDMOND MING 568d45808a Merge branch 'export-top-order-pdf' into 'master'
export top order pdf

See merge request CIEFWorldwideSdnBhd/shipping-portal!138
2023-01-03 05:47:39 +00:00
edmondlang 715051076c export top order pdf 2023-01-03 00:41:12 +08:00
edmondlang 0298eb946f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into activity-route-log-dev 2023-01-02 17:41:29 +08:00
edmondlang 70fb35e37c api and web route logs 2023-01-02 17:41:00 +08:00
edmondlang 1a30877ca9 activity route log dev 2022-12-31 11:53:41 +08:00
Omair Saleh 7642f6e9d3 regenerate invoices for specific customers 2022-12-30 17:35:28 +08:00
Omair Saleh 84ad39ac11 regenerate invoices for specific customers 2022-12-30 17:35:07 +08:00
Omair Saleh 03b44cf71d regenerate invoices for specific customers 2022-12-30 17:34:33 +08:00
Omair Saleh 0b577c22f4 regenerate invoices for specific customers 2022-12-30 17:33:29 +08:00
Omair Saleh cabb7b7d63 regenerate invoices for specific customers 2022-12-30 17:32:34 +08:00
Omair Saleh 880d3fc8ce regenerate invoices for specific customers 2022-12-30 17:29:00 +08:00
Omair Saleh 8d901505fe regenerate invoices for specific customers 2022-12-30 17:28:27 +08:00
Omair Saleh 489216e7be regenerate invoices for specific customers 2022-12-30 17:23:56 +08:00
Omair Saleh e413dfa795 regenerate invoices for specific customers 2022-12-30 17:21:47 +08:00
WAKOYA_KUMSA\waqo1 569a22c0db route activity log 2022-12-28 13:15:15 +03:00
Omair Saleh 4ff5c6df80 update gz warehouse notice 2022-12-26 21:21:00 +08:00
edmondlang 851e2e1815 multi payment ui 2022-12-24 16:39:17 +08:00
edmondlang 503bc90556 multiple payment ui 2022-12-23 16:37:06 +08:00
Omair Saleh 762add8e5c fix log data for transactional tables 2022-12-18 15:14:36 +08:00
Omair Saleh 96723461e4 log transactional data 2022-12-16 13:39:19 +08:00
Omair Saleh 2c1431a813 fix over weight minimum charge 2022-12-14 20:16:52 +08:00
Omair Saleh 90ca018e81 fix over weight minimum charge 2022-12-14 20:15:02 +08:00
Omair Saleh 60c51419bb fix over weight minimum charge 2022-12-14 20:07:31 +08:00
Omair Saleh 69f98125a0 fix over weight minimum charge 2022-12-14 20:05:50 +08:00
Omair Saleh f56bfb0309 fix over weight minimum charge 2022-12-14 20:04:02 +08:00
Omair Saleh aedd836211 fix over weight minimum charge 2022-12-14 20:03:11 +08:00
Omair Saleh abfb0ea47b fix over weight minimum charge 2022-12-14 19:57:10 +08:00
Omair Saleh 09461e5bef fix over weight minimum charge 2022-12-14 19:56:21 +08:00
Omair Saleh d5b16f288a fix over weight minimum charge 2022-12-14 19:55:55 +08:00
Omair Saleh 7c1a77089b fix over weight minimum charge 2022-12-14 19:54:19 +08:00
Omair Saleh 505d924eec fix over weight minimum charge 2022-12-14 19:48:39 +08:00
Omair Saleh d0dd802693 fix over weight minimum charge 2022-12-14 19:47:56 +08:00
Omair Saleh 3113cc9fc0 fix over weight minimum charge 2022-12-14 19:47:00 +08:00
Omair Saleh 840e1147c8 fix over weight minimum charge 2022-12-14 19:42:16 +08:00
Omair Saleh 5c89471e14 fix over weight minimum charge 2022-12-14 11:45:28 +08:00
Omair Saleh fbc73e040f fix billplz bill status 2022-12-13 11:03:48 +08:00
Omair Saleh 414f22ab05 fix billplz bill status 2022-12-13 10:56:36 +08:00
Omair Saleh d7328bafdc fix billplz bill status 2022-12-13 10:54:46 +08:00
Omair Saleh 5c5505174a fix billplz bill status 2022-12-13 10:52:51 +08:00
Omair Saleh 6b73d13c33 fix billplz bill status 2022-12-09 12:01:47 +08:00
Omair Saleh 8a62807356 fix billplz bill status 2022-12-09 11:54:16 +08:00
Omair Saleh acca5192b6 estimate container shipping cost 2022-12-07 17:30:48 +08:00
Dillon 515c71daa7 Merge branch 'dillon/setup-docker-2' into dillon/crm-integration 2022-12-06 08:34:29 +08:00
Omair Saleh dfbf22951b estimate container shipping cost 2022-12-02 11:23:40 +08:00
Omair Saleh cc26e67340 estimate container shipping cost 2022-12-02 11:22:47 +08:00
Omair Saleh 15db2715f5 estimate container shipping cost 2022-12-02 11:15:50 +08:00
Omair Saleh 2fc54f796a estimate container shipping cost 2022-12-02 11:01:33 +08:00
Omair Saleh 91b14b3820 estimate container shipping cost 2022-12-02 10:14:37 +08:00
Omair Saleh 7dc549ab2e estimate container shipping cost 2022-12-01 19:08:43 +08:00
Omair Saleh 5480a55edc estimate container shipping cost 2022-12-01 18:44:04 +08:00
Omair Saleh 0cb3bd6ce3 estimate container shipping cost 2022-12-01 18:41:17 +08:00
Omair Saleh f2cc45303c estimate container shipping cost 2022-12-01 18:40:36 +08:00
Omair Saleh e0db537931 estimate container shipping cost 2022-12-01 18:37:50 +08:00
Omair Saleh 53b4af2b5c estimate container shipping cost 2022-12-01 18:35:24 +08:00
Omair Saleh c9d2041653 estimate container shipping cost 2022-12-01 18:31:43 +08:00
Omair Saleh 53e9fcaeb8 debug minimum charge 2022-11-29 15:14:34 +08:00
Omair Saleh 7e007e7d78 debug minimum charge 2022-11-29 15:07:32 +08:00
Omair Saleh 7c879c8633 add bcc to invoice notification email for testing 2022-11-25 11:42:20 +08:00
Omair Saleh 9f255664ac show add/edit billing address to admin 2022-11-24 09:52:12 +08:00
Omair Saleh 63918b4eb0 update china on hold list 2022-11-22 12:10:24 +08:00
Omair Saleh ae36513635 round up cbm to 3 decimals 2022-11-16 16:52:01 +08:00
Omair Saleh 7ac66080ec update export invoice 2022-11-16 16:45:33 +08:00
Omair Saleh 4b699345b8 update export invoice 2022-11-16 16:32:45 +08:00
Dillon a041a70d93 Merge branch 'dillon/setup-docker' into dillon/setup-docker-2 2022-11-16 11:07:30 +08:00
Omair Saleh 634a97f3b4 minor changes to dummy data seeder comments 2022-11-15 19:56:03 +08:00
Omair Saleh 8a4810d961 remove lockdown announcement from order form 2022-11-15 15:07:33 +08:00
Omair Saleh ab3ba64d31 show anitha debtor ui 2022-11-14 15:01:56 +08:00
Omair Saleh 7bca4be9b9 show anitha debtor ui 2022-11-14 14:54:43 +08:00
Omair Saleh 4f12c7c8ac show anitha debtor ui 2022-11-14 14:53:37 +08:00
Omair Saleh 759a9c19d7 show anitha debtor ui 2022-11-14 14:21:25 +08:00
Omair Saleh 6fa72a4195 show anitha debtor ui 2022-11-14 14:19:06 +08:00
Omair Saleh c82581dcc4 show anitha debtor ui 2022-11-14 14:13:55 +08:00
Omair Saleh d4a63c0095 disable notification for non production enviroments 2022-11-10 21:13:28 +08:00
Omair Saleh 22b03669c6 disable notification for non production enviroments 2022-11-10 21:11:45 +08:00
Omair Saleh 58e9e80fd9 dummy data seed 2022-11-10 20:32:14 +08:00
Omair Saleh 4dab73fc8e re-release yd paid orders 2022-11-09 12:00:25 +08:00
Omair Saleh 9b87f26ca3 re-release yd paid orders 2022-11-09 11:56:43 +08:00
Omair Saleh cd81683816 add container summary for billing report 2022-11-07 13:18:59 +08:00
Omair Saleh 169fac4ab0 add container summary for billing report 2022-11-07 13:17:22 +08:00
Omair Saleh 34b4482139 add container summary for billing report 2022-11-07 13:16:42 +08:00
Omair Saleh 945e8585d4 show edit billing address at invoice pending approval 2022-11-07 10:57:11 +08:00
Omair Saleh 68cb7b7df1 show edit billing address at invoice pending approval 2022-11-07 10:51:32 +08:00
Omair Saleh 84b6750bcc show edit billing address at invoice pending approval 2022-11-07 10:21:27 +08:00
Omair Saleh 7f766cde6a Invoice reminder and shipment update notification emails 2022-11-07 09:38:03 +08:00
Omair Saleh 5d1bb976f8 misc fixes 2022-11-07 08:20:24 +08:00
Omair Saleh 529eb1be93 GZ warehouse close notice 2022-11-03 20:28:30 +08:00
Dillon d4c9899120 Dockerising shipping-portal usign the same setting from exchange-2.0.
Update gitignore to include docker-compose.yml (same as exchange-2.0)
2022-11-02 05:56:06 +08:00
Omair Saleh 95fd0aa45d shipping sales report 2022-11-01 15:45:46 +08:00
Omair Saleh 64a7e4e0b7 shipping sales report 2022-11-01 15:41:28 +08:00
Omair Saleh de4577346c shipping sales report 2022-11-01 15:36:37 +08:00
Omair Saleh 0ac9ca38f2 shipping sales report 2022-11-01 15:34:15 +08:00
Omair Saleh 4b79039a18 shipping sales report 2022-11-01 15:32:39 +08:00
Omair Saleh 4b32a48e07 shipping sales report 2022-11-01 15:30:53 +08:00
Omair Saleh eb09993397 yd api to fetch 30 days 2022-11-01 12:36:29 +08:00
Omair Saleh 627d782e5d yd api to fetch 30 days 2022-11-01 12:35:17 +08:00
Omair Saleh 04771cec4f yd api to fetch 30 days 2022-11-01 12:24:48 +08:00
Omair Saleh d7630af675 fix payment due date days filter 2022-10-31 12:30:24 +08:00
Omair Saleh 37c710def6 fix payment due date days filter 2022-10-30 20:41:20 +08:00
Omair Saleh 7423588324 fix payment due date days filter 2022-10-30 20:38:36 +08:00
Omair Saleh cb76e86c75 fix payment due date days filter 2022-10-30 20:37:43 +08:00
Omair Saleh cb862123b5 fix payment due date days filter 2022-10-30 20:37:02 +08:00
Omair Saleh 032efcb96b fix payment due date days filter 2022-10-30 20:35:54 +08:00
Omair Saleh a90730d616 fix payment due date days filter 2022-10-30 20:35:01 +08:00
Omair Saleh d5026df3a5 fix payment due date days filter 2022-10-30 20:33:33 +08:00
Omair Saleh 6dd3849bff fix payment due date days filter 2022-10-30 20:31:46 +08:00
Omair Saleh 9e4bad1eee fix payment due date days filter 2022-10-30 19:02:29 +08:00
Omair Saleh e356573715 fix payment due date days filter 2022-10-30 19:01:51 +08:00
Omair Saleh de6cb6a75f fix payment due date days filter 2022-10-30 18:59:47 +08:00
Omair Saleh 524da42526 fix payment due date days filter 2022-10-30 18:56:19 +08:00
Omair Saleh 1abc99fe10 fix payment due date days filter 2022-10-30 18:46:14 +08:00
Omair Saleh e91e770bf3 fix payment due date days filter 2022-10-30 18:41:55 +08:00
omair saleh 2e5d39fe96 Merge branch '417-payment-filter' into 'master'
Payment filter

See merge request CIEFWorldwideSdnBhd/shipping-portal!137
2022-10-30 10:28:25 +00:00
omair saleh 6efa78e40d Merge branch 'master' into '417-payment-filter'
# Conflicts:
#   app/Http/Resources/PackingListResource.php
2022-10-30 10:28:19 +00:00
Fairuz df862b7107 Payment filter 2022-10-30 17:44:14 +08:00
Omair Saleh 9df97f3db5 whitelist replica 3992WHE 2022-10-28 12:26:14 +08:00
Omair Saleh aa2ce980bc fix export invoice 2022-10-27 15:57:27 +08:00
Omair Saleh a6446b88fd shorten yd fetch duration 2022-10-20 11:37:55 +08:00
Omair Saleh be283dee78 shorten yd fetch duration 2022-10-20 11:28:09 +08:00
Omair Saleh 2d58db7bd9 allow to edit company name for personal account s 2022-10-20 11:12:10 +08:00
Omair Saleh 2b44254186 add further description to export payments 2022-10-19 15:50:18 +08:00
Omair Saleh e99cec81d7 add further description to export payments 2022-10-19 15:44:45 +08:00
Omair Saleh 5e810a1c16 add further description to export payments 2022-10-19 15:40:57 +08:00
Omair Saleh b5cba80db9 add further description to export payments 2022-10-19 15:09:33 +08:00
Omair Saleh 3479aed911 add further description to export payments 2022-10-19 15:07:45 +08:00
Omair Saleh f05e96725b add further description to export payments 2022-10-19 15:06:41 +08:00
Omair Saleh becb16c674 add further description to export payments 2022-10-19 14:53:51 +08:00
Omair Saleh 7e8163166b add further description to export payments 2022-10-19 14:52:26 +08:00
Omair Saleh ad21580c3e add excel extension 2022-10-19 12:04:19 +08:00
Omair Saleh 2f15268897 add excel extension 2022-10-19 11:34:56 +08:00
Omair Saleh ff4efdcd54 add excel extension 2022-10-19 11:31:52 +08:00
Omair Saleh fe400264c7 add excel extension 2022-10-19 11:23:30 +08:00
Omair Saleh cb0189e7d8 add excel extension 2022-10-19 10:49:57 +08:00
Omair Saleh f5070b2138 add excel extension 2022-10-19 10:46:33 +08:00
Omair Saleh 6a6497cac3 add excel extension 2022-10-19 10:39:30 +08:00
Omair Saleh dbf61d3a77 add excel extension 2022-10-19 10:37:43 +08:00
Omair Saleh 2f1164d606 add excel extension 2022-10-19 10:35:54 +08:00
Omair Saleh a472ec6684 add excel extension 2022-10-19 10:27:50 +08:00
Omair Saleh 10403943d0 add excel extension 2022-10-19 10:22:30 +08:00
Omair Saleh 5d49847f1f list customer with delayed shipment 2022-10-18 13:49:29 +08:00
Omair Saleh f96321c854 list customer with delayed shipment 2022-10-18 13:48:37 +08:00
Omair Saleh 2e6432f2e5 list customer with delayed shipment 2022-10-18 13:45:24 +08:00
Omair Saleh f8c37f4dbc list customer with delayed shipment 2022-10-18 13:44:17 +08:00
Omair Saleh 9deed272ad list customer with delayed shipment 2022-10-18 13:37:16 +08:00
Omair Saleh 38e7f89293 list customer with delayed shipment 2022-10-18 13:36:41 +08:00
Omair Saleh 724861270c list customer with delayed shipment 2022-10-18 13:34:29 +08:00
Omair Saleh 88cf72eb75 fix invoice complete bug 2022-10-18 10:44:15 +08:00
Omair Saleh 5fcd11e84c allow admin to do partial payment 2022-10-18 10:32:33 +08:00
Omair Saleh 13bd343198 allow admin to do partial payment 2022-10-18 10:29:59 +08:00
Omair Saleh d6c5b45b44 show manual transfer bank in details 2022-10-17 16:59:40 +08:00
Omair Saleh db0da02e27 show manual transfer bank in details 2022-10-17 16:57:08 +08:00
Omair Saleh 6db2675e76 hide sensitive pages from customer view 2022-10-17 16:31:25 +08:00
Omair Saleh 13271f311c fix debtor upload ui 2022-10-17 16:25:18 +08:00
Omair Saleh a2ac87b659 add published announcement filter 2022-10-17 15:21:21 +08:00
Omair Saleh 0b317ae1f7 hide payment button when outstanding is less than 0.01 2022-10-17 15:18:51 +08:00
Omair Saleh 5a0ef40e44 show debtor ui to anitha 2022-10-17 15:07:31 +08:00
Omair Saleh 97273a30cb show debtor ui to anitha 2022-10-17 15:05:32 +08:00
Omair Saleh c13145ad41 hide billing address button 2022-10-17 14:01:27 +08:00
Omair Saleh 045b0b9878 show edit billing address only to super admin 2022-10-17 13:55:24 +08:00
Omair Saleh 39a9e45fc4 export payment UI 2022-10-17 13:53:53 +08:00
Omair Saleh 910fa13867 export payment debug 2022-10-17 13:49:48 +08:00
Omair Saleh 6f86702df0 export payment debug 2022-10-17 13:49:06 +08:00
Omair Saleh b79bcdbbb3 export payment debug 2022-10-17 13:48:22 +08:00
Omair Saleh 086b262fca fix edit billing address ui 2022-10-17 13:44:32 +08:00
Omair Saleh 8396e8dab3 export payments 2022-10-17 13:43:26 +08:00
Omair Saleh 96948c96b5 edit billing address 2022-10-17 13:39:03 +08:00
Omair Saleh d8386601c3 1. Import Debtor
2. export payments
2022-10-17 13:29:52 +08:00
omair saleh bf2a6e7f23 Merge branch 'import-debtor' into 'master'
Import debtor

See merge request CIEFWorldwideSdnBhd/shipping-portal!136
2022-10-17 05:00:51 +00:00
omair saleh 235b04e395 Merge branch 'master' into 'import-debtor'
# Conflicts:
#   routes/web.php
2022-10-17 05:00:42 +00:00
Omair Saleh 5ea4044e3f debug callback url for billplz 2022-10-13 15:54:56 +08:00
Omair Saleh 66bbf9934c fix payment ui & reload issue 2022-10-13 01:44:48 +08:00
Omair Saleh 94a6f0758c fix payment ui & reload issue 2022-10-13 01:42:11 +08:00
Omair Saleh 04f43d8ea8 fix payment ui & reload issue 2022-10-13 01:40:47 +08:00
Omair Saleh 0808d86af9 fix payment ui & reload issue 2022-10-13 01:34:00 +08:00
Omair Saleh 714678fdc1 fix payment ui & reload issue 2022-10-13 01:31:41 +08:00
Omair Saleh c050444cdb export yd parcel postcode 2022-10-13 01:17:55 +08:00
Omair Saleh bc6c690b54 export yd parcel postcode 2022-10-13 01:12:22 +08:00
Omair Saleh 7cfa328ec0 export yd parcel postcode 2022-10-13 01:05:54 +08:00
Omair Saleh 45685bf2a4 export yd parcel postcode 2022-10-13 01:04:26 +08:00
Omair Saleh 534e02a20f export yd parcel postcode 2022-10-13 00:55:29 +08:00
Omair Saleh 26547328cb remove delivery address postcode to yd to release goods from china 2022-10-13 00:36:18 +08:00
Omair Saleh f92ca756aa submit delivery address postcode to yd to release goods from china 2022-10-11 23:25:30 +08:00
Omair Saleh 5514f3b8e0 submit delivery address postcode to yd to release goods from china 2022-10-11 23:13:48 +08:00
Omair Saleh 14d80fd457 fix invoice date 2022-10-10 17:51:04 +08:00
Omair Saleh c8d621057b fix invoice date 2022-10-10 17:49:14 +08:00
Omair Saleh 6ecfa8e031 fix invoice date 2022-10-10 17:43:32 +08:00
Omair Saleh 975e3d49e7 hide payment button for floating amount 2022-09-30 16:20:54 +08:00
Omair Saleh 2bd30492c5 hide payment button for floating amount 2022-09-30 16:13:15 +08:00
Omair Saleh c089b5f072 hide payment button for floating amount 2022-09-30 16:12:15 +08:00
Omair Saleh fbaa1238cb hide payment button for floating amount 2022-09-30 16:10:17 +08:00
Omair Saleh d1cf06d700 hide payment button for floating amount 2022-09-30 16:09:05 +08:00
Omair Saleh ff159730e0 hide payment button for floating amount 2022-09-30 16:07:06 +08:00
Omair Saleh e59934fa7b show order reference on payment verification component 2022-09-30 15:59:25 +08:00
Omair Saleh 650d232ab0 show order reference on payment verification component 2022-09-30 15:57:26 +08:00
Omair Saleh 71ae2437a4 show order reference on payment verification component 2022-09-30 15:54:06 +08:00
Omair Saleh 17edf59b57 show order reference on payment verification component 2022-09-30 15:52:21 +08:00
Omair Saleh 6268cdd21f show order reference on payment verification component 2022-09-30 15:50:30 +08:00
Omair Saleh 2ea62bcfb9 show order reference on payment verification component 2022-09-30 15:48:46 +08:00
Omair Saleh 1debc8e2d5 show order reference on payment verification component 2022-09-30 15:46:21 +08:00
Omair Saleh fb849aa4cc show order reference on payment verification component 2022-09-30 15:44:31 +08:00
Omair Saleh 913f6f84e2 show order reference on payment verification component 2022-09-30 15:40:24 +08:00
Omair Saleh f28d0382b8 show order reference on payment verification component 2022-09-30 15:35:57 +08:00
edmondlang 97a568322c edit billing address in payment and billing 2022-09-29 20:53:00 +08:00
edmondlang b01e2022dc import debtor 2022-09-29 19:11:59 +08:00
Omair Saleh f7a1ba05f8 customer announcement in customer profile 2022-09-28 17:34:27 +08:00
Omair Saleh a05a6381df fix delete packinglist 2022-09-28 13:12:57 +08:00
Omair Saleh d7c0f7302d delete duplicated buttons from unclaimed packing list component 2022-09-28 13:07:36 +08:00
Omair Saleh 78a8451699 fix unclaimed packing list pending invoice 2022-09-27 13:31:28 +08:00
Omair Saleh 5964123c5f fix bug when dispute has no comment 2022-09-27 13:28:30 +08:00
Omair Saleh 28e5fa43a5 update delivery keywords for yd 2022-09-27 10:54:31 +08:00
Omair Saleh 4d39d7f43f update delivery keywords for yd 2022-09-27 10:53:40 +08:00
Omair Saleh ee65ceac1d update delivery keywords for yd 2022-09-27 10:46:42 +08:00
Omair Saleh ee1dfea0c8 show packing list reference 2022-09-27 10:33:13 +08:00
omair saleh a90766ba13 fix cnt quantity in the invoice 2022-09-26 12:15:45 +08:00
omair saleh 6613ca9a86 fix qr image ratio in pdf 2022-09-25 22:36:34 +08:00
omair saleh 2839f7855c fix qr image ratio in pdf 2022-09-25 22:35:56 +08:00
omair saleh 9b70fdf37f fix qr image ratio in pdf 2022-09-25 22:35:09 +08:00
omair saleh 4667d8fbc3 fix qr image ratio in pdf 2022-09-25 22:34:32 +08:00
omair saleh 8b3e60a74a fix qr image ratio in pdf 2022-09-25 22:33:59 +08:00
omair saleh 1f6c6bf87d fix qr image ratio in pdf 2022-09-25 22:33:27 +08:00
omair saleh 8100ea0329 Merge remote-tracking branch 'origin/master' 2022-09-25 22:30:49 +08:00
omair saleh 20d706caf8 fix qr image ratio in pdf 2022-09-25 22:30:24 +08:00
edmondlang 3fe46f596a delete pending approval invoice 2022-09-22 23:27:32 +08:00
omair saleh c22e13f3cb show address at invoice component 2022-09-22 15:47:34 +08:00
omair saleh e39d364782 show address at invoice component 2022-09-22 15:35:47 +08:00
omair saleh 47fdac08aa debug invoice 2022-09-22 13:40:22 +08:00
omair saleh d824075e51 debug invoice 2022-09-22 13:40:10 +08:00
omair saleh af5de245ad debug invoice 2022-09-22 13:37:11 +08:00
omair saleh a58a5bd9a6 debug invoice 2022-09-22 13:35:41 +08:00
omair saleh 0493057805 debug invoice 2022-09-22 13:34:56 +08:00
omair saleh b6fc042d07 debug invoice 2022-09-22 13:33:19 +08:00
omair saleh 6bdcc007fc debug invoice 2022-09-22 13:32:44 +08:00
omair saleh 747402a5bc debug invoice 2022-09-22 13:32:06 +08:00
omair saleh c49d43f000 debug vt container update script 2022-09-22 13:25:40 +08:00
omair saleh 1e06e4db21 debug vt container update script 2022-09-22 13:24:12 +08:00
omair saleh 3b449fc812 change transactions receiver and issuer relationship from companies to company_modules 2022-09-22 13:18:57 +08:00
omair saleh a1ea94fa73 debug billing 2022-09-22 13:14:50 +08:00
omair saleh 79f6637b7b hide payment and billing page from customer 2022-09-22 11:56:20 +08:00
omair saleh dd684531c6 fetch vt recieve last 10 days 2022-09-21 13:02:01 +08:00
omair saleh 52e95b40ab fetch vt recieve last 10 days 2022-09-21 12:43:31 +08:00
omair saleh b6269ee369 fetch vt recieve last 10 days 2022-09-21 12:35:52 +08:00
omair saleh 144b5e7e13 fetch vt recieve last 10 days 2022-09-21 12:30:42 +08:00
omair saleh a84f44e9b0 fetch vt recieve last 10 days 2022-09-21 12:19:11 +08:00
omair saleh 32b90a3387 fetch vt recieve last 10 days 2022-09-21 11:54:24 +08:00
omair saleh 7faf5331e5 billing fix up 2022-09-21 10:10:39 +08:00
omair saleh 9783c76be3 billing fix up 2022-09-21 09:02:41 +08:00
omair saleh 3658991c43 billing fix up 2022-09-21 09:01:48 +08:00
omair saleh d2d82aabac Merge branch 'development' into 'master'
if company doesn't have billing address - hide generate invoice and show...

See merge request CIEFWorldwideSdnBhd/shipping-portal!135
2022-09-21 00:54:20 +00:00
omair saleh 6fe3023abc billing fix up 2022-09-20 16:50:50 +08:00
omair saleh e0356599bb billing fix up 2022-09-20 16:46:03 +08:00
omair saleh 37c3f95eda billing fix up 2022-09-20 16:43:21 +08:00
omair saleh 843b311c77 billing fix up 2022-09-20 16:41:30 +08:00
omair saleh 3fc7ccb51e billing fix up 2022-09-20 16:31:40 +08:00
omair saleh 9216c176f3 billing fix up 2022-09-20 16:27:38 +08:00
omair saleh 021c200d07 billing fix up 2022-09-20 16:24:56 +08:00
omair saleh a795a118a5 billing fix up 2022-09-20 16:23:05 +08:00
omair saleh 9833d07b04 billing fix up 2022-09-20 16:22:29 +08:00
omair saleh 7bf865ed3e billing fix up 2022-09-20 16:21:36 +08:00
omair saleh f7c8f68520 billing fix up 2022-09-20 16:19:05 +08:00
omair saleh 756e1b9419 billing fix up 2022-09-20 15:58:14 +08:00
omair saleh dd28171011 billing fix up 2022-09-20 09:13:46 +08:00
omair saleh 9f6fe2722c billing fix up 2022-09-20 09:09:11 +08:00
omair saleh 25928305ea billing fix up 2022-09-20 09:08:15 +08:00
omair saleh 499d1f9759 billing fix up 2022-09-20 09:06:10 +08:00
omair saleh 0e8c74bec2 billing fix up 2022-09-20 09:05:08 +08:00
omair saleh f774e90d50 billing fix up 2022-09-20 09:04:29 +08:00
omair saleh 6558ce20d9 billing fix up 2022-09-20 09:01:26 +08:00
omair saleh f16a843197 billing fix up 2022-09-20 08:49:48 +08:00
omair saleh 1ea081d831 billing fix up 2022-09-20 08:47:32 +08:00
omair saleh ce4e88fcdc billing fix up 2022-09-20 08:44:59 +08:00
omair saleh 6ca4f235df billing fix up 2022-09-20 08:06:39 +08:00
omair saleh 03843d8726 billing fix up 2022-09-20 08:04:43 +08:00
omair saleh 48b4381ba5 billing fix up 2022-09-20 07:56:29 +08:00
omair saleh 71d45fa100 billing fix up 2022-09-20 07:53:59 +08:00
omair saleh ebd42cfcbe billing fix up 2022-09-20 07:52:48 +08:00
omair saleh 9541f32641 billing fix up 2022-09-20 07:50:22 +08:00
omair saleh 5077e0e8d4 billing fix up 2022-09-20 07:48:49 +08:00
omair saleh c1c2c155be billing fix up 2022-09-20 07:36:20 +08:00
omair saleh c69dcf6ba3 billing fix up 2022-09-20 07:32:05 +08:00
omair saleh 10a95f0b4d billing fix up 2022-09-20 07:28:40 +08:00
omair saleh d8b41cbe55 billing fix up 2022-09-20 06:43:54 +08:00
omair saleh ad15b2f6b8 export parcel summary 2022-09-20 03:33:10 +08:00
omair saleh 5a69a31628 export parcel summary 2022-09-20 03:32:49 +08:00
omair saleh 65e0fe668d export parcel summary 2022-09-20 03:30:43 +08:00
omair saleh 0cd2272e6c export parcel summary 2022-09-20 03:29:55 +08:00
omair saleh 2f358c659b export parcel summary 2022-09-20 03:29:18 +08:00
omair saleh 3bec5b9c86 export parcel summary 2022-09-20 03:28:09 +08:00
omair saleh f499aaa0a7 export parcel summary 2022-09-20 03:27:29 +08:00
omair saleh dfcb6064f8 export parcel summary 2022-09-20 03:26:10 +08:00
omair saleh 968ff5c02a Merge branch 'connetction-segment-integration' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php
#	app/Http/Resources/OrderResource.php
#	app/Http/Resources/PackingListResource.php
#	resources/assets/vue/components/orders/sections/OrderProfileSectionComponent.vue
#	resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue
2022-09-20 02:47:47 +08:00
omair saleh 427bbb9de2 export parcel summary 2022-09-20 02:31:09 +08:00
omair saleh dc4fabbf36 export parcel summary 2022-09-20 02:30:26 +08:00
omair saleh e5e93e500e fix pending delivery export 2022-09-19 12:03:07 +08:00
omair saleh 924f686381 fix pending delivery export 2022-09-19 11:57:36 +08:00
omair saleh acb334f2c2 fix pending delivery export 2022-09-19 11:39:59 +08:00
omair saleh 35611da094 fix pending delivery export 2022-09-19 11:39:16 +08:00
omair saleh ba192563ba fix pending delivery export 2022-09-19 11:38:01 +08:00
omair saleh 42525a4d32 fix export on hold list 2022-09-15 12:57:14 +08:00
omair saleh 7af7b28408 move csw to yd 2022-09-14 13:40:58 +08:00
omair saleh b90fa86eae don't allow to release packing list with yd without person in charge info 2022-09-14 13:35:51 +08:00
omair saleh ba7f9807a7 remove csw from yd exempt list 2022-09-09 14:17:59 +08:00
edmondlang daf5c65bd7 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/web.php
2022-09-07 21:50:48 +08:00
omair saleh 4280a9188c add 2 days to eta date 2022-09-07 17:30:45 +08:00
omair saleh 08398c481e break line for postcode 2022-09-07 15:35:40 +08:00
omair saleh c8399cc336 break line for postcode 2022-09-07 15:31:13 +08:00
omair saleh 84bef88f16 break line for postcode 2022-09-07 15:25:22 +08:00
omair saleh 3e45f58b3b break line for postcode 2022-09-07 15:24:33 +08:00
omair saleh 856302f480 break line for postcode 2022-09-07 15:22:36 +08:00
edmondlang 1a67fa31dc fix connection segment in customer page 2022-09-03 18:59:12 +08:00
omair saleh d045e0401d billing segment 2022-09-03 15:03:17 +08:00
omair saleh d2e3e1979a remove announcement 2022-09-03 11:33:55 +08:00
omair saleh 4dba55eb32 add customers to the exception list for auto release 2022-09-02 14:39:17 +08:00
omair saleh 29fe4cf53c csw move to yd 2022-08-30 15:21:10 +08:00
omair saleh 3b39477369 holiday announcement 2022-08-26 11:15:42 +08:00
omair saleh a79d9249af update holiday announcement 2022-08-26 11:14:14 +08:00
omair saleh 6c1a9fe992 fix vt container api 2022-08-25 16:54:12 +08:00
omair saleh 01b539bea8 fix vt container api 2022-08-25 16:52:15 +08:00
omair saleh 73ba896e7c fix vt container api 2022-08-25 16:50:20 +08:00
omair saleh 8635e5f71f fix vt container api 2022-08-25 16:49:26 +08:00
omair saleh fb3405cdbc fix vt container api 2022-08-25 16:48:12 +08:00
omair saleh 4e4e0b5d9c fix vt container api 2022-08-25 16:45:48 +08:00
omair saleh 41c76c7c09 fix vt container api 2022-08-25 16:43:43 +08:00
omair saleh 5fada5310e fix vt container api 2022-08-25 16:41:24 +08:00
omair saleh 10fc3d7f68 fix vt container api 2022-08-25 14:39:39 +08:00
omair saleh a495d5ac0a fix vt container api 2022-08-25 14:33:58 +08:00
omair saleh 49a21865b6 fix vt container api 2022-08-25 14:33:21 +08:00
omair saleh 32c03caff1 fix vt container api 2022-08-25 14:28:53 +08:00
omair saleh 42e7ee43f2 fix vt container api 2022-08-25 14:28:13 +08:00
omair saleh 18fab0e8d4 fix vt container api 2022-08-25 14:27:21 +08:00
omair saleh f8bd9c0372 fix vt container api 2022-08-25 14:26:43 +08:00
omair saleh 9845b85cf0 fix vt container api 2022-08-25 14:24:58 +08:00
omair saleh 5163728298 fix vt container api 2022-08-25 14:17:41 +08:00
omair saleh 3e19696d02 fix vt container api 2022-08-25 14:16:32 +08:00
omair saleh 41dbd80d0d fix vt container api 2022-08-25 14:10:43 +08:00
omair saleh 4e64d8cd1d fix vt api 2022-08-24 18:49:50 +08:00
omair saleh 3108d20c16 fix vt update container 2022-08-24 18:42:53 +08:00
omair saleh ea35cd0c10 fix vt container update 2022-08-24 18:41:16 +08:00
omair saleh fffd6da513 fix vt container update 2022-08-24 18:40:17 +08:00
omair saleh 4b6d288485 fix vt container update 2022-08-24 18:37:33 +08:00
omair saleh 750ebbd769 fix vt container updates 2022-08-24 18:35:35 +08:00
omair saleh e638186367 fix vt container updates 2022-08-24 18:34:38 +08:00
omair saleh 77812e625a fix vt 2022-08-24 18:28:15 +08:00
omair saleh 5acd08d8e4 debug vt 2022-08-24 18:18:52 +08:00
omair saleh 6d7a05d264 add customer to exception for auto release from china 2022-08-24 17:11:47 +08:00
omair saleh fcb16cc115 enable yiwu 2022-08-22 15:32:12 +08:00
omair saleh 4f7097772f enable yiwu 2022-08-22 15:23:51 +08:00
omair saleh 9e8ee0f405 export all cbm report 2022-08-16 12:14:04 +08:00
omair saleh 8acbc56aeb yiwu notice 2022-08-11 19:47:04 +08:00
omair saleh 460b141102 yiwu notice 2022-08-11 19:43:55 +08:00
edmondlang d00620564b update Customer order page and admin payment billing page - include remarks 2022-08-09 02:44:05 +08:00
edmondlang 68028d5cf3 add function for admin to regenerate the dispute invoice 2022-08-08 22:19:55 +08:00
edmondlang a2c7eddf7b update payment and billing 2022-08-07 17:11:26 +08:00
edmondlang 9e756132ca update annoucment css 2022-08-06 23:53:43 +08:00
edmondlang 1706e2e1a3 remove console.log 2022-08-06 23:48:23 +08:00
edmondlang e84e39b8a1 debug annoucment segment 2022-08-06 23:46:37 +08:00
edmondlang 6ed383c06c update create annoucment service to suit the date time format from datetime picker 2022-08-06 23:34:07 +08:00
edmondlang b52445f106 migrate annoucment module from exchange 2022-08-06 23:33:09 +08:00
edmondlang e7f8b62116 update seeder for segment constant 2022-08-06 01:57:34 +08:00
edmondlang cd59debee4 update CUSTOM SEGMENTS price api 2022-08-06 01:46:06 +08:00
edmondlang f7a2861072 update admin payments billing page - do extra validation checking on each data with vue conditions 2022-08-06 00:42:20 +08:00
edmondlang 845fdfd5ca debug all constant in settings 2022-08-06 00:41:28 +08:00
edmondlang b984f931e1 update admin payments and billings page - add address and postcode 2022-08-05 23:40:59 +08:00
edmondlang 2b1fca6b2e if company doesn't have billing address - hide generate invoice and show create billing address modal 2022-08-05 21:24:36 +08:00
edmondlang 433d8e63b4 hide generate invoice for un-claimed packing list 2022-08-05 20:07:55 +08:00
edmondlang 30bf744854 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/assets/vue/components/settings/forms/EditSegmentPriceFormComponent.vue
2022-08-05 19:53:55 +08:00
omair saleh ea880a1a54 update eta arrival date 2022-08-05 15:35:31 +08:00
omair saleh b6a62fed2b update eta arrival date 2022-08-05 15:34:35 +08:00
omair saleh 3106750be6 update eta arrival date 2022-08-05 15:26:02 +08:00
omair saleh f1c2ff7364 update eta when arrival 2022-08-05 15:22:53 +08:00
omair saleh 0f307bda1f update eta on arrival 2022-08-05 15:15:48 +08:00
omair saleh 52e601de00 disable yiwu warehouse temp 2022-08-05 10:40:49 +08:00
omair saleh 83351f17b1 hide payment and billing page from menu 2022-08-01 03:09:49 +08:00
omair saleh be3d10e055 rename addon table 2022-08-01 03:06:52 +08:00
omair saleh d6616c0c5c rename addon table 2022-08-01 03:06:07 +08:00
omair saleh a667e23647 rename addon table 2022-08-01 03:05:20 +08:00
omair saleh c018fa9050 rename addon table 2022-08-01 02:56:15 +08:00
omair saleh 61eae220d1 rename addon table 2022-08-01 02:55:22 +08:00
omair saleh e4aa8fdd57 rename addon table 2022-08-01 02:51:59 +08:00
omair saleh 8b41056129 rename addon table 2022-08-01 02:50:11 +08:00
omair saleh df69ff6fec disable addon migration temp 2022-08-01 02:49:01 +08:00
omair saleh 894799a801 disable addon migration temp 2022-08-01 02:47:56 +08:00
omair saleh c62231fe3a hide notification temp 2022-08-01 02:15:03 +08:00
omair saleh 6335e90aab update yd new delivery api 2022-08-01 02:13:19 +08:00
omair saleh 02c83044a2 Merge remote-tracking branch 'origin/master' 2022-08-01 02:11:40 +08:00
omair saleh 86e6ef7af5 update yd new delivery api 2022-08-01 02:11:07 +08:00
edmondlang 0bad26e8ff update segment - delete props 2022-08-01 00:17:24 +08:00
edmondlang c24ddb4fa2 remove code error 2022-07-31 22:52:05 +08:00
edmondlang ff68ee76ab update base price according to packlinglist drop date 2022-07-31 22:08:48 +08:00
edmondlang 2a0501ad99 remove extra line of codes 2022-07-31 22:08:15 +08:00
edmondlang 43491223ab customer payment ui inside orders 2022-07-31 21:38:15 +08:00
edmondlang 436985db8f fix error section not showing 2022-07-31 20:17:10 +08:00
edmondlang 37887de61d add invoice in order resources 2022-07-31 20:15:38 +08:00
edmondlang 374cc7748a update billplz ui 2022-07-31 18:00:05 +08:00
edmondlang af15e462ba Merge branch 'payment-and-billing-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-31 16:06:52 +08:00
edmondlang db6412c5c0 when click on cancel will disminss the modal 2022-07-31 16:06:35 +08:00
edmondlang afc6595715 Merge branch 'payment-and-billing-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-31 15:59:30 +08:00
edmondlang e77e82bac2 move bill plz to shipping 2022-07-31 15:58:20 +08:00
edmondlang ce38d098fd Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-31 14:38:36 +08:00
glovetleong 4db4f6094d unit test bug 2022-07-30 09:56:30 +08:00
glovetleong 2a6a980fc3 unit test 2022-07-30 09:40:50 +08:00
omair saleh 1b230dbce0 Merge branch 'development' into 'master'
seperate log in page and sign up page for marketing

See merge request CIEFWorldwideSdnBhd/shipping-portal!131
2022-07-28 04:49:21 +00:00
edmondlang 4329f77e95 Merge branch 'payment-and-billing-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-27 20:20:41 +08:00
edmondlang 2f999d7e3c code tidy up 2022-07-27 20:20:16 +08:00
edmondlang 302aa521ed Merge branch 'payment-and-billing-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-27 20:10:46 +08:00
edmondlang 50ca61c587 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-27 20:10:30 +08:00
edmondlang a6cbec3523 payment-and-billing ui 2022-07-27 20:09:53 +08:00
omair saleh ee2208c992 debug claim packing list 2022-07-26 11:05:28 +08:00
omair saleh b73ef5a386 debug claim packing list 2022-07-26 11:00:36 +08:00
omair saleh cecc0a1b1b debug claim packing list 2022-07-26 10:55:20 +08:00
omair saleh b92a6fe710 debug claim packing list 2022-07-26 10:52:04 +08:00
omair saleh 24bd8be09d debug claim packing list 2022-07-26 10:51:07 +08:00
omair saleh d8801408ae debug claim packing list 2022-07-26 10:49:44 +08:00
edmondlang 274b64de7e Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into payment-and-billing-ui 2022-07-23 23:32:54 +08:00
edmondlang 06da9bb435 add missing code 2022-07-23 23:32:31 +08:00
edmondlang a276bc9582 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into payment-and-billing-ui
# Conflicts:
#	routes/web.php
2022-07-23 20:30:41 +08:00
edmondlang 72f555d7d2 payments and billing 2022-07-23 20:28:50 +08:00
edmondlang 9db80220b8 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/assets/vue/components/containers/elements/PackingListComponent.vue
#	resources/assets/vue/components/orders/elements/UnclaimedPackinglistComponent.vue
2022-07-23 19:56:06 +08:00
omair saleh 55882aaacb delete packinglist when deleting warehouselist 2022-07-22 19:17:18 +08:00
omair saleh ca669f6f0a fix exports pending delivery lists 2022-07-22 19:15:38 +08:00
omair saleh ec70a390d0 fix exports pending delivery lists 2022-07-22 19:04:07 +08:00
omair saleh 987418d51a fix exports pending delivery lists 2022-07-22 18:57:44 +08:00
omair saleh 6b641d44f2 fix exports pending delivery lists 2022-07-22 18:56:34 +08:00
omair saleh b57dbe77be delete unclaimed packing list button 2022-07-22 14:22:15 +08:00
omair saleh b9ddd42f82 delete unclaimed packing list button 2022-07-22 14:21:43 +08:00
omair saleh 039a048150 delete unclaimed packing list button 2022-07-22 14:18:54 +08:00
omair saleh f727389add delete unclaimed packing list button 2022-07-22 14:18:18 +08:00
omair saleh 2bb6816794 delete unclaimed packing list button 2022-07-22 14:15:26 +08:00
omair saleh 0616ee0bac show more data for unclaimed packages 2022-07-22 14:08:57 +08:00
omair saleh c038324339 fix vt wrong delivery date 2022-07-21 11:00:32 +08:00
omair saleh ac839c5835 break address words in packing list component 2022-07-21 10:48:38 +08:00
omair saleh d4b85f2952 fix vt packing list api 2022-07-21 10:43:40 +08:00
omair saleh 2be24c4dac fix vt packing list api 2022-07-19 19:24:05 +08:00
omair saleh 6caa68cfa4 fix vt packing list api 2022-07-19 19:21:55 +08:00
omair saleh 582534849a fix vt packing list api 2022-07-19 19:00:55 +08:00
omair saleh b4f816b90d fix vt packing list api 2022-07-19 19:00:00 +08:00
omair saleh 0c939dca6f fix vt packing list api 2022-07-19 18:59:11 +08:00
omair saleh f5b2664f5f fix vt packing list api 2022-07-19 18:56:44 +08:00
omair saleh 9613ed32c1 fix vt packing list api 2022-07-19 18:46:54 +08:00
omair saleh 202456289b fix vt packing list api 2022-07-19 18:46:10 +08:00
omair saleh c59bbd6677 fix vt packing list api 2022-07-19 18:41:27 +08:00
omair saleh ebfa25933d fix vt packing list api 2022-07-19 18:39:34 +08:00
omair saleh 3dedb75239 fix vt packing list api 2022-07-19 18:38:56 +08:00
omair saleh 9152bae815 fix vt packing list api 2022-07-19 18:38:35 +08:00
omair saleh a88512e973 fix vt packing list api 2022-07-19 18:36:23 +08:00
omair saleh 2f59295f67 fix vt packing list api 2022-07-19 18:34:01 +08:00
omair saleh bdb81daf1a fix vt packing list api 2022-07-19 16:45:44 +08:00
omair saleh 42935d025d fix vt packing list api 2022-07-19 16:36:22 +08:00
omair saleh 92b463b78e fix vt packing list api 2022-07-18 14:41:46 +08:00
omair saleh f62fc48636 fix vt packing list api 2022-07-18 14:39:40 +08:00
omair saleh a71ca9dd29 fix vt packing list api 2022-07-18 09:44:31 +08:00
omair saleh 651dea8f3a fix vt packing list api 2022-07-18 09:31:15 +08:00
omair saleh 79ada10312 fix vt containers api 2022-07-18 09:15:04 +08:00
omair saleh 66ef0c08f5 fix vt warehouse list api 2022-07-18 08:45:41 +08:00
omair saleh fafc716109 fix vt warehouse list api 2022-07-18 08:37:54 +08:00
omair saleh d93d51ff09 fix vt warehouse list api 2022-07-18 08:35:23 +08:00
omair saleh b260d30e42 fix vt warehouse list api 2022-07-18 08:02:56 +08:00
omair saleh af2d3adbcd fix vt warehouse list api 2022-07-18 08:01:44 +08:00
omair saleh 846f617e00 fix packinglist without package bug in packinglist component 2022-07-18 06:25:23 +08:00
omair saleh daa8618616 fix packinglist without package bug in packinglist component 2022-07-18 06:23:12 +08:00
omair saleh 22aaccbe21 yd fetch daily 2022-07-18 04:38:44 +08:00
omair saleh 1be99a0730 yd fetch daily 2022-07-18 04:30:54 +08:00
omair saleh ac461a48b7 yd fetch daily 2022-07-18 04:20:07 +08:00
omair saleh 1619bc212f yd fetch daily 2022-07-18 04:05:49 +08:00
omair saleh c487b31673 yd fetch daily 2022-07-18 04:03:45 +08:00
omair saleh 0775c2687f yd fetch daily 2022-07-18 04:03:13 +08:00
omair saleh 7767b4f177 yd fetch daily 2022-07-18 03:51:16 +08:00
omair saleh ee7acbc683 yd fetch daily 2022-07-18 03:49:13 +08:00
omair saleh b3b048ef2b yd fetch daily 2022-07-18 03:47:02 +08:00
omair saleh 12e2ce4de1 yd fetch daily 2022-07-18 03:44:49 +08:00
omair saleh d90347d2ee yd debug 2022-07-18 03:42:34 +08:00
omair saleh ad39cdd124 yd debug 2022-07-18 03:41:34 +08:00
omair saleh e0f0e0e59e yd debug 2022-07-18 03:38:53 +08:00
omair saleh e497eec331 yd debug 2022-07-18 03:37:38 +08:00
omair saleh 1429f97bca yd debug 2022-07-18 03:35:51 +08:00
omair saleh 952333e5cb yd debug 2022-07-18 03:34:46 +08:00
omair saleh e4af160ad2 yd debug 2022-07-18 03:33:59 +08:00
omair saleh 16031665a9 yd debug 2022-07-18 03:32:49 +08:00
omair saleh 39e1c09f05 yd debug 2022-07-18 03:11:00 +08:00
omair saleh 0d4db39013 yd debug 2022-07-18 03:09:50 +08:00
edmondlang 1e634ddc44 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-07-11 15:00:15 +08:00
omair saleh 06015cea72 remove customer profile junk code 2022-07-07 11:31:07 +08:00
omair saleh 3ccf7a088a debug smc report 2022-07-06 10:40:34 +08:00
omair saleh 258b8085ee debug smc report 2022-07-06 10:39:03 +08:00
omair saleh 76c05b7c77 debug smc report 2022-07-06 10:37:05 +08:00
omair saleh 6ebe22b798 debug smc report 2022-07-06 10:36:40 +08:00
omair saleh 17042b4312 debug smc report 2022-07-06 10:34:14 +08:00
omair saleh f935cc10a6 debug smc report 2022-07-06 10:03:01 +08:00
omair saleh 415b5d7697 debug smc report 2022-07-06 10:00:00 +08:00
omair saleh 591575081a add customer to yd exempt list 2022-06-30 09:20:28 +08:00
omair saleh 96fcfb241a update air shipment product list 2022-06-29 11:08:28 +08:00
omair saleh 5b9a286467 Merge remote-tracking branch 'origin/development' into development 2022-06-29 11:07:29 +08:00
omair saleh 5ed84c1ee9 update air shipment product list 2022-06-29 11:07:05 +08:00
omair saleh 40fec78213 update yd list to fetch 3 months 2022-06-24 11:47:35 +08:00
ahmedsophyudden b4dcc0f049 Create approve shipping invoice endpoint 2022-06-18 22:51:15 +08:00
ahmedsophyudden 6873ddb7cf New endpoint to add/edit/delete item in shipping invoiceNew endpoint to add/edit/delete item in shipping invoice 2022-06-17 14:45:34 +08:00
ahmedsophyudden 84e45f9824 New endpoint to add/edit/delete item in shipping invoice 2022-06-17 09:28:14 +08:00
ahmedsophyudden 8079584f04 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-06-17 09:25:50 +08:00
ahmedsophyudden 866dda9d98 New endpoint to add/edit/delete item in shipping invoice 2022-06-17 09:25:47 +08:00
edmondlang 8715997f88 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-06-16 23:25:06 +08:00
omair saleh 822c9c467f fix development js compile error 2022-06-16 14:52:38 +08:00
omair saleh 59d2b5c50a fix development js compile error 2022-06-16 14:51:50 +08:00
omair saleh 6676951dee temp disable vt 2022-06-15 11:17:31 +08:00
omair saleh 1ac7657870 Merge branch 'EXCHANGE-648-Shipping-Estimation-Calculator-API' into 'development'
implement ShippingEstimationCalculator

See merge request CIEFWorldwideSdnBhd/shipping-portal!132
2022-06-14 07:30:33 +00:00
omair saleh 761dedf427 Merge branch 'EXCHANGE-653-Revise-data-structure-of-the-segment_constant-table' into 'development'
implementing new data structure for segment_constant table

See merge request CIEFWorldwideSdnBhd/shipping-portal!133
2022-06-14 07:30:21 +00:00
edmondlang 0c2c64c637 Merge branch 'new-air-shipment-module' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-06-13 23:05:42 +08:00
edmondlang 10b699990f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-06-13 22:59:07 +08:00
edmondlang 606325706e air shipment module 2022-06-13 22:58:41 +08:00
omair saleh 742d26bdd3 update vt container packing list api 2022-06-13 11:39:41 +08:00
omair saleh 308a1bcdc0 update vt container packing list api 2022-06-13 11:36:21 +08:00
omair saleh f0f70e421e update vt container packing list api 2022-06-13 11:24:32 +08:00
omair saleh 3dff650b04 update vt container packing list api 2022-06-13 11:23:25 +08:00
omair saleh 5a55b4ccf2 update vt container packing list api 2022-06-13 11:22:50 +08:00
omair saleh 303b1abff1 update vt container packing list api 2022-06-13 11:21:07 +08:00
omair saleh 69a2743056 update vt container packing list api 2022-06-13 11:19:09 +08:00
omair saleh cf49a661e1 update vt container packing list api 2022-06-13 11:17:21 +08:00
omair saleh 4bcb67e972 update vt container packing list api 2022-06-13 11:16:28 +08:00
omair saleh e8564ee3b5 update vt container packing list api 2022-06-13 11:13:38 +08:00
omair saleh 23e5e1e268 update vt container packing list api 2022-06-13 11:13:25 +08:00
omair saleh cce1979388 update vt container packing list api 2022-06-13 11:12:21 +08:00
omair saleh f39f9ee2a7 update vt container packing list api 2022-06-13 11:09:59 +08:00
omair saleh c1cf22544f update vt container packing list api 2022-06-13 11:07:53 +08:00
omair saleh 321002ed04 remove old notice 2022-06-09 17:45:47 +08:00
omair saleh de237a4110 update new notice 2022-06-09 17:41:08 +08:00
omair saleh ee408da523 update smc monthly summary containers ref 2022-05-31 16:16:05 +08:00
omair saleh de797d65ee update smc monthly summary containers ref 2022-05-31 16:15:14 +08:00
omair saleh 9831ff29af update smc monthly summary containers ref 2022-05-31 16:14:22 +08:00
omair saleh 0102dabdba update smc monthly summary containers ref 2022-05-31 15:18:40 +08:00
omair saleh 86913ad80b update smc monthly summary containers ref 2022-05-31 15:15:20 +08:00
omair saleh fad2685534 update smc monthly summary containers ref 2022-05-31 15:14:22 +08:00
omair saleh 589422a9a8 update smc monthly summary containers ref 2022-05-31 15:09:05 +08:00
omair saleh e2b96d7281 update smc monthly summary containers ref 2022-05-31 15:03:47 +08:00
omair saleh df14f196b9 holiday announcement 2022-05-30 17:25:23 +08:00
omair saleh 7698c35b85 fix onhold packing list 2022-05-30 11:19:25 +08:00
omair saleh 88c0b4303e update vt new warehouselist 2022-05-26 10:14:12 +08:00
omair saleh c4eec73803 update vt new warehouselist 2022-05-26 10:11:55 +08:00
marjuqi@ad 6932b3291c implementing new data structure for segment_constant table 2022-05-25 10:28:51 +07:00
edmondlang cbaf05389e Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-05-24 00:12:34 +08:00
marjuqi@ad 00f4f141c4 remove unused newline 2022-05-20 09:07:24 +07:00
marjuqi@ad 7771b903ae refactor codes in ShippingEstimationCalculatorLogic.php 2022-05-20 09:06:20 +07:00
marjuqi@ad 6de35b13f1 rearrange the lines of code to improve readability 2022-05-20 08:14:14 +07:00
marjuqi@ad 46da64fc47 revert the changes for CreateShippingInvoiceTransactionLogic.php and Helper.php 2022-05-20 08:11:28 +07:00
marjuqi@ad 0821db2899 refactor functions: getConstantByKey, checkPostcodeExistInConstant 2022-05-19 06:23:19 +07:00
marjuqi@ad 74005ba312 remove unused lines 2022-05-19 06:07:28 +07:00
marjuqi@ad 7935be2912 update logic for state_rate 2022-05-19 05:40:13 +07:00
omair saleh 8e0d23a208 update yd fetch api to include delivery missing cases 2022-05-18 16:59:49 +08:00
omair saleh 2a077edcde update vt api url for new warehouse list 2022-05-18 16:41:15 +08:00
marjuqi@ad 142904b0af activate lines after executing SegmentConstantsTableSeeder 2022-05-18 11:15:25 +07:00
marjuqi@ad 97fe1d9192 revise logic for ShippingEstimationCalculator following Omair's feedback 2022-05-18 10:43:09 +07:00
omair saleh 27940854e2 add chi bin to vt 2022-05-17 17:26:09 +08:00
marjuqi@ad d4c35a5286 initial commit for ShippingEstimationCalculator 2022-05-17 15:31:17 +07:00
omair saleh 35dec3042b fix export arrival list 2022-05-17 11:47:30 +08:00
omair saleh 918db70429 fix export arrival list 2022-05-17 11:46:24 +08:00
omair saleh 1796ddefbf fix export arrival list 2022-05-17 11:45:13 +08:00
edmondlang e1ee96f77c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-05-13 23:03:35 +08:00
omair saleh 31e28c3dfa fix export arrival list 2022-05-13 12:51:20 +08:00
omair saleh faf4d35340 fix export arrival list 2022-05-13 12:50:36 +08:00
omair saleh 4fef6f8e6f fix export arrival list 2022-05-13 12:45:54 +08:00
omair saleh 5d504b5111 fix export arrival list 2022-05-13 12:44:19 +08:00
omair saleh 3854884370 fix export arrival list 2022-05-12 12:14:29 +08:00
omair saleh fe70c4b111 fix export arrival list 2022-05-11 18:00:13 +08:00
omair saleh dad2f95eaa fix export arrival list 2022-05-11 14:03:52 +08:00
omair saleh 764e709135 fix export arrival list 2022-05-11 14:01:02 +08:00
omair saleh 9b35f8c374 fix export arrival list 2022-05-11 13:51:13 +08:00
omair saleh 2e03ce370d fix export arrival list 2022-05-11 13:42:26 +08:00
omair saleh d972e98732 fix export arrival list 2022-05-10 19:50:19 +08:00
omair saleh 9041d9623b fix export arrival list 2022-05-10 19:46:16 +08:00
omair saleh f4a96fec78 fix export arrival list 2022-05-10 19:41:35 +08:00
omair saleh c299c60d38 fix export arrival list 2022-05-10 19:38:04 +08:00
omair saleh 96eeb5a63e fix export arrival list 2022-05-10 19:37:49 +08:00
omair saleh fc6c365792 fix export arrival list 2022-05-10 19:37:39 +08:00
omair saleh 6094adadec fix export arrival list 2022-05-10 19:35:16 +08:00
omair saleh 78ce2084b9 fix export arrival list 2022-05-10 19:31:04 +08:00
omair saleh 4fb284c85c fix export arrival list 2022-05-10 19:27:45 +08:00
omair saleh 9e060bccd3 fix export arrival list 2022-05-10 19:24:02 +08:00
omair saleh 3100d42bd7 fix export arrival list 2022-05-10 19:23:03 +08:00
omair saleh 0640e0de9b fix export arrival list 2022-05-10 19:13:36 +08:00
omair saleh aa1d1dccc5 fix export arrival list 2022-05-10 18:57:22 +08:00
omair saleh e369bc7f9e fix export arrival list 2022-05-10 15:42:33 +08:00
omair saleh 6713542dc9 fix export arrival list 2022-05-10 15:02:06 +08:00
omair saleh f73094ca06 fix export arrival list 2022-05-10 15:01:35 +08:00
omair saleh 453683ca76 fix export arrival list 2022-05-10 14:59:43 +08:00
edmondlang caef08aa98 update generate invoice api 2022-05-07 22:28:13 +08:00
edmondlang 2c2e4eece8 update generate invoice api 2022-05-07 20:08:22 +08:00
omair saleh a30421a3e9 fix addons table migration 2022-05-07 16:42:44 +08:00
omair saleh 056342308e fix addons table migration 2022-05-07 16:37:48 +08:00
omair saleh f7ca8558f5 fix addons table migration 2022-05-07 16:32:02 +08:00
edmondlang 92255056cc Merge branch 'container-payment-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-05-07 16:28:40 +08:00
edmondlang 5e1626e6a4 add soft delete in segemtns model 2022-05-07 16:28:11 +08:00
edmondlang c533c0c4a6 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-05-06 21:34:57 +08:00
omair saleh e8eb02430b update warehouse operation time 2022-05-06 13:49:14 +08:00
edmondlang f17bfea250 fix generate invoice api and database seeder for segment constant 2022-05-05 21:05:45 +08:00
edmondlang 24ceb3cb39 Merge branch 'new-signup' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-05-02 12:05:40 +08:00
edmondlang b6086554e2 sepereate delivery login component and shipping login component 2022-05-02 12:05:19 +08:00
edmondlang fee73f7708 Merge branch 'new-signup' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-30 21:08:29 +08:00
edmondlang cd7ee3afb3 new signup 2022-04-30 11:57:32 +08:00
edmondlang 3329028860 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-30 10:18:56 +08:00
omair saleh 6507b84e55 update warehouse operation time 2022-04-28 10:12:27 +08:00
omair saleh eab465e837 update gz default warehouse 2022-04-27 17:29:26 +08:00
omair saleh 1cc0303539 update raya announcement 2022-04-27 12:55:49 +08:00
omair saleh 305ae6c217 update raya announcement 2022-04-27 12:51:39 +08:00
omair saleh bcd926b4c9 update crisp session data 2022-04-25 15:14:11 +08:00
edmondlang cd84348542 Merge branch 'delete-packing-list' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-24 23:30:18 +08:00
edmondlang 8e0efdf6e7 delete packing list 2022-04-24 23:30:02 +08:00
edmondlang 37cdbbb2c4 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-24 23:04:26 +08:00
edmondlang 86893efe3d update base price date range 2022-04-23 14:59:52 +08:00
edmondlang 3dfec9fd6d update list base price section component 2022-04-22 22:23:35 +08:00
edmondlang 0634fbf78e update constant base price 2022-04-22 21:41:02 +08:00
edmondlang 6375ac753e clean up error in console for settiongs page 2022-04-22 00:23:59 +08:00
edmondlang 3899dd8416 update base price api 2022-04-22 00:18:12 +08:00
edmondlang 8ca1cc1625 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 22:08:07 +08:00
edmondlang d0ee2473ac update section name 2022-04-21 22:07:50 +08:00
edmondlang b67b676704 Merge branch 'update-delivery-date' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 21:42:53 +08:00
edmondlang 2f98dc976a add file RescheduleTransportDateFormComponent 2022-04-21 21:42:32 +08:00
edmondlang 2421dd0988 Merge branch 'update-delivery-date' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 21:02:38 +08:00
edmondlang 20237d69fb update 2022-04-21 21:02:25 +08:00
edmondlang 03851deeea Merge branch 'update-delivery-date' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 20:59:16 +08:00
edmondlang 22f1548eac update delivery date 2022-04-21 20:58:27 +08:00
omair saleh 4e4475ad12 switch back to temp warehouse 2022-04-21 14:12:23 +08:00
omair saleh a287a1193a allow admin to add arrived parcels 2022-04-21 12:19:57 +08:00
omair saleh a80b3013c3 go to previous yd warehouse 2022-04-21 10:31:24 +08:00
edmondlang 4224c3e436 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 09:31:12 +08:00
edmondlang 33124d6588 update declare postcode and implement api 2022-04-21 09:30:56 +08:00
edmondlang 77c2ede28e Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-21 01:14:33 +08:00
edmondlang 86e257106a add code to check if postcode constant does not exist, insert new postcode constant 2022-04-21 01:13:46 +08:00
edmondlang edb644eaeb remove insert segment if segment does not exist 2022-04-21 01:12:32 +08:00
edmondlang 8418268731 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-19 20:50:28 +08:00
edmondlang 98dc43d23a update segment constant logic 2022-04-19 20:50:09 +08:00
edmondlang 5fdc6d5719 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-19 15:10:12 +08:00
edmondlang cfd6757a84 tidy up 2022-04-19 15:09:56 +08:00
edmondlang 08517e8ee7 Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-19 14:58:17 +08:00
edmondlang eb31291e25 update warehouse api 2022-04-19 14:57:38 +08:00
edmondlang ddbecaae6f Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-19 13:31:04 +08:00
edmondlang 7b88fd5c3c update state charges 2022-04-19 13:28:56 +08:00
edmondlang 1814352780 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into api-intergration 2022-04-19 13:26:23 +08:00
edmondlang 8795f1c203 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-19 11:00:57 +08:00
omair saleh f5cf2ac2df fix login error handler & add new modern warehouse 2022-04-19 00:00:12 +08:00
omair saleh 2767d94a16 fix login error handler & add new modern warehouse 2022-04-18 23:56:27 +08:00
omair saleh f68ef5c5e2 fix login error handler & add new modern warehouse 2022-04-18 23:46:25 +08:00
omair saleh 639ccd3927 fix login error handler & add new modern warehouse 2022-04-18 23:40:08 +08:00
omair saleh 5651ed7010 fix LMD to HWT 2022-04-18 15:47:25 +08:00
omair saleh fd89233e49 fix LMD to HWT 2022-04-18 15:44:58 +08:00
omair saleh be70afd9bf fix LMD to HWT 2022-04-18 15:44:25 +08:00
omair saleh efac46264e fix LMD to HWT 2022-04-18 15:43:43 +08:00
omair saleh a0817dbb6e debug delivery registration 2022-04-18 15:42:10 +08:00
omair saleh dfa7013f04 debug delivery registration 2022-04-18 15:39:57 +08:00
omair saleh 28a57887b6 debug forget password 2022-04-18 04:59:49 +08:00
edmondlang 762e9b8dca update segment migration files 2022-04-17 23:54:44 +08:00
edmondlang d8c9c77d8d Merge branch 'api-intergration' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-17 23:42:26 +08:00
edmondlang f21708ff57 Merge branch 'notification-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/web.php
2022-04-17 23:38:10 +08:00
edmondlang ac4fcb05e9 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/views/vendor/js.blade.php
2022-04-17 23:36:42 +08:00
edmondlang b3a296f2eb update notification ui, display no result found if no notification 2022-04-17 21:10:52 +08:00
edmondlang 5a723c5fd1 update notification ui - solve ui bug when only have 1 notification 2022-04-16 23:54:51 +08:00
edmondlang 6e9a27024b update notification ui 2022-04-16 16:19:25 +08:00
omair saleh 8a96941127 debug forget password 2022-04-15 14:55:21 +08:00
omair saleh 3a5423a308 on hold packing list export 2022-04-15 14:21:08 +08:00
omair saleh ddd1b7b29e on hold packing list export 2022-04-15 14:20:20 +08:00
omair saleh 5433c202a7 on hold packing list export 2022-04-15 14:19:32 +08:00
omair saleh b967e4f9ab on hold packing list export 2022-04-15 14:18:38 +08:00
omair saleh e9b7de47fa on hold packing list export 2022-04-15 14:17:43 +08:00
omair saleh 3c942af883 on hold packing list export 2022-04-15 14:17:20 +08:00
omair saleh baa9f79272 on hold packing list export 2022-04-15 14:00:13 +08:00
omair saleh 10c66dc2dc export delivery list excel 2022-04-15 11:58:37 +08:00
omair saleh 05d4b7fe36 fix fetch from vt 2022-04-15 11:43:17 +08:00
omair saleh 7fc4568fbf fix fetch from vt 2022-04-14 13:14:47 +08:00
omair saleh f55a57c222 fix fetch from vt 2022-04-14 13:12:56 +08:00
omair saleh 301d7b5520 update hywavetech lineclear excel format 2022-04-14 10:15:07 +08:00
omair saleh 9f965109c7 update hywavetech lineclear excel format 2022-04-14 10:01:10 +08:00
omair saleh 108a952ee3 update hywavetech lineclear excel format 2022-04-13 21:56:21 +08:00
omair saleh 1426d804e5 fix yd fetch 2022-04-13 15:10:10 +08:00
omair saleh 88b3dc8b84 fix yd fetch 2022-04-13 14:27:08 +08:00
omair saleh 4b3274f6d5 fix yd fetch 2022-04-13 14:24:50 +08:00
omair saleh da1b6b1b6d fix yd fetch 2022-04-13 13:22:23 +08:00
omair saleh ac0a90c168 fix yd fetch 2022-04-13 13:17:04 +08:00
omair saleh a5e47324b2 fix yd fetch 2022-04-13 13:11:30 +08:00
omair saleh 40d22de809 fix customer profile 2022-04-13 12:19:34 +08:00
omair saleh 7154b5a943 fix customer profile 2022-04-13 12:15:32 +08:00
omair saleh 863c2874dd fix yd fetch 2022-04-13 11:50:23 +08:00
omair saleh 862398b0d5 update qr pdf 2022-04-13 11:30:53 +08:00
omair saleh 9e20b717a6 update qr pdf 2022-04-13 11:29:15 +08:00
omair saleh 129f3ecf10 update crisp to production 2022-04-13 00:25:49 +08:00
omair saleh f71f1fecd4 update crisp to production 2022-04-13 00:18:57 +08:00
omair saleh 6f5f854827 update crisp to production 2022-04-13 00:18:44 +08:00
omair saleh f4275f20a3 update crisp to production 2022-04-13 00:17:19 +08:00
omair saleh 35d9a1f8d8 update crisp to production 2022-04-13 00:15:51 +08:00
omair saleh de1afc26dc update crisp to production 2022-04-12 16:22:57 +08:00
omair saleh 904fb3d9e5 update crisp to production 2022-04-12 16:18:33 +08:00
omair saleh 304337d5e2 update crisp to production 2022-04-12 16:02:00 +08:00
omair saleh aa312c8f6e Merge remote-tracking branch 'origin/master' 2022-04-12 15:20:41 +08:00
omair saleh 05d079f261 update crisp to production 2022-04-12 15:20:13 +08:00
omair saleh a1cb511125 Merge branch 'export-arrived-parcel' into 'master'
export-arrived-parcel

See merge request CIEFWorldwideSdnBhd/shipping-portal!130
2022-04-12 07:10:44 +00:00
omair saleh 8d29a25793 create replica white list 2022-04-12 09:42:27 +08:00
edmondlang a7593e4ab2 export-arrived-parcel 2022-04-11 23:29:39 +08:00
omair saleh 8ecb306e92 update final touch up for last delivery integration 2022-04-09 20:43:00 +08:00
omair saleh 918fd0d17d update final touch up for last delivery integration 2022-04-09 20:41:48 +08:00
omair saleh 4f888da29a Merge branch 'last-mile-integration' into 'master'
update field change value of  'Pickup_Address_Type' from sender to Default'

See merge request CIEFWorldwideSdnBhd/shipping-portal!129
2022-04-09 12:20:56 +00:00
edmondlang 559de29acf update field change value of 'Pickup_Address_Type' from sender to Default'
export multiple sheet with the correct name of each field
2022-04-09 15:10:54 +08:00
edmondlang 5ba46a96a3 api intergration 2022-04-08 21:08:54 +08:00
edmondlang 1c79d88d8d remove service set up and add in base price 2022-04-08 19:05:18 +08:00
edmondlang 029f25a003 update state charges 2022-04-08 18:42:30 +08:00
edmondlang 557881104c implement api for warehouse charges 2022-04-08 18:23:54 +08:00
edmondlang d30dab61ea intergrate api for decalreing postcode area 2022-04-07 23:45:36 +08:00
edmondlang e0018de70d Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-07 22:57:28 +08:00
edmondlang 87116d29c9 last mile delivery search order ui and search order number function 2022-04-07 22:54:02 +08:00
omair saleh d9eeaf4bef update final touch up for last delivery integration 2022-04-07 22:47:30 +08:00
omair saleh 5dabc88fa9 update final touch up for last delivery integration 2022-04-07 22:40:01 +08:00
omair saleh 8c29fcda1f update final touch up for last delivery integration 2022-04-07 22:28:51 +08:00
omair saleh edd6b0d6ff update final touch up for last delivery integration 2022-04-07 22:22:22 +08:00
omair saleh 6940290570 update final touch up for last delivery integration 2022-04-07 22:21:21 +08:00
omair saleh 327bd75cc9 update final touch up for last delivery integration 2022-04-07 22:20:47 +08:00
omair saleh 9f760d8694 Merge branch 'last-mile-integration' into 'master'
updates last mile intergration - add functions

See merge request CIEFWorldwideSdnBhd/shipping-portal!128
2022-04-07 14:13:57 +00:00
omair saleh f5a0e9cd07 Merge branch 'last-mile-integration' into 'development'
update final touch up for last delivery integration

See merge request CIEFWorldwideSdnBhd/shipping-portal!127
2022-04-07 13:28:33 +00:00
omair saleh 4a1905abde update final touch up for last delivery integration 2022-04-07 21:27:53 +08:00
omair saleh 908c547ddc Merge branch 'last-mile-integration' into 'development'
update final touch up for last delivery integration

See merge request CIEFWorldwideSdnBhd/shipping-portal!126
2022-04-07 13:21:17 +00:00
omair saleh 5d1ff709eb update final touch up for last delivery integration 2022-04-07 21:20:13 +08:00
omair saleh cdda3ff5e1 Merge branch 'last-mile-integration' into 'development'
update final touch up for last delivery integration

See merge request CIEFWorldwideSdnBhd/shipping-portal!125
2022-04-07 13:17:48 +00:00
omair saleh a50b475525 update final touch up for last delivery integration 2022-04-07 21:16:59 +08:00
omair saleh 27bacd412a Merge branch 'last-mile-integration' into 'development'
Last mile integration

See merge request CIEFWorldwideSdnBhd/shipping-portal!124
2022-04-07 13:13:58 +00:00
omair saleh 97ec65e292 Merge remote-tracking branch 'origin/last-mile-integration' into last-mile-integration 2022-04-07 21:13:21 +08:00
omair saleh 5df226c153 update final touch up for last delivery integration 2022-04-07 21:12:15 +08:00
edmondlang 424ac600c3 Merge branch 'export-customer-order-list' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-07 12:31:05 +08:00
edmondlang 715635954a update file name 2022-04-07 12:30:39 +08:00
edmondlang a5a450a7d4 Merge branch 'export-customer-order-list' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-07 11:50:03 +08:00
edmondlang 3e87f320bf Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into last-mile-integration 2022-04-07 11:45:56 +08:00
edmondlang 2919544769 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into export-customer-order-list 2022-04-07 11:37:10 +08:00
edmondlang e3284fdf98 export customer order list 2022-04-07 11:36:03 +08:00
omair saleh 114a083627 Merge branch 'last-mile-integration' into 'development'
update last mile delivery logo

See merge request CIEFWorldwideSdnBhd/shipping-portal!123
2022-04-07 03:13:22 +00:00
omair saleh 408a3a1211 update last mile delivery logo 2022-04-07 11:12:27 +08:00
omair saleh bed78c053a remove memo 2022-04-07 10:59:50 +08:00
omair saleh 32a509d090 Merge branch 'last-mile-integration' into 'development'
updates last mile intergration - add functions

See merge request CIEFWorldwideSdnBhd/shipping-portal!122
2022-04-07 01:54:39 +00:00
omair saleh c53ebf76b3 hide admin menu flashing 2022-04-07 09:53:59 +08:00
omair saleh bd2b7b236b Merge branch 'last-mile-integration' into 'development'
hide admin menu flashing

See merge request CIEFWorldwideSdnBhd/shipping-portal!121
2022-04-07 01:48:33 +00:00
omair saleh 4085ac4829 hide admin menu flashing 2022-04-07 09:46:22 +08:00
omair saleh 6a08d88031 Merge branch 'last-mile-integration' into 'development'
hide admin menu flashing

See merge request CIEFWorldwideSdnBhd/shipping-portal!120
2022-04-07 01:45:16 +00:00
omair saleh 778729b81d hide admin menu flashing 2022-04-07 09:44:02 +08:00
omair saleh ef95893c3b Merge branch 'last-mile-integration' into 'development'
update last mile delivery module

See merge request CIEFWorldwideSdnBhd/shipping-portal!119
2022-04-06 10:53:05 +00:00
omair saleh 54c212e905 update last mile delivery module 2022-04-06 18:51:08 +08:00
edmondlang 5043b32191 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-06 18:31:15 +08:00
omair saleh 7169ba423c Merge branch 'last-mile-integration' into 'development'
updates last mile intergration - add functions

See merge request CIEFWorldwideSdnBhd/shipping-portal!118
2022-04-06 10:25:09 +00:00
omair saleh 5b370a299c update pending delivery report excel 2022-04-06 16:01:31 +08:00
omair saleh e57dc231e6 update pending delivery report excel 2022-04-06 16:01:03 +08:00
omair saleh 5727801918 update pending delivery report excel 2022-04-06 15:59:28 +08:00
omair saleh bf325ff028 update pending delivery report excel 2022-04-06 15:55:31 +08:00
omair saleh 229e757663 Merge branch 'export-delivery-list' into 'master'
Export delivery list

See merge request CIEFWorldwideSdnBhd/shipping-portal!117
2022-04-06 07:32:01 +00:00
edmondlang f8e7573cfd Merge branch 'export-delivery-list' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-06 14:37:23 +08:00
edmondlang bb59a444cf update export excel form 2022-04-06 11:24:24 +08:00
edmondlang 45c878a2ed add orders created date to the table 2022-04-06 10:21:40 +08:00
edmondlang e871f4b287 hide tick and show only for admin 2022-04-05 20:03:27 +08:00
edmondlang 5aa93b30c7 update container select packing list 2022-04-05 19:05:57 +08:00
edmondlang 8c35601ccd Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-04-05 19:04:24 +08:00
omair saleh 0ec9226226 add crisp 2022-04-05 13:26:24 +08:00
omair saleh 3286939ccc Merge remote-tracking branch 'origin/development' into development 2022-04-05 13:21:07 +08:00
omair saleh 3a2146146c add crisp 2022-04-05 13:20:52 +08:00
edmondlang 6eaa810b67 remove text order list 2022-04-05 11:40:58 +08:00
edmondlang 4e53e1b48a updates last mile intergration - add functions
- admin cancel order
- add filter to display only active orders
- hide customer page
- show parcel weight as total weight (quantity * weight per quantity)
    - in create order form
    - order table
    - export excel
- update export excel, only include the data of the selected Ids
2022-04-05 10:45:30 +08:00
omair saleh aef9b82918 Merge remote-tracking branch 'origin/last-mile-integration' into last-mile-integration
# Conflicts:
#	resources/views/pages/delivery/admin.blade.php
2022-04-04 19:41:43 +08:00
omair saleh f96fef94fe finalize last mile delivery 2022-04-04 19:40:54 +08:00
edmondlang ab141ae160 update admin view for last mile intergration 2022-04-04 14:21:59 +08:00
edmondlang bf4830ba7a update mobile responsive for delivery order form component 2022-04-03 23:47:58 +08:00
edmondlang 5baf04c835 fix mobile responsive 2022-04-03 23:39:27 +08:00
edmondlang 4917c54868 remove vuetable 2022-04-03 23:26:45 +08:00
edmondlang 9c7d07f603 remove imports that are not using 2022-04-03 20:20:09 +08:00
edmondlang 6f9320f3a4 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into last-mile-integration 2022-04-03 19:13:24 +08:00
omair saleh c69c043576 fix the user ui, create delivery order, delivery customer dashboard 2022-04-03 19:10:06 +08:00
edmondlang 745655dbfa last mile intergration 2022-04-02 15:21:14 +08:00
edmondlang d96a35a49f revert RegistrationFormComponent 2022-03-30 20:01:45 +08:00
edmondlang 8024fef2e8 Merge branch 'new-registration-ui' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into last-mile-integration 2022-03-30 19:54:35 +08:00
omair saleh 0e7469f1cd new registration ui flow 2022-03-29 23:15:42 +08:00
edmondlang e2e8f69f90 update notification add List Notifications API and UI 2022-03-15 16:14:21 +08:00
edmondlang e5c28faba7 Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into notification-ui 2022-03-14 12:38:13 +08:00
edmondlang 4b81666cf2 Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into notification-ui 2022-03-13 22:16:16 +08:00
edmondlang 4a2fb8e9e4 update notification icon 2022-03-12 17:10:38 +08:00
edmondlang ea772c3916 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into notification-ui 2022-03-12 17:02:36 +08:00
edmondlang f8d65d05da notification-ui 2022-01-15 13:39:17 +08:00
421 changed files with 19958 additions and 2198 deletions
+4 -2
View File
@@ -10,9 +10,9 @@ LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_DATABASE=shpping_portal
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=root
BROADCAST_DRIVER=log
CACHE_DRIVER=file
@@ -55,3 +55,5 @@ EXCHANGE_URL=https://dev.exchange.cief-malaysia.com/
MIX_EXCHANGE_URL="${EXCHANGE_URL}"
YD_API_CODE=''
JWT_SECRET=Btj63iMEleEaww6Bb2IBECkxWn7YHPhhPFluAkg9DfcQik0qDRy6QW75ABGmPT2h
+59
View File
@@ -0,0 +1,59 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:rIar2fvNeRzQdvKOgLUg03detGDMx6ym2SYFRjawrAc=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=shpping_portal
DB_USERNAME=root
DB_PASSWORD=P@ssw0rd
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
UNITY_APP_URL="https://unity.izyim.com"
EXCHANGE_URL=https://dev.exchange.cief-malaysia.com/
MIX_EXCHANGE_URL="${EXCHANGE_URL}"
YD_API_CODE=''
JWT_SECRET=Btj63iMEleEaww6Bb2IBECkxWn7YHPhhPFluAkg9DfcQik0qDRy6QW75ABGmPT2h
+2 -1
View File
@@ -2,6 +2,8 @@
/public/hot
/public/storage
/storage/*.key
/tests/_output
/tests/_support
/vendor
**/.idea/
.env
@@ -21,7 +23,6 @@ gox.iml
rebuild_docker.sh
docker/*
db/*
docker-compose.yml
package-lock.json
public/*
/public/*
+149
View File
@@ -0,0 +1,149 @@
image: php:7.4
stages:
- service_build
- node
- building_assets
- database
- unit_test
- acceptance_test
- code_quality
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: mysql_password
MYSQL_PASSWORD: mysql_password
MYSQL_DATABASE: shpping_portal
DB_HOST: mysql
before_script:
- apt-get update -yqq
- apt-get install -yqq
- apt-get install -y libonig-dev
- apt-get install -y libxml2-dev
- apt-get install -y libzip-dev
- apt-get install -y libgd-dev
- apt-get install -y libgd-dev
# Install PDO MySQL extension
- docker-php-ext-install pdo_mysql
#install php dependencies
- docker-php-ext-install mbstring xml zip gd
# Install composer package manager
- curl --location --output /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar
- chmod +x /usr/local/bin/composer
# Install MySQL client
- apt-get install -y default-mysql-client
#install node js
- apt-get update && apt-get install -y nodejs npm
#install gulp Js
- npm install -g gulp-cli
#jobs
#buld the backend
composer_php:
stage: service_build
script:
- composer install
- cp .env.example .env
- php artisan key:generate
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#build the UI
#node installation
npm:
stage: node
script:
- npm install # Install npm dependencies
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#building assets
building_assets:
stage: building_assets
# dependencies:
# - npm
script:
- npm install # Install npm dependencies
- gulp build # Build assets
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#mysql
database:
stage: database
services:
- name: mysql:8.0
command: [ "--default-authentication-plugin=mysql_native_password" ]
#dependencies:
# - composer_php
script:
- composer install
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:fresh
- php artisan db:seed
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#unit test
unit_test:
stage: unit_test
services:
- name: mysql:8.0
command: [ "--default-authentication-plugin=mysql_native_password" ]
#dependencies:
# - database
script:
- npm install # Install npm dependencies
- gulp build # Build assets
- composer install
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:fresh
- php artisan db:seed
- php artisan test
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#acceptance tests
acceptance_test:
stage: acceptance_test
services:
- name: mysql:8.0
command: [ "--default-authentication-plugin=mysql_native_password" ]
- selenium/standalone-chrome:latest
#dependencies:
# - database
script:
- npm install # Install npm dependencies
- gulp build # Build assets
- composer install
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:fresh
- php artisan db:seed
- php artisan serve &
- vendor/bin/codecept run
artifacts:
when: always
paths:
- tests/_output
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
+20 -43
View File
@@ -1,62 +1,39 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
## Shipping portal documentation
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
simple documentation on how to install, run, test, commit and deploy application
## About Laravel
## creating and running unit tests
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
Required Tools
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
- Chromium Driver / selenium
- add running and setting selenium on all OS if possible
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Required Packages :
## Learning Laravel
- laravel/legacy-factories
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
- codeception/codeception
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
Or Simply Run
## Laravel Sponsors
``Composer install``
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
To create a unit test
### Premium Partners
``php artisan make test: Test Example --unit``
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
Running the tests :
## Contributing
Running a single Test
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
`` php artisan test --filter Example``
## Code of Conduct
Running Unit tests -
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
`` php artisan test ``
## Security Vulnerabilities
Running Codeception tests -
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
``vendor/bin/codecept run``
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
@@ -95,4 +95,4 @@ abstract class AbstractControllerLogic
return $this->response(json_decode($collection->response()->getContent(), true));
}
}
}
@@ -39,6 +39,11 @@ abstract class AbstractListRecord extends AbstractGetRecord
$query = $query->orderBy($filters->get('order_by')->column, $filters->get('order_by')->DESC ? 'DESC': 'ASC');
}
if($filters->has('group_by')){
$query = $query->groupBy($filters->get('group_by')->column);
}
//dd($query->toSql());
return $filters->has('per_page') ? $query->paginate($filters->get('per_page')) : $query->get();
}
@@ -0,0 +1,37 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\TransactionType;
use Illuminate\Database\Eloquent\Builder;
class CreditTerm implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder;
return $builder->whereHas('packingLists.owner', function($query) use($value) {
$query->whereHas('companyModule.connections', function($query) use($value){
if ($value) {
$query->whereHas('segments', function($query) {
$query->where('segments.id' , 3);
});
}else{
$query->whereDoesntHave('segments', function($query) {
$query->where('segments.id' , 3);
});
}
});
});
}
}
@@ -0,0 +1,23 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
class DoesNotHaveTransactionType implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDoesntHave('transactions', function (Builder $query) use($value) {
$query->where('type', $value);
})->whereHas('containers', function ($query){
return $query->whereDate('loading_date', '>=', Carbon::parse('20-09-2022'));
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class HasInvoiceStatusIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('transactions', function (Builder $query) use($value) {
$query->where('type', 1)->whereIn('status', $value);
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class HasTransactionType implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('transactions', function (Builder $query) use($value) {
$query->where('type', $value);
});
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
class IsPublished implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDate('starting_on', '<=', Carbon::now())
->whereDate('ending_on', '>=', Carbon::now());
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Models\Order;
use Illuminate\Database\Eloquent\Builder;
class OrderMarkingIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('owner', function($query) use ($value) {
$query->where('reference', 'LIKE', '%' . $value . '%');
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class OwnerIdNotIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereNotIn('owner_id', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class OwnerType implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('owner_type', $value);
}
}
@@ -0,0 +1,29 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\PackingList;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\DB;
class PackingListOrderedByInvoiceDate implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->select('packing_lists.*')->join('transactions', function($join){
$join->on('transactions.owner_id', '=', 'packing_lists.id');
$join->where('transactions.owner_type', '=', PackingList::class);
$join->where('transactions.status', '=', ApprovalStatus::APPROVED);
})->orderBy('transactions.updated_at', 'DESC');
}
}
@@ -0,0 +1,24 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
class PaymentDay implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('transactions', function (Builder $query) use($value) {
$query->where('transactions.type', 1)->where('status', ApprovalStatus::APPROVED)->whereDate('updated_at', '<=', Carbon::now()->subdays($value));
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class PaymentReference implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('payment_reference', '=', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class Receiver implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('receiver', '=', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class SegmentIdIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereIn('segment_id', $value);
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
class TargetId implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('target_type', User::class)->where('target_id', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class TypeIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereIn('type', $value);
}
}
+87
View File
@@ -0,0 +1,87 @@
<?php
namespace App\Classes\General;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Cache;
class ExcelHandel
{
function __construct()
{
}
public static function generateFolder($path = '')
{
$folder = \Storage::disk('public')->makeDirectory($path);
return $folder;
}
public static function insertExcel($path = '', $base64Set = [])
{
$file_info = [];
$folder_path = ExcelHandel::generateFolder('excels/' . $path);
foreach ($base64Set as $key => $row) {
$exceldata = $row;
$filename = (string) Str::uuid();
$f = finfo_open();
$mime_type = finfo_file($f, $exceldata, FILEINFO_MIME_TYPE);
$extension = 'xls';
switch ($mime_type) {
case 'application/vnd.ms-excel':
$extension = 'xls';
break;
case 'application/zip':
$extension = 'xlsx';
break;
}
if (empty($extension)) {
return false;
}
$exceldata = explode('base64,', $exceldata);
$exceldata = base64_decode($exceldata[1]);
$filename_with_ext = $filename . '.' . $extension;
$file = ExcelHandel::generateExcel($path, $exceldata, $filename, $extension);
$file_info[] = [
'path' => $path,
'filename' => $filename_with_ext,
'mime_type' => $mime_type,
'extension' => $extension,
'file_info' => empty($file) ? [] : $file,
];
}
return $file_info;
}
public static function generateExcel($path = '', $exceldata = '', $filename = '', $extension = '')
{
$file_info = [];
$file = \Storage::disk('public')->put('excels/' . $path . '/' . $filename . '.' . $extension, $exceldata);
$file_info['original']['file'] = storage_path('app/public/excels/' . $path . '/' . $filename . '.' . $extension);
return $file_info;
}
public static function removeExcel($excel_info = [])
{
$excel_info = json_decode(json_encode($excel_info), true);
foreach ($excel_info as $key => $row) {
if (!empty($row['path'])) {
\File::delete([$row['file_info']['original']['file']]);
}
}
return true;
}
}
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Classes\General\Traits;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
trait LogData
{
public static function boot()
{
parent::boot();
static::updating(function($model)
{
$tableName = Str::singular($model->table).'_logs';
$relationshipColumn = Str::singular($model->table).'_id';
$originalData = $model->getRawOriginal();
$originalData[$relationshipColumn] = $originalData['id'];
unset($originalData['id']);
if (!Schema::hasTable($tableName)) {
DB::statement('CREATE TABLE '.$tableName.' LIKE '.$model->table);
$indexs = DB::select('SHOW INDEX FROM '.$tableName.';');
$removedIndexes = [];
foreach ($indexs as $index){
if($index->Column_name === 'id' || in_array($index->Key_name, $removedIndexes)) continue;
DB::statement('ALTER TABLE '.$tableName.' drop index '.$index->Key_name);
$removedIndexes[] = $index->Key_name;
}
DB::statement('ALTER TABLE '.$tableName.' ADD COLUMN `'.$relationshipColumn.'` BIGINT NOT NULL AFTER `id`');
}
DB::table($tableName)->insert($originalData);
});
}
}
@@ -0,0 +1,33 @@
<?php
namespace App\Classes\Jobs;
use App\Classes\Modules\PerfexCRM\Processors\CreatePerfexCRMLeadProcessor;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateLeadPerfexCRMObject;
class CreatePerfexCRMCustomer implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var CreateLeadPerfexCRMObject */
private $createLeadPerfexCRMObject;
/**
* CreatePerfexCRMCustomer constructor.
* @param CreateLeadPerfexCRMObject $createLeadPerfexCRMObject
*/
public function __construct(CreateLeadPerfexCRMObject $createLeadPerfexCRMObject)
{
$this->createLeadPerfexCRMObject = $createLeadPerfexCRMObject;
}
public function handle()
{
(App()->make(CreatePerfexCRMLeadProcessor::class))->execute($this->createLeadPerfexCRMObject);
}
}
@@ -0,0 +1,42 @@
<?php
namespace App\Classes\Jobs;
use App\Classes\Modules\PerfexCRM\Processors\CreatePerfexCRMTaskProcessor;
use App\Classes\Modules\PerfexCRM\Services\FetchesPerfexCRMLead;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateTaskPerfexCRMObject;
class CreatePerfexCRMSingleTask implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var FetchesPerfexCRMLead */
private $fetchesPerfexCRMLead;
/** @var CreateTaskPerfexCRMObject */
private $createTaskPerfexCRMObject;
/**
* CreatePerfexCRMSingleTask constructor.
* @param CreateTaskPerfexCRMObject $createTaskPerfexCRMObject
*/
public function __construct(CreateTaskPerfexCRMObject $createTaskPerfexCRMObject)
{
$this->createTaskPerfexCRMObject = $createTaskPerfexCRMObject;
}
public function handle()
{
$lead = (App()->make(FetchesPerfexCRMLead::class))->execute($this->createTaskPerfexCRMObject->getEmail());
if(!is_null($lead))
{
$this->createTaskPerfexCRMObject->setLeadId($lead->id);
(App()->make(CreatePerfexCRMTaskProcessor::class))->execute($this->createTaskPerfexCRMObject);
}
}
}
@@ -2,8 +2,12 @@
namespace App\Classes\Jobs;
use App\Classes\Modules\PackingLists\Processors\FetchContainersFromYdPortalProcessor;
use App\Classes\Modules\PackingLists\Processors\FetchContainersUpdatesFromYdPortalProcessor;
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
use App\Classes\Modules\PackingLists\Processors\FetchPackingListsFromYdPortalProcessor;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -25,8 +29,12 @@ class FetchOrdersFromYDPortalJob implements ShouldQueue
*/
public function handle()
{
(App()->make(FetchPackingListsFromYdPortalProcessor::class))->execute();
(App()->make(FetchContainersFromYdPortalProcessor::class))->execute();
(App()->make(FetchContainersUpdatesFromYdPortalProcessor::class))->execute();
(App()->make(FetchDeliveryUpdatesFromYdPortalProcessor::class))->execute();
(App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
// (App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Classes\Jobs;
use App\Classes\Modules\PerfexCRM\Processors\InitializePerfexCRMProcessor;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InitialPerfexCRMObject;
class InitializePerfexCRM implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var InitialPerfexCRMObject */
private $initialPerfexCRMObject;
/**
* InitializePerfexCRM constructor.
* @param InitialPerfexCRMObject $initialPerfexCRMObject
*/
public function __construct(InitialPerfexCRMObject $initialPerfexCRMObject)
{
$this->initialPerfexCRMObject = $initialPerfexCRMObject;
}
public function handle()
{
(App()->make(InitializePerfexCRMProcessor::class))->execute($this->initialPerfexCRMObject);
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Classes\Jobs;
use App\Classes\Modules\PerfexCRM\Processors\UpdatePerfexCRMProcessor;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMObject;
class UpdatePerfexCRM implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var UpdatePerfexCRMObject */
private $updatePerfexCRMObject;
/**
* UpdatePerfexCRM constructor.
* @param UpdatePerfexCRMObject $updatePerfexCRMObject
*/
public function __construct(UpdatePerfexCRMObject $updatePerfexCRMObject)
{
$this->updatePerfexCRMObject = $updatePerfexCRMObject;
}
public function handle()
{
(App()->make(UpdatePerfexCRMProcessor::class))->execute($this->updatePerfexCRMObject);
}
}
@@ -8,22 +8,27 @@ use App\Classes\General\Services\GeneratesInitials;
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
use App\Classes\Modules\Accounts\Processors\GenerateEmailVerificationAttemptProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyConnectionObject;
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
use App\Classes\Modules\Companies\Processors\CreateCompanyProcessor;
use App\Classes\Modules\Companies\Processors\CreateCompanyModuleProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\Companies\Services\ApprovesCompanyConnection;
use App\Classes\Modules\Companies\Services\CreatesCompanyConnection;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\PerfexCRM\Processors\CreatePerfexCRMLeadProcessor;
use App\Classes\Modules\Documents\Processors\UploadIdentityDocumentProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyConnectionObject;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateLeadPerfexCRMObject;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Classes\Jobs\CreatePerfexCRMCustomer;
use App\Models\Company;
use App\Models\CompanyModule;
use App\Models\User;
@@ -76,6 +81,12 @@ class CreateCustomerLogic extends AbstractControllerLogic
/** @var GenerateEmailVerificationAttemptProcessor */
private $generateEmailVerificationAttemptProcessor;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatePerfexCRMLeadProcessor */
private $createPerfexCRMLeadProcessor;
/**
* CreateCustomerLogic constructor.
* @param CreateUserProcessor $createUserProcessor
@@ -88,8 +99,10 @@ class CreateCustomerLogic extends AbstractControllerLogic
* @param UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor
* @param AuthenticationProcessor $authenticationProcessor
* @param GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor
* @param FetchesCompanyModule $fetchesCompanyModule
* @param CreatePerfexCRMLeadProcessor $createPerfexCRMLeadProcessor
*/
public function __construct(CreateUserProcessor $createUserProcessor, CreateCompanyProcessor $createCompanyProcessor, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, AssignEmployeeProcessor $assignEmployeeProcessor, UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor, AuthenticationProcessor $authenticationProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor)
public function __construct(CreateUserProcessor $createUserProcessor, CreateCompanyProcessor $createCompanyProcessor, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, AssignEmployeeProcessor $assignEmployeeProcessor, UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor, AuthenticationProcessor $authenticationProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor, FetchesCompanyModule $fetchesCompanyModule, CreatePerfexCRMLeadProcessor $createPerfexCRMLeadProcessor)
{
$this->createUserProcessor = $createUserProcessor;
$this->createCompanyProcessor = $createCompanyProcessor;
@@ -101,6 +114,8 @@ class CreateCustomerLogic extends AbstractControllerLogic
$this->uploadIdentityDocumentProcessor = $uploadIdentityDocumentProcessor;
$this->authenticationProcessor = $authenticationProcessor;
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->createPerfexCRMLeadProcessor = $createPerfexCRMLeadProcessor;
}
/**
@@ -126,7 +141,9 @@ class CreateCustomerLogic extends AbstractControllerLogic
/** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($company, BusinessType::IMPORTER);
$connectionObject = new CompanyConnectionObject($companyModule, 'CIEF', mt_rand(1000, 9999).(new GeneratesInitials())->name($company->name)->length(3)->generate());
$inviter = $this->fetchesCompanyModule->execute(['reference'=>'CIEF']);
$connectionObject = new CompanyConnectionObject($companyModule, $inviter, mt_rand(1000, 9999).(new GeneratesInitials())->name($company->name)->length(3)->generate(), 'CIEF');
$connection = $this->createsCompanyConnection->execute($connectionObject);
@@ -138,6 +155,17 @@ class CreateCustomerLogic extends AbstractControllerLogic
$this->uploadIdentityDocumentProcessor->execute($request, $company);
if(config('perfexcrm.is_enabled') == 'true'){
// $this->createPerfexCRMLeadProcessor->execute($request);
$createLeadPerfexCRMObject = new CreateLeadPerfexCRMObject(
$request->input('name'),
$request->input('email'),
$request->input('phone'),
$request->input('type') === CompanyType::COMPANY_BUSINESS ? $request->input('company_name') : $request->input('name')
);
CreatePerfexCRMCustomer::dispatch($createLeadPerfexCRMObject);
}
// $this->generateEmailVerificationAttemptProcessor->execute($user);
return $this->response($this->authenticationProcessor->execute($request));
@@ -0,0 +1,63 @@
<?php
namespace App\Classes\Modules\Accounts\ControllersLogic;
use App\Classes\Modules\Accounts\Services\FetchesUser;
use App\Classes\Modules\Accounts\Standards\Rules\CanFetchUser;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Http\Resources\UserCompanyResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class FetchUserByEmailLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Fetch Users',
'message' => 'You have successfully retrieved the user by email'
];
}
/** @var CanFetchUser */
private $canFetchUser;
/** @var FetchesUser */
private $fetchesUser;
/**
* FetchUserByEmailLogic constructor.
* @param CanFetchUser $canFetchUser
* @param FetchesUser $fetchessUser
*/
public function __construct(CanFetchUser $canFetchUser, FetchesUser $fetchesUser)
{
$this->canFetchUser = $canFetchUser;
$this->fetchesUser = $fetchesUser;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
try {
$this->canFetchUser->passes();
$query = $this->fetchesUser->execute(['email' => $request->route('email')]);
return $this->resourceResponse(new UserCompanyResource($query));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
}
}
@@ -12,6 +12,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\ValueObjects\Constants\Notifications;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class GeneratePasswordResetLogic extends AbstractControllerLogic
{
@@ -67,4 +67,4 @@ class AuthenticationProcessor
}
}
}
@@ -23,4 +23,4 @@ class AuthenticatesUser
}
}
}
@@ -2,6 +2,7 @@
namespace App\Classes\Modules\Accounts\Services;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Models\User;
@@ -11,6 +12,11 @@ class AuthenticationRedirect
public function url(User $user){
if($user->type === RoleTypes::USER){
if (in_array($user->companyModule()->first()->type, [BusinessType::ONLINE_SELLER, BusinessType::LAST_MILE_DELIVERY_AGENT])) {
return route('last_mile_delivery.dashboard');
}
return route('dashboard');
}
@@ -68,7 +68,11 @@ class GeneratesAuthenticationToken {
$companyModule = $user->companyModule()->first();
$claims = array_merge($claims, [
'company_id' => $companyModule->company_id
'company_id' => $companyModule->company_id,
'company_module_id' => $companyModule->id,
'company_module_type' => $companyModule->type,
'company_name' => $companyModule->name,
'company_marking' => $companyModule->type !== 8 ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : 'HWT',
]);
}
@@ -14,6 +14,7 @@ use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use ErrorException;
@@ -82,7 +83,7 @@ class CreateAddressLogic extends AbstractControllerLogic
$district = $this->fetchesDistrict->execute(['id' => $request->input('district_id')]);
$object = new AddressObject($request->input('street_one'), $request->input('street_two'), $district->country_id, $district->state_id, $district->id, $request->input('post_code'), $request->input('reference'));
$object = new AddressObject($request->input('street_one'), $request->input('street_two'), $district->country_id, $district->state_id, $district->id, $request->input('post_code'), $request->input('type'), ApprovalStatus::APPROVED, $request->input('reference'));
$this->canCreateAddress->passes($object);
@@ -0,0 +1,86 @@
<?php
namespace App\Classes\Modules\Addresses\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use App\Models\CompanyModule;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateBillingAddressLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created Billing Address',
'message' => 'You have successfully created a new Billing Address'
];
}
/** @var CanCreateAddress */
private $canCreateAddress;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatesAddress */
private $createsAddress;
/** @var FetchesAddress */
private $fetchesAddress;
/**
* CreateAddressLogic constructor.
* @param CanCreateAddress $canCreateAddress
* @param FetchesCompanyModule $fetchesCompanyModule
* @param CreatesAddress $createsAddress
* @param FetchesAddress $fetchesAddress
*/
public function __construct(CanCreateAddress $canCreateAddress, FetchesCompanyModule $fetchesCompanyModule, CreatesAddress $createsAddress, FetchesAddress $fetchesAddress)
{
$this->canCreateAddress = $canCreateAddress;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->createsAddress = $createsAddress;
$this->fetchesAddress = $fetchesAddress;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$companyModule = $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]);
$billingAddressInputed = $this->fetchesAddress->execute(['id' => $request->input('billing_address_id')]);
if ($billingAddressInputed->type !== AddressType::BILLING || $billingAddressInputed->id !== $companyModule->addresses->where('type', AddressType::BILLING)->first()->id) {
// delete all current billing address
Address::where('owner_type', CompanyModule::class)->where('owner_id', $request->input('company_module_id'))->where('type', AddressType::BILLING)->delete();
// create new billing addrress
$billingAddress = new AddressObject($billingAddressInputed->street_one, $billingAddressInputed->street_two, $billingAddressInputed->country_id, $billingAddressInputed->state_id, $billingAddressInputed->district_id, $billingAddressInputed->postcode, AddressType::BILLING, ApprovalStatus::APPROVED, $billingAddressInputed->reference);
$this->canCreateAddress->passes($billingAddress);
$this->createsAddress->execute($companyModule, $billingAddress);
}
return $this->resourceResponse(new AddressResource($billingAddressInputed));
}
}
@@ -13,6 +13,8 @@ use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use Illuminate\Http\JsonResponse;
@@ -79,7 +81,7 @@ class UpdateAddressLogic extends AbstractControllerLogic
{
$district = $this->fetchesDistrict->execute(['id' => $request->input('district_id')]);
$object = new AddressObject($request->input('street_one'), $request->input('street_two'), $district->country_id, $district->state_id, $district->id, $request->input('post_code'), $request->input('reference'));
$object = new AddressObject($request->input('street_one'), $request->input('street_two'), $district->country_id, $district->state_id, $district->id, $request->input('post_code'), AddressType::DELIVERY, ApprovalStatus::APPROVED, $request->input('reference'));
$this->canUpdateAddress->passes($object);
@@ -26,6 +26,12 @@ class AddressObject implements DataTransferObject
/** @var int */
private $postCode;
/** @var int */
private $type;
/** @var int */
private $status;
/** @var string|null */
private $reference;
@@ -37,9 +43,11 @@ class AddressObject implements DataTransferObject
* @param int $stateId
* @param int $districtId
* @param int $postCode
* @param int $type
* @param int $status
* @param null|string $reference
*/
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, ?string $reference = null, ?int $status = ApprovalStatus::APPROVED)
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, int $type, int $status, ?string $reference = null)
{
$this->streetOne = $streetOne;
$this->streetTwo = $streetTwo;
@@ -47,8 +55,9 @@ class AddressObject implements DataTransferObject
$this->stateId = $stateId;
$this->districtId = $districtId;
$this->postCode = $postCode;
$this->reference = $reference;
$this->type = $type;
$this->status = $status;
$this->reference = $reference;
}
/**
@@ -100,11 +109,11 @@ class AddressObject implements DataTransferObject
}
/**
* @return null|string
* @return int
*/
public function getReference(): ?string
public function getType(): int
{
return $this->reference;
return $this->type;
}
/**
@@ -115,5 +124,13 @@ class AddressObject implements DataTransferObject
return $this->status;
}
/**
* @return null|string
*/
public function getReference(): ?string
{
return $this->reference;
}
}
@@ -10,6 +10,8 @@ namespace App\Classes\Modules\Addresses\Services;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\District;
use App\Models\OldAddress;
@@ -31,7 +33,7 @@ class CleansOldAddress
return null;
}
return new AddressObject($this->cleanAddress($address->street_one, $district, $address->post_code), $this->cleanAddress($address->street_two, $district, $address->post_code), $district->country_id, $district->state_id, $district->id, $address->post_code, 'Delivery Address');
return new AddressObject($this->cleanAddress($address->street_one, $district, $address->post_code), $this->cleanAddress($address->street_two, $district, $address->post_code), $district->country_id, $district->state_id, $district->id, $address->post_code, AddressType::DELIVERY, ApprovalStatus::APPROVED, 'Delivery Address');
}
@@ -29,6 +29,7 @@ class CreatesAddress extends AbstractUpdateRelationshipRecord
$model->district_id = $object->getDistrictId();
$model->postcode = $object->getPostCode();
$model->status = $object->getStatus();
$model->type = $object->getType();
return $this->handler($addressable->addresses(), $model);
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\Announcements\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Announcements\DataTransferObjects\AnnouncementObject;
use App\Models\Announcement;
use DateTime;
class CreatesAnnouncement extends AbstractUpdateRecord
{
@@ -18,9 +19,17 @@ class CreatesAnnouncement extends AbstractUpdateRecord
$model = new Announcement();
$model->title = $object->getTitle();
$model->description = $object->getDescription();
$model->starting_on = $object->getStartingOn();
$model->ending_on = $object->getEndingOn();
// $model->starting_on = $object->getStartingOn();
$model->starting_on = $this->convertDateFormat($object->getStartingOn());
// $model->ending_on = $object->getEndingOn();
$model->ending_on = $this->convertDateFormat($object->getEndingOn());
return $this->handler($model);
}
public function convertDateFormat($value) {
$value = DateTime::createFromFormat('d-m-Y', $value)->format('Y-m-d H:i:s');
return $value;
}
}
@@ -2,6 +2,8 @@
namespace App\Classes\Modules\Billplzs\ControllersLogic;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\UpdatesWallet;
@@ -21,6 +23,7 @@ use App\Classes\Modules\Billplzs\DataTransferObjects\BillplzXSignatureObject;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
@@ -35,21 +38,27 @@ class CallbackBillplzLogic
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var UpdatesWalletBalance */
private $updatesWalletBalance;
/** @var UpdateDoFromVTPortalProcessor */
private $updateDoFromVTPortalProcessor;
/** @var UpdateDoFromYDPortalProcessor */
private $updateDoFromYDPortalProcessor ;
/**
* CallbackBillplzLogic constructor.
* @param GetBillplzBill $getBillplzBill
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param UpdatesWalletBalance $updatesWalletBalance
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
*/
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor)
{
$this->getBillplzBill = $getBillplzBill;
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
}
@@ -58,6 +67,8 @@ class CallbackBillplzLogic
* @return bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws MalformedRequestException
* @throws ResourceNotFoundException
* @throws \App\Classes\Exceptions\InternalServerErrorException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function execute(Request $request)
{
@@ -73,6 +84,12 @@ class CallbackBillplzLogic
$transaction = $this->fetchesTransaction->execute(['payment_reference' => $billplzXSignatureObject->getBillPlzId()]);
$invoice = $transaction->owner;
$packingList = $invoice->owner;
$order = $packingList->owner;
$status = ApprovalStatus::PENDING_VERIFICATION;
if($billPlz->state === 'paid') {
$status = ApprovalStatus::APPROVED;
}
@@ -84,8 +101,23 @@ class CallbackBillplzLogic
$token = Auth::fromUser(User::find(1));
$request->headers->set('Authorization', 'Bearer '.$token);
$marking = $transaction->owner()->first()->owner()->first();
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED);
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking->reference, 'transaction' => $transaction, 'status' => $status]);
if(($invoice->amount - $transaction->amount) < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
}
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $order->reference, 'transaction' => $transaction, 'status' => $status]);
}
}
}
@@ -23,7 +23,7 @@ class CreatesBillplzBill
try{
// config('billplz.maybank')
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [
'collection_id' => $wallet ? config('billplz.wallet_collection_id') : config('billplz.collection_id'),
'collection_id' => config('billplz.collection_id'),
'name' => $name,
'email' => $email,
'description' => $description,
@@ -14,6 +14,8 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\FetchesDocument;
use App\Classes\Modules\Documents\Services\ApprovesDocument;
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
use App\Models\Document;
use Illuminate\Http\JsonResponse;
@@ -50,6 +52,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
/** @var UpdatesOrdersStatus */
private $updatesOrdersStatus;
/** @var CreateNotificationProcessor */
private $createNotificationProcessor;
/**
* ApproveIdentificationDocumentLogic constructor.
* @param CanApproveDocument $canApproveDocument
@@ -58,8 +63,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
* @param FetchesDocument $fetchesDocument
* @param UpdatesCompanyStatus $updatesCompanyStatus
* @param UpdatesOrdersStatus $updatesOrdersStatus
* @param CreateNotificationProcessor $createNotificationProcessor
*/
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus)
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus, CreateNotificationProcessor $createNotificationProcessor)
{
$this->canApproveDocument = $canApproveDocument;
$this->approvesDocument = $approvesDocument;
@@ -67,6 +73,7 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
$this->fetchesDocument = $fetchesDocument;
$this->updatesCompanyStatus = $updatesCompanyStatus;
$this->updatesOrdersStatus = $updatesOrdersStatus;
$this->createNotificationProcessor = $createNotificationProcessor;
}
/**
@@ -90,6 +97,16 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
$this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
// $object = new NotificationObject(
// 'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
// ( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
// $document->owner,
// $document->owner->companyModules()->first()->employees()->first(),
// $document,
// );
//
// $this->createNotificationProcessor->execute($object);
if($status === 'approve'){
$orders = $this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
}
@@ -0,0 +1,88 @@
<?php
namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\UpdatesCompany;
use App\Classes\Modules\Companies\Services\UpdatesCompanyModuleName;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Standards\Rules\CanUpdateCompany;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
use App\Classes\Modules\Companies\Services\UpdatesCompanyDebtor;
use App\Http\Resources\CompanyResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateCompanyNameAndDebtorLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Company Name and Debtor',
'message' => 'You have successfully updated the Company'
];
}
/** @var CanUpdateCompany */
private $canUpdateCompany;
/** @var UpdatesCompany */
private $updatesCompany;
/** @var FetchesCompany */
private $fetchesCompany;
/** @var UpdatesCompanyDebtor */
private $updatesCompanyDebtor;
/** @var UpdatesCompanyModuleName */
private $updatesCompanyModuleName;
/**
* UpdateCompanyControllersLogic constructor.
* @param CanUpdateCompany $canUpdateCompany
* @param UpdatesCompany $updatesCompany
* @param FetchesCompany $fetchesCompany
* @param UpdatesCompanyDebtor $updatesCompanyDebtor
* @param UpdatesCompanyModuleName $updatesCompanyModuleName
*/
public function __construct(CanUpdateCompany $canUpdateCompany, UpdatesCompany $updatesCompany, FetchesCompany $fetchesCompany, UpdatesCompanyDebtor $updatesCompanyDebtor, UpdatesCompanyModuleName $updatesCompanyModuleName)
{
$this->canUpdateCompany = $canUpdateCompany;
$this->updatesCompany = $updatesCompany;
$this->fetchesCompany = $fetchesCompany;
$this->updatesCompanyDebtor = $updatesCompanyDebtor;
$this->updatesCompanyModuleName = $updatesCompanyModuleName;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$object = new CompanyObject($request->input('name'), $request->input('reference'), $request->input('type'));
$this->canUpdateCompany->passes($object);
$query = $this->fetchesCompany->execute(['id' => $request->route('id')]);
$this->updatesCompanyModuleName->execute($query->companyModules()->first(), $object->getName());
$query = $this->updatesCompany->execute($query, $object);
if ($request->input('debtor') || $query->first()->debtor !== null) {
$this->updatesCompanyDebtor->execute($query, $request->input('debtor'));
}
return $this->resourceResponse(new CompanyResource($query));
}
}
@@ -10,6 +10,9 @@ class CompanyConnectionObject implements DataTransferObject
/** @var CompanyModule */
private $invitee;
/** @var CompanyModule */
private $inviter;
/** @var string */
private $inviterReference;
@@ -20,12 +23,14 @@ class CompanyConnectionObject implements DataTransferObject
/**
* CompanyConnectionObject constructor.
* @param CompanyModule $invitee
* @param CompanyModule $inviter
* @param string $inviterReference
* @param string $inviteeReference
*/
public function __construct(CompanyModule $invitee, string $inviterReference, string $inviteeReference)
public function __construct(CompanyModule $invitee, CompanyModule $inviter, string $inviteeReference, string $inviterReference)
{
$this->invitee = $invitee;
$this->inviter = $inviter;
$this->inviterReference = $inviterReference;
$this->inviteeReference = $inviteeReference;
}
@@ -38,6 +43,14 @@ class CompanyConnectionObject implements DataTransferObject
return $this->invitee;
}
/**
* @return CompanyModule
*/
public function getInviter(): CompanyModule
{
return $this->inviter;
}
/**
* @return string
*/
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Companies\Services;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Models\Company;
use App\Models\Segment;
use Illuminate\Database\QueryException;
@@ -19,8 +20,9 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord
public function execute(Company $company, Segment $segment)
{
try {
$company->segments()->attach($segment);
$companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first();
$connection = $companyModule->connections()->where('inviter_reference', 'CIEF');
$connection->segments()->attach($segment);
return $company;
@@ -30,10 +30,8 @@ class CreatesCompanyConnection extends AbstractUpdateRecord
public function execute(CompanyConnectionObject $object)
{
$companyModule = $this->fetchesCompany->execute(['id', 1])->companyModules()->first();
$connection = new CompanyConnection();
$connection->inviter_id = $companyModule->id;
$connection->inviter_id = $object->getInviter()->id;
$connection->invitee_id = $object->getInvitee()->id;
$connection->inviter_reference = $object->getInviterReference();
$connection->invitee_reference = $object->getInviteeReference();
@@ -0,0 +1,24 @@
<?php
namespace App\Classes\Modules\Companies\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
use App\Models\Company;
class UpdatesCompanyDebtor extends AbstractUpdateRecord
{
/**
* @param Company $model
* @param CompanyObject $object
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Company $model, ?string $debtor)
{
$model->debtor = $debtor;
return $this->handler($model);
}
}
@@ -0,0 +1,58 @@
<?php
namespace App\Classes\Modules\Delivery\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Services\CancelsOrder;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Http\Resources\DeliveryOrderResource;
use App\Models\Order;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CancelDeliveryOrderLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Cancelled Order',
'message' => 'You have successfully cancelled an order'
];
}
/** @var CancelsOrder */
private $cancelsOrder;
/** @var FetchesOrder */
private $fetchesOrder;
/**
* CancelDeliveryOrderLogic constructor.
* @param CancelsOrder $cancelsOrder
* @param FetchesOrder $fetchesOrder
*/
public function __construct(CancelsOrder $cancelsOrder, FetchesOrder $fetchesOrder)
{
$this->cancelsOrder = $cancelsOrder;
$this->fetchesOrder = $fetchesOrder;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request): JsonResponse
{
/** @var Order $order */
$order = $this->fetchesOrder->execute(['id' => $request->route('id')]);
return $this->resourceResponse(new DeliveryOrderResource($this->cancelsOrder->execute($order)));
}
}
@@ -0,0 +1,150 @@
<?php
namespace App\Classes\Modules\Delivery\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\Services\GeneratesInitials;
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
use App\Classes\Modules\Accounts\Processors\GenerateEmailVerificationAttemptProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyConnectionObject;
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
use App\Classes\Modules\Companies\Processors\CreateCompanyProcessor;
use App\Classes\Modules\Companies\Processors\CreateCompanyModuleProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\Companies\Services\ApprovesCompanyConnection;
use App\Classes\Modules\Companies\Services\CreatesCompanyConnection;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Documents\Processors\UploadIdentityDocumentProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Models\Company;
use App\Models\CompanyModule;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use Illuminate\Support\Facades\Log;
class CreateDeliveryCustomerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Created User',
'message' => 'You have successfully created a new User'
];
}
/** @var CreateUserProcessor */
private $createUserProcessor;
/** @var CreateCompanyProcessor */
private $createCompanyProcessor;
/** @var CreateCompanyModuleProcessor */
private $createCompanyModuleProcessor;
/** @var CreateContactProcessor */
private $createContactProcessor;
/** @var CreatesCompanyConnection */
private $createsCompanyConnection;
/** @var ApprovesCompanyConnection */
private $approvesCompanyConnection;
/** @var AssignEmployeeProcessor */
private $assignEmployeeProcessor;
/** @var UploadIdentityDocumentProcessor */
private $uploadIdentityDocumentProcessor;
/** @var AuthenticationProcessor */
private $authenticationProcessor;
/** @var GenerateEmailVerificationAttemptProcessor */
private $generateEmailVerificationAttemptProcessor;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/**
* CreateDeliveryCustomerLogic constructor.
* @param CreateUserProcessor $createUserProcessor
* @param CreateCompanyProcessor $createCompanyProcessor
* @param CreateCompanyModuleProcessor $createCompanyModuleProcessor
* @param CreateContactProcessor $createContactProcessor
* @param CreatesCompanyConnection $createsCompanyConnection
* @param ApprovesCompanyConnection $approvesCompanyConnection
* @param AssignEmployeeProcessor $assignEmployeeProcessor
* @param UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor
* @param AuthenticationProcessor $authenticationProcessor
* @param GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor
* @param FetchesCompanyModule $fetchesCompanyModule
*/
public function __construct(CreateUserProcessor $createUserProcessor, CreateCompanyProcessor $createCompanyProcessor, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, AssignEmployeeProcessor $assignEmployeeProcessor, UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor, AuthenticationProcessor $authenticationProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor, FetchesCompanyModule $fetchesCompanyModule)
{
$this->createUserProcessor = $createUserProcessor;
$this->createCompanyProcessor = $createCompanyProcessor;
$this->createCompanyModuleProcessor = $createCompanyModuleProcessor;
$this->createContactProcessor = $createContactProcessor;
$this->createsCompanyConnection = $createsCompanyConnection;
$this->approvesCompanyConnection = $approvesCompanyConnection;
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
$this->uploadIdentityDocumentProcessor = $uploadIdentityDocumentProcessor;
$this->authenticationProcessor = $authenticationProcessor;
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
$this->fetchesCompanyModule = $fetchesCompanyModule;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request): JsonResponse
{
/** @var User $user */
$user = $this->createUserProcessor->execute($request, RoleTypes::USER, !App::environment(['production']) ? ApprovalStatus::APPROVED : ApprovalStatus::PENDING_VERIFICATION);
/** @var Company $company */
$company = $this->createCompanyProcessor->execute($request->input('name'), CompanyType::PERSONAL_BUSINESS, ApprovalStatus::PENDING_SUBMISSION);
$contactObject = new ContactObject($request->input('name'), $request->input('phone'), $request->input('contact_email'), $request->input('wechat_id'));
$this->createContactProcessor->execute($contactObject, $company);
/** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($company, BusinessType::ONLINE_SELLER);
$inviter = $this->fetchesCompanyModule->execute(['reference'=>'HWT']);
$connectionObject = new CompanyConnectionObject($companyModule, $inviter, mt_rand(1000, 9999).(new GeneratesInitials())->name($company->name)->length(3)->generate(), 'HWT');
$connection = $this->createsCompanyConnection->execute($connectionObject);
$this->approvesCompanyConnection->execute($connection);
$Object = new EmploymentObject($companyModule, $user);
$this->assignEmployeeProcessor->execute($Object);
return $this->response($this->authenticationProcessor->execute($request));
}
}
@@ -0,0 +1,178 @@
<?php
namespace App\Classes\Modules\Delivery\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
use App\Classes\Modules\Orders\Services\CreatesOrder;
use App\Classes\Modules\Orders\Services\GeneratesOrderNumber;
use App\Classes\Modules\Orders\Standards\Rules\CanCreateOrder;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\CreatesPackingList;
use App\Classes\Modules\PackingLists\Services\Packages\CreatesPackage;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\OrderType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Http\Resources\DeliveryOrderResource;
use App\Models\Address;
use App\Models\CompanyModule;
use App\Models\Order;
use App\Models\PackingList;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateDeliveryOrderLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Created Order',
'message' => 'You have successfully created a new Order'
];
}
/** @var FetchesCompany */
private $fetchesCompany;
/** @var fetchesAddress */
private $fetchesAddress;
/** @var CanCreateOrder */
private $canCreateOrder;
/** @var CreatesOrder */
private $createsOrder;
/** @var CreatesAddress */
private $createAddress;
/** @var CreateContactProcessor */
private $createContactProcessor;
/** @var CreateRemarkProcessor */
private $createRemarkProcessor;
/** @var GeneratesOrderNumber */
private $generatesOrderNumber;
/** @var CreatesPackingList */
private $createsPackingList;
/** @var CreatesPackage */
private $createsPackage;
/**
* CreateDeliveryOrderLogic constructor.
* @param FetchesCompany $fetchesCompany
* @param FetchesAddress $fetchesAddress
* @param CanCreateOrder $canCreateOrder
* @param CreatesOrder $createsOrder
* @param CreatesAddress $createAddress
* @param CreateContactProcessor $createContactProcessor
* @param CreateRemarkProcessor $createRemarkProcessor
* @param GeneratesOrderNumber $generatesOrderNumber
* @param CreatesPackingList $createsPackingList
* @param CreatesPackage $createPackage
*/
public function __construct(FetchesCompany $fetchesCompany, FetchesAddress $fetchesAddress, CanCreateOrder $canCreateOrder, CreatesOrder $createsOrder, CreatesAddress $createAddress, CreateContactProcessor $createContactProcessor, CreateRemarkProcessor $createRemarkProcessor, GeneratesOrderNumber $generatesOrderNumber, CreatesPackingList $createsPackingList, CreatesPackage $createsPackage)
{
$this->fetchesCompany = $fetchesCompany;
$this->fetchesAddress = $fetchesAddress;
$this->canCreateOrder = $canCreateOrder;
$this->createsOrder = $createsOrder;
$this->createAddress = $createAddress;
$this->createContactProcessor = $createContactProcessor;
$this->createRemarkProcessor = $createRemarkProcessor;
$this->generatesOrderNumber = $generatesOrderNumber;
$this->createsPackingList = $createsPackingList;
$this->createsPackage = $createsPackage;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request): JsonResponse
{
$company = $this->fetchesCompany->execute(['id' => $request->input('company_id')]);
$senderAddress = $this->fetchesAddress->execute(['id' => $request->input('sender_address_id')]);
$deliveryAddress = $this->fetchesAddress->execute(['id' => $request->input('delivery_address_id')]);
/** @var CompanyModule $companyModule */
$companyModule = $company->companyModules()->where('type', BusinessType::ONLINE_SELLER)->first();
$orderObject = new OrderObject($this->generatesOrderNumber->execute('168M', 7), OrderType::LAST_MILE_DELIVERY, ApprovalStatus::APPROVED);
$this->canCreateOrder->passes($orderObject);
/** @var Order $order */
$order = $this->createsOrder->execute($companyModule, $orderObject);
$senderAddressObject = new AddressObject($senderAddress->street_one, $senderAddress->street_two, $senderAddress->country_id, $senderAddress->state_id, $senderAddress->district_id, $senderAddress->postcode, $senderAddress->type, ApprovalStatus::APPROVED, $senderAddress->reference);
$deliveryAddressObject = new AddressObject($deliveryAddress->street_one, $deliveryAddress->street_two, $deliveryAddress->country_id, $deliveryAddress->state_id, $deliveryAddress->district_id, $deliveryAddress->postcode, $deliveryAddress->type, ApprovalStatus::APPROVED, $deliveryAddress->reference);
/** @var Address $orderSenderAddress */
$orderSenderAddress = $this->createAddress->execute($order, $senderAddressObject);
/** @var Address $orderDeliveryAddress */
$orderDeliveryAddress = $this->createAddress->execute($order, $deliveryAddressObject);
$senderContact = $senderAddress->contacts()->first();
$deliveryContact = $deliveryAddress->contacts()->first();
$contactObject = new ContactObject($senderContact->reference, $senderContact->phone, '','');
$this->createContactProcessor->execute($contactObject, $orderSenderAddress);
$contactObject = new ContactObject($deliveryContact->reference, $deliveryContact->phone, '','');
$this->createContactProcessor->execute($contactObject, $orderDeliveryAddress);
$senderRemark = $senderAddress->remarks()->first();
$deliveryRemark = $deliveryAddress->remarks()->first();
if ($senderRemark){
$remarkObject = new RemarkObject($senderRemark->content, Auth()->user()->id);
if($remarkObject->getContent()){
$this->createRemarkProcessor->execute($orderSenderAddress, $remarkObject);
}
}
if ($deliveryRemark){
$remarkObject = new RemarkObject($deliveryRemark->content, Auth()->user()->id);
if($remarkObject->getContent()){
$this->createRemarkProcessor->execute($orderDeliveryAddress, $remarkObject);
}
}
$packingListObject = new PackingListObject($order->reference, $companyModule->id, PackingListType::DELIVERY_PACKING_LIST, ApprovalStatus::PENDING_VERIFICATION);
/** @var PackingList $packingList */
$packingList = $this->createsPackingList->execute($packingListObject, $order);
$packageObject = new PackageObject($request->input('packing_list.type'), $request->input('packing_list.description'), (float) 1, (float) 1, (float) 1, $request->input('packing_list.weight'), (float) $request->input('packing_list.quantity'), ApprovalStatus::APPROVED);
$this->createsPackage->execute($packageObject, $packingList);
return $this->resourceResponse(new DeliveryOrderResource($order));
}
}
@@ -0,0 +1,57 @@
<?php
namespace App\Classes\Modules\Delivery\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Services\ListsOrders;
use App\Classes\Modules\Orders\Standards\Rules\CanListOrders;
use App\Classes\ValueObjects\Constants\OrderType;
use App\Http\Resources\DeliveryOrderResource;
use App\Http\Resources\OrderResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListOrdersLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Orders',
'message' => 'You have successfully retrieved a list of Orders'
];
}
/** @var CanListOrders */
private $canListOrders;
/** @var ListsOrders */
private $listsOrders;
/**
* ListOrdersLogic constructor.
* @param CanListOrders $canListOrders
* @param ListsOrders $listsOrders
*/
public function __construct(CanListOrders $canListOrders, ListsOrders $listsOrders)
{
$this->canListOrders = $canListOrders;
$this->listsOrders = $listsOrders;
}
public function logic(Request $request) : JsonResponse
{
$this->canListOrders->passes();
$query = $this->listsOrders->execute(array_merge($this->listsOrders->deserializeFilters($request->input('filters')), ['with_parcels' => true, 'type_in' => [OrderType::LAST_MILE_DELIVERY]]));
return $this->collectionResponse(DeliveryOrderResource::collection($query));
}
}
@@ -28,7 +28,7 @@ class FileObject implements DataTransferObject
*/
public function getData()
{
return $this->getExtension() === 'pdf' ? $this->data : (new imageManager())->make($this->data);
return in_array($this->getExtension(), ['pdf', 'excel']) ? $this->data : (new imageManager())->make($this->data);
}
/**
@@ -66,7 +66,7 @@ class FileObject implements DataTransferObject
*/
public function getDecodedData(): string
{
return $this->getExtension() === 'pdf' ?
return in_array($this->getExtension(), ['pdf', 'excel']) ?
base64_decode((explode('base64,', $this->getData()))[1]):
$this->getData()->encode('data-url')->encoded;
}
@@ -78,9 +78,4 @@ class FileObject implements DataTransferObject
{
$this->data = $data;
}
}
}
@@ -36,7 +36,7 @@ class ConvertsBase64ToFile
foreach ($files as $file) {
$object = new FileObject($file);
$object->getExtension() === 'pdf' ? $this->generatePDF($object) : $this->generateImage($object);
in_array($object->getExtension(), ['pdf', 'excel']) ? $this->generatePDF($object) : $this->generateImage($object);
}
@@ -122,4 +122,4 @@ class ConvertsBase64ToFile
]);
}
}
}
@@ -0,0 +1,73 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Models\Order;
use App\Models\PackingList;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery
{
use Exportable;
public function headings(): array
{
return [
'ORDER NUMBER',
'Marking',
'Warehouse',
'Cbm',
'Description',
'quantity',
'Received Date',
'Remarks'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class);
}
/**
* @param $packingList
* @return array
*/
public function map($packingList): array
{
$order = $packingList->owner;
$connection = $order->companyModule()->first()->inviters()->withPivot('invitee_reference')->first();
$marking = $connection ? $connection->pivot->invitee_reference:'';
$warehouse = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee;
$cbm = $packingList->packages->sum(function($package){
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
});
$arrival_date = $packingList->transports()->first()->drop_date->format('d-m-Y');
return [
$packingList->owner->reference,
$marking,
$warehouse->reference,
$cbm,
$packingList->packages->implode('description', ', '),
$packingList->packages->sum('quantity'),
$arrival_date,
''
];
}
}
@@ -0,0 +1,91 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Models\Container;
use App\Models\Package;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsCompanyModuleSummary implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
protected $companyModuleId, $containerIds;
public function headings(): array
{
return [
'Date',
'Full Marking',
'Container',
'Description',
'Ctns',
'L (cm)',
'H (cm)',
'W (cm)',
'CBM'
];
}
public function setParameters($companyModuleId, $containerIds)
{
$this->companyModuleId = $companyModuleId;
$this->containerIds = $containerIds;
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$packagesArray = collect();
$containers = Container::whereIn('reference', explode(',', $this->containerIds))->get();
foreach ($containers as $container){
$company_module_id = $this->companyModuleId;
$packingLists = $container->packingLists()->get()->filter(function ($packingList) use ($company_module_id) {
return $packingList->owner->company_module_id == $company_module_id;
});
foreach ($packingLists as $packingList){
if($packingList->packingLists->first()){
$packingList = $packingList->packingLists->first();
}
$packages = $packingList->packages;
foreach ($packages as $package){
$packagesArray->push($package);
}
}
}
return $packagesArray;
}
/**
* @param Package $package
*
* @return array
*/
public function map($package): array
{
$connection = $package->packingList->owner->companyModule->inviters()->withPivot('invitee_reference')->first();
$marking = $connection ? $connection->pivot->invitee_reference:'';
return [
Carbon::parse($package->created_at)->format('d-m-Y'),
$marking,
$package->packingList->containers()->first()->reference,
$package->description,
$package->quantity,
$package->length,
$package->height,
$package->width,
((($package->length / 100) * ($package->height / 100) * ($package->width / 100)) * $package->quantity)
];
}
}
@@ -0,0 +1,84 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\CompanyModule;
use App\Models\Company;
use App\Models\PackingList;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Illuminate\Http\Request;
class ExportsCustomerTotalOrderByYear implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'CompanyId',
'CompanyName',
'CompanyReference',
'TotalCbm'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$packingLists = PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->whereHas('containers', function($container){
return $container->where('loading_date', '>=', Carbon::parse('01-01-' . $this->request->route('year')))
->where('loading_date', '<=', Carbon::parse('31-12-' . $this->request->route('year')));
})->get();
$packingLists = $packingLists->groupBy(function ($packingList){
return $packingList->owner->company_module_id;
})->sortByDesc(function($companyModule){
return $companyModule->sum(function($packingList){
return $packingList->packages->sum(function ($package){
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
});
});
})->take(10);
return $packingLists;
}
/**
* @param $row
* @return array
*/
public function map($row): array
{
$companyModule = $row[0]->owner->companyModule;
$marking = $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
$cbm = $row->sum(function($packingList){
return $packingList->packages->sum(function ($package){
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
});
});
return [
$companyModule->company_id,
$companyModule->name,
$marking,
$cbm
];
}
}
@@ -0,0 +1,120 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\OrderType;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Concerns\WithTitle;
class ExportsDeliveryOrders implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, WithTitle
{
use Exportable;
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'Types_Of_Services',
'Service_Type',
'Sender_Name',
'Sender_Company_Name',
'Sender_Building_Unit',
'Sender_Address',
'Sender_Address_2',
'Sender_Postal_Code',
'Sender_Phone_Number',
'Delivery_Name',
'Delivery Company Name',
'Delivery_Building_Unit',
'Delivery_Address',
'Delivery_Address_2',
'Delivery_Postal_Code',
'Delivery_Phone_Number',
'Shipment_Type',
'Mode',
'Pickup_Address_Type',
'Reference_Number',
'Quantity',
'Weight',
'Length',
'Width',
'Height',
'COD_Amount',
'DO_Numbers'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
$selectedIds = array_map(function($value){
return ['id' => $value];
}, json_decode($this->request->input('ids')));
return Order::where('type', OrderType::LAST_MILE_DELIVERY)->whereIn('id', $selectedIds);
}
public function title(): string
{
return 'bulk-shipment';
}
/**
* @param Order $order
*
* @return array
*/
public function map($order): array
{
$senderAddress = $order->addresses()->where('type', AddressType::PICK_UP)->first();
$deliveryAddress = $order->addresses()->where('type', AddressType::DELIVERY)->first();
$package = $order->packingLists()->first()->packages()->first();
return [
'Domestic Shipment',
'ST00000020',
$senderAddress->contacts()->first()->reference,
$senderAddress->reference ? $senderAddress->reference : $order->companyModule->name,
$senderAddress->street_one,
$senderAddress->street_two.' '.$senderAddress->district->name.' '.$senderAddress->postcode.' '.$senderAddress->state->name.' '.$senderAddress->country->name,
'',
$senderAddress->postcode,
$senderAddress->contacts()->first()->phone,
$deliveryAddress->contacts()->first()->reference,
$deliveryAddress->reference,
$deliveryAddress->street_one,
$deliveryAddress->street_two.' '.$deliveryAddress->district->name.' '.$deliveryAddress->postcode.' '.$deliveryAddress->state->name.' '.$deliveryAddress->country->name,
'',
$deliveryAddress->postcode,
$deliveryAddress->contacts()->first()->phone,
$package->type === PackageType::CARTON ? 'Package' : ($package->type === PackageType::PALLET ? 'Pallet' : 'Documents'),
'Pick Up',
'Default',
$order->reference,
$package->quantity,
$package->weight * $package->quantity,
1,
1,
1,
'',
''
];
}
}
@@ -0,0 +1,74 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Concerns\WithTitle;
class ExportsDeliveryValidValues implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, WithTitle, FromCollection
{
use Exportable;
private $request;
/**
* ExportsDeliveryValidValues constructor.
* @param Request $request
*/
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'Types_Of_Services',
'Service_Type',
'Mode',
'Flag',
'Pickup Address'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$returnArray = collect();
$returnArray->push(['Domestic Shipment', 'Package', 'Pick Up', 'Yes', 'Default']);
$returnArray->push(['', 'Documents', 'Lodge In / Walk In', 'No', 'Sender']);
$returnArray->push(['', 'Pallet', '', '', '']);
return $returnArray;
}
public function title(): string
{
return 'valid-values';
}
/**
* @param ReturnArray $returnArray
*
* @return array
*/
public function map($returnArray): array
{
return [
$returnArray[0],
$returnArray[1],
$returnArray[2],
$returnArray[3],
$returnArray[4],
];
}
}
@@ -0,0 +1,38 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\Modules\Exports\Services\ExportsDeliveryOrders;
use App\Classes\Modules\Exports\Services\ExportsDeliveryValidValues;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\Exportable;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
class ExportsMultipleDeliveryOrders implements WithMultipleSheets
{
use Exportable;
protected $request;
/**
* ExportsMultipleDeliveryOrders constructor.
* @param Request $request
*/
public function __construct(Request $request)
{
$this->request = $request;
}
/**
* @return array
*/
public function sheets(): array
{
$sheets = [];
$sheets[] = new ExportsDeliveryOrders($this->request);
$sheets[] = new ExportsDeliveryValidValues($this->request);
return $sheets;
}
}
@@ -0,0 +1,97 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Company;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
public function headings(): array
{
return [
'Code',
'DebtorControlAcc',
'ControlAccount',
'CompanyName',
'Desc2',
'DebtorType',
'DisplayTerm',
'CurrencyCode',
'RegisterNo',
'Address1',
'Address2',
'Address3',
'PostCode',
'DeliverAddr1',
'DeliverAddr2',
'DeliverAddr3',
'DeliverPostCode',
'EmailAddress',
'Attention',
'Phone1',
'Phone2',
'Fax1'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return Company::where(function($query){
$query->whereNull('debtor')->orWhere('debtor', '');
})->whereHas('companyModules', function($query){
$query->where('type', BusinessType::IMPORTER);
})->whereHas('parcels')->where('status', ApprovalStatus::APPROVED);
}
/**
* @param Company $company
*
* @return array
*/
public function map($company): array
{
$marking = $company->companyModules()->where('type', BusinessType::IMPORTER)->first()->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
return [
'<<New>>',
'300-0000',
'300-0000',
$company->name.' (Shipping)',
$marking,
'',
'PIA',
'MYR',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',//EmailAddress
'',
'',
'',
''
];
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Order;
use App\Models\PackingList;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsOnHoldPackingList implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
public function headings(): array
{
return [
'Container Ref.',
'ETA',
'Unstuffing',
'Marking',
'Order Number'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return PackingList::where('type', '=', 2)->whereIn('status', [4, 5])->whereHas('containers');
}
/**
* @param PackingList $packingList
*
* @return array
*/
public function map($packingList): array
{
$container = $packingList->containers()->first();
$ContainerTransport = $container->transports()->first();
$order = $packingList->owner;
if(!$order instanceof Order)return [];
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
return [
$container->reference,
$ContainerTransport ? $ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first() ? $ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->eta : 'n/a' : 'n/a',
$ContainerTransport ? $ContainerTransport->drop_date : 'n/a',
$marking,
$order->reference,
];
}
}
@@ -0,0 +1,108 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Models\CompanyConnection;
use App\Models\Container;
use App\Models\Order;
use App\Models\Package;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsOrderSummaryByMarking implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
protected $customerMarking;
protected $dateFrom;
protected $dateTo;
public function headings(): array
{
return [
'Date',
'Container',
'Order Marking',
'Packing List Reference',
'Description',
'Quantity',
'L (cm)',
'H (cm)',
'W (cm)',
'CBM'
];
}
public function setParameters($customerMarking, $dateFrom, $dateTo)
{
$this->customerMarking = $customerMarking;
$this->dateFrom = $dateFrom;
$this->dateTo = $dateTo;
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$connection = CompanyConnection::where('invitee_reference', $this->customerMarking)->first();
$company_id = $connection->invitee->company->id;
$company_module_id = $connection->invitee->id;
$packagesArray = collect();
$orders = Order::where('company_module_id', $company_module_id);
if (isset($this->dateFrom) && isset($this->dateTo)) {
$from = Carbon::createFromFormat('d-m-Y', $this->dateFrom);
$to = Carbon::createFromFormat('d-m-Y', $this->dateTo);
$orders = $orders->whereBetween('created_at', [$from, $to]);
}
$orders = $orders->get();
foreach ($orders as $order){
$packingLists = $order->packingLists;
foreach ($packingLists as $packingList){
if($packingList->packingLists->first()){
$packingList = $packingList->packingLists->first();
}
$packages = $packingList->packages;
foreach ($packages as $package){
$packagesArray->push($package);
}
}
}
return $packagesArray;
}
/**
* @param Package $package
*
* @return array
*/
public function map($package): array
{
$packinglist = ($package->packingList()->first()->owner->owner_type == Order::class) ? $package->packingList()->first(): $package->packingList->owner;
$order = $packinglist->owner;
return [
Carbon::parse($package->created_at)->format('d-m-Y'),
'',
$order->reference,
$package->packingList->reference,
$package->description,
$package->quantity,
$package->length,
$package->height,
$package->width,
((($package->length / 100) * ($package->height / 100) * ($package->width / 100)) * $package->quantity)
];
}
}
@@ -0,0 +1,28 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\Modules\Exports\Sheets\ContainersSheet;
use App\Classes\Modules\Exports\Sheets\PackingListsSheet;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;;
class ExportsParcel implements WithMultipleSheets
{
use Exportable;
/**
* @return array
*/
public function sheets(): array
{
$sheets = [];
$sheets[] = new ContainersSheet();
$sheets[] = new PackingListsSheet();
return $sheets;
}
}
@@ -0,0 +1,52 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\Order;
use App\Models\PackingList;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
class ExportsParcelPostcodes implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery
{
use Exportable;
public function headings(): array
{
return [
'Order Number',
'Postcode'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->whereRaw('LENGTH(reference) > 8')->where('reference', 'not like', "%YW%")->where('owner_type', Order::class)->whereDate('created_at', '>=', Carbon::parse('20-09-2022'))->whereDoesntHave('containers');
}
/**
* @param $packingList
* @return array
*/
public function map($packingList): array
{
$address = $packingList->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first();
return [
$packingList->reference,
$address->postcode
];
}
}
@@ -0,0 +1,143 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Transaction;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Illuminate\Http\Request;
use Carbon\Carbon;
class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'DocNo',
'DocDate',
'DebtorCode',
'ShipInfo',
'AccNo',
'DetailDescription',
'FurtherDescription',
'ProjNo',
'DeptNo',
'Qty',
'UnitPrice'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
$start_date = $this->request->input('startDate', null);
if ($start_date) {
$start_date = Carbon::parse($this->request->input('startDate'))->format('Y-m-d');
}
$end_date = $this->request->input('endDate', null);
if ($end_date) {
$end_date = Carbon::parse($this->request->input('endDate'))->format('Y-m-d');
}
$query = Transaction::query();
// paidInvoiceSection
$approvalStatus = ApprovalStatus::COMPLETED;
if ($this->request->route('section') == 'pendingPaymentSection') {
// pendingPaymentSection
$approvalStatus = ApprovalStatus::APPROVED;
}
$query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [$approvalStatus]);
if($start_date && $end_date) {
$query->whereBetween('updated_at', [
Carbon::parse($start_date)->format('Y-m-d 0:00:00'),
Carbon::parse($end_date)->format('Y-m-d 23:59:59')
]);
}
elseif($start_date && !$end_date) {
$query->whereHas('transactions', function($transaction) use ($start_date) {
$transaction->where('type', TransactionType::PAYMENT)->where('updated_at', '>=', Carbon::parse($start_date)->format('Y-m-d 0:00:00'));
});
}
elseif(!$start_date && $end_date) {
$query->whereHas('transactions', function($transaction) use ($end_date) {
$transaction->where('type', TransactionType::PAYMENT)->where('updated_at', '>=', Carbon::parse($end_date)->format('Y-m-d 0:00:00'));
});
}
return $query;
}
public function map($transaction): array
{
$container = $transaction->owner->containers()->first();
$order = $transaction->owner->owner;
$company = $order->companyModule->company;
$shippingTransactionDetails = $transaction->transactionDetails()->where('reference', 'SHIPPING_FEE')->first();
$furtherDescription = '';
foreach ($transaction->transactionDetails as $item){
if($item->reference === 'SHIPPING_FEE')
$furtherDescription .= str_replace('X1 Freight Service Charge<br>', '', $item->name)."\n";
elseif($item->reference === 'OVER_WEIGHT_CHARGES')
$furtherDescription .= $item->name.' '.$item->quantity.' CBM'."\n";
elseif($item->reference === 'MIN_CBM_CHARGES')
$furtherDescription .= $item->name.' '.$item->quantity.' CBM'."\n";
else
$furtherDescription .= $item->name.' '.$item->quantity.' X '.$item->price."\n";
}
return [
'<<New>>',
$transaction->created_at->format('m/d/Y H:m'),
$company->debtor,
$order->reference,
'500-0000',
'X1 Freight Service Charge',
$furtherDescription,
$container->reference,
'CIEF',
$shippingTransactionDetails->quantity,
$shippingTransactionDetails->price
];
return [
'<<New>>',
$transaction->updated_at->format('m/d/Y H:m'),
$company->debtor,
$container->reference,
'500-0000',
'X1 Freight Service Charge',
'FurtherDescription',
$container->reference,
'M3',
'CIEF',
$shippingTransactionDetails->quantity,
$shippingTransactionDetails->price,
];
}
}
@@ -20,16 +20,20 @@ class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings,
public function headings(): array
{
return [
'Order Number',
'Container Ref.',
'ETA',
'Unstuffing',
'Marking',
'Order Number',
'status',
'Delay Days / delivery date',
'Quantity',
'Remark',
'Contact Person Name',
'Contact Number',
'Delivery Date',
'Delivery Address',
'Delivery State',
'Delivery Postcode'
'State',
'Postcode',
'Address',
'PIC',
'Phone',
'Remark'
];
}
@@ -39,8 +43,8 @@ class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings,
public function query()
{
return PackingList::where('type', '=', 2)->whereHas('containers', function ($query){
$query->where('containers.status', ApprovalStatus::COMPLETED);
})->whereDoesntHave('transports');
$query->where('containers.status', ApprovalStatus::COMPLETED)->where('containers.created_at', '>', Carbon::now()->subMonths(3));
});
}
/**
@@ -50,26 +54,33 @@ class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings,
*/
public function map($packingList): array
{
$container = $packingList->containers()->first();
$ContainerTransport = $container->transports()->first();
$order = $packingList->owner;
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
$defaultAddress = $order->companyModule->addresses()->defaultAddress()->first();
$defaultAddress = $defaultAddress ? $defaultAddress : $order->companyModule->addresses()->first();
$address = $defaultAddress->street_one.', '.$defaultAddress->street_two.' '.$defaultAddress->district->name.' '.$defaultAddress->postcode.' '.$defaultAddress->state->name.' '.$defaultAddress->country->name;
$contacts = $defaultAddress->contacts->first() ? $defaultAddress->contacts->first(): '';
$inviter = $order->companyModule ? $order->companyModule->inviters()->withPivot('invitee_reference')->first() : null;
$marking = $inviter ? $inviter->pivot->invitee_reference : 'Unclaimed';
$address = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
$contacts = $address->contacts->first() ? $address->contacts->first(): '';
$originalPackingList = $packingList->owner instanceof PackingList ? $packingList->owner : $packingList;
$transport = $originalPackingList->containers()->first()->transports()->first();
$deliveryTransport = $originalPackingList->transports()->first();
$schedule = $deliveryTransport ? $deliveryTransport->schedules()->first() : null;
return [
$order->reference,
$container->reference,
$ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first() ? $ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->eta : '',
$ContainerTransport->drop_date,
$marking,
$order->reference,
$schedule ? (Carbon::parse($schedule->eta) < Carbon::now() ? 'Delivered' : 'Pending Delivery') : 'Pending Arrangement',
$schedule ? $schedule->eta : ($transport ? Carbon::now()->diffInDays($transport->drop_date, false) . ' Days' : ''),
$packingList->packages()->sum('quantity'),
$defaultAddress->remarks->first() ? $defaultAddress->remarks->first()->content: '',
$address->state->name,
$address->postcode,
$address->street_one.', '.$address->street_two.' '.$address->district->name.' '.$address->postcode.' '.$address->state->name.' '.$address->country->name,
$address->remarks->first() ? $address->remarks->first()->content: '',
$contacts ? $contacts ->reference : '',
$contacts ? $contacts ->phone : '',
$transport ? Carbon::now()->diffInDays($transport->drop_date, false) . ' Days' : '',
$address,
$defaultAddress->state->name,
$defaultAddress->postcode
];
}
}
@@ -0,0 +1,55 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsWarehousePackingList implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
public function headings(): array
{
return [
'Customer Marking',
'Order Number'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return Order::whereHas('addresses', function($address) {
$address->where('status', ApprovalStatus::APPROVED);
})->whereHas('packingLists', function($packingLists) {
$packingLists->where('type', PackingListType::SHIPPING_PACKING_LIST)->whereDoesntHave('transports');
});
}
/**
* @param Order $order
*
* @return array
*/
public function map($order): array
{
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
return [
$marking,
$order->reference,
];
}
}
@@ -0,0 +1,105 @@
<?php
/**
* Created by PhpStorm.
* User: Omair Saleh
* Date: 20/9/2022
* Time: 12:20 AM
*/
namespace App\Classes\Modules\Exports\Sheets;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Container;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithTitle;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class ContainersSheet implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery, WithTitle
{
use Exportable;
public function headings(): array
{
return [
'Container No.',
'Loaded Date',
'ETD',
'ETA',
'Delay',
'Unstuffing date',
'Status',
'CTN',
'CBM'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return Container::query();
}
/**
* @param $container
* @return array
*/
public function map($container): array
{
$transport = $container->transports()->first();
$currentSchedule = $transport ? $transport->schedules()->where('status', '!=', ApprovalStatus::EXPIRED)->first() : null;
$scheduleHistory = $transport ? $transport->schedules()->where('status', ApprovalStatus::EXPIRED)->get() : null;
$status = 'Loaded';
if($currentSchedule) {
if(Carbon::parse($currentSchedule->etd) >= Carbon::today()){
$status = 'Shipping';
}
if(Carbon::parse($currentSchedule->eta) >= Carbon::today()){
$status = 'Arrived?';
}
if($transport->drop_date){
$status = 'Pending deliveries';
if(!$container->packinglists()->whereDoesntHave('transports')->get()){
$status = 'Complete';
}
}
}
return [
$container->reference,
$container->loading_date,
$currentSchedule ? $currentSchedule->etd : null,
$currentSchedule ? $currentSchedule->eta : null,
$scheduleHistory ? count($scheduleHistory) : 0,
$transport ? $transport->drop_date : null,
$status,
$container->packages()->sum('quantity'),
$container->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity')),
];
}
/**
* @return string
*/
public function title(): string
{
return 'Containers';
}
}
@@ -0,0 +1,131 @@
<?php
/**
* Created by PhpStorm.
* User: Omair Saleh
* Date: 20/9/2022
* Time: 12:20 AM
*/
namespace App\Classes\Modules\Exports\Sheets;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\Order;
use App\Models\PackingList;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithTitle;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class PackingListsSheet implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromCollection, WithTitle
{
use Exportable;
public function headings(): array
{
return [
'Arrival Date',
'Marking',
'Order No.',
'Reference',
'Quantity',
'CBM',
'Overweight',
'Total CBM',
'Container No.',
'Delivery Date',
'Warehouse',
'Warehouse District',
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$packingLists = PackingList::where('status', '=', 2)->whereIn('type', [PackingListType::WAREHOUSE_RECEIVE_LIST, PackingListType::SHIPPING_PACKING_LIST])->get();
return $packingLists->filter(function ($packingList) {
if($packingList->type === PackingListType::SHIPPING_PACKING_LIST){
$warehouseArrival = PackingList::where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->where('reference', $packingList->reference)->get();
return $warehouseArrival ? false : true;
}
return true;
});
}
/**
* @param $packingList
* @return array
*/
public function map($packingList): array
{
$warehouseArrivalList = $packingList;
$shippingList = PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->where('reference', $packingList->reference)->first();
if($packingList->type === PackingListType::SHIPPING_PACKING_LIST) {
$warehouseArrivalList = null;
$shippingList = $packingList;
}
$arrivalTransport = null;
if($warehouseArrivalList){
$arrivalTransport = $warehouseArrivalList->transports()->first();
}
$order = null;
if($packingList->owner instanceof Order){
$order = $packingList->owner;
}
$cbm = $packingList->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum(function($package) {
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
});
$overWeight = $packingList->packages->where('type', PackageType::OVER_WEIGHT)->sum(function($package) {
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
});
$container = $shippingList ? $shippingList->container : null;
$delivery = $shippingList ? $shippingList->transport : null;
return [
$arrivalTransport ? $arrivalTransport->drop_date : null,
$order ? $order->reference : 'Unclaimed',
$order ? $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : 'Unclaimed',
$packingList->reference,
$packingList->packages()->sum('quantity'),
$cbm,
$overWeight ? $overWeight : 0,
$cbm + $overWeight,
$container ? $container->reference : null,
$delivery ? $delivery->drop_date : null,
strlen($packingList->reference) > 8 ? 'YD' : 'VT',
$order ? $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->name : null,
];
}
/**
* @return string
*/
public function title(): string
{
return 'Packing Lists';
}
}
@@ -0,0 +1,56 @@
<?php
namespace App\Classes\Modules\Imports\Services;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Models\Company;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithBatchInserts;
use Maatwebsite\Excel\Concerns\WithValidation;
class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithValidation
{
public function __construct() {
}
public function model($row = [])
{
try {
preg_match_all('/([0-9]{3,4}[a-zA-Z]{3,4})/', $row['desc2'], $matches);
foreach ($matches[0] as $match){
$reference = $match;
$debtor = $row['code'];
$company = Company::whereNull('debtor')->whereHas('companyModules', function($query) use ($reference) {
$query->whereHas('connections', function($query) use ($reference) {
$query->where('invitee_reference', $reference);
});
})->first();
if ($company) {
$company->debtor = $debtor;
$company->update();
}
}
} catch (\Exception $exception){
dd($exception);
}
}
public function batchSize(): int
{
return 100;
}
public function rules(): array
{
return [
];
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\Notifications\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Notifications\Services\ListsNotification;
use App\Http\Resources\NotificationResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListNotificationsLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieve Notifications',
'message' => 'You have successfully retrieved a list of Notifications'
];
}
/** @var ListsNotification */
private $listsNotification;
/**
* ListNotificationsLogic constructor.
* @param ListsNotification $listsNotification
*/
public function __construct(
ListsNotification $listsNotification
)
{
$this->listsNotification = $listsNotification;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$filters = [
// 'target_id'=>auth()->user()->id,
// 'per_page'=>$request->route('per_page')
];
$notifications = $this->listsNotification->execute($filters);
return $this->collectionResponse(NotificationResource::collection($notifications));
}
}
@@ -0,0 +1,33 @@
<?php
namespace App\Classes\Modules\Notifications\Services;
use App\Classes\General\Eloquent\AbstractListRecord;
use Illuminate\Database\Eloquent\Builder;
use App\Models\Notification;
class ListsNotification extends AbstractListRecord
{
/** @var Bank */
private $repository;
/**
* ListsBank constructor.
* @param Notification $repository
*/
public function __construct(Notification $repository)
{
$this->repository = $repository;
}
/**
* @return Builder
*/
function getRepository(): Builder
{
return $this->repository->newQuery();
}
}
@@ -4,13 +4,19 @@ namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Processors\CreateOrderProcessor;
use App\Classes\Modules\Orders\Services\GeneratesOrderNumber;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Http\Resources\OrderResource;
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
use App\Models\Address;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
@@ -39,6 +45,12 @@ class CreateOrderLogic extends AbstractControllerLogic
/** @var GeneratesOrderNumber */
private $generatesOrderNumber;
/** @var CreatesAddress */
private $createsAddress;
/** @var CanCreateAddress */
private $canCreateAddress;
/**
* CreateOrderLogic constructor.
* @param FetchesCompany $fetchesCompany
@@ -46,14 +58,18 @@ class CreateOrderLogic extends AbstractControllerLogic
* @param CreateOrderProcessor $createOrderProcessor
* @param FetchesCompanyModule $fetchesCompanyModule
* @param GeneratesOrderNumber $generatesOrderNumber
* @param CreatesAddress $createsAddress
* @param CanCreateAddress $canCreateAddress
*/
public function __construct(FetchesCompany $fetchesCompany, FetchesAddress $fetchesAddress, CreateOrderProcessor $createOrderProcessor, FetchesCompanyModule $fetchesCompanyModule, GeneratesOrderNumber $generatesOrderNumber)
public function __construct(FetchesCompany $fetchesCompany, FetchesAddress $fetchesAddress, CreateOrderProcessor $createOrderProcessor, FetchesCompanyModule $fetchesCompanyModule, GeneratesOrderNumber $generatesOrderNumber, CreatesAddress $createsAddress, CanCreateAddress $canCreateAddress)
{
$this->fetchesCompany = $fetchesCompany;
$this->fetchesAddress = $fetchesAddress;
$this->createOrderProcessor = $createOrderProcessor;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->generatesOrderNumber = $generatesOrderNumber;
$this->createsAddress = $createsAddress;
$this->canCreateAddress = $canCreateAddress;
}
@@ -66,6 +82,21 @@ class CreateOrderLogic extends AbstractControllerLogic
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
if ($request->input('billing_address_id')) {
$companyModule = $company->companyModules->first();
$billingAddressInputed = $this->fetchesAddress->execute(['id' => $request->input('billing_address_id')]);
if ($billingAddressInputed->type !== AddressType::BILLING || $billingAddressInputed->id !== $companyModule->addresses->where('type', AddressType::BILLING)->first()->id) {
// delete all current billing address
Address::where('owner_type', CompanyModule::class)->where('owner_id', $request->input('company_module_id'))->where('type', AddressType::BILLING)->delete();
// create new billing addrress
$billingAddress = new AddressObject($billingAddressInputed->street_one, $billingAddressInputed->street_two, $billingAddressInputed->country_id, $billingAddressInputed->state_id, $billingAddressInputed->district_id, $billingAddressInputed->postcode, AddressType::BILLING, ApprovalStatus::APPROVED, $billingAddressInputed->reference);
$this->canCreateAddress->passes($billingAddress);
$this->createsAddress->execute($companyModule, $billingAddress);
}
}
if(!in_array($company->companyModules()->importers()->first()->id, WarehouseReferences::YD_EXEMPT_LIST)){
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU : WarehouseReferences::YD_YIWU]);
}
@@ -6,6 +6,7 @@ namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Services\ListsOrders;
use App\Classes\Modules\Orders\Standards\Rules\CanListOrders;
use App\Classes\ValueObjects\Constants\OrderType;
use App\Http\Resources\OrderResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -44,7 +45,7 @@ class ListOrdersLogic extends AbstractControllerLogic
{
$this->canListOrders->passes();
$query = $this->listsOrders->execute(array_merge($this->listsOrders->deserializeFilters($request->input('filters')), ['with_parcels' => true]));
$query = $this->listsOrders->execute(array_merge($this->listsOrders->deserializeFilters($request->input('filters')), ['with_parcels' => true, 'type_in' => [OrderType::SHARED_CONTAINER, OrderType::DEDICATED_CONTAINER]]));
return $this->collectionResponse(OrderResource::collection($query));
@@ -9,7 +9,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
class OrderObject implements DataTransferObject
{
/** @var int */
/** @var string */
private $reference;
/** @var int */
@@ -20,11 +20,11 @@ class OrderObject implements DataTransferObject
/**
* OrderObject constructor.
* @param int $reference
* @param string $reference
* @param int $type
* @param int|null $status
*/
public function __construct(int $reference, int $type, ?int $status = ApprovalStatus::PENDING_VERIFICATION)
public function __construct(string $reference, int $type, ?int $status)
{
$this->reference = $reference;
$this->type = $type;
@@ -32,9 +32,9 @@ class OrderObject implements DataTransferObject
}
/**
* @return int
* @return string
*/
public function getReference(): int
public function getReference(): string
{
return $this->reference;
}
@@ -48,12 +48,13 @@ class OrderObject implements DataTransferObject
}
/**
* @return int
* @return int|null
*/
public function getStatus(): int
public function getStatus(): ?int
{
return $this->status;
}
}
@@ -84,7 +84,7 @@ class CreateOrderProcessor
/** @var Order $order */
$order = $this->createsOrder->execute($importer, $orderObject);
$addressObject = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode,$address->reference);
$addressObject = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode, $address->type, ApprovalStatus::APPROVED, $address->reference);
/** @var Address $order_address */
$order_address = $this->createAddress->execute($order, $addressObject);
@@ -8,6 +8,7 @@ use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Addresses\Services\DeletesAddress;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
@@ -76,7 +77,7 @@ class RequestChangeOrderAddressProcessor
}
$address = $this->fetchesAddress->execute(['id' => $request->get('address_id')]);
$addressObject = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode, $address->reference, ApprovalStatus::PENDING_VERIFICATION);
$addressObject = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode, AddressType::DELIVERY, ApprovalStatus::PENDING_VERIFICATION, $address->reference);
$order_address = $this->createsAddress->execute($order, $addressObject);
$contact = $address->contacts()->first();
@@ -3,6 +3,7 @@
namespace App\Classes\Modules\Orders\Processors;
use App\Classes\Exceptions\InternalServerErrorException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\Orders\Services\FetchesDataFromYDPortal;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
@@ -54,6 +55,7 @@ class UpdateDoFromYDPortalProcessor
$reference = $contact ? $contact->reference : null;
$remark = $remark ? $remark->content : 'URGENT!!! PLEASE CALL BEFORE ONE DAY DELIVERY.';
if(!$phone || !$reference) throw new MalformedRequestException('Can\'t release this packing list because it doesn\'t have the person in charge contact information');
$this->fetchesDataFRomYDPortal->clientRequest(
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
'POST',
@@ -21,7 +21,7 @@ class ChecksIfOrderNumberExists
$this->repository = $repository;
}
public function execute(int $orderNumber): bool {
public function execute(string $orderNumber): bool {
return $this->repository->where('reference', $orderNumber)->exists();
}
@@ -14,12 +14,11 @@ class FetchesDataFromYDPortal
* @return \Psr\Http\Message\ResponseInterface
*/
public function clientRequest(string $url, string $method, $body){
$client = new \GuzzleHttp\Client();
$client = new \GuzzleHttp\Client();
$body['apicode'] = env('YD_API_CODE');
$request = $client->requestAsync($method, $url, ['query' => $body]);
$request = $client->requestAsync($method, $url, ['query' => $body, 'timeout' => 15]);
return $request->wait();
}
@@ -32,6 +31,7 @@ class FetchesDataFromYDPortal
$content = $request->getBody()->getContents();
$content = str_replace("\r",'', $content);
$content = str_replace("\n",'', $content);
$content = str_replace("\t",'', $content);
return json_decode($content);
}
}
}
@@ -20,11 +20,13 @@ class GeneratesOrderNumber
/**
* @return int
* @param null|string $prefix
* @param int|null $length
* @return string
*/
public function execute(): int {
public function execute(?string $prefix = '', ?int $length = 9): string {
$reference = rand(100000001, 999999999);
$reference = $prefix.rand((int)('1'.str_repeat(0, $length - 2).'1'), (int) str_repeat(9, $length));
return !$this->checkIfOrderNumberExists->execute($reference) ? $reference : self::execute();
}
@@ -2,6 +2,7 @@
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Orders\Services\FetchesOrder;
@@ -134,20 +135,25 @@ class AssignPackingListOrderLogic extends AbstractControllerLogic
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
$packing_list = $this->fetchesPackingList->execute([
'reference' => $warehouse_packing_list->reference,
'type' => PackingListType::SHIPPING_PACKING_LIST
]);
try {
$packing_list = $this->fetchesPackingList->execute([
'reference' => $warehouse_packing_list->reference,
'type' => PackingListType::SHIPPING_PACKING_LIST
]);
$warehouse_packing_list = $this->updatesPackingListOwner->execute($packing_list, $order);
$this->updatesPackingListContractReference->execute($packing_list, $contractReference);
$warehouse_packing_list = $this->updatesPackingListOwner->execute($packing_list, $order);
$this->updatesPackingListContractReference->execute($packing_list, $contractReference);
foreach($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packing_list, $stepObject);
}
} catch (ResourceNotFoundException $exception) {
foreach($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packing_list, $stepObject);
}
return $this->resourceResponse(new PackingListResource($warehouse_packing_list));
}
}
@@ -7,6 +7,8 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\DeletesPackingList;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\PackingLists\Standards\Rules\CanDeletePackingList;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\PackingList;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -58,9 +60,9 @@ class DeletePackingListLogic extends AbstractControllerLogic
$this->canDeletePackingList->passes();
$query = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$this->deletesPackingList->execute($query);
PackingList::where('reference', $packingList->reference)->delete();
return $this->response([]);
@@ -7,9 +7,13 @@ use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Schedules\Services\UpdatesScheduleStatus;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Http\Resources\PackingListResource;
use App\Models\Transport;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,6 +21,8 @@ use Carbon\Carbon;
class ReschedulePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
@@ -33,51 +39,57 @@ class ReschedulePackingListLogic extends AbstractControllerLogic
/** @var UpdatesScheduleStatus */
private $updatesScheduleStatus;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatesSchedule */
private $createsSchedule;
/**
* DeleteContainerControllersLogic constructor.
* ReschedulePackingListLogic constructor.
* @param FetchesPackingList $fetchesPackingList
* @param UpdatesScheduleStatus $updatesScheduleStatus
* @param CreatesTransport $createsTransport
* @param CreatesSchedule $createsSchedule
*/
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesScheduleStatus $updatesScheduleStatus, CreatesSchedule $createsSchedule)
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesScheduleStatus $updatesScheduleStatus, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule)
{
$this->fetchesPackingList = $fetchesPackingList;
$this->updatesScheduleStatus = $updatesScheduleStatus;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
try {
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$transport = $packing_list->transports()->first();
$transport = $packing_list->transports()->first();
$old_sechedule = $transport->schedules()->first();
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('eta')),
Carbon::parse($request->input('etd')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new PackingListResource($packing_list));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
if(!$transport) {
$object = new TransportObject(TransportType::LAND, null, '', Carbon::parse($request->input('etd')), Carbon::parse($request->input('eta')),ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($object, $packing_list);
}
$transport->schedules()->update([
'status' => ApprovalStatus::REJECTED
]);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('eta')),
Carbon::parse($request->input('etd')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new PackingListResource($packing_list));
}
}
@@ -6,6 +6,8 @@ namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Services\Packages\CreatesPackage;
use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanCreatePackage;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\Order;
use App\Models\PackingList;
class CreatePackageProcessor
@@ -48,6 +50,11 @@ class CreatePackageProcessor
if($replica) {
$modificationValue = 1;
if($replica->owner->owner instanceof Order){
$modificationValue = in_array( $replica->owner->owner->companyModule->id, WarehouseReferences::REPLICA_WHITE_LIST) ? 0 : 1;
}
$packageObject = new PackageObject($object->getType(), $object->getDescription(), $object->getWidth() + $modificationValue, $object->getHeight() + $modificationValue, $object->getLength() + $modificationValue, $object->getWeight(), $object->getQuantity(), $object->getStatus());
$package = $this->createsPackage->execute($packageObject, $replica);
}
@@ -10,7 +10,10 @@ use App\Classes\Modules\PackingLists\Standards\Rules\CanCreatePackingList;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\Order;
use App\Models\PackingList;
use function PHPUnit\Framework\isInstanceOf;
class CreatePackingListProcessor
{
@@ -48,14 +51,15 @@ class CreatePackingListProcessor
/** @var PackingList $packingList */
$packingList = $this->createsPackingList->execute($object, $packable);
$appointee_id = $packingList->owner_id == 1 ? 2037 : $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
$appointee_id = $packingList->owner_id == 1 ? 2307 : $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
$type = $object->getType() === PackingListType::SHIPPING_PACKING_LIST ? PackingListType::SHIPPING_PACKING_LIST_REPLICA : PackingListType::WAREHOUSE_RECEIVE_LIST_REPLICA;
/** create packing list replica */
$object = new PackingListObject($object->getReference().'_01', $appointee_id, $type, ApprovalStatus::PENDING_SUBMISSION);
$this->createsPackingList->execute($object, $packingList);
return $packingList;
}
}
}
@@ -0,0 +1,160 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Services\FetchesDataFromYDPortal;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Steps\DataTransferObjects\StepsObject;
use App\Classes\Modules\Steps\Services\CreatesStep;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Processors\ActivateContractProcessor;
use App\Classes\Modules\Unity\Processors\AssignContractEntityProcessor;
use App\Classes\Modules\Unity\Processors\CreateContractEntityProcessor;
use App\Classes\Modules\Unity\Services\CreatesContract;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\Notifications\ShipmentDepartureEmail;
use App\Classes\Notifications\ShipmentRescheduleEmail;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\ContainerTypes;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\Container;
use App\Models\Order;
use App\Models\PackingList;
use App\Models\Transport;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class FetchContainersFromYdPortalProcessor
{
/** @var FetchesDataFromYDPortal */
private $fetchesDataFRomYDPortal;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatesSchedule */
private $createsSchedule;
/** @var FetchesContainer */
private $fetchesContainer;
/** @var CreateContainerProcessor */
private $createContainerProcessor;
/**
* @param FetchesDataFromYDPortal $fetchesDataFRomYDPortal
* @param CreatesTransport $createsTransport
* @param CreatesSchedule $createsSchedule
* @param FetchesContainer $fetchesContainer
* @param CreateContainerProcessor $createContainerProcessor
*/
public function __construct(FetchesDataFromYDPortal $fetchesDataFRomYDPortal, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule, FetchesContainer $fetchesContainer, CreateContainerProcessor $createContainerProcessor)
{
$this->fetchesDataFRomYDPortal = $fetchesDataFRomYDPortal;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
$this->fetchesContainer = $fetchesContainer;
$this->createContainerProcessor = $createContainerProcessor;
}
/**
* @return void
* @throws MalformedRequestException
* @throws AccessForbiddenException
* @throws RequestValidationException
*/
public function execute()
{
$packingLists = PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->doesntHave('containers')->get();
foreach ($packingLists as $packingList) {
$time_start = microtime(true);
$containerReference = null;
$loadingDate = null;
$etd = null;
$eta = null;
$trackingRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/ApiTracking.ashx', 'GET', [
'trakingno' => $packingList->reference
]);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
if(!$rows->data){
continue;
}
foreach (array_reverse($rows->data) as $trackingRow) {
if (strpos($trackingRow->tracking, '货物装柜完成。') !== false) {
$tracking = explode(':', $trackingRow->tracking);
$containerReference = explode('预计到港时间', $tracking[1])[0];
$loadingDate = Carbon::parse($trackingRow->trackingtime);
$etd = Carbon::parse($tracking[2])->subDays(5);
$eta = Carbon::parse($tracking[2])->addDays(2);
}
}
if($containerReference) {
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
} catch (ResourceNotFoundException $exception){
if(!($packingList->owner instanceof Order)) continue;
$originWarehouse = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee;
$containerObject = new ContainerObject($containerReference, '', '', ContainerTypes::FORTY_FEET_DRY_CONTAINER, $loadingDate, ApprovalStatus::PENDING_VERIFICATION);
/** @var Container $container */
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$transport = $container->transports()->first();
if(!$transport){
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $container);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
}
}
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo 'successful => <b>Total Execution Time:</b> '.$execution_time.' Mins<br>';
}
}
}
@@ -0,0 +1,162 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\Orders\Services\FetchesDataFromYDPortal;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\Notifications\ShipmentRescheduleEmail;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Models\Container;
use App\Models\Order;
use App\Models\PackingList;
use Carbon\Carbon;
class FetchContainersUpdatesFromYdPortalProcessor
{
/** @var FetchesDataFromYDPortal */
private $fetchesDataFRomYDPortal;
/** @var UpdatesContractObligation */
private $updatesContractObligations;
/** @var CreatesSchedule */
private $createsSchedule;
/**
* @param FetchesDataFromYDPortal $fetchesDataFRomYDPortal
* @param UpdatesContractObligation $updatesContractObligations
* @param CreatesSchedule $createsSchedule
*/
public function __construct(FetchesDataFromYDPortal $fetchesDataFRomYDPortal, UpdatesContractObligation $updatesContractObligations, CreatesSchedule $createsSchedule)
{
$this->fetchesDataFRomYDPortal = $fetchesDataFRomYDPortal;
$this->updatesContractObligations = $updatesContractObligations;
$this->createsSchedule = $createsSchedule;
}
/**
* @return void
* @throws MalformedRequestException
*/
public function execute()
{
$containers = Container::where('status', ApprovalStatus::PENDING_VERIFICATION)->get();
foreach ($containers as $container) {
$time_start = microtime(true);
$packingList = $container->packingLists()->random();
$trackingRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/ApiTracking.ashx', 'GET', [
'trakingno' => $packingList->reference
]);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
if(!$rows->data){
continue;
}
$unstuffingDate = null;
$delayDate = null;
foreach (array_reverse($rows->data) as $trackingRow) {
$rescheduleETD = strpos($trackingRow->remark, '开') || strpos($trackingRow->remark, '到港');
$rescheduleETA = strpos($trackingRow->remark, '到港');
if (($rescheduleETD !== false || $rescheduleETA !== false) && strpos($trackingRow->tracking, '货物装柜完成。') === false) {
preg_match_all('/([0-9]+.{3})/', $trackingRow->remark, $matches);
$dates = collect();
foreach($matches[0] as $date){
try {
$dates->push(Carbon::parse(str_replace('.', '/', $date).Carbon::now()->format('Y')));
} catch (\Exception $exception) {
continue;
}
}
$rescheduleDate = $dates->sortDesc()->first();
if(!$delayDate || $rescheduleDate > $delayDate){
/** @var Carbon $delayDate */
$delayDate = $rescheduleDate;
if($rescheduleETA === false && $delayDate) {
$delayDate = $delayDate->addDays('5');
}
}
}
if ($trackingRow->tracking === '到港') {
$delayDate = Carbon::parse($trackingRow->trackingtime);
}
if ($trackingRow->tracking === '已开船') {
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
}
if ($trackingRow->tracking === '货物已进目的港仓库') {
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
}
}
if($delayDate){
$delayDate = $delayDate->addDays(2);
$transport = $container->transports()->first();
if(!$transport->schedules()->whereDate('eta', '>=', $delayDate)->first()) {
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
foreach ($container->packingLists as $packingList){
if(!($packingList->owner instanceof Order)) continue;
$user = $packingList->owner->companyModule->employees()->first();
if(app()->environment(['production'])) {
$user->notify(new ShipmentRescheduleEmail($user, $packingList));
}
}
}
}
if($unstuffingDate){
$container->update(['status' => ApprovalStatus::COMPLETED]);
$container->transports()->first()->update(['drop_date' => $unstuffingDate, 'status' => ApprovalStatus::COMPLETED]);
/** @var PackingList $packingList */
foreach($container->packingLists as $packingList){
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
}
if(!($packingList->owner instanceof Order)) continue;
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
$step->update(['status' => ApprovalStatus::COMPLETED]);
}
}
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo 'successful => <b>Total Execution Time:</b> '.$execution_time.' Mins<br>';
}
}
}
@@ -91,7 +91,6 @@ class FetchDeliveryListFromVTPortalProcessor
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
} catch (GuzzleException $exception) {
dd($exception);
continue;
}
@@ -0,0 +1,115 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\CompanyModule;
use App\Models\Order;
use App\Models\PackingList;
use App\Models\Transport;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class FetchDeliveryUpdatesFromYdPortalProcessor
{
/** @var UpdatesContractObligation */
private $updatesContractObligations;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatesSchedule */
private $createsSchedule;
/**
* @param UpdatesContractObligation $updatesContractObligations
* @param CreatesTransport $createsTransport
* @param CreatesSchedule $createsSchedule
*/
public function __construct(UpdatesContractObligation $updatesContractObligations, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule)
{
$this->updatesContractObligations = $updatesContractObligations;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
}
/**
* @return void
* @throws MalformedRequestException
* @throws GuzzleException
*/
public function execute()
{
$packingLists = PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->whereRaw('LENGTH(reference) > 12')->whereHas('containers', function ($container){
return $container->where('status', 3);
})->doesntHave('transports')->get()->reverse();
foreach ($packingLists->chunk(50) as $chunk) {
foreach ($chunk as $packingList){
if(!$packingList->reference) continue;
$time_start = microtime(true);
$deliveryDate = null;
try {
$client = new \GuzzleHttp\Client(['cookies' => true, 'headers' => ['Cookie' => 'utc_offset=480']]);
$request = $client->request('get', 'https://main.universe.com.my/Tracking/User/Paging?sEcho=1&sTrackingNo='.$packingList->reference.'&sOrgId=sti', ['timeout' => 3]);
$deliveryTracking = json_decode($request->getBody()->getContents());
foreach (array_reverse($deliveryTracking->aaData) as $trackingRow) {
$trackingDate = Carbon::createFromFormat('d/m/y H:i', $trackingRow->LocalDateTime);
if (Str::contains($trackingRow->PublicDescription, ['delivered'])) {
$deliveryDate = $trackingDate;
}
}
} catch (\Exception $exception){
dump($exception);
Log::debug('failed to fetch delivery tracking');
}
if($deliveryDate){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
$deliveryDate = Carbon::parse($deliveryDate);
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
if(!($packingList->owner instanceof Order)) continue;
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo 'successful => <b>Total Execution Time:</b> '.$execution_time.' Mins<br>';
}
}
}
}
@@ -7,12 +7,15 @@ use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Steps\DataTransferObjects\StepsObject;
use App\Classes\Modules\Steps\Services\CreatesStep;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Processors\ActivateContractProcessor;
use App\Classes\Modules\Unity\Processors\AssignContractEntityProcessor;
@@ -21,10 +24,13 @@ use App\Classes\Modules\Unity\Services\CreatesContract;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\ContainerTypes;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Models\Order;
use App\Models\PackingList;
use App\Models\Transport;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\DB;
@@ -124,9 +130,8 @@ class FetchLoadedContainersFromVTPortalProcessor
*/
public function execute(?Carbon $start = null, ?Carbon $end = null){
DB::beginTransaction();
try {
$start = $start ? $start : Carbon::now()->subDays(10);
$start = $start ? $start : Carbon::today()->subDays(5);
$startLimit = Carbon::parse('11-08-2021');
@@ -134,80 +139,162 @@ class FetchLoadedContainersFromVTPortalProcessor
$start = $startLimit;
}
$end = $end ? $end : Carbon::now();
$end = $end ? $end : Carbon::today()->addDay();
$filter = '["LoadedTime:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$containersRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"LoadedTime asc","Filter":'.$filter.'}}'), '');
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
foreach ($containers->Rows as $container){
$filter = '["ContainerID:=%js%'.$container[11].'"]';
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$filter = '["ContainerID:=%js%'.$container[12].'"]';
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"ParcelInContainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":null,"Filter":'.$filter.'}}'), '');
$containerDetail = $this->fetchesDataFRomVTPortal->getResponseBody($containerDetailRequest);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[15]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[5]), ApprovalStatus::PENDING_VERIFICATION);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[16]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[6]), ApprovalStatus::PENDING_VERIFICATION);
$containerInfo = $container;
try {
$container = $this->fetchesContainer->execute(['reference' => $containerObject->getReference()]);
} catch (ResourceNotFoundException $exception){
$warehouseId = $container[12];
$warehouseId = $container[13];
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
}
$eta = Carbon::parse($containerInfo[4])->addDays(2);
$etd = Carbon::parse($eta)->subDays(7);
$delayDate = $containerInfo[7];
$containerStatus = $containerInfo[10];
$unstuffingDate = $containerInfo[8];
$transport = $container->transports()->first();
if(!$transport || $eta !== $transport->eta){
$container->transports()->delete();
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $container);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
}
if($delayDate){
$delayDate = Carbon::parse($delayDate)->addDays(2);
$transport = $container->transports()->first();
if(!$transport->schedules()->where('eta', '=', $delayDate)->first()) {
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
}
}
if($containerStatus === 'Unstuffing'){
$container->update(['status' => ApprovalStatus::COMPLETED]);
$container->transports()->first()->update(['drop_date' => Carbon::parse($unstuffingDate)->subDay(), 'status' => ApprovalStatus::COMPLETED]);
/** @var PackingList $packingList */
foreach($container->packingLists as $packingList){
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
}
}
}
foreach($containerDetail->Rows as $packingList){
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[13]));
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[39]));
$orderNumber = $marking[array_key_last($marking)];
if(!$packingList[22]){
if(!$packingList[11]){
continue;
}
$allow_contract = true;
try {
/** @var Order $order */
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception){
continue;
$warehousePackingList = $this->fetchesPackingList->execute(['reference' => $packingList[3]]);
if(!$warehousePackingList->owner instanceof Order) throw new ResourceNotFoundException;
$order = $warehousePackingList->owner;
} catch (ResourceNotFoundException $exception) {
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
try {
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
} catch (ResourceNotFoundException $exception) {
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
$allow_contract = false;
}
}
}
$packingListReference = $packingList[16];
try{
$this->fetchesPackingList->execute(['reference' => $packingListReference]);
$packingListReference = $packingList[3];
$package = $packingList;
$deliveryDate = $package[1] ? Carbon::parse($package[1]) : null;
try {
$packingList = $this->fetchesPackingList->execute(['reference' => $packingListReference, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
} catch (ResourceNotFoundException $exception){
$contract = $this->unityCreateContract->execute();
$contractReference = $contract->hash_id;
$contractObligations = $contract->contract_obligation_list;
if ($allow_contract) {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
// $contract = $this->unityCreateContract->execute();
// $contractReference = $contract->hash_id;
// $contractObligations = $contract->contract_obligation_list;
//
// $this->unityActivateContract->execute($contractReference);
//
// $supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
//
// $supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
//
// $importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
//
// $this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
} else {
$appointee_id = 2307;
}
$this->unityActivateContract->execute($contractReference);
$supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
$supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
$importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
$connection = $order->companyModule->connections()->first();
$marking = $connection->invitee_reference;
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, $contractReference);
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, null);
/** @var PackingList $packingList */
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
$container->packingLists()->attach($packingList);
}
foreach($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packingList, $stepObject);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
$packageObject = new PackageObject(PackageType::CARTON, $package[8], $package[21], $package[22], $package[20], 0, $package[11], ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
if($containerStatus === 'Unstuffing'){
$packingList->transports()->delete();
if($deliveryDate) {
// && !$packingList->transports()->exists()
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
}
}
}
@@ -217,8 +304,6 @@ class FetchLoadedContainersFromVTPortalProcessor
Log::error($exception);
}
DB::commit();
return [];
}
@@ -2,6 +2,7 @@
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Services\FetchesDataFromYDPortal;
@@ -23,6 +24,8 @@ use App\Classes\Modules\Unity\Processors\AssignContractEntityProcessor;
use App\Classes\Modules\Unity\Processors\CreateContractEntityProcessor;
use App\Classes\Modules\Unity\Services\CreatesContract;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\Notifications\ShipmentDepartureEmail;
use App\Classes\Notifications\ShipmentRescheduleEmail;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\ContainerTypes;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
@@ -132,305 +135,364 @@ class FetchOrderListsFromYdPortalProcessor
* @param Carbon|null $start
* @param Carbon|null $end
* @return void
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function execute(?Carbon $start = null, ?Carbon $end = null)
{
try {
$start = $start ? $start : Carbon::now()->subMonths(2);
ini_set('max_execution_time', '900');
// $missingOrders = ['M202302161513122', 'YW202302161027442', 'YW202302151637022', 'M202302151605025', 'M202302151527103', 'M202302151527356', 'M202302151556019', 'YW202302151520241', 'YW202302151445068', 'M202302151359169', 'YW202302151349223', 'YW202302151336520', 'M202302151334316', 'YW202302151148129', 'M202302151145379', 'M202302151142411', 'M202302151037036', 'M202302151036398', 'M202302150919406', 'M202302141535009', 'YW202302141532318', 'M202302141319463', 'M202302141319045', 'YW202302141405471', 'M202302141334494', 'YW202302141321569', 'YW202302141323005', 'M202302141309053', 'M202302140905116', 'M202302141039558', 'M202302141022333', 'YW202302140943182', 'YW202302140923485', 'YW202302131728233', 'YW202302131702040', 'M202302131649417', 'M202302131638056', 'YW202302131601110', 'YW202302131530436', 'YW202302131411338', 'YW202302131355161', 'YW202302131312526', 'M202302130859076', 'M202302111708070', 'M202302111455134', 'M202302111457501', 'M202302111444041', 'M202302111506514', 'M202302111440286', 'M202302111354585', 'M202302111055551', 'M202302110900216', 'YW202302101743112', 'M202302091559443', 'M202302101716374', 'M202302101700402', 'M202302101633570', 'M202302101612095', 'M202302101611408', 'M202302101542340', 'M202302101408370', 'M202302101323341', 'M202302101129532', 'M202302101025109', 'M202302101006595', 'M202302091706357', 'YW202302091255022', 'YW202302091448196', 'YW202302091446431', 'M202302091138154', 'M202302091129396', 'YW202302091028175', 'M202302091006545', 'YW202302090942033', 'YW202302081743094', 'M202302081530599', 'M202302081531210', 'M202302081508571', 'YW202302081530492', 'M202302081500361', 'M202302081253105', 'M202302081303370', 'M202302071636303', 'M202302071741187', 'YW202302071735407', 'M202302071706323', 'M202302071537501', 'M202302071538092', 'YW202302071516453', 'M202302071311314', 'M202302071148154', 'YW202302071136018', 'M202302071036027', 'M202302071008010', 'M202302061742178', 'M202302061615198', 'M202302061502093', 'M202302061458532', 'M202302061552141', 'M202302061548431', 'M202302061555033', 'YW202302061404567', 'M202302061322463', 'M202302061042556', 'M202302061021277', 'M202302060917276', 'M202302041551570', 'M202302041552382', 'YW202302041515257', 'M202302041405502', 'M202302041030185', 'YW202302041215576', 'YW202302041058469', 'YW202302041024459', 'YW202302040939568', 'M202302031701053', 'M202302031700316', 'M202302031430562', 'M202302031431535', 'M202302031147213', 'YW202302031406529', 'YW202302031322256', 'M202302021718554', 'M202302021417415', 'YW202302021404542', 'M202302021055324', 'YW202302021037462', 'M202302011613381', 'M202302011347586', 'M202302011348245', 'M202301151635132', 'M202301141803516', 'YW202301141653536', 'M202301131504477', 'M202301131538220', 'M202301121327453', 'YW202301111153183', 'M202301091649543', 'M202212311641071', 'YW202212211532191', 'YW202212191605226'];
$startLimit = Carbon::parse('01-12-2021');
$from = $end ? Carbon::today()->diff($end)->days : 0;
$to = $start ? Carbon::today()->diff($start)->days : 10;
if($start->isBefore($startLimit)){
$start = $startLimit;
}
for ($x = $from; $x <= $to; $x++) {
try {
$startDate = Carbon::today()->subDays($x);
$end = $end ? $end : Carbon::now();
$startLimit = Carbon::parse('01-12-2021');
$orderRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/GetOrderList.ashx', 'GET', [
'begintime' => $start->timestamp,
'endtime' => $end->timestamp,
]);
if($startDate->isBefore($startLimit)){
$startDate = $startLimit;
}
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
$endDate = Carbon::today()->subDays($x - 1);
foreach($rows->data as $row){
$containerReference = null;
$loadingDate = null;
$unstuffingDate = null;
$deliveryDate = null;
$etd = null;
$eta = null;
$delayDate = null;
$trackingRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/ApiTracking.ashx', 'GET', [
'trakingno' => $row->expressno
$orderRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/GetOrderList.ashx', 'GET', [
'begintime' => $startDate->timestamp,
'endtime' => $endDate->timestamp,
]);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
if(!$rows){
Log::debug($row->expressno);
continue;
}
if(!$rows->data) continue;
foreach (array_reverse($rows->data) as $trackingRow) {
if ($trackingRow->tracking === '货物已送达仓库准备入库中') {
$receiveDate = Carbon::parse($trackingRow->trackingtime);
}
foreach($rows->data as $row){
$time_start = microtime(true);
if (strpos($trackingRow->tracking, '货物装柜完成。') !== false) {
$tracking = explode(':', $trackingRow->tracking);
$containerReference = explode('预计到港时间', $tracking[1])[0];
$loadingDate = Carbon::parse($trackingRow->trackingtime);
$etd = Carbon::parse($tracking[2])->subDays(5);
$eta = Carbon::parse($tracking[2]);
}
$containerReference = null;
$loadingDate = null;
$unstuffingDate = null;
$deliveryDate = null;
$etd = null;
$eta = null;
$delayDate = null;
$status = $row->status;
$rescheduleETD = strpos($trackingRow->remark, '开') || strpos($trackingRow->remark, '到港');
$rescheduleETA = strpos($trackingRow->remark, '到港');
if (($rescheduleETD !== false || $rescheduleETA !== false) && strpos($trackingRow->tracking, '货物装柜完成。') === false) {
preg_match_all('/([0-9]+.{3})/', $trackingRow->remark, $matches);
$dates = collect();
foreach($matches[0] as $date){
try {
$dates->push(Carbon::parse(str_replace('.', '/', $date).Carbon::now()->format('Y')));
} catch (\Exception $exception) {
continue;
}
}
$rescheduleDate = $dates->sortDesc()->first();
if(!$delayDate || $rescheduleDate > $delayDate){
/** @var Carbon $delayDate */
$delayDate = $rescheduleDate;
if($rescheduleETA === false && $delayDate) {
$delayDate = $delayDate->addDays('5');
}
}
}
if ($trackingRow->tracking === '已开船') {
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
}
if ($trackingRow->tracking === '货物已进目的港仓库') {
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
}
if (Str::contains($trackingRow->tracking, ['派送中'])) {
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
}
}
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
$orderNumber = $customerno[array_key_last($customerno)];
$allow_contract = true;
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
try {
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
} catch (ResourceNotFoundException $exception) {
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
$allow_contract = false;
}
}
DB::beginTransaction();
$packingListReference = $row->expressno;
try{
$packingList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
$warehouseReceiveList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::WAREHOUSE_RECEIVE_LIST]);
$warehouseReceiveList->packages()->delete();
$replica = $warehouseReceiveList->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
} catch (ResourceNotFoundException $exception) {
if (!$allow_contract) {
$appointee_id = 2037;
} else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
}
$warehouseReceiveObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
/** @var PackingList $warehouseReceiveList */
$warehouseReceiveList = $this->createPackingListProcessor->execute($warehouseReceiveObject, $order);
$transportObject = new TransportObject(TransportType::LAND, null, $row->kuaidilist, Carbon::parse($receiveDate), Carbon::parse($receiveDate), $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
$transport = $this->createsTransport->execute($transportObject, $warehouseReceiveList);
if ($allow_contract) {
$contract = $this->unityCreateContract->execute();
$contractReference = $contract->hash_id;
$contractObligations = $contract->contract_obligation_list;
$this->unityActivateContract->execute($contractReference);
$supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
$supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
$importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
}
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, !$allow_contract ? null : $contractReference);
/** @var PackingList $packingList */
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
if ($allow_contract) {
foreach ($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packingList, $stepObject);
}
}
}
foreach($row->deliverysize as $package) {
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $package->width, (float) $package->height, (float) $package->length, 0, (float) $package->num, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if(!count($row->deliverysize)){
$measurement = round(((float) $row->volume / (float) $row->goodcount) ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $measurement, (float) $measurement, (float) $measurement, 0, (float) $row->goodcount, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
$weightCbm = (float) $row->weight / 500;
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
if($overWeightCbm > 0){
$measurement = round($overWeightCbm ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::OVER_WEIGHT, 'Overweight CBM', (float) $measurement, (float) $measurement, (float) $measurement, 0, 1, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if($order instanceof Order){
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
if(!in_array($marking, ['2192KAA', '2353GFE', '6866DTR', '153DSR', '1291NSC', '8288MIB'])){
$this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/confirmsendorder.ashx', 'GET', [
'expressno' => $row->expressno
if($status >= 3){
$trackingRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/ApiTracking.ashx', 'GET', [
'trakingno' => $row->expressno
]);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
if(!$rows){
continue;
}
foreach (array_reverse($rows->data) as $trackingRow) {
if ($trackingRow->tracking === '货物已送达仓库准备入库中') {
$receiveDate = Carbon::parse($trackingRow->trackingtime);
}
if (strpos($trackingRow->tracking, '货物装柜完成。') !== false) {
$tracking = explode(':', $trackingRow->tracking);
$containerReference = explode('预计到港时间', $tracking[1])[0];
$loadingDate = Carbon::parse($trackingRow->trackingtime);
$etd = Carbon::parse($tracking[2])->subDays(5);
$eta = Carbon::parse($tracking[2])->addDays(2);
}
$rescheduleETD = strpos($trackingRow->remark, '开') || strpos($trackingRow->remark, '到港');
$rescheduleETA = strpos($trackingRow->remark, '到港');
if (($rescheduleETD !== false || $rescheduleETA !== false) && strpos($trackingRow->tracking, '货物装柜完成。') === false) {
preg_match_all('/([0-9]+.{3})/', $trackingRow->remark, $matches);
$dates = collect();
foreach($matches[0] as $date){
try {
$dates->push(Carbon::parse(str_replace('.', '/', $date).Carbon::now()->format('Y')));
} catch (\Exception $exception) {
continue;
}
}
$rescheduleDate = $dates->sortDesc()->first();
if(!$delayDate || $rescheduleDate > $delayDate){
/** @var Carbon $delayDate */
$delayDate = $rescheduleDate;
if($rescheduleETA === false && $delayDate) {
$delayDate = $delayDate->addDays('5');
}
}
}
if ($trackingRow->tracking === '到港') {
$delayDate = Carbon::parse($trackingRow->trackingtime);
}
if ($trackingRow->tracking === '已开船') {
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
}
if ($trackingRow->tracking === '货物已进目的港仓库') {
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
}
if (Str::contains($trackingRow->tracking, ['派送中', '已签收', '签收完成', ' 第三方提货', '货物已派送完成', '派送', 'delivery', 'delivered'])) {
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
}
}
}
}
if($status >= 5){
$client = new \GuzzleHttp\Client(['cookies' => true, 'headers' => ['Cookie' => 'utc_offset=480']]);
try {
$request = $client->request('get', 'https://main.universe.com.my/Tracking/User/Paging?sEcho=1&sTrackingNo='.$row->expressno.'&sOrgId=sti');
$deliveryTracking = json_decode($request->getBody()->getContents());
foreach (array_reverse($deliveryTracking->aaData) as $trackingRow) {
$trackingDate = Carbon::createFromFormat('d/m/y H:i', $trackingRow->LocalDateTime);
if (Str::contains($trackingRow->PublicDescription, ['accepted/picked'])){
$unstuffingDate = $trackingDate;
}
if (Str::contains($trackingRow->PublicDescription, ['delivered'])) {
$deliveryDate = $trackingDate;
}
}
} catch (\Exception $exception){
Log::debug('failed to fetch delivery tracking');
}
}
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
$orderNumber = $customerno[array_key_last($customerno)];
$allow_contract = true;
if($containerReference) {
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
} catch (ResourceNotFoundException $exception){
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
try {
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
} catch (ResourceNotFoundException $exception) {
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
$allow_contract = false;
}
}
$packingListReference = $row->expressno;
try{
$packingList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
$warehouseReceiveList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::WAREHOUSE_RECEIVE_LIST]);
$warehouseReceiveList->packages()->delete();
$replica = $warehouseReceiveList->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
} catch (ResourceNotFoundException $exception) {
if (!$allow_contract) {
$appointee_id = 2037;
}
else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id;
$appointee_id = 2307;
} else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
}
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $appointee_id]);
$warehouseReceiveObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
$containerObject = new ContainerObject($containerReference, '', '', ContainerTypes::FORTY_FEET_DRY_CONTAINER, $loadingDate, ApprovalStatus::PENDING_VERIFICATION);
/** @var Container $container */
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
/** @var PackingList $warehouseReceiveList */
$warehouseReceiveList = $this->createPackingListProcessor->execute($warehouseReceiveObject, $order);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$transportObject = new TransportObject(TransportType::LAND, null, $row->kuaidilist, Carbon::parse($receiveDate), Carbon::parse($receiveDate), $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
$transport = $this->createsTransport->execute($transportObject, $warehouseReceiveList);
$transport = $container->transports()->first();
if ($allow_contract) {
if(!$transport){
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $container);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
}
}
$contract = $this->unityCreateContract->execute();
if($delayDate){
$contractReference = $contract->hash_id;
$contractObligations = $contract->contract_obligation_list;
$transport = $container->transports()->first();
$this->unityActivateContract->execute($contractReference);
if(!$transport->schedules()->whereDate('eta', '>=', $delayDate)->first()) {
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
$supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
$supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
$importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
}
}
if($unstuffingDate && $container->status !== ApprovalStatus::COMPLETED){
$container->update(['status' => ApprovalStatus::COMPLETED]);
$container->transports()->first()->update(['drop_date' => $unstuffingDate, 'status' => ApprovalStatus::COMPLETED]);
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, !$allow_contract ? null : $contractReference);
/** @var PackingList $packingList */
foreach($container->packingLists as $packingList){
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
}
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
$step->update(['status' => ApprovalStatus::COMPLETED]);
if ($allow_contract) {
foreach ($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packingList, $stepObject);
}
}
}
foreach($row->deliverysize as $package) {
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $package->width, (float) $package->height, (float) $package->length, 0, (float) $package->num, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if(!count($row->deliverysize)){
$measurement = round(((float) $row->volume / (float) $row->goodcount) ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $measurement, (float) $measurement, (float) $measurement, 0, (float) $row->goodcount, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
$weightCbm = (float) $row->weight / 500;
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
if($overWeightCbm > 0){
$measurement = round($overWeightCbm ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::OVER_WEIGHT, 'Overweight CBM', (float) $measurement, (float) $measurement, (float) $measurement, 0, 1, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if($order instanceof Order){
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
if(!in_array($marking, ['1290CSW', '8997ITB', '3992WHE', '962LOW', '1152AAT'])){
$this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/confirmsendorder.ashx', 'GET', [
'expressno' => $row->expressno
]);
}
}
if($containerReference) {
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
} catch (ResourceNotFoundException $exception){
if (!$allow_contract) {
$appointee_id = 2307;
}
else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id;
}
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $appointee_id]);
$containerObject = new ContainerObject($containerReference, '', '', ContainerTypes::FORTY_FEET_DRY_CONTAINER, $loadingDate, ApprovalStatus::PENDING_VERIFICATION);
/** @var Container $container */
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$transport = $container->transports()->first();
if(!$transport){
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $container);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
}
}
if($delayDate){
$delayDate = $delayDate->addDays(2);
$transport = $container->transports()->first();
if(!$transport->schedules()->whereDate('eta', '>=', $delayDate)->first()) {
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
foreach ($container->packingLists as $packingList){
if(!($packingList->owner instanceof Order)) continue;
$user = $packingList->owner->companyModule->employees()->first();
if(app()->environment(['production'])) {
$user->notify(new ShipmentRescheduleEmail($user, $packingList));
}
}
}
}
if($unstuffingDate && $container->status !== ApprovalStatus::COMPLETED){
$container->update(['status' => ApprovalStatus::COMPLETED]);
$container->transports()->first()->update(['drop_date' => $unstuffingDate, 'status' => ApprovalStatus::COMPLETED]);
/** @var PackingList $packingList */
foreach($container->packingLists as $packingList){
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
}
if ($allow_contract) {
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
$step->update(['status' => ApprovalStatus::COMPLETED]);
}
}
}
}
}
if($deliveryDate && !$packingList->transports()->exists()){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
$deliveryDate = Carbon::parse($deliveryDate);
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
if ($allow_contract) {
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
}
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo '<b>Total Execution Time:</b> '.$execution_time.' Mins';
echo 'successful';
}
if($deliveryDate && !$packingList->transports()->exists()){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
$deliveryDate = Carbon::parse($deliveryDate);
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
}
DB::commit();
echo 'successful';
} catch (\Exception $exception) {
Log::debug($exception);
}
} catch (\Exception $exception) {
Log::debug($exception);
}
}
}
@@ -46,42 +46,31 @@ class FetchPackingListFromVTPortalProcessor
*/
public function execute(){
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])->whereDoesntHave('containers', function($query){
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->where('reference', 'not like', '%PO%')->whereIn('claimant_id', [2])->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])->whereDoesntHave('containers', function($query){
$query->where('status', '=', ApprovalStatus::COMPLETED);
})->get();
})->limit(10)->get();
DB::beginTransaction();
foreach($packingLists as $packingList){
try {
$filter = '["PoID:=%js%'.$packingList->reference.'"]';
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Po","view":"grid1","request":{"PageIndex":-1,"PageSize":1000,"Filter":'.$filter.'}}'), '');
$shippingPackingLists = $this->fetchesDataFRomVTPortal->getResponseBody($shippingPackingListsRequest);
if(count($shippingPackingLists->Rows)) {
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
foreach($shippingPackingLists->Rows as $shippingPackingList){
if(!$shippingPackingList[22]) {
continue;
}
$packageObject = new PackageObject(PackageType::CARTON, $shippingPackingList[19], $shippingPackingList[31], $shippingPackingList[30], $shippingPackingList[29], 0, $shippingPackingList[22], ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
} else {
dump($packingList->reference);
}
} catch (GuzzleException $exception) {
Log::error($exception);
continue;
}
}
DB::commit();
return [];
@@ -0,0 +1,267 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Services\FetchesDataFromYDPortal;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Steps\DataTransferObjects\StepsObject;
use App\Classes\Modules\Steps\Services\CreatesStep;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Processors\ActivateContractProcessor;
use App\Classes\Modules\Unity\Processors\AssignContractEntityProcessor;
use App\Classes\Modules\Unity\Processors\CreateContractEntityProcessor;
use App\Classes\Modules\Unity\Services\CreatesContract;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Models\Order;
use App\Models\PackingList;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class FetchPackingListsFromYdPortalProcessor
{
/** @var FetchesDataFromYDPortal */
private $fetchesDataFRomYDPortal;
/** @var FetchesOrder */
private $fetchesOrder;
/** @var CreatePackingListProcessor */
private $createPackingListProcessor;
/** @var CreatePackageProcessor */
private $createPackageProcessor;
/** @var CreatesTransport */
private $createsTransport;
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatesContract */
private $unityCreateContract;
/** @var AssignContractEntityProcessor */
private $unityAssignContractEntity;
/** @var CreateContractEntityProcessor */
private $unityCreateContractEntity;
/** @var CreatesStep */
private $createsStep;
/** @var ActivateContractProcessor */
private $unityActivateContract;
/**
* @param FetchesDataFromYDPortal $fetchesDataFRomYDPortal
* @param FetchesOrder $fetchesOrder
* @param CreatePackingListProcessor $createPackingListProcessor
* @param CreatePackageProcessor $createPackageProcessor
* @param CreatesTransport $createsTransport
* @param FetchesPackingList $fetchesPackingList
* @param FetchesCompanyModule $fetchesCompanyModule
* @param CreatesContract $unityCreateContract
* @param AssignContractEntityProcessor $unityAssignContractEntity
* @param CreateContractEntityProcessor $unityCreateContractEntity
* @param CreatesStep $createsStep
* @param ActivateContractProcessor $unityActivateContract
*/
public function __construct(FetchesDataFromYDPortal $fetchesDataFRomYDPortal, FetchesOrder $fetchesOrder, CreatePackingListProcessor $createPackingListProcessor, CreatePackageProcessor $createPackageProcessor, CreatesTransport $createsTransport, FetchesPackingList $fetchesPackingList, FetchesCompanyModule $fetchesCompanyModule, CreatesContract $unityCreateContract, AssignContractEntityProcessor $unityAssignContractEntity, CreateContractEntityProcessor $unityCreateContractEntity, CreatesStep $createsStep, ActivateContractProcessor $unityActivateContract)
{
$this->fetchesDataFRomYDPortal = $fetchesDataFRomYDPortal;
$this->fetchesOrder = $fetchesOrder;
$this->createPackingListProcessor = $createPackingListProcessor;
$this->createPackageProcessor = $createPackageProcessor;
$this->createsTransport = $createsTransport;
$this->fetchesPackingList = $fetchesPackingList;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->unityCreateContract = $unityCreateContract;
$this->unityAssignContractEntity = $unityAssignContractEntity;
$this->unityCreateContractEntity = $unityCreateContractEntity;
$this->createsStep = $createsStep;
$this->unityActivateContract = $unityActivateContract;
}
/**
* @param Carbon|null $start
* @param Carbon|null $end
* @return void
* @throws GuzzleException
*/
public function execute(?Carbon $start = null, ?Carbon $end = null)
{
$from = $end ? Carbon::today()->diff($end)->days : 0;
$to = $start ? Carbon::today()->diff($start)->days : 10;
for ($x = $from; $x <= $to; $x++) {
try {
$startDate = Carbon::today()->subDays($x);
$startLimit = Carbon::parse('01-12-2021');
if($startDate->isBefore($startLimit)){
$startDate = $startLimit;
}
$endDate = Carbon::today()->subDays($x - 1);
$orderRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/GetOrderList.ashx', 'GET', [
'begintime' => $startDate->timestamp,
'endtime' => $endDate->timestamp,
]);
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
if(!$rows->data) continue;
foreach($rows->data as $row){
$time_start = microtime(true);
$receiveDate = Carbon::parse(substr(preg_replace("/[^0-9]/", "", $row->expressno), 0, 8));
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
$orderNumber = $customerno[array_key_last($customerno)];
$allow_contract = true;
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
try {
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
} catch (ResourceNotFoundException $exception) {
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
$allow_contract = false;
}
}
$packingListReference = $row->expressno;
try{
$packingList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
$warehouseReceiveList = $this->fetchesPackingList->execute(['reference' => $row->expressno, 'type' => PackingListType::WAREHOUSE_RECEIVE_LIST]);
$warehouseReceiveList->packages()->delete();
$replica = $warehouseReceiveList->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST_REPLICA)->first();
if($replica) $replica->packages()->delete();
} catch (ResourceNotFoundException $exception) {
if (!$allow_contract) {
$appointee_id = 2307;
} else {
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
}
$warehouseReceiveObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
/** @var PackingList $warehouseReceiveList */
$warehouseReceiveList = $this->createPackingListProcessor->execute($warehouseReceiveObject, $order);
$transportObject = new TransportObject(TransportType::LAND, null, $row->kuaidilist, Carbon::parse($receiveDate), Carbon::parse($receiveDate), $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
$transport = $this->createsTransport->execute($transportObject, $warehouseReceiveList);
if ($allow_contract) {
$contract = $this->unityCreateContract->execute();
$contractReference = $contract->hash_id;
$contractObligations = $contract->contract_obligation_list;
$this->unityActivateContract->execute($contractReference);
$supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
$supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
$importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
}
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, !$allow_contract ? null : $contractReference);
/** @var PackingList $packingList */
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
if ($allow_contract) {
foreach ($contractObligations as $obligation) {
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
$this->createsStep->execute($packingList, $stepObject);
}
}
}
foreach($row->deliverysize as $package) {
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $package->width, (float) $package->height, (float) $package->length, 0, (float) $package->num, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if(!count($row->deliverysize)){
$measurement = round(((float) $row->volume / (float) $row->goodcount) ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $measurement, (float) $measurement, (float) $measurement, 0, (float) $row->goodcount, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
$weightCbm = (float) $row->weight / 500;
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
if($overWeightCbm > 0){
$measurement = round($overWeightCbm ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::OVER_WEIGHT, 'Overweight CBM', (float) $measurement, (float) $measurement, (float) $measurement, 0, 1, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if($order instanceof Order){
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
if(!in_array($marking, ['1290CSW', '8997ITB', '3992WHE', '962LOW', '1152AAT'])){
$this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/confirmsendorder.ashx', 'GET', [
'expressno' => $row->expressno
]);
}
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo 'successful => <b>Total Execution Time:</b> '.$execution_time.' Mins<br>';
}
} catch (\Exception $exception) {
Log::debug($exception);
}
}
}
}
@@ -116,7 +116,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
try {
$start = $start ? $start : Carbon::now()->subMonth();
$start = $start ? $start : Carbon::today()->subDays(10);
$startLimit = Carbon::parse('11-08-2021');
@@ -124,76 +124,44 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$start = $startLimit;
}
$end = $end ? $end : Carbon::now();
$end = $end ? $end : Carbon::today()->addDay();
$filter = '["ParcelDate:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Parcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$response = $this->fetchesDataFRomVTPortal->getResponseBody($warehouseListRequest);
foreach ($response->Rows as $parcel){
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
$allow_contract = true;
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[11]));
$orderNumber = $marking[array_key_last($marking)];
if(!$parcel[9]){
$quantity = $parcel[16];
if(!$quantity){
continue;
}
if(!$parcel[23] || !$parcel[22] || !$parcel[21]) continue;
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
} catch (ResourceNotFoundException $exception) {
$oldOrder = OldOrders::where('marking', '=', $orderNumber)->first();
if(!$oldOrder){
continue;
}
$customerMarking = str_replace('/', '', str_replace(' ', '', explode('CIEF/', $oldOrder->company->marking)[1]));
$companyModule = CompanyModule::whereHas('inviters', function($query) use ($customerMarking) {
return $query->where('invitee_reference', '=', $customerMarking);
})->first();
if(!$companyModule){
log::error('unknown customer: '.$customerMarking);
continue;
}
if(!$oldOrder->address) {
continue;
}
/** @var Address $address */
$address = $this->createAddressFromOldAddressProcessor->execute($oldOrder->address, $companyModule);
if(!$address){
continue;
}
$warehouseId = $parcel[0];
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$order = $this->createOrderProcessor->execute($companyModule->company, $originWarehouse, $address, $orderNumber);
$order->created_at = Carbon::parse($parcel[1]);
$order->save();
$allow_contract = false;
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
$appointee_id = 2307;
}
$packingListReference = $parcel[17];
$quantity = $parcel[9];
$measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[7];
$tracking = $parcel[6];
$packingListReference = $parcel[0];
// $measurement = round(($parcel[26]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[13];
$tracking = $parcel[37];
$receiveDate = $parcel[1];
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id, PackingListType::WAREHOUSE_RECEIVE_LIST, ApprovalStatus::APPROVED);
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
/** @var PackingList $packingList */
$packingList = $order->packingLists()->where('reference', '=', $packingListReference)->first();
@@ -216,7 +184,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$packingList->packages()->delete();
if($replica) $replica->packages()->delete();
$packageObject = new PackageObject(PackageType::CARTON, $description, $measurement, $measurement, $measurement, 0, $quantity, ApprovalStatus::APPROVED);
$packageObject = new PackageObject(PackageType::CARTON, $description, $parcel[23], $parcel[22], $parcel[21], 0, $quantity, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
} catch (\Exception $exception){
@@ -0,0 +1,63 @@
<?php
namespace App\Classes\Modules\PerfexCRM\DataTransferObjects;
use Illuminate\Http\Request;
use App\Classes\General\Interfaces\DataTransferObject;
class CreateLeadPerfexCRMObject implements DataTransferObject
{
/** @var string */
private $name;
/** @var string */
private $email;
/** @var string */
private $phone;
/** @var string */
private $companyName;
public function __construct(string $name, string $email, string $phone, string $companyName)
{
$this->name = $name;
$this->email = $email;
$this->phone = $phone;
$this->companyName = $companyName;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @return string
*/
public function getPhone(): string
{
return $this->phone;
}
/**
* @return string
*/
public function getCompanyName(): string
{
return $this->companyName;
}
}

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