From 503bc9055669c01d29b3642dd3799090b855c5db Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 23 Dec 2022 16:37:06 +0800 Subject: [PATCH 1/3] multiple payment ui --- .../ListCompanyModuleInvoicesLogic.php | 88 +++++++++++++++++++ .../ListCompanyModuleInvoicesController.php | 20 +++++ ...CustomerPaymentBillingSectionComponent.vue | 50 +++++++++++ .../pages/customers/paymentsBilling.blade.php | 4 + resources/views/partials/menu.blade.php | 2 +- routes/company.php | 2 + routes/web.php | 10 ++- 7 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php create mode 100644 app/Http/Controllers/Companies/ListCompanyModuleInvoicesController.php create mode 100644 resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue create mode 100644 resources/views/pages/customers/paymentsBilling.blade.php diff --git a/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php b/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php new file mode 100644 index 00000000..2abc4c23 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php @@ -0,0 +1,88 @@ + 'Retrieved Company Module Invoices', + 'message' => 'You have successfully retrieved a list of Invoices' + ]; + } + + /** @var CanListPackingLists */ + private $canListPackingLists; + + /** @var ListsPackingLists */ + private $listsPackingLists; + + /** + * ListCompanyModuleInvoicesLogic constructor. + * @param CanListPackingLists $canListPackingLists + * @param ListsPackingLists $listsPackingLists + */ + public function __construct(CanListPackingLists $canListPackingLists, ListsPackingLists $listsPackingLists, ListsTransactions $listsTransactions) + { + $this->canListPackingLists = $canListPackingLists; + $this->listsPackingLists = $listsPackingLists; + $this->listsTransactions = $listsTransactions; + } + + + /** + * @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 + { + $filterArray = [ + "per_page" => 10, + "order_by" => (object)[ + "column" => 'id', + "DESC" => true, + ], + "type" => TransactionType::SHIPPING_INVOICE + ]; + + // // dd($request->route('id')); + + // $this->canListPackingLists->passes(); + + // $query = $this->listsPackingLists->execute($filterArray); + + // return $this->collectionResponse(PackingListResource::collection($query)); + + $query = $this->listsTransactions->execute($filterArray); + + return $this->collectionResponse(TransactionResource::collection($query)); + + // transaction -> type shipping invoice -> invoice belongs to company id + + // transaction + + // order has packing_list has transaction + // inside order can find (company_module_id) + } +} diff --git a/app/Http/Controllers/Companies/ListCompanyModuleInvoicesController.php b/app/Http/Controllers/Companies/ListCompanyModuleInvoicesController.php new file mode 100644 index 00000000..86b1f6a8 --- /dev/null +++ b/app/Http/Controllers/Companies/ListCompanyModuleInvoicesController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue new file mode 100644 index 00000000..0c492ba4 --- /dev/null +++ b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue @@ -0,0 +1,50 @@ + + diff --git a/resources/views/pages/customers/paymentsBilling.blade.php b/resources/views/pages/customers/paymentsBilling.blade.php new file mode 100644 index 00000000..6a26871b --- /dev/null +++ b/resources/views/pages/customers/paymentsBilling.blade.php @@ -0,0 +1,4 @@ +@extends('layouts.base_portal') +@section('inner_content') + +@endsection \ No newline at end of file diff --git a/resources/views/partials/menu.blade.php b/resources/views/partials/menu.blade.php index 4b975eb4..05aac613 100644 --- a/resources/views/partials/menu.blade.php +++ b/resources/views/partials/menu.blade.php @@ -122,7 +122,7 @@ style=" fill:#000000;">
-
Payments & Billing
+
Payments & Billing
diff --git a/routes/company.php b/routes/company.php index 37448fe4..14e1572e 100644 --- a/routes/company.php +++ b/routes/company.php @@ -33,4 +33,6 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani }); Route::get('/module/list', 'ListCompanyModulesController@list')->name('module.list'); + + Route::get('/{id}/invoice/list', 'ListCompanyModuleInvoicesController@list')->name('invoice.list'); }); diff --git a/routes/web.php b/routes/web.php index f71292e9..911d9d83 100644 --- a/routes/web.php +++ b/routes/web.php @@ -160,6 +160,12 @@ Route::get('/customer/{marking}/details', function ($marking) { return view('pages.customers.profile_details', ['id' => $id]); })->name('customer.profile.details'); +Route::get('/customer/{marking}/payment-and-billing', function ($marking) { + $connection = CompanyConnection::where('invitee_reference', $marking)->first(); + $id = $connection->invitee->company->id; + return view('pages.customers.paymentsBilling', ['id' => $id]); +})->name('customer.payment-and-billing'); + Route::get('/orders/refresh', function(\Illuminate\Http\Request $request){ $packingLists = \App\Models\PackingList::where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->has('containers')->get(); dd($packingLists); @@ -198,9 +204,9 @@ Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download Route::get('/report/customclearance/{orderid}', 'Reports\CustomcClearanceReportController@download')->name('report.customclearance'); Route::group(['prefix' => 'template', 'as' => 'template.'], function () { - Route::get('/payments-and-billing', function () { + Route::get('/payment-and-billing', function () { return view('pages.templates.paymentsBilling'); - })->name('payments-and-billing'); + })->name('payment-and-billing'); Route::get('/shipping-queue', function () { return view('pages.templates.shippingQueue'); From 851e2e1815fb620b08016e8a9be89e15c6d363c5 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Sat, 24 Dec 2022 16:39:17 +0800 Subject: [PATCH 2/3] multi payment ui --- .../General/Eloquent/Filters/Receiver.php | 20 +++ .../ListCompanyModuleInvoicesLogic.php | 36 +---- ...CustomerPaymentBillingSectionComponent.vue | 137 +++++++++++++++++- .../elements/PaymentsBillingComponents.vue | 2 +- .../pages/customers/paymentsBilling.blade.php | 2 +- routes/company.php | 2 +- routes/web.php | 4 +- 7 files changed, 163 insertions(+), 40 deletions(-) create mode 100644 app/Classes/General/Eloquent/Filters/Receiver.php diff --git a/app/Classes/General/Eloquent/Filters/Receiver.php b/app/Classes/General/Eloquent/Filters/Receiver.php new file mode 100644 index 00000000..a0ecd6eb --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Receiver.php @@ -0,0 +1,20 @@ +where('receiver', '=', $value); + } + +} diff --git a/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php b/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php index 2abc4c23..f8545a4b 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php @@ -4,14 +4,9 @@ namespace App\Classes\Modules\Companies\ControllersLogic; use App\Classes\General\Abstracts\AbstractControllerLogic; -use App\Classes\Modules\PackingLists\Services\ListsPackingLists; use App\Classes\Modules\Transactions\Services\ListsTransactions; -use App\Classes\Modules\PackingLists\Standards\Rules\CanListPackingLists; -use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\TransactionType; -use App\Http\Resources\PackingListResource; use App\Http\Resources\TransactionResource; -use ErrorException; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -29,21 +24,15 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic ]; } - /** @var CanListPackingLists */ - private $canListPackingLists; - - /** @var ListsPackingLists */ - private $listsPackingLists; + /** @var ListsTransactions */ + private $listsTransactions; /** * ListCompanyModuleInvoicesLogic constructor. - * @param CanListPackingLists $canListPackingLists - * @param ListsPackingLists $listsPackingLists + * @param ListsTransactions $listsTransactions */ - public function __construct(CanListPackingLists $canListPackingLists, ListsPackingLists $listsPackingLists, ListsTransactions $listsTransactions) + public function __construct(ListsTransactions $listsTransactions) { - $this->canListPackingLists = $canListPackingLists; - $this->listsPackingLists = $listsPackingLists; $this->listsTransactions = $listsTransactions; } @@ -63,26 +52,15 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic "column" => 'id', "DESC" => true, ], + "status_in" => [2], + "receiver" => intval($request->route('company_module_id')), "type" => TransactionType::SHIPPING_INVOICE ]; - // // dd($request->route('id')); - - // $this->canListPackingLists->passes(); - - // $query = $this->listsPackingLists->execute($filterArray); - - // return $this->collectionResponse(PackingListResource::collection($query)); + // $this->canListTransactions->passes(); $query = $this->listsTransactions->execute($filterArray); return $this->collectionResponse(TransactionResource::collection($query)); - - // transaction -> type shipping invoice -> invoice belongs to company id - - // transaction - - // order has packing_list has transaction - // inside order can find (company_module_id) } } diff --git a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue index 0c492ba4..0e59f9e7 100644 --- a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue @@ -1,14 +1,139 @@