mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -16,6 +16,7 @@ use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
abstract class AbstractControllerLogic
|
||||
{
|
||||
@@ -66,6 +67,7 @@ abstract class AbstractControllerLogic
|
||||
return $response;
|
||||
|
||||
} catch (ErrorException|GeneralExceptions $exception){
|
||||
log::error($exception);
|
||||
return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(),
|
||||
$exception->getCode() ? $exception->getCode() : HttpStatus::SERVER_ERROR))->handler();
|
||||
|
||||
@@ -99,4 +101,4 @@ abstract class AbstractControllerLogic
|
||||
return $this->response(json_decode($collection->response()->getContent(), true));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Classes\General\Eloquent;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
abstract class AbstractListRecord extends AbstractGetRecord
|
||||
{
|
||||
@@ -23,6 +24,7 @@ abstract class AbstractListRecord extends AbstractGetRecord
|
||||
return $this->handler($filters);
|
||||
|
||||
} catch (QueryException $exception){
|
||||
log::error($exception);
|
||||
throw new MalformedRequestException('Unable to fetch the list of records due to unexpected error');
|
||||
}
|
||||
|
||||
@@ -43,4 +45,4 @@ abstract class AbstractListRecord extends AbstractGetRecord
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class DoesNotHaveTransactionType implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions', function($query) use($value) {
|
||||
return $query->where('transactions.type', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class HasPaymentStatusIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function($query) use($value) {
|
||||
return $query->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class HasPurchaseOrderStatusIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function($query) use($value) {
|
||||
return $query->where('transactions.type', TransactionType::PURCHASE_ORDER)->where('transactions.status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class HasTransactionType implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->has('transactions', function($query) use($value) {
|
||||
return $query->where('transactions.type', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class WithWallets implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->with('wallets');
|
||||
}
|
||||
}
|
||||
+28
-13
@@ -3,12 +3,15 @@
|
||||
namespace App\Classes\Modules\Bookings\Processors;
|
||||
|
||||
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Modules\Bookings\Services\Convert1688PurchaseOrderToProductList;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\CreatePurchaseOrderTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Booking;
|
||||
@@ -21,6 +24,9 @@ class CreatePurchaseOrderFor1688OrderProcessor
|
||||
/** @var CreatePurchaseOrderTransactionProcessor */
|
||||
private $createPurchaseOrderTransactionProcessor;
|
||||
|
||||
/** @var Convert1688PurchaseOrderToProductList */
|
||||
private $convert1688PurchaseOrderToProductList;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
@@ -28,31 +34,38 @@ class CreatePurchaseOrderFor1688OrderProcessor
|
||||
private $createInvoiceTransactionProcessor;
|
||||
|
||||
/**
|
||||
* CreatePurchaseOrderFor1688OrderProcessor constructor.
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param CreatePurchaseOrderTransactionProcessor $createPurchaseOrderTransactionProcessor
|
||||
* @param Convert1688PurchaseOrderToProductList $convert1688PurchaseOrderToProductList
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
|
||||
*/
|
||||
public function __construct(GeneratesTransactionBillNumber $generatesTransactionBillNumber, CreatePurchaseOrderTransactionProcessor $createPurchaseOrderTransactionProcessor, UpdatesTransactionStatus $updatesTransactionStatus, CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor)
|
||||
public function __construct(GeneratesTransactionBillNumber $generatesTransactionBillNumber, CreatePurchaseOrderTransactionProcessor $createPurchaseOrderTransactionProcessor, Convert1688PurchaseOrderToProductList $convert1688PurchaseOrderToProductList, UpdatesTransactionStatus $updatesTransactionStatus, CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor)
|
||||
{
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->createPurchaseOrderTransactionProcessor = $createPurchaseOrderTransactionProcessor;
|
||||
$this->convert1688PurchaseOrderToProductList = $convert1688PurchaseOrderToProductList;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->createInvoiceTransactionProcessor = $createInvoiceTransactionProcessor;
|
||||
}
|
||||
|
||||
|
||||
public function execute(Booking $booking){
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('PO-');
|
||||
|
||||
$products = [
|
||||
[
|
||||
'description' => 'please refer to the attachment below',
|
||||
'quantity' => 1,
|
||||
'stockCode' => '',
|
||||
'unit_price' => $booking->fix_amount
|
||||
]
|
||||
];
|
||||
$documents = $booking->documents()->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get();
|
||||
$products = [];
|
||||
foreach($documents as $document) {
|
||||
foreach ($document->files as $file) {
|
||||
try {
|
||||
$products = $this->convert1688PurchaseOrderToProductList->execute($file);
|
||||
} catch (MalformedRequestException $exception) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($products)) return false;
|
||||
|
||||
$total = collect($products)->sum(function($product){
|
||||
return $product['quantity'] * floatval(str_replace(',', '', $product['unit_price']));
|
||||
@@ -65,9 +78,11 @@ class CreatePurchaseOrderFor1688OrderProcessor
|
||||
|
||||
$purchaseOrder = $this->createPurchaseOrderTransactionProcessor->execute($booking, $object);
|
||||
|
||||
$this->updatesTransactionStatus->execute($purchaseOrder, ApprovalStatus::APPROVED);
|
||||
if($purchaseOrder->amount === $booking->fix_amount){
|
||||
$this->updatesTransactionStatus->execute($purchaseOrder, ApprovalStatus::APPROVED);
|
||||
$this->createInvoiceTransactionProcessor->execute($booking);
|
||||
}
|
||||
|
||||
$this->createInvoiceTransactionProcessor->execute($booking);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Bookings\Services;
|
||||
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Models\File;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Convert1688PurchaseOrderToProductList
|
||||
{
|
||||
/**
|
||||
* @param File $file
|
||||
* @return array
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(File $file): array
|
||||
{
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
$productList = [];
|
||||
$shipping = 0;
|
||||
$discount = 0;
|
||||
|
||||
try {
|
||||
$pdf = $parser->parseFile(Storage::disk('documents')->path($file->file->file_info->original->file));
|
||||
} catch (Exception $exception) {
|
||||
throw new MalformedRequestException('Invalid file format.');
|
||||
}
|
||||
|
||||
$text = $pdf->getText();
|
||||
if(str_contains($text, '订单详情单')) throw new MalformedRequestException('Can\'t process non english documents');
|
||||
|
||||
$tables = explode('Amount (yuan)', $text);
|
||||
$footer = end($tables);
|
||||
$footer = preg_split('(Shipping|运费)', $footer);
|
||||
if(array_key_exists(1, $footer)){
|
||||
$footer = preg_split('/[\t\n]/', $footer[1]);
|
||||
$shipping = (float) filter_var( $footer[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
||||
$discount = array_filter($footer, function($var) { return preg_match("/(Discount|优惠)/", $var); });
|
||||
$discount = (float) filter_var(reset($discount), FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
||||
}
|
||||
|
||||
|
||||
array_shift($tables);
|
||||
|
||||
foreach ($tables as $table){
|
||||
$products = preg_split('/(yuan\/|yuan \/|元\/|元 \/)/', str_replace("\r\n","",$table));
|
||||
|
||||
array_pop($products);
|
||||
foreach ($products as $product){
|
||||
$product = preg_split('/[\t]/',$product);
|
||||
|
||||
$adjuster = (count($product) - 7);
|
||||
$descriptionIndex = 3 + $adjuster;
|
||||
|
||||
$quantity = (int) str_replace("\n","",$product[$descriptionIndex + 2]);
|
||||
$unitPrice = (float) str_replace("\n","",$product[$descriptionIndex + 3]);
|
||||
|
||||
$productList[] = [
|
||||
'stockCode' => '',
|
||||
'description' => str_replace("\n","",$product[$descriptionIndex]),
|
||||
'quantity' => $quantity,
|
||||
'unit_price' => $unitPrice,
|
||||
'total' => (float) str_replace("\n","",$product[$descriptionIndex + 3])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if($shipping > 0) {
|
||||
$productList[] = [
|
||||
'stockCode' => '',
|
||||
'description' => 'Shipping Fee',
|
||||
'quantity' => 1,
|
||||
'unit_price' => $shipping,
|
||||
'total' => $shipping
|
||||
];
|
||||
}
|
||||
|
||||
if($discount > 0) {
|
||||
$productList[] = [
|
||||
'stockCode' => '',
|
||||
'description' => 'Discount',
|
||||
'quantity' => 1,
|
||||
'unit_price' => $discount * -1,
|
||||
'total' => $discount * -1
|
||||
];
|
||||
}
|
||||
|
||||
return $productList;
|
||||
}
|
||||
}
|
||||
@@ -52,10 +52,10 @@ class FetchCompanyLogic extends AbstractControllerLogic
|
||||
{
|
||||
$this->canFetchCompany->passes();
|
||||
|
||||
$query = $this->fetchesCompany->execute(['id' => $request->route('id'), 'with_bookings' => true]);
|
||||
$query = $this->fetchesCompany->execute(['id' => $request->route('id'), 'with_bookings' => true, 'with_wallets' => true]);
|
||||
|
||||
return $this->resourceResponse(new CompanyResource($query));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,9 +80,9 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, Sho
|
||||
$transactionTypes[$transaction->type],
|
||||
$transaction->issuerCompany->name,
|
||||
$transaction->reciver,
|
||||
$transaction->currency_id === 1 ? 'MYR' : 'RMB',
|
||||
$transaction->currency->short_code,
|
||||
$transaction->amount,
|
||||
$transaction->original_currency_id === 1 ? 'MYR' : 'RMB',
|
||||
$transaction->original_currency->short_code,
|
||||
$transaction->original_amount,
|
||||
$transaction->currency_rate,
|
||||
$transaction->tax,
|
||||
@@ -90,7 +90,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, Sho
|
||||
$transactionStatus[$transaction->status],
|
||||
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->created_at),
|
||||
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->updated_at),
|
||||
$marking
|
||||
// $marking
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-3
@@ -100,7 +100,7 @@ class CreateProformaInvoiceTransactionProcessor
|
||||
* @return void
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Booking $booking)
|
||||
public function execute(Booking $booking)
|
||||
{
|
||||
|
||||
$po_order_transaction = $booking->transactions()
|
||||
@@ -129,14 +129,26 @@ class CreateProformaInvoiceTransactionProcessor
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('PROFORMA-');
|
||||
|
||||
$payable_amount = $booking->transactions()->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::SUSPENDED])->payments()->sum('amount');
|
||||
$payable_amount = $booking->transactions()->payments()->where(function($query){
|
||||
return $query->where(function($query){
|
||||
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
|
||||
})->orWhere(function($query){
|
||||
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
});
|
||||
})->sum('amount');
|
||||
$booking_amount = $booking->fix_amount;
|
||||
|
||||
$transaction = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->first();
|
||||
|
||||
$booking_currency_average_rate = $booking_amount / $booking->transactions()->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::SUSPENDED])->payments()->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
|
||||
$booking_currency_average_rate = $booking_amount / $booking->transactions()->payments()->where(function($query){
|
||||
return $query->where(function($query){
|
||||
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
|
||||
})->orWhere(function($query){
|
||||
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
});
|
||||
})->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
|
||||
|
||||
$total_service_charge = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
|
||||
+1
-1
@@ -86,4 +86,4 @@ class GeneratesGroupTransactionsPurchaseOrder
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class BookingResource extends JsonResource
|
||||
->whereDate('expires_on', '>=', Carbon::now())
|
||||
->get()
|
||||
),
|
||||
'expired_payment_attempts' => TransactionResource::collection($this->transactions()->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '<', Carbon::now())->get()),
|
||||
'expired_payment_attempts' => TransactionResource::collection($this->transactions()->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString())->get()),
|
||||
'payment_history' => TransactionResource::collection($this->transactions()->where(function($query){
|
||||
$query->where(function($query){
|
||||
$query->payments()->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED]);
|
||||
|
||||
@@ -61,7 +61,7 @@ class CompanyResource extends JsonResource
|
||||
],
|
||||
'segments' => SegmentResource::collection($this->segments),
|
||||
'services' => (new FetchesCompanyServices())->getServices($this->servicesConfigurations()),
|
||||
'wallet' => new WalletResource($this->wallets()->first()),
|
||||
'wallet' => $this->whenLoaded('wallets', new WalletResource($this->wallets()->with('transactions')->first()), new WalletResource($this->wallets()->first())),
|
||||
'created_at' => $this->created_at->format('d-m-Y'),
|
||||
$this->mergeWhen($this->business_type === BusinessType::CURRENCY_VENDOR, [
|
||||
'currencies' => $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : [],
|
||||
|
||||
@@ -21,8 +21,8 @@ class WalletResource extends JsonResource
|
||||
'currency_id' => $this->currency_id,
|
||||
'amount' => (double) $this->amount,
|
||||
'company_id' => (int) $this->owner->id,
|
||||
'transactions' => WalletTransactionResource::collection($this->transactions()->whereIn('status', [2, 3])->orderBy('id', 'DESC')->get()),
|
||||
'top_up_records' => WalletTransactionResource::collection($this->transactions()->whereNotIn('status', [0])->where('type', TransactionType::TOP_UP)->orderBy('id', 'DESC')->get())
|
||||
'transactions' => $this->whenLoaded('transactions', WalletTransactionResource::collection($this->transactions()->whereIn('status', [2, 3])->orderBy('id', 'DESC')->get()), []),
|
||||
'top_up_records' => $this->whenLoaded('transactions', WalletTransactionResource::collection($this->transactions()->whereNotIn('status', [0])->where('type', TransactionType::TOP_UP)->orderBy('id', 'DESC')->get()), []),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -228,14 +228,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="m-b-0 fs-12">Due to the system upgrades, you are no longer required to fill out the Purchase Order. We apologize that the invoices won't be available until the system has been fully upgraded. Thanks for your patience.</p>
|
||||
<p class="m-b-0 fs-12">You are no longer required to key in your purchase order details manually, the system will automatically get your purchase order detail from 1688 directly.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row" v-if="booking.documents.ecommerce_purchase_order">
|
||||
<div class="col-md col-6 h-100">
|
||||
<document-file-viewer-component :file="booking.documents.ecommerce_purchase_order.files[0]" v-if="booking.documents.ecommerce_purchase_order">
|
||||
<div class="col-md col-6 h-100" v-for="file in booking.documents.ecommerce_purchase_order.files">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="bg-white text-center padding-20 pointer b-grey">
|
||||
<div class="m-b-10">
|
||||
@@ -263,7 +263,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<purchase-order-form-component v-if="booking.service.id !== 4" :data="booking" :section="section"></purchase-order-form-component>
|
||||
<purchase-order-form-component v-if="booking.service.id !== 4 || ($store.getters.isAdmin && booking.purchase_order)" :data="booking" :section="section"></purchase-order-form-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15" v-if="booking.status === 3 && $store.getters.isSuperAdmin">
|
||||
@@ -494,4 +494,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -54,21 +54,21 @@
|
||||
@php
|
||||
$sub_total_booking_amount = number_format((float)$transactions->sum('original_amount'), 2, '.', '');
|
||||
@endphp
|
||||
<td>RMB {{$sub_total_booking_amount}}</td>
|
||||
<td>{{$transaction->original_currency->short_code}} {{$sub_total_booking_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Transfer fee: </td>
|
||||
@php
|
||||
$transfer_fee = number_format((float)$transferFeeTransactions->sum('service_charge'), 2, '.', '');
|
||||
@endphp
|
||||
<td>RMB {{$transfer_fee}}</td>
|
||||
<td>{{$transaction->original_currency->short_code}} {{$transfer_fee}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Total booking amount: </td>
|
||||
@php
|
||||
$total_booking_amount = number_format((float) ($transactions->sum('original_amount') + $transfer_fee), 2, '.', '');
|
||||
@endphp
|
||||
<td>RMB {{$total_booking_amount}}</td>
|
||||
<td>{{$transaction->original_currency->short_code}} {{$total_booking_amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="text-align: right;">Sub total amount: </td>
|
||||
@@ -100,4 +100,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<div class="row" v-if="$store.getters.isAdmin">
|
||||
<div class="col p-t-15 p-b-15">
|
||||
<div class="row tabsContainer">
|
||||
<div class="col">
|
||||
<div class="row m-l-0 m-r-0 d-flex">
|
||||
<div class="col">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton active" tab-name="all">
|
||||
<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="104.8125" y1="95.74219" x2="104.8125" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-1_TUOBhQt-Vj1j_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="67.1875" y1="95.74219" x2="67.1875" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-2_TUOBhQt-Vj1j_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="125.40413" x2="86" y2="133.41288" gradientUnits="userSpaceOnUse" id="color-3_TUOBhQt-Vj1j_gr3"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="10.234" x2="86" y2="158.13788" gradientUnits="userSpaceOnUse" id="color-4_TUOBhQt-Vj1j_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><circle cx="39" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-1_TUOBhQt-Vj1j_gr1)"></circle><circle cx="25" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-2_TUOBhQt-Vj1j_gr2)"></circle><rect x="28" y="47" transform="scale(2.6875,2.6875)" width="8" height="3" fill="url(#color-3_TUOBhQt-Vj1j_gr3)"></rect><path d="M142.4375,80.11975v-7.55725c0,-31.11856 -25.31625,-56.4375 -56.4375,-56.4375c-31.12125,0 -56.4375,25.31894 -56.4375,56.4375v7.55725c-4.81062,2.79231 -8.0625,7.98994 -8.0625,13.94275c0,8.89294 7.23206,16.125 16.125,16.125h0.13706c1.40556,25.42106 22.47019,45.6875 48.23794,45.6875c25.76775,0 46.83238,-20.26644 48.23794,-45.6875h0.13706c8.89294,0 16.125,-7.23206 16.125,-16.125c0,-5.95281 -3.25188,-11.15044 -8.0625,-13.94275zM34.9375,77.9375v-5.375h16.125c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-5.375h-5.375v5.375c0,4.44512 -3.61738,8.0625 -8.0625,8.0625h-15.83744c2.69556,-25.63875 24.43475,-45.6875 50.77494,-45.6875c26.34019,0 48.07938,20.04875 50.77494,45.6875h-42.71244c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-5.375h-5.375v5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375h43v5.375h-46.91837c-8.213,0 -14.89413,-6.68113 -14.89413,-14.89413v-9.29337h-5.375v8.94937c0,8.40113 -6.837,15.23813 -15.23813,15.23813zM26.875,94.0625c0,-5.92863 4.82138,-10.75 10.75,-10.75v8.0625h-2.6875c-1.4835,0 -2.6875,1.20131 -2.6875,2.6875c0,1.48619 1.204,2.6875 2.6875,2.6875h2.6875v8.0625c-5.92862,0 -10.75,-4.82137 -10.75,-10.75zM86,150.5c-23.70912,0 -43,-19.29087 -43,-43v-24.1875h11.63687c7.61906,0 14.28675,-4.15488 17.85575,-10.31731c3.48031,6.15438 10.08888,10.31731 17.6515,10.31731h38.85587v24.1875c0,23.70913 -19.29087,43 -43,43zM134.375,104.8125v-8.0625h2.6875c1.4835,0 2.6875,-1.20131 2.6875,-2.6875c0,-1.48619 -1.204,-2.6875 -2.6875,-2.6875h-2.6875v-8.0625c5.92863,0 10.75,4.82137 10.75,10.75c0,5.92863 -4.82137,10.75 -10.75,10.75z" fill="url(#color-4_TUOBhQt-Vj1j_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">All</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="pending-submission">
|
||||
<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="104.8125" y1="95.74219" x2="104.8125" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-1_TUOBhQt-Vj1j_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="67.1875" y1="95.74219" x2="67.1875" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-2_TUOBhQt-Vj1j_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="125.40413" x2="86" y2="133.41288" gradientUnits="userSpaceOnUse" id="color-3_TUOBhQt-Vj1j_gr3"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="10.234" x2="86" y2="158.13788" gradientUnits="userSpaceOnUse" id="color-4_TUOBhQt-Vj1j_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><circle cx="39" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-1_TUOBhQt-Vj1j_gr1)"></circle><circle cx="25" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-2_TUOBhQt-Vj1j_gr2)"></circle><rect x="28" y="47" transform="scale(2.6875,2.6875)" width="8" height="3" fill="url(#color-3_TUOBhQt-Vj1j_gr3)"></rect><path d="M142.4375,80.11975v-7.55725c0,-31.11856 -25.31625,-56.4375 -56.4375,-56.4375c-31.12125,0 -56.4375,25.31894 -56.4375,56.4375v7.55725c-4.81062,2.79231 -8.0625,7.98994 -8.0625,13.94275c0,8.89294 7.23206,16.125 16.125,16.125h0.13706c1.40556,25.42106 22.47019,45.6875 48.23794,45.6875c25.76775,0 46.83238,-20.26644 48.23794,-45.6875h0.13706c8.89294,0 16.125,-7.23206 16.125,-16.125c0,-5.95281 -3.25188,-11.15044 -8.0625,-13.94275zM34.9375,77.9375v-5.375h16.125c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-5.375h-5.375v5.375c0,4.44512 -3.61738,8.0625 -8.0625,8.0625h-15.83744c2.69556,-25.63875 24.43475,-45.6875 50.77494,-45.6875c26.34019,0 48.07938,20.04875 50.77494,45.6875h-42.71244c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-5.375h-5.375v5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375h43v5.375h-46.91837c-8.213,0 -14.89413,-6.68113 -14.89413,-14.89413v-9.29337h-5.375v8.94937c0,8.40113 -6.837,15.23813 -15.23813,15.23813zM26.875,94.0625c0,-5.92863 4.82138,-10.75 10.75,-10.75v8.0625h-2.6875c-1.4835,0 -2.6875,1.20131 -2.6875,2.6875c0,1.48619 1.204,2.6875 2.6875,2.6875h2.6875v8.0625c-5.92862,0 -10.75,-4.82137 -10.75,-10.75zM86,150.5c-23.70912,0 -43,-19.29087 -43,-43v-24.1875h11.63687c7.61906,0 14.28675,-4.15488 17.85575,-10.31731c3.48031,6.15438 10.08888,10.31731 17.6515,10.31731h38.85587v24.1875c0,23.70913 -19.29087,43 -43,43zM134.375,104.8125v-8.0625h2.6875c1.4835,0 2.6875,-1.20131 2.6875,-2.6875c0,-1.48619 -1.204,-2.6875 -2.6875,-2.6875h-2.6875v-8.0625c5.92863,0 10.75,4.82137 10.75,10.75c0,5.92863 -4.82137,10.75 -10.75,10.75z" fill="url(#color-4_TUOBhQt-Vj1j_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Pending Submission</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="pending-review">
|
||||
<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="104.8125" y1="95.74219" x2="104.8125" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-1_TUOBhQt-Vj1j_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="67.1875" y1="95.74219" x2="67.1875" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-2_TUOBhQt-Vj1j_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="125.40413" x2="86" y2="133.41288" gradientUnits="userSpaceOnUse" id="color-3_TUOBhQt-Vj1j_gr3"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="10.234" x2="86" y2="158.13788" gradientUnits="userSpaceOnUse" id="color-4_TUOBhQt-Vj1j_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><circle cx="39" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-1_TUOBhQt-Vj1j_gr1)"></circle><circle cx="25" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-2_TUOBhQt-Vj1j_gr2)"></circle><rect x="28" y="47" transform="scale(2.6875,2.6875)" width="8" height="3" fill="url(#color-3_TUOBhQt-Vj1j_gr3)"></rect><path d="M142.4375,80.11975v-7.55725c0,-31.11856 -25.31625,-56.4375 -56.4375,-56.4375c-31.12125,0 -56.4375,25.31894 -56.4375,56.4375v7.55725c-4.81062,2.79231 -8.0625,7.98994 -8.0625,13.94275c0,8.89294 7.23206,16.125 16.125,16.125h0.13706c1.40556,25.42106 22.47019,45.6875 48.23794,45.6875c25.76775,0 46.83238,-20.26644 48.23794,-45.6875h0.13706c8.89294,0 16.125,-7.23206 16.125,-16.125c0,-5.95281 -3.25188,-11.15044 -8.0625,-13.94275zM34.9375,77.9375v-5.375h16.125c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-5.375h-5.375v5.375c0,4.44512 -3.61738,8.0625 -8.0625,8.0625h-15.83744c2.69556,-25.63875 24.43475,-45.6875 50.77494,-45.6875c26.34019,0 48.07938,20.04875 50.77494,45.6875h-42.71244c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-5.375h-5.375v5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375h43v5.375h-46.91837c-8.213,0 -14.89413,-6.68113 -14.89413,-14.89413v-9.29337h-5.375v8.94937c0,8.40113 -6.837,15.23813 -15.23813,15.23813zM26.875,94.0625c0,-5.92863 4.82138,-10.75 10.75,-10.75v8.0625h-2.6875c-1.4835,0 -2.6875,1.20131 -2.6875,2.6875c0,1.48619 1.204,2.6875 2.6875,2.6875h2.6875v8.0625c-5.92862,0 -10.75,-4.82137 -10.75,-10.75zM86,150.5c-23.70912,0 -43,-19.29087 -43,-43v-24.1875h11.63687c7.61906,0 14.28675,-4.15488 17.85575,-10.31731c3.48031,6.15438 10.08888,10.31731 17.6515,10.31731h38.85587v24.1875c0,23.70913 -19.29087,43 -43,43zM134.375,104.8125v-8.0625h2.6875c1.4835,0 2.6875,-1.20131 2.6875,-2.6875c0,-1.48619 -1.204,-2.6875 -2.6875,-2.6875h-2.6875v-8.0625c5.92863,0 10.75,4.82137 10.75,10.75c0,5.92863 -4.82137,10.75 -10.75,10.75z" fill="url(#color-4_TUOBhQt-Vj1j_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Pending Review</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col b-r b-white">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="approved">
|
||||
<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="104.8125" y1="95.74219" x2="104.8125" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-1_TUOBhQt-Vj1j_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="67.1875" y1="95.74219" x2="67.1875" y2="114.9175" gradientUnits="userSpaceOnUse" id="color-2_TUOBhQt-Vj1j_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="125.40413" x2="86" y2="133.41288" gradientUnits="userSpaceOnUse" id="color-3_TUOBhQt-Vj1j_gr3"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="10.234" x2="86" y2="158.13788" gradientUnits="userSpaceOnUse" id="color-4_TUOBhQt-Vj1j_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><circle cx="39" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-1_TUOBhQt-Vj1j_gr1)"></circle><circle cx="25" cy="39" transform="scale(2.6875,2.6875)" r="3" fill="url(#color-2_TUOBhQt-Vj1j_gr2)"></circle><rect x="28" y="47" transform="scale(2.6875,2.6875)" width="8" height="3" fill="url(#color-3_TUOBhQt-Vj1j_gr3)"></rect><path d="M142.4375,80.11975v-7.55725c0,-31.11856 -25.31625,-56.4375 -56.4375,-56.4375c-31.12125,0 -56.4375,25.31894 -56.4375,56.4375v7.55725c-4.81062,2.79231 -8.0625,7.98994 -8.0625,13.94275c0,8.89294 7.23206,16.125 16.125,16.125h0.13706c1.40556,25.42106 22.47019,45.6875 48.23794,45.6875c25.76775,0 46.83238,-20.26644 48.23794,-45.6875h0.13706c8.89294,0 16.125,-7.23206 16.125,-16.125c0,-5.95281 -3.25188,-11.15044 -8.0625,-13.94275zM34.9375,77.9375v-5.375h16.125c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-5.375h-5.375v5.375c0,4.44512 -3.61738,8.0625 -8.0625,8.0625h-15.83744c2.69556,-25.63875 24.43475,-45.6875 50.77494,-45.6875c26.34019,0 48.07938,20.04875 50.77494,45.6875h-42.71244c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-5.375h-5.375v5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375h43v5.375h-46.91837c-8.213,0 -14.89413,-6.68113 -14.89413,-14.89413v-9.29337h-5.375v8.94937c0,8.40113 -6.837,15.23813 -15.23813,15.23813zM26.875,94.0625c0,-5.92863 4.82138,-10.75 10.75,-10.75v8.0625h-2.6875c-1.4835,0 -2.6875,1.20131 -2.6875,2.6875c0,1.48619 1.204,2.6875 2.6875,2.6875h2.6875v8.0625c-5.92862,0 -10.75,-4.82137 -10.75,-10.75zM86,150.5c-23.70912,0 -43,-19.29087 -43,-43v-24.1875h11.63687c7.61906,0 14.28675,-4.15488 17.85575,-10.31731c3.48031,6.15438 10.08888,10.31731 17.6515,10.31731h38.85587v24.1875c0,23.70913 -19.29087,43 -43,43zM134.375,104.8125v-8.0625h2.6875c1.4835,0 2.6875,-1.20131 2.6875,-2.6875c0,-1.48619 -1.204,-2.6875 -2.6875,-2.6875h-2.6875v-8.0625c5.92863,0 10.75,4.82137 10.75,10.75c0,5.92863 -4.82137,10.75 -10.75,10.75z" fill="url(#color-4_TUOBhQt-Vj1j_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Approved</div>
|
||||
</div>
|
||||
</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 m-l-0 m-r-0" tab-name="all">
|
||||
<list-component key="2" section="all" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2,3], has_payment_status_in: [2, 3]}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="pending-submission">
|
||||
<list-component key="2" section="poPendingSubmissionSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], has_payment_status_in: [2, 3], does_not_have_transaction_type: 7}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="pending-review">
|
||||
<list-component key="2" section="poPendingReviewSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[2], has_payment_status_in: [2, 3], has_purchase_order_status_in: [0, 1]}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent m-l-0 m-r-0 hide" tab-name="approved">
|
||||
<list-component key="2" section="poApprovedSection" :endpoint="route('api.booking.list')" :options="{per_page: 10, ServiceId: 4, status_in:[3], has_purchase_order_status_in: [2]}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<booking-component :data="data"></booking-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+13
-27
@@ -16,6 +16,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Maatwebsite\Excel\Excel;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
@@ -98,6 +99,10 @@ Route::get('/transfer/merge/{marking}', function ($marking) {
|
||||
return view('pages.bookings.merge', ['marking' => $marking]);
|
||||
})->name('booking.merge');
|
||||
|
||||
Route::get('/purchase_orders', function () {
|
||||
return view('pages.purchase_orders');
|
||||
})->name('purchase_orders');
|
||||
|
||||
Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
|
||||
|
||||
Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
||||
@@ -379,39 +384,20 @@ Route::get('/payments/manual', function(){
|
||||
echo '</table>';
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::get('/1688/fix', function(){
|
||||
set_time_limit(1800);
|
||||
$purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get();
|
||||
|
||||
$bookings = [];
|
||||
foreach($purchaseOrderDocuments as $document){
|
||||
foreach($document->files as $file) {
|
||||
if(!$file->file->file_info) dd($file);
|
||||
continue;
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
$pdf = $parser->parseFile(Storage::disk('documents')->path($file->file->file_info->original->file));
|
||||
$booking = $document->owner;
|
||||
$booking->status = ApprovalStatus::APPROVED;
|
||||
$booking->save();
|
||||
|
||||
$text = $pdf->getText();
|
||||
$tables = explode('Amount (yuan)', $text);
|
||||
array_shift($tables);
|
||||
$booking->documents()->whereIn('document_type', [DocumentType::INVOICE, DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->delete();
|
||||
|
||||
foreach ($tables as $table){
|
||||
$products = preg_split('/(yuan\/|yuan \/)/', str_replace("\r\n","",$table));
|
||||
|
||||
array_pop($products);
|
||||
foreach ($products as $product){
|
||||
$product = preg_split('/[\t]/',$product);
|
||||
$type = count($product) === 10 ? 2 : 1;
|
||||
$bookings[$document->owner->marking] = [
|
||||
'description' => str_replace("\n","",$product[$type === 2 ? 6 : 3]),
|
||||
'quantity' => (int) str_replace("\n","",$product[$type === 2 ? 8 : 5]),
|
||||
'unit_price' => (float) str_replace("\n","",$product[$type === 2 ? 9 : 6])
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
// if($document->owner->status === ApprovalStatus::COMPLETED) continue;
|
||||
// (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner);
|
||||
(App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner);
|
||||
}
|
||||
dd($bookings);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user