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..a9b9cb8f 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/ListCompanyModuleInvoicesLogic.php @@ -6,6 +6,7 @@ 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\Companies\Services\FetchesCompanyModule; use App\Classes\Modules\PackingLists\Standards\Rules\CanListPackingLists; use App\Classes\ValueObjects\Constants\DocumentType; use App\Classes\ValueObjects\Constants\TransactionType; @@ -35,16 +36,21 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic /** @var ListsPackingLists */ private $listsPackingLists; + /** @var FetchesCompanyModule */ + private $fetchesCompanyModule; + /** * ListCompanyModuleInvoicesLogic constructor. * @param CanListPackingLists $canListPackingLists * @param ListsPackingLists $listsPackingLists + * @param FetchesCompanyModule $fetchesCompanyModule */ - public function __construct(CanListPackingLists $canListPackingLists, ListsPackingLists $listsPackingLists, ListsTransactions $listsTransactions) + public function __construct(CanListPackingLists $canListPackingLists, ListsPackingLists $listsPackingLists, ListsTransactions $listsTransactions, FetchesCompanyModule $fetchesCompanyModule) { $this->canListPackingLists = $canListPackingLists; $this->listsPackingLists = $listsPackingLists; $this->listsTransactions = $listsTransactions; + $this->fetchesCompanyModule = $fetchesCompanyModule; } @@ -57,12 +63,16 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic */ public function logic(Request $request): JsonResponse { + $companyModule = $this->fetchesCompanyModule->execute(['company_id' => $request->route('id')]); + $filterArray = [ "per_page" => 10, "order_by" => (object)[ "column" => 'id', "DESC" => true, ], + "status_in" => [2], + "receiver" => intval($companyModule->id), "type" => TransactionType::SHIPPING_INVOICE ]; @@ -80,9 +90,9 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic // transaction -> type shipping invoice -> invoice belongs to company id - // transaction + // transaction - // order has packing_list has 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..c2fc1db1 100644 --- a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue @@ -1,7 +1,7 @@