mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 23:43:58 +00:00
Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0
This commit is contained in:
@@ -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,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class IssuerNot implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('issuer', '!=', $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]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\ControllersLogic;
|
||||
|
||||
use App\Classes\Exceptions\ResourceConflictException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
|
||||
use App\Classes\Modules\Accounts\Processors\GenerateEmailVerificationAttemptProcessor;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
|
||||
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Http\Resources\UserResource;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class AddNewMemberLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
public function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Updated Email',
|
||||
'message' => 'Successfully updated email'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @var AssignEmployeeProcessor
|
||||
*/
|
||||
private $assignEmployeeProcessor;
|
||||
|
||||
/**
|
||||
* @var GenerateEmailVerificationAttemptProcessor
|
||||
*/
|
||||
private $generateEmailVerificationAttemptProcessor;
|
||||
|
||||
/**
|
||||
* AddNewMemberLogic constructor.
|
||||
* @param AssignEmployeeProcessor $assignEmployeeProcessor
|
||||
* @param GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor
|
||||
*/
|
||||
public function __construct(AssignEmployeeProcessor $assignEmployeeProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor)
|
||||
{
|
||||
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
|
||||
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ResourceConflictException
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
try {
|
||||
$user = Auth::user()->replicate();
|
||||
$user->email = $request->input('email');
|
||||
$user->status = ApprovalStatus::PENDING_VERIFICATION;
|
||||
$user->save();
|
||||
} catch (QueryException $exception){
|
||||
throw new ResourceConflictException('Unable to change your email address as it already exists');
|
||||
}
|
||||
|
||||
if($company = Auth::user()->company()->first()){
|
||||
$Object = new EmploymentObject($company, $user);
|
||||
$this->assignEmployeeProcessor->execute($Object);
|
||||
}
|
||||
|
||||
$this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
|
||||
return $this->resourceResponse(new UserResource($user));
|
||||
}
|
||||
}
|
||||
@@ -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),
|
||||
|
||||
@@ -9,19 +9,29 @@ use Carbon\Carbon;
|
||||
|
||||
class CalculatesBookingCurrencyAverageRate
|
||||
{
|
||||
/** @var CalculatesBookingPayableAmount */
|
||||
private $calculatesBookingPayableAmount;
|
||||
|
||||
/**
|
||||
* CalculatesBookingCurrencyAverageRate constructor.
|
||||
* @param CalculatesBookingPayableAmount $calculatesBookingPayableAmount
|
||||
*/
|
||||
public function __construct(CalculatesBookingPayableAmount $calculatesBookingPayableAmount)
|
||||
{
|
||||
$this->calculatesBookingPayableAmount = $calculatesBookingPayableAmount;
|
||||
}
|
||||
|
||||
|
||||
public function execute(Booking $booking, $type){
|
||||
|
||||
if ($type == TransactionType::PAYMENT) {
|
||||
return $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->avg('currency_rate');
|
||||
$totalPayment = $booking->fix_currency_id === 1 ? $booking->transactions()->payments()->complete()->sum('original_amount') :
|
||||
$booking->transactions()->payments()->complete()->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
|
||||
return $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id) / $totalPayment;
|
||||
|
||||
}
|
||||
else if ($type == TransactionType::BILL) {
|
||||
return $booking->transactions()
|
||||
->where('type', TransactionType::BILL)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->avg('currency_rate');
|
||||
return $booking->transactions()->bills()->complete()->sum('original_amount') / $booking->transactions()->bills()->complete()->sum('amount');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,12 @@ final class RoleTypes
|
||||
|
||||
public const USER = 3;
|
||||
|
||||
public const CURRENCY_SUPPLIER = 4;
|
||||
|
||||
public const MONEY_MULE = 5;
|
||||
|
||||
public const ORIGIN_ACCOUNT_ADMIN = 6;
|
||||
|
||||
public const DESTINATION_ACCOUNT_ADMIN = 7;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Companies;
|
||||
|
||||
use App\Classes\Modules\Accounts\ControllersLogic\AddNewMemberLogic;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class AddNewMemberController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param AddNewMemberLogic $execute
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, AddNewMemberLogic $execute) : JsonResponse
|
||||
{
|
||||
return $execute->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,17 @@
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompanyServices;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\BankAccountType;
|
||||
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;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CompanyResource extends JsonResource
|
||||
{
|
||||
@@ -21,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,
|
||||
@@ -30,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($this->employees->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()),
|
||||
'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)),
|
||||
@@ -43,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')
|
||||
|
||||
|
||||
];
|
||||
|
||||
@@ -21,6 +21,7 @@ class TransactionResource extends JsonResource
|
||||
'booking' => new BookingResource($this->booking),
|
||||
'type' => (int) $this->type,
|
||||
'bill_no' => $this->bill_no,
|
||||
'recipient_bank_account' => new BankResource($this->when((int) $this->type === TransactionType::BILL,$this->booking->bank)),
|
||||
'amount' => (double) $this->amount,
|
||||
'original_amount' => (double) $this->original_amount,
|
||||
'currency' => new CurrencyResource($this->currency),
|
||||
|
||||
+13
-1
@@ -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
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,8 @@ use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
|
||||
@@ -24,6 +26,14 @@ class Transaction extends AbstractModel implements Documentable
|
||||
return $this->BelongsTo( Booking::class, 'booking_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function recipientBankAccount(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo(Bank::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
|
||||
@@ -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,6 +24,7 @@
|
||||
"rinvex/countries": "^6.1",
|
||||
"spatie/laravel-activitylog": "^3.14",
|
||||
"spatie/laravel-permission": "^3.17",
|
||||
"staudenmeir/eloquent-has-many-deep": "^1.7",
|
||||
"tymon/jwt-auth": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
+1
-1
@@ -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'),
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="row m-b-5">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Bank In Amount</div>
|
||||
<div class="font-heading fs-14">
|
||||
<span class="text-success bold">{{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}} {{item.original_currency.short_code}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10 bold">{{item.recipient_bank_account.holder_name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10 bold">{{item.recipient_bank_account.bank_name}}<span class="m-l-5">({{item.recipient_bank_account.bank_branch}})</span>: <span class="text-primary">{{item.recipient_bank_account.account_no.replace(/[^\dA-Z]/g, '').replace(/(.{4})/g, '$1 ').trim()}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
props: {
|
||||
section: {
|
||||
default: 'banksSection'
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -40,13 +40,13 @@
|
||||
<div class="font-heading fs-10 muted all-caps">Payable Amount</div>
|
||||
<div class="font-heading fs-11 text-success bold">{{this.item.amount}} {{this.item.fixed_currency.short_code}}</div>
|
||||
</div>
|
||||
<div class="col-auto" v-if="!$store.getters.isAdmin">
|
||||
<div class="col-auto" v-if="$store.getters.isCustomer">
|
||||
<div class="font-heading fs-10 muted all-caps">status</div>
|
||||
<div class="font-heading fs-8 all-caps text-master btn-rounded p-l-10 p-r-10 lh-15 mt-1" :class="[{'bg-warning': item.status !== 3}, {'bg-success': item.status === 3} ]">
|
||||
{{item.status === 3 ? 'Complete' : 'In Progress'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto hide" :class="[{'invisible': !item.service.configurations.billable}]" v-if="!$store.getters.isAdmin">
|
||||
<div class="col-auto hide" :class="[{'invisible': !item.service.configurations.billable}]" v-if="$store.getters.isCustomer">
|
||||
<div class="font-heading fs-10 muted all-caps">Billing</div>
|
||||
<div class="font-heading fs-8 all-caps text-danger btn-rounded bg-master-lightest p-l-10 p-r-10 lh-15 mt-1">
|
||||
Pending...
|
||||
|
||||
@@ -3,53 +3,50 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row align-items-center pointer parentContainer" >
|
||||
<div class="col p-t-5 p-b-5">
|
||||
<div class="row">
|
||||
<div class="row parentContainer m-b-10">
|
||||
<div class="col">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Reference</div>
|
||||
<a :href="route('booking.details', item.booking.marking)">
|
||||
<div class="font-heading fs-10">
|
||||
{{item.booking.marking}}
|
||||
<div class="row m-b-10">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Date</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.updated_at}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Reference</div>
|
||||
<a :href="$store.getters.isAdmin ? route('booking.details', item.booking.marking): '#'">
|
||||
<div class="font-heading fs-10">
|
||||
{{item.booking.marking}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Marking</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.booking.company.reference}}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Date</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.updated_at}}
|
||||
</div>
|
||||
<bank-in-component :data="item"></bank-in-component>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Marking</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.booking.company.reference}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Currency</div>
|
||||
<div class="font-heading fs-10">
|
||||
<span class="flag-icon" :class="'flag-icon-'+item.original_currency.country.short_code.toLowerCase()"></span> {{item.original_currency.short_code}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Amount</div>
|
||||
<div class="font-heading fs-12 text-success bold">
|
||||
{{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-5 p-r-5 bg-success requestModal pointer" data-type="paymentProofModal">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 b-a b-dashed b-success requestModal pointer" @click="selectedID(item.id)" data-type="paymentProofModal">
|
||||
<div class="row align-item-center justify-content-center h-100">
|
||||
<div class="col-auto" >
|
||||
<div class="row align-items-center h-100">
|
||||
<div class="col">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="30" height="30"
|
||||
width="40" height="40"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><defs><linearGradient x1="86" y1="70.76994" x2="86" y2="116.46013" gradientUnits="userSpaceOnUse" id="color-1_52139_gr1"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="61.8125" y1="34.48869" x2="61.8125" y2="144.97181" gradientUnits="userSpaceOnUse" id="color-2_52139_gr2"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="130.34375" y1="34.48869" x2="130.34375" y2="144.97181" gradientUnits="userSpaceOnUse" id="color-3_52139_gr3"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="86" y1="32.25" x2="86" y2="148.71013" gradientUnits="userSpaceOnUse" id="color-4_52139_gr4"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></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="M102.45825,99.43213h-5.70825c-1.4835,0 -2.6875,1.16637 -2.6875,2.65256v8.10013c0,1.48081 -1.19862,2.68481 -2.67944,2.68481h-10.76612c-1.48081,0 -2.67944,-1.204 -2.67944,-2.68481v-8.10013c0,-1.48619 -1.204,-2.65256 -2.6875,-2.65256h-5.70825c-1.93769,0 -3.04225,-2.39188 -1.88125,-4.05275l14.577,-20.855c1.8275,-2.61494 5.69481,-2.61763 7.52231,-0.00538l14.577,20.86306c1.16369,1.66088 0.05644,4.05006 -1.87856,4.05006z" fill="url(#color-1_52139_gr1)"></path><path d="M51.0625,67.1875h5.375c0,-8.0625 7.23206,-16.12231 16.125,-16.12231v-5.375c-11.85456,0 -21.5,10.74731 -21.5,21.49731z" fill="url(#color-2_52139_gr2)"></path><path d="M139.75,80.625c0,-10.75 -8.44144,-18.80981 -18.8125,-18.80981v5.375c7.40944,0 13.4375,5.37231 13.4375,13.43481z" fill="url(#color-3_52139_gr3)"></path><path d="M148.09738,92.27263c1.59369,-3.68188 2.40263,-7.59219 2.40263,-11.64494c0,-16.29969 -13.26281,-29.5625 -29.5625,-29.5625c-6.5145,0 -12.68769,2.08819 -17.78588,5.96088c-4.30269,-13.03438 -16.52006,-22.08587 -30.58912,-22.08587c-17.78319,0 -32.25,14.46681 -32.25,32.25c0,4.14681 0.16662,8.05981 1.42437,10.74731h-1.42437c-13.33806,0 -24.1875,10.84944 -24.1875,24.1875c0,11.56431 8.16194,21.24737 19.0275,23.62044c1.02394,6.39894 6.53869,11.31706 13.2225,11.31706h56.4375h16.125h5.375c6.54944,0 12.00238,-4.71388 13.18488,-10.92469c9.2235,-1.20131 16.37762,-9.08913 16.37762,-18.63513c0,-6.09256 -2.924,-11.72019 -7.77762,-15.23006zM126.3125,131.6875h-5.375h-16.125h-56.4375c-3.49912,0 -6.45538,-2.6875 -7.568,-5.375h93.0735c-1.11263,2.6875 -4.06888,5.375 -7.568,5.375zM137.0625,120.9375h-96.75c-10.37106,0 -18.8125,-8.44144 -18.8125,-18.8125c0,-10.37106 8.44144,-18.8125 18.8125,-18.8125h9.51375l-1.68506,-3.78131c-2.23063,-5.01488 -2.45369,-7.48737 -2.45369,-12.341c0,-14.81888 12.05613,-26.875 26.875,-26.875c13.01825,0 24.13106,9.29875 26.42619,22.11275l0.92719,5.17075l3.64962,-3.77325c4.60638,-4.76225 10.77687,-7.38525 17.372,-7.38525c13.33806,0 24.1875,10.84944 24.1875,24.1875c0,3.6765 -0.81431,7.21056 -2.37575,10.41944l-1.763,3.32713l2.37037,1.26044c4.40481,2.34081 7.14338,6.88806 7.14338,11.868c0,7.40944 -6.02806,13.43481 -13.4375,13.43481z" fill="url(#color-4_52139_gr4)"></path></g></g></svg>
|
||||
style=" fill:#000000;"><defs><linearGradient x1="86" y1="45.01563" x2="86" y2="152.92681" gradientUnits="userSpaceOnUse" id="color-1_48314_gr1"><stop offset="0" stop-color="#1ac86f"></stop><stop offset="1" stop-color="#1ac86f"></stop></linearGradient><linearGradient x1="86" y1="45.01563" x2="86" y2="152.92681" gradientUnits="userSpaceOnUse" id="color-2_48314_gr2"><stop offset="0" stop-color="#1ac86f"></stop><stop offset="1" stop-color="#1ac86f"></stop></linearGradient><linearGradient x1="86" y1="16.79688" x2="86" y2="92.05225" gradientUnits="userSpaceOnUse" id="color-3_48314_gr3"><stop offset="0" stop-color="#67eba8"></stop><stop offset="1" stop-color="#67eba8"></stop></linearGradient><linearGradient x1="86" y1="45.01563" x2="86" y2="152.92681" gradientUnits="userSpaceOnUse" id="color-4_48314_gr4"><stop offset="0" stop-color="#1ac86f"></stop><stop offset="1" stop-color="#1ac86f"></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="M147.8125,48.375h-32.25v5.375h32.25c1.50769,0 2.6875,1.12875 2.6875,2.56925v75.25c0,1.51844 -1.23087,2.80575 -2.6875,2.80575h-123.625c-1.45662,0 -2.6875,-1.28731 -2.6875,-2.80575v-75.25c0,-1.4405 1.17981,-2.56925 2.6875,-2.56925h32.25v-5.375h-32.25c-4.52038,0 -8.0625,3.49106 -8.0625,7.94425v75.25c0,3.55019 2.25481,6.54944 5.375,7.67819v3.07181c0,4.51231 3.61737,8.18075 8.0625,8.18075h112.875c4.44512,0 8.0625,-3.66844 8.0625,-8.18075v-3.07181c3.12019,-1.12875 5.375,-4.128 5.375,-7.67819v-75.25c0,-4.45319 -3.54212,-7.94425 -8.0625,-7.94425zM142.4375,145.125h-112.875c-1.45662,0 -2.6875,-1.28731 -2.6875,-2.80575v-2.56925h118.25v2.56925c0,1.51844 -1.23087,2.80575 -2.6875,2.80575z" fill="url(#color-1_48314_gr1)"></path><path d="M126.3125,129h-83.3125v-2.6875c0,-7.51425 -6.02806,-13.4375 -13.4375,-13.4375h-2.6875v-37.625h2.6875c6.3425,0 13.4375,-5.79156 13.4375,-13.46706v-2.70363l13.4375,0.04569v5.375l-8.2775,-0.01613c-1.26044,7.95231 -7.94425,14.61731 -15.91,15.86969v27.219c8.25869,1.18788 14.80006,7.76956 15.94762,16.05244h75.6155c1.17444,-8.30438 7.70238,-14.85112 15.93688,-16.03631v-27.262c-7.96844,-1.247 -14.65494,-7.89587 -15.91269,-15.82669h-8.27481v-5.375h13.4375v2.6875c0,6.30219 5.74587,13.4375 13.4375,13.4375h2.6875v37.50675l-2.6875,0.01613c-7.40944,0 -13.4375,6.03344 -13.4375,13.45094v2.6875z" fill="url(#color-2_48314_gr2)"></path><path d="M104.8125,53.75h-8.0625c-1.4835,0 -2.6875,1.14487 -2.6875,2.63106v29.61356c0,1.48619 -1.204,2.69288 -2.6875,2.69288h-10.75c-1.4835,0 -2.6875,-1.20669 -2.6875,-2.69288v-29.61356c0,-1.48619 -1.204,-2.63106 -2.6875,-2.63106h-8.0625c-2.2145,0 -3.47763,-2.881 -2.15,-4.87781l16.65175,-25.04481c2.05056,-3.08256 6.57094,-3.08794 8.6215,-0.00806l16.65175,25.05556c1.32762,1.99681 0.0645,4.87512 -2.15,4.87512z" fill="url(#color-3_48314_gr3)"></path><path d="M86,112.875c-10.37375,0 -18.8125,-8.0625 -18.8125,-18.8125h5.375c0,8.0625 6.02806,13.4375 13.4375,13.4375c7.40944,0 13.4375,-5.375 13.4375,-13.4375h5.375c0,10.75 -8.43875,18.8125 -18.8125,18.8125z" fill="url(#color-4_48314_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<modal-component type="paymentProofModal">
|
||||
<payment-proof-form-component section="paymentProofSection" :id="item.id" :data="item"></payment-proof-form-component>
|
||||
<payment-proof-form-component v-if="selected_id == item.id" section="paymentProofSection" :id="item.id" :data="item"></payment-proof-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,6 +60,16 @@
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
selected_id: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectedID(id){
|
||||
this.selected_id = id;
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<img src="images/3568950.png" class="w-100">
|
||||
<img src="/images/3568950.png" class="w-100">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="row no-margin">
|
||||
<div class="col bg-white p-t-15 p-b-10 p-l-25 p-r-25">
|
||||
<div class="absolute w-100 h-100 bg-white hint-text" style="top: 0; left: 0; z-index: 1;" v-if="!data.services.length"></div>
|
||||
<img src="images/order_form.png" class="w-100" v-if="!data.services.length">
|
||||
<img src="/images/order_form.png" class="w-100" v-if="!data.services.length">
|
||||
<div class="row" v-if="data.services.length">
|
||||
<div class="col">
|
||||
<div class="row p-t-5 p-b-20">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<error-message-component class="m-b-20" :error="error"></error-message-component>
|
||||
<bank-in-component :data="data" class="m-b-25"></bank-in-component>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<file-input-component :validator="$v.files" v-model="files">
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -326,6 +326,9 @@
|
||||
<div class="col">
|
||||
<div class="font-head fs-10 all-caps">Payment History</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-head fs-10 all-caps">of {{booking.marking}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
<div class="col">
|
||||
|
||||
@@ -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>
|
||||
@@ -9,7 +9,8 @@
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<img :src="src" class="w-100" v-if="type !== 'pdf'">
|
||||
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
|
||||
<div class="btn btn-info b-rad-none pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
|
||||
<a :href="'data:application/pdf;base64,'+src" :download="file.file.filename" v-show="type === 'pdf'"><div class="btn btn-success b-rad-none pointer m-b-20">Download</div></a>
|
||||
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<div class="font-heading fs-11 muted" v-text="$store.getters.getUserEmail"></div>
|
||||
</div>
|
||||
<div class="col-auto p-r-0">
|
||||
<div class="btn btn-xs btn-default bg-master-lighter btn-rounded p-r-20 p-l-15">
|
||||
<div class="btn btn-xs btn-default bg-master-lighter btn-rounded p-r-20 p-l-15 requestModal" data-type="editEmail">
|
||||
<i class="fa fa-envelope-open-o m-r-10"></i>Request Email Change
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,6 +50,10 @@
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="resetPassword">
|
||||
<reset-user-password-form-component :data="{email: $store.getters.getUserEmail}" section="resetPassword"></reset-user-password-form-component>
|
||||
</modal-component>
|
||||
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="editEmail">
|
||||
<edit-email-form-component :data="{email: $store.getters.getUserEmail}" section="editEmail"></edit-email-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<h5 class="all-caps m-b-5 bold no-margin">Change Email Address</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.email">
|
||||
<label>New Email Address</label>
|
||||
<input type="text" class="form-control" v-model="parameters.email">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div class="btn btn-sm btn-default bg-master-lightest btn-block b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submit(route('api.company.team.create'), 'post', section, true, false)">Update</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { required, email } from "vuelidate/lib/validators";
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
error: '',
|
||||
parameters: {
|
||||
email: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
email: { required, email }
|
||||
}
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -13,6 +13,8 @@ export default {
|
||||
|
||||
isSuperAdmin: (state, getters) => getters.getDecodedAccessToken.user.type === 0 || getters.getDecodedAccessToken.user.type === 1,
|
||||
isAdmin: (state, getters) => getters.getDecodedAccessToken.user.type === 0 || getters.getDecodedAccessToken.user.type === 1 || getters.getDecodedAccessToken.user.type === 2,
|
||||
isCustomer: (state, getters) => getters.getDecodedAccessToken.user.type === 3,
|
||||
isDestinationAccountAdmin: (state, getters) => getters.getDecodedAccessToken.user.type === 7,
|
||||
getUserName: (state, getters) => getters.getUpdatedFullname || getters.getDecodedAccessToken.user.name,
|
||||
getUserId: (state, getters) => getters.getDecodedAccessToken.user.id,
|
||||
getUserEmail: (state, getters) => getters.getDecodedAccessToken.user.email,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row d-none" :class="[{'d-flex': !$store.getters.isAdmin}]" v-if="!$store.getters.isAdmin">
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isCustomer}]" v-if="$store.getters.isCustomer">
|
||||
<div class="col-6 bg-white p-l-25 p-r-25 p-t-15 p-b-15">
|
||||
<div class="row p-b-5 m-b-20 b-b b-grey align-items-center parentContainer">
|
||||
<div class="col">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isDestinationAccountAdmin}]" v-if="$store.getters.isDestinationAccountAdmin">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-5 bg-white padding-25">
|
||||
<list-component ref="paymentProofList" section="paymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 2, type: 3, issuer_not: 2}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -328,7 +328,7 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component ref="paymentProofList" section="paymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 2, type: 3}">
|
||||
<list-component ref="paymentProofList" section="paymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 2, type: 3, issuer_in: [2]}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<payment-proof-component :data="data"></payment-proof-component>
|
||||
</template>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row d-none" :class="[{'d-flex': !$store.getters.isAdmin}]" v-if="!$store.getters.isAdmin">
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isCustomer}]" v-if="$store.getters.isCustomer">
|
||||
<div class="col">
|
||||
<customer-dashboard-section-component></customer-dashboard-section-component>
|
||||
</div>
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
@section('inner_content')
|
||||
@include('pages.dashboards.admin')
|
||||
@include('pages.dashboards.customer')
|
||||
@include('pages.dashboards.account_admin')
|
||||
@endsection
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
<div class="ref">REF: {{ $invoice_transaction->payment_reference ?? '-' }}</div>
|
||||
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
|
||||
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -77,18 +77,22 @@
|
||||
<th class="stock-code" width="10%">Stock Code</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="10%">Quantity</th>
|
||||
<th width="12%">Unit Price (RM)</th>
|
||||
<th width="15%">Unit Price (RM)</th>
|
||||
<th width="10%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
@endphp
|
||||
|
||||
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
|
||||
<td class="description">{{ $transaction_detail->product_name }}</td>
|
||||
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
|
||||
<td width="12%" class="center top">
|
||||
<td width="15%" class="center top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
|
||||
@else
|
||||
@@ -97,9 +101,18 @@
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($transaction_detail->amount, 2) }}
|
||||
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@else
|
||||
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -110,11 +123,7 @@
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($invoice_transaction->amount, 2) }}
|
||||
@endif
|
||||
{{ number_format($subtotal, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
@@ -124,6 +133,17 @@
|
||||
{{ number_format($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Adjustment</td>
|
||||
<td class="right">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@else
|
||||
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
<div class="ref">Ref# {{ $invoice_transaction->payment_reference ?? '-' }}</div>
|
||||
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
|
||||
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -76,18 +76,22 @@
|
||||
<th class="stock-code" width="10%">Stock Code</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="10%">Quantity</th>
|
||||
<th width="12%">Unit Price (RM)</th>
|
||||
<th width="15%">Unit Price (RM)</th>
|
||||
<th width="10%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
@endphp
|
||||
|
||||
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
|
||||
<td class="description">{{ $transaction_detail->product_name }}</td>
|
||||
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
|
||||
<td width="12%" class="center top">
|
||||
<td width="15%" class="center top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
|
||||
@else
|
||||
@@ -96,9 +100,18 @@
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($transaction_detail->amount, 2) }}
|
||||
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@else
|
||||
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -109,11 +122,7 @@
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($invoice_transaction->amount, 2) }}
|
||||
@endif
|
||||
{{ number_format($subtotal, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
@@ -123,6 +132,17 @@
|
||||
{{ number_format($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Adjustment</td>
|
||||
<td class="right">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@else
|
||||
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
|
||||
@@ -81,18 +81,22 @@
|
||||
<th class="stock-code" width="10%">Stock Code</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="10%">Quantity</th>
|
||||
<th width="12%">Unit Price (RM)</th>
|
||||
<th width="15%">Unit Price (RM)</th>
|
||||
<th width="10%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
@endphp
|
||||
|
||||
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
|
||||
<td class="description">{{ $transaction_detail->product_name }}</td>
|
||||
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
|
||||
<td width="12%" class="center top">
|
||||
<td width="15%" class="center top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
|
||||
@else
|
||||
@@ -101,9 +105,18 @@
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($transaction_detail->amount, 2) }}
|
||||
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@else
|
||||
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -112,13 +125,9 @@
|
||||
<tfoot>
|
||||
<tr class="subtotal">
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($invoice_transaction->amount, 2) }}
|
||||
@endif
|
||||
{{ number_format($subtotal, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
@@ -128,6 +137,17 @@
|
||||
{{ number_format($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Adjustment</td>
|
||||
<td class="right">
|
||||
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@else
|
||||
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<td class="document-detail">
|
||||
PO#: {{ $supplier_deliver_order_transaction->bill_no }} <br>
|
||||
Ref#: {{ $supplier_deliver_order_transaction->payment_reference ?? '-' }} <br>
|
||||
Date: {{ $supplier_deliver_order_transaction->created_at }}
|
||||
Date: {{ $po_order_transaction->created_at }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -66,18 +66,22 @@
|
||||
<th class="stock-code" width="10%">Stock Code</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="10%">Quantity</th>
|
||||
<th width="12%">Unit Price (RM)</th>
|
||||
<th width="15%">Unit Price (RM)</th>
|
||||
<th width="10%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$subtotal = 0;
|
||||
@endphp
|
||||
|
||||
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
|
||||
<td class="description">{{ $transaction_detail->product_name }}</td>
|
||||
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
|
||||
<td width="12%" class="center top">
|
||||
<td width="15%" class="center top">
|
||||
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2) }}
|
||||
@else
|
||||
@@ -86,9 +90,18 @@
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($transaction_detail->amount, 2) }}
|
||||
|
||||
{{ number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@else
|
||||
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
|
||||
|
||||
@php
|
||||
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
|
||||
@endphp
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -99,10 +112,17 @@
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $supplier_deliver_order_transaction->amount, 2) }}
|
||||
@else
|
||||
{{ number_format($supplier_deliver_order_transaction->amount, 2) }}
|
||||
{{ number_format($subtotal, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Adjustment</td>
|
||||
<td class="right">
|
||||
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
|
||||
{{ number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $supplier_deliver_order_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@else
|
||||
{{ number_format((float)number_format($supplier_deliver_order_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -512,84 +512,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 p-r-0">
|
||||
<div class="col-4 p-r-0" v-if="$store.getters.isAdmin">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row tabsContainer" v-if="$store.getters.isAdmin">
|
||||
<div class="col">
|
||||
<div class="row m-l-0 m-r-0 d-none d-md-flex">
|
||||
<div class="col" v-if="$store.getters.isAdmin">
|
||||
<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" v-bind:class="{ active: $store.getters.isAdmin }" vtab-name="customer-list">
|
||||
<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 class="col" v-else>
|
||||
<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 " v-bind:class="{ active: !$store.getters.isAdmin }" tab-name="announcement-list">
|
||||
<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="43.33594" x2="99.4375" y2="60.14625" gradientUnits="userSpaceOnUse" id="color-1_43971_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="106.15625" y1="26.875" x2="106.15625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-2_43971_gr2"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="83.3125" y1="26.875" x2="83.3125" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-3_43971_gr3"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="73.90625" y1="26.875" x2="73.90625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-4_43971_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="51.0625" y1="26.875" x2="51.0625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-5_43971_gr5"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="51.0625" y1="26.875" x2="51.0625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-6_43971_gr6"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="45.6875" y1="26.875" x2="45.6875" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-7_43971_gr7"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="43" y1="26.875" x2="43" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-8_43971_gr8"><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="M112.875,59.125h-26.875c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-10.75c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h26.875c1.4835,0 2.6875,1.204 2.6875,2.6875v10.75c0,1.4835 -1.204,2.6875 -2.6875,2.6875z" fill="url(#color-1_43971_gr1)"></path><path d="M155.875,96.75c0,-7.97381 -5.82381,-14.59581 -13.4375,-15.88313v-18.82325c0,-2.08819 -1.16906,-3.94525 -3.05031,-4.85094c-1.88125,-0.90031 -4.06081,-0.65575 -5.69481,0.64769l-21.48925,17.18925c-0.08062,0.0645 -0.13975,0.14781 -0.21769,0.21769h-31.36044c-7.40944,0 -13.4375,6.02806 -13.4375,13.4375h-5.375c-2.96431,0 -5.375,2.41069 -5.375,5.375v5.375c0,2.96431 2.41069,5.375 5.375,5.375h5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375v16.125c0,5.92863 4.82138,10.75 10.75,10.75c5.92863,0 10.75,-4.82137 10.75,-10.75v-16.125h9.86044c0.07794,0.06988 0.13706,0.15319 0.22038,0.22037l21.48656,17.18925c0.98094,0.78475 2.16075,1.18519 3.35131,1.18519c0.79281,0 1.59369,-0.17738 2.3435,-0.5375c1.88125,-0.903 3.05031,-2.76275 3.05031,-4.84825v-18.82325c7.61369,-1.28731 13.4375,-7.90931 13.4375,-15.88312zM61.8125,99.4375v-5.375h5.375v5.375zM96.75,134.375c0,2.96431 -2.41069,5.375 -5.375,5.375c-2.96431,0 -5.375,-2.41069 -5.375,-5.375v-16.125h10.75zM80.625,112.875c-4.44513,0 -8.0625,-3.61738 -8.0625,-8.0625v-16.125c0,-4.44513 3.61737,-8.0625 8.0625,-8.0625h29.5625v32.25h-8.0625zM137.05175,131.46175l-21.48925,-17.19462v-35.04231l10.75,-8.59194v26.11713h5.375v-30.41175l5.375,-4.29462l0.00538,69.42887c0,0 -0.00538,-0.00269 -0.01613,-0.01075zM142.4375,107.11837v-20.73675c4.6225,1.20131 8.0625,5.375 8.0625,10.36838c0,4.99337 -3.44,9.16706 -8.0625,10.36838z" fill="url(#color-2_43971_gr2)"></path><path d="M77.9375,91.375v5.375h5.375v-5.375h5.375v-5.375h-5.375c-2.96431,0 -5.375,2.41069 -5.375,5.375z" fill="url(#color-3_43971_gr3)"></path><path d="M21.5,107.5v-67.1875c0,-4.44512 3.61737,-8.0625 8.0625,-8.0625h88.6875c4.44512,0 8.0625,3.61738 8.0625,8.0625v10.75h5.375v-10.75c0,-7.40944 -6.02806,-13.4375 -13.4375,-13.4375h-88.6875c-7.40944,0 -13.4375,6.02806 -13.4375,13.4375v67.1875c0,7.40944 6.02806,13.4375 13.4375,13.4375h32.25v-5.375h-32.25c-4.44513,0 -8.0625,-3.61737 -8.0625,-8.0625z" fill="url(#color-4_43971_gr4)"></path><path d="M32.25,43h37.625v5.375h-37.625z" fill="url(#color-5_43971_gr5)"></path><path d="M32.25,53.75h37.625v5.375h-37.625z" fill="url(#color-6_43971_gr6)"></path><path d="M32.25,64.5h26.875v5.375h-26.875z" fill="url(#color-7_43971_gr7)"></path><path d="M32.25,75.25h21.5v5.375h-21.5z" fill="url(#color-8_43971_gr8)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Announcements</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 class="row tabsContainer tabContent hide" tab-name="announcement-list">
|
||||
<announcement-quick-view-section-component></announcement-quick-view-section-component>
|
||||
</div>
|
||||
<div class="row tabsContainer hide tabContent" tab-name="PO">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,12 @@
|
||||
<div class="text-white all-caps fs-12">Urgent List</div>
|
||||
</a>
|
||||
</div>
|
||||
<div v-if="!$store.getters.isAdmin" class="col-auto p-r-20">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
+5
-3
@@ -33,13 +33,15 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account
|
||||
Route::post('/verification/resend', 'ResendEmailVerificationController@resend')->name('verification.resend');
|
||||
});
|
||||
|
||||
|
||||
Route::group(['prefix' => 'user', 'as' => 'user.'], function () {
|
||||
Route::group(['prefix' => 'user', 'as' => 'user.', 'middleware' => 'valid.token'], function () {
|
||||
Route::post('/show', 'FetchUserController@fetch')->name('show');
|
||||
Route::get('/list', 'ListUsersController@list')->name('list');
|
||||
Route::put('/update/{id}', 'UpdateUserController@update')->name('update');
|
||||
|
||||
|
||||
Route::post('/admin/create', 'CreateAdminUserController@create')->name('admin.create');
|
||||
Route::delete('/delete/{id}', 'DeleteUserController@delete')->name('delete');
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
+3
-1
@@ -9,6 +9,8 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
Route::put('/update/{id}', 'UpdateCompanyController@update')->name('update');
|
||||
Route::delete('/delete/{id}', 'DeleteCompanyController@destroy')->name('delete');
|
||||
|
||||
Route::post('/team/create', 'AddNewMemberController@create')->name('team.create');
|
||||
|
||||
Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () {
|
||||
Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign');
|
||||
Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach');
|
||||
@@ -25,4 +27,4 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
Route::put('/{document_id}/approval/{status}', 'ApproveIdentificationDocumentController@approve')->where('status', 'approve|reject')->name('approval');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
|
||||
|
||||
route::post('/supplier/{id}/bill/create', 'CreateSupplierTransactionController@create')->name('supplier.create');
|
||||
route::post('{id}/bill/verification', 'CreatePaymentProofDocumentController@verify')->name('bill.verification');
|
||||
route::post('{id}/bill/pay', 'CreatePaymentProofDocumentController@pay')->name('bill.pay');
|
||||
|
||||
Route::post('booking/{id}/details/update', 'CreatePurchaseOrderTransactionController@create')->name('po.create');
|
||||
|
||||
|
||||
+36
-6
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -40,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 () {
|
||||
@@ -65,11 +71,35 @@ Route::get('/transfer/merge/{marking}', function ($marking) {
|
||||
return view('pages.booking_merge', ['marking' => $marking]);
|
||||
})->name('booking.merge');
|
||||
|
||||
Route::get('/mail', function () {
|
||||
echo route('login');
|
||||
Route::get('/test', function(){
|
||||
|
||||
// Auth::login(User::findOrFail(1));
|
||||
// try {
|
||||
// $zip_file = 'cief_jun_to_september_delivery_orders.zip'; // Name of our archive to download
|
||||
// $zip = new ZipArchive();
|
||||
// if ($zip->open(storage_path().'/'.$zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) === TRUE) {
|
||||
//
|
||||
// //whereMonth('created_at', 5)->whereYear('created_at', 2021)->
|
||||
// $bookings = \App\Models\Booking::where('status', \App\Classes\ValueObjects\Constants\ApprovalStatus::COMPLETED)->get();
|
||||
//
|
||||
// foreach ($bookings as $booking) {
|
||||
// $file = $booking->documents()->where('document_type', \App\Classes\ValueObjects\Constants\DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();
|
||||
// if (! $zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), Carbon::now()->format('d_m_Y').'_'.$booking->marking.'.pdf')) {
|
||||
// echo 'Could not add file to ZIP: ' . $file;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Close ZipArchive
|
||||
// $zip->close();
|
||||
// } else {
|
||||
// echo 'Could not open ZIP file.';
|
||||
// }
|
||||
// } catch (Exception $exception) {
|
||||
// dd($exception);
|
||||
// }
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
||||
Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions');
|
||||
|
||||
Reference in New Issue
Block a user