mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 20:44:19 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c1343f45a5 | |||
| 503bc90556 |
@@ -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,98 @@
|
||||
<?php
|
||||
|
||||
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;
|
||||
use App\Http\Resources\PackingListResource;
|
||||
use App\Http\Resources\TransactionResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Retrieved Company Module Invoices',
|
||||
'message' => 'You have successfully retrieved a list of Invoices'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanListPackingLists */
|
||||
private $canListPackingLists;
|
||||
|
||||
/** @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, FetchesCompanyModule $fetchesCompanyModule)
|
||||
{
|
||||
$this->canListPackingLists = $canListPackingLists;
|
||||
$this->listsPackingLists = $listsPackingLists;
|
||||
$this->listsTransactions = $listsTransactions;
|
||||
$this->fetchesCompanyModule = $fetchesCompanyModule;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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(['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
|
||||
];
|
||||
|
||||
// // 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)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Companies;
|
||||
|
||||
use App\Classes\Modules\Companies\ControllersLogic\ListCompanyModuleInvoicesLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListCompanyModuleInvoicesController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListCompanyModulesLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListCompanyModuleInvoicesLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div class="row" v-if="company">
|
||||
<div class="col">
|
||||
<p>{{ company }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
company_id: {
|
||||
type: Number,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
section: 'customerPaymentBillingSectionComponent',
|
||||
isLoading: true,
|
||||
company: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pendingQueue () {
|
||||
return this.$store.getters.isInCompleteQueue(this.section);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pendingQueue(inComplete){
|
||||
if(inComplete){
|
||||
this.fetchInvoice();
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$store.dispatch('updateListQueue', {'name': this.section});
|
||||
},
|
||||
methods: {
|
||||
fetchInvoice(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('api.company.invoice.list', this.company_id), 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
|
||||
this.isLoading = false;
|
||||
this.company = response.payload.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,4 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<customer-payment-billing-section-component :company_id={{$id}}></customer-payment-billing-section-component>
|
||||
@endsection
|
||||
File diff suppressed because one or more lines are too long
@@ -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');
|
||||
});
|
||||
|
||||
+8
-2
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user