Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into improve-responsive-ui

This commit is contained in:
edmondlang
2021-10-26 13:21:07 +08:00
21 changed files with 453 additions and 93 deletions
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Models\Company;
use Illuminate\Database\Eloquent\Builder;
class DoesNotHaveSegments implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDoesntHave('segments', function ($segment) use ($value) {
$segment->whereIn('id', $value);
});
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Models\Company;
use Illuminate\Database\Eloquent\Builder;
class SegmentsIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('segments', function ($segment) use ($value) {
$segment->whereIn('id', $value);
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithOutTransactions implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDoesntHave('transactions');
}
}
@@ -0,0 +1,25 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\DB;
class WithTotalPayments implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->leftJoin('bookings', 'companies.id', '=', 'bookings.company_id')->rightJoin('transactions', function ($join) {
$join->on('bookings.id', '=', 'transactions.booking_id')->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
})->addSelect(['companies.*', DB::raw('SUM(transactions.amount) as total_payments')])->groupBy(['companies.id']);
}
}
@@ -0,0 +1,24 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use Illuminate\Database\Eloquent\Builder;
class WithoutConfirmedPayments implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDoesntHave('transactions', function($transaction){
return $transaction->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
});
}
}
@@ -80,7 +80,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
$outstanding = $this->calculatesBookingOutstanding->execute($booking);
if($conversionObject->getAmount() > $outstanding) throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.');
if($conversionObject->getAmount() > round($outstanding, 2)) throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.');
$configurations = $this->fetchBookingQuotation->execute($booking->company, $conversionObject);
@@ -68,7 +68,7 @@ class FetchBookingPaymentQuotationLogic extends AbstractControllerLogic
$conversionObject = new CurrencyConversionObject(floatval(str_replace(',', '', $request->input('amount'))), $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, PaymentMethodType::PAYMENT_METHODS[$request->input('payment_method')]);
$outstanding = $this->calculatesBookingOutstanding->execute($booking);
if($conversionObject->getAmount() > $outstanding) throw new MalformedRequestException('Your payment must not be greater than '.$booking->fixedCurrency->short_code.' '. number_format((float)$outstanding, 2, '.', ','));
if($conversionObject->getAmount() > round($outstanding, 2)) throw new MalformedRequestException('Your payment must not be greater than '.$booking->fixedCurrency->short_code.' '. number_format((float)$outstanding, 2, '.', ','));
return $this->response(['data' => $this->generatesBookingQuotation->execute(
$this->fetchBookingQuotation->execute($booking->company, $conversionObject),
+7 -2
View File
@@ -9,6 +9,7 @@ use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Currency;
use App\Models\SegmentConstant;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -24,6 +25,7 @@ class CompanyResource extends JsonResource
*/
public function toArray($request)
{
$lastPayment = $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->orderBy('id', 'DESC')->first();
return [
'id' => $this->id,
'name' => $this->name,
@@ -33,9 +35,11 @@ class CompanyResource extends JsonResource
'status' => (int) $this->status,
'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())),
'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())),
'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->where('users.status', '=', ApprovalStatus::APPROVED)->orderBy('id', 'DESC')->first()),
'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->orderBy('id', 'DESC')->first()),
'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()),
'bookings' => $this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), []),
'total_payments' => (float) $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount'),
'last_payment' => $lastPayment ? $lastPayment->created_at->diffForHumans() : 'No Payments',
'personal_banks' => BankResource::collection($this->banks->where('type', BankAccountType::PERSONAL)),
'recipient_banks' => [
'accounts' => BankResource::collection($this->banks->where('type', BankAccountType::EXTERNAL)),
@@ -46,7 +50,8 @@ class CompanyResource extends JsonResource
'currencies' => $this->when($this->business_type === BusinessType::CURRENCY_VENDOR, function(){
$segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first();
return $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : [];
})
}),
'created_at' => $this->created_at->format('d-m-Y')
];
+13 -1
View File
@@ -12,6 +12,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
/**
* Class Company
@@ -27,11 +30,12 @@ use Illuminate\Support\Collection;
*/
class Company extends AbstractModel implements Documentable
{
use HasRelationships;
use SoftDeletes;
protected $table = 'companies';
protected $dates = ['deleted_at'];
protected $dates = ['deleted_at', 'created_at'];
/**
@@ -90,6 +94,14 @@ class Company extends AbstractModel implements Documentable
return $this->HasMany(Booking::class, 'company_id');
}
/**
* @return hasManyDeep
*/
public function transactions(): hasManyDeep
{
return $this->hasManyDeep(Transaction::class, [Booking::class], ['company_id', 'booking_id'], ['id', 'id']);
}
/**
* @return Builder
*/
+3 -2
View File
@@ -11,6 +11,7 @@
"php": "^7.2.5",
"ext-fileinfo": "*",
"ext-json": "^1.6",
"ext-zip": "*",
"barryvdh/laravel-dompdf": "^0.9.0",
"carlos-meneses/laravel-mpdf": "^2.1",
"fideloper/proxy": "^4.2",
@@ -23,8 +24,8 @@
"rinvex/countries": "^6.1",
"spatie/laravel-activitylog": "^3.14",
"spatie/laravel-permission": "^3.17",
"tymon/jwt-auth": "^1.0",
"ext-zip": "*"
"staudenmeir/eloquent-has-many-deep": "^1.7",
"tymon/jwt-auth": "^1.0"
},
"require-dev": {
"facade/ignition": "^2.0",
+1 -1
View File
@@ -56,7 +56,7 @@ return [
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'strict' => false,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
@@ -101,9 +101,9 @@
</div>
<div class="row">
<div class="col-7">
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) > (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)">
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) > (Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)">
<div class="col">
<div class="alert alert-warning padding-15" role="alert">
<div class="alert alert-warning padding-15" role="alert" v-if="false">
<div class="font-heading fs-12 all-caps bold m-b-15">Can't Complete Your Purchase Order ?</div>
<div class="row m-b-15">
<div class="col">
@@ -123,17 +123,17 @@
<div class="font-heading all-caps fs-12 bold">Total:</div>
</div>
<div class="col-auto text-right">
<div class="font-heading muted"><span v-if="!submitted" class="bold m-r-5" :class="[{'text-danger' : (Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}, {'text-success' : (Math.round((this.poTotal + Number.EPSILON) * 100) / 100).toFixed(2) === (Math.round((this.data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}]">{{(Math.round(( poTotal + Number.EPSILON) * 100) / 100).toFixed(2)}}/</span><span class="text-primary bold m-l-5">{{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}} {{data.fixed_currency.short_code}}</span></div>
<div class="font-heading muted"><span v-if="!submitted" class="bold m-r-5" :class="[{'text-danger' : (Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== (Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)}, {'text-success' : (Math.round((this.poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) === (Math.round((this.data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)}]">{{(Math.round(( poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3)}}/</span><span class="text-primary bold m-l-5">{{(Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)}} {{data.fixed_currency.short_code}}</span></div>
</div>
</div>
<div class="row" v-if="poTotal > 0 && !submitted">
<div class="col">
<div class="row m-b-10">
<div class="col">
<button class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
<button class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== (Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
</div>
</div>
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== data.amount">
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== data.amount">
<div class="col">
<div class="fs-10">** you purchase order will be saved but wont be approved until your <span class="text-danger bold all-caps">purchase order's total</span> matches your <span class="text-success bold all-caps">transfer order's total</span>.</div>
</div>
@@ -211,7 +211,7 @@
this.submit(route('api.transaction.po.create', this.data.id), 'post', this.section, true, true);
},
successHandler(){
if((Math.round((this.poTotal + Number.EPSILON) * 100) / 100).toFixed(2) === (Math.round((this.data.amount + Number.EPSILON) * 100) / 100).toFixed(2)){
if((Math.round((this.poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) === (Math.round((this.data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3)){
this.submitted = true;
}
this.updateList()
@@ -0,0 +1,91 @@
<template>
<div class="row m-b-15 align-items-end">
<div class="col">
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">Marking</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps fs-11">{{this.item.reference}}</div>
</div>
</div>
</div>
<div class="col-3 text-center">
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">Payments</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps fs-11">MYR {{(Math.round((this.item.total_payments + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
</div>
</div>
</div>
<div class="col-2 text-center">
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">Last Payment</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading fs-11">{{this.item.last_payment}}</div>
</div>
</div>
</div>
<div class="col-2 text-center">
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">Bookings</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps fs-11">{{this.item.bookings.length}}</div>
</div>
</div>
</div>
<div class="col-2 text-right">
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">Registered On</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps fs-11">{{this.item.created_at}}</div>
</div>
</div>
</div>
<div class="col-auto">
<a :href="route('customer.profile', item.reference)">
<button type="button" class="btn btn-xs btn-primary fs-11">View</button>
</a>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
data(){
return {
minWidth:{
minWidth:'100px',
},
minWidth150:{
minWidth:'150px',
},
}
},
methods: {
viewCompany() {
this.$root.$emit('viewCompany', this.item);
}
},
mixins: [componentHandler]
}
</script>
@@ -1,40 +0,0 @@
<template>
<div class="row align-items-center m-b-10 parentContainer">
<div class="row w-100 m-0 p-0 ">
<div class="col pull-left mt-2 pr-0">
<div class="font-heading all-caps fs-11">{{this.item.name}}</div>
</div>
<div class="col-2 text-center mt-2">
<div class="font-heading all-caps fs-11">{{this.item.bookings.length}}</div>
</div>
<div class="col-3 text-right pull-right">
<button type="button" @click="viewCompany()" class="btn btn-xs btn-info fs-11"><i class="fa fa-angle-down"></i></button>
<a :href="route('customer.profile', item.reference)">
<button type="button" class="btn btn-xs btn-primary fs-11">View</button>
</a>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
data(){
return {
minWidth:{
minWidth:'100px',
},
minWidth150:{
minWidth:'150px',
},
}
},
methods: {
viewCompany() {
this.$root.$emit('viewCompany', this.item);
}
},
mixins: [componentHandler]
}
</script>
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -33,7 +33,7 @@
<div class="ref">Ref# {{ $invoice_transaction->payment_reference ?? '-' }}</div>
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
<div class="date">Date: {{ $po_order_transaction->booking->created_at }}</div>
<div>&nbsp;</div>
</div>
</td>
@@ -14,7 +14,7 @@
<td class="document-detail">
PO#: {{ $po_order_transaction->bill_no }} <br>
Ref#: {{ $po_order_transaction->payment_reference ?? '-' }} <br>
Date: {{ $po_order_transaction->created_at }}
Date: {{ $po_order_transaction->booking->created_at }}
</td>
</tr>
</table>
+1 -36
View File
@@ -515,42 +515,7 @@
<div class="col-4 p-r-0" v-if="$store.getters.isAdmin">
<div class="row">
<div class="col">
<div class="row tabsContainer">
<div class="col">
<div class="row m-l-0 m-r-0 d-none d-md-flex">
<div class="col">
<div class="row justify-content-end">
<div class="col">
<div class="row fs-12 text-center">
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active">
<div class="row justify-content-center m-b-5">
<div class="col-auto">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="35" height="35"
viewBox="0 0 172 172"
style=" fill:#000000;"><defs><linearGradient x1="99.4375" y1="60.46875" x2="99.4375" y2="79.9585" gradientUnits="userSpaceOnUse" id="color-1_44007_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="72.5625" y1="60.46875" x2="72.5625" y2="79.9585" gradientUnits="userSpaceOnUse" id="color-2_44007_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="16.125" x2="86" y2="157.44988" gradientUnits="userSpaceOnUse" id="color-3_44007_gr3"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="72.69688" y1="16.125" x2="72.69688" y2="157.44988" gradientUnits="userSpaceOnUse" id="color-4_44007_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M99.4375,61.8125c-4.4528,0 -8.0625,3.6097 -8.0625,8.0625c0,4.4528 3.6097,8.0625 8.0625,8.0625c4.4528,0 8.0625,-3.6097 8.0625,-8.0625c0,-4.4528 -3.6097,-8.0625 -8.0625,-8.0625z" fill="url(#color-1_44007_gr1)"></path><path d="M72.5625,61.8125c-4.4528,0 -8.0625,3.6097 -8.0625,8.0625c0,4.4528 3.6097,8.0625 8.0625,8.0625c4.4528,0 8.0625,-3.6097 8.0625,-8.0625c0,-4.4528 -3.6097,-8.0625 -8.0625,-8.0625z" fill="url(#color-2_44007_gr2)"></path><path d="M121.14981,92.23769c3.27606,-5.8265 5.16269,-12.52912 5.16269,-19.67519v-16.125c0,-22.22831 -18.08419,-40.3125 -40.3125,-40.3125c-22.22831,0 -40.3125,18.08419 -40.3125,40.3125v16.125c0,7.14606 1.88931,13.84869 5.16269,19.67519c-15.03387,11.13969 -23.97519,28.76163 -23.97519,47.51231v16.125h118.25v-16.125c0,-18.75069 -8.944,-36.37262 -23.97519,-47.51231zM51.0625,56.4375c0,-19.264 15.6735,-34.9375 34.9375,-34.9375c19.264,0 34.9375,15.6735 34.9375,34.9375v16.125c0,19.264 -15.6735,34.9375 -34.9375,34.9375c-19.264,0 -34.9375,-15.6735 -34.9375,-34.9375zM86,112.875c13.158,0 24.82444,-6.364 32.18819,-16.14381c1.45931,1.09381 2.8595,2.24944 4.18712,3.47225c-8.729,11.46756 -21.96763,18.04656 -36.37531,18.04656c-14.35125,0 -27.74844,-6.69725 -36.378,-18.04387c1.33031,-1.2255 2.7305,-2.38112 4.18981,-3.47494c7.36375,9.77981 19.03288,16.14381 32.18819,16.14381zM139.75,150.5h-13.4375v-5.375h-5.375v5.375h-69.875v-5.375h-5.375v5.375h-13.4375v-10.75c0,-13.28431 4.93425,-25.94781 13.57725,-35.69c9.6535,12.31144 24.39444,19.565 40.17275,19.565c15.8455,0 30.41713,-7.12725 40.17006,-19.56769c8.64569,9.7395 13.57994,22.40569 13.57994,35.69269z" fill="url(#color-3_44007_gr3)"></path><path d="M86,32.25v-5.375c-11.24719,0 -21.69081,6.54138 -26.60625,16.65981l4.83481,2.34887c4.085,-8.40919 12.427,-13.63369 21.77144,-13.63369z" fill="url(#color-4_44007_gr4)"></path></g></g></svg>
</div>
</div>
<div class="row">
<div class="col">
<div class="fs-12 m-t-5 all-caps">Customers</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row no-margin">
<div class="col bg-white padding-25">
<div class="row tabsContainer tabContent" tab-name="customer-list" v-if="$store.getters.isAdmin">
<company-quick-view-section-component></company-quick-view-section-component>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -41,6 +41,11 @@
<div class="text-white all-caps fs-12">Urgent List</div>
</a>
</div>
<div class="col-auto p-r-20" v-if="$store.getters.isAdmin">
<a href="{{route('customers')}}">
<div class="text-white all-caps fs-12">customers</div>
</a>
</div>
<div v-if="$store.getters.isCustomer" class="col-auto p-r-20">
<a href="{{route('banks')}}"><div class="text-white all-caps fs-12">Bank Accounts</div></a>
</div>
+5 -1
View File
@@ -42,9 +42,13 @@ Route::get('/settings', function () {
return view('pages.settings');
})->name('settings');
Route::get('/customers', function () {
return view('pages.customers.index');
})->name('customers');
Route::get('/customer/{marking}', function ($marking) {
$id = \App\Models\Company::where('reference', '=', $marking)->first()->id;
return view('pages.customers', ['id' => $id]);
return view('pages.customers.profile', ['id' => $id]);
})->name('customer.profile');
Route::get('/payments', function () {