fixing bugs

This commit is contained in:
omair saleh
2021-03-22 04:16:57 +08:00
parent efc8a38c37
commit 192d07e3a0
16 changed files with 210 additions and 183 deletions
@@ -29,8 +29,8 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
*/
protected function notification():array {
return [
'title' => 'Create Payment Attempt',
'message' => 'You have successfully created a payment attempt'
'title' => 'Create Payment Booking',
'message' => 'You have successfully created a payment booking'
];
}
@@ -59,12 +59,6 @@ class RenderDocumentLogic extends AbstractControllerLogic
throw new ResourceNotFoundException();
}
$extention = explode('.', $file);
if ($extention[1] == 'pdf') {
return $this->response(['src' => chunk_split(base64_encode(Storage::disk('documents')->get($file)))]);
}
else {
return $this->response(['src' => Storage::disk('documents')->get($file)]);
}
return $this->response(['src' => explode('.', $file)[1] == 'pdf' ? chunk_split(base64_encode(Storage::disk('documents')->get($file))) : Storage::disk('documents')->get($file) ]);
}
}
@@ -17,6 +17,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Document;
use App\Models\Transaction;
use Barryvdh\DomPDF\PDF;
use Carbon\Carbon;
@@ -115,12 +116,13 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic
$object = new DocumentObject(
DocumentType::CUSTOMER_PAYMENT_PROOF,
[chunk_split('data:application/pdf;base64,'.base64_encode($pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'',
ApprovalStatus::COMPLETED,
'supplier_orders'
);
foreach ($transactions as $key => $row) {
/** @var Document $document */
$document = $this->createsDocument->execute($row, $object);
$this->createsFile->execute($document, $object);
}
@@ -22,7 +22,7 @@ class SuspendTransactionLogic extends AbstractControllerLogic
protected function notification():array {
return [
'title' => 'Suspend Transaction',
'message' => 'You have successfully suspended the payment attempt'
'message' => 'You have successfully suspended the payment booking'
];
}
File diff suppressed because one or more lines are too long
@@ -38,35 +38,40 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="row" v-if="type === 2">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.bank_branch">
<label class="muted">Bank Branch</label>
<input type="text" class="form-control" v-model="parameters.bank_branch">
</validation-wrapper-component>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.bank_branch">
<label class="muted">Bank Branch</label>
<input type="text" class="form-control" v-model="parameters.bank_branch">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="col p-r-5">
<validation-wrapper-component :validator="$v.parameters.swift">
<label class="muted">Swift</label>
<input type="text" class="form-control" v-model="parameters.swift">
</validation-wrapper-component>
</div>
<div class="col p-l-5">
<validation-wrapper-component :validator="$v.parameters.snap">
<label class="muted">Snap</label>
<input type="text" class="form-control" v-model="parameters.snap">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.bank_name">
<label class="muted">Bank Name</label>
<input type="text" class="form-control" v-model="parameters.bank_name">
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.swift">
<label class="muted">Swift</label>
<input type="text" class="form-control" v-model="parameters.swift">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.snap">
<label class="muted">Snap</label>
<input type="text" class="form-control" v-model="parameters.snap">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-20" v-if="type !== 2">
<div class="col">
<validation-wrapper-component selecatable :validator="$v.parameters.bank_name">
@@ -75,14 +80,6 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10" v-if="type === 2">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.bank_name">
<label class="muted">Bank Name</label>
<input type="text" class="form-control" v-model="parameters.bank_name">
</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="type !== 2 ? 'modal':''" @click="$emit('close')">Cancel</div>
@@ -30,7 +30,13 @@
<div class="col">
<div class="row no-margin">
<div v-for="file in item.documents.files" v-bind:key="file.id" class="col-auto no-padding m-r-5">
<document-file-viewr-component :file="file"></document-file-viewr-component>
<document-file-viewr-component :file="file">
<template slot="button">
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
<i class="fa fa-file-image-o fs-10"></i>
</div>
</template>
</document-file-viewr-component>
</div>
</div>
</div>
@@ -120,6 +120,22 @@
<div class="btn btn-sm btn-block btn-success b-rad-none shadow-sm pointer requestModal" data-type="transferSummary" >Transfer Now</div>
</div>
</div>
<div class="row" v-if="summary.calculation.total > 0 && data.status === 0">
<div class="col">
<div class="alert alert-warning padding-15" role="alert">
<div class="font-heading fs-12 all-caps bold m-b-15">Create a transfer order</div>
<div class="row m-b-15">
<div class="col">
<div class="font-heading fs-10">You are unable to create a new transfer order until you upload your identification document for verification. You can verify your identity by clicking on the button below</div>
</div>
</div>
<button class="btn btn-xs all-caps b-rad-none btn-warning requestModal" data-type="identificationVerificationModal">Upload identification Document</button>
</div>
<modal-component type="identificationVerificationModal">
<identification-verification-form-component section="customerProfileSection" :data="data"></identification-verification-form-component>
</modal-component>
</div>
</div>
<modal-component v-if="summary.calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="transferSummary" size="large">
<booking-confirmation-component :data="summary" :section="section"></booking-confirmation-component>
</modal-component>
@@ -102,15 +102,6 @@
<div class="absolute w-100 b-l b-b b-r b-complete" :class="[{'hide': !paymentMethod.status}]" style="top: 100%; right: 0; z-index: 1;">
<div class="row text-left no-margin bg-white">
<div class="col no-padding">
<div class="row no-margin" :class="[{'bg-complete-light': paymentMethod.name === 'Cash Deposit'}, {'text-white': paymentMethod.name === 'Cash Deposit'}, {'hover-complete': paymentMethod.name !== 'Cash Deposit'}]" @click="updatePaymentType({name: 'Cash Deposit', id: 'cash'})">
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10">
<div class="row align-items-center justify-content-center">
<div class="col">
<div class="font-heading fs-10">Cash Deposit</div>
</div>
</div>
</div>
</div>
<div class="row no-margin" :class="[{'bg-complete-light': paymentMethod.name === 'Bank Transfer'}, {'text-white': paymentMethod.name === 'Bank Transfer'}, {'hover-complete': paymentMethod.name !== 'Bank Transfer'}]" @click="updatePaymentType({name: 'Bank Transfer', id: 'cash'})">
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10">
<div class="row align-items-center justify-content-center">
@@ -120,6 +111,15 @@
</div>
</div>
</div>
<div class="row no-margin" :class="[{'bg-complete-light': paymentMethod.name === 'Cash Deposit'}, {'text-white': paymentMethod.name === 'Cash Deposit'}, {'hover-complete': paymentMethod.name !== 'Cash Deposit'}]" @click="updatePaymentType({name: 'Cash Deposit', id: 'cash'})">
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10">
<div class="row align-items-center justify-content-center">
<div class="col">
<div class="font-heading fs-10">Cash Deposit</div>
</div>
</div>
</div>
</div>
<div class="row no-margin" :class="[{'bg-complete-light': paymentMethod.name === 'Cheque'}, {'text-white': paymentMethod.name === 'Cheque'}, {'hover-complete': paymentMethod.name !== 'Cheque'}]" @click="updatePaymentType({name: 'Cheque', id: 'cheque'})">
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10">
<div class="row align-items-center justify-content-center">
@@ -166,7 +166,7 @@
<button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="expandPayment = false">Cancel</button>
</div>
<div class="col p-l-0">
<button class="btn btn-xs all-caps b-rad-none btn-success btn-block" @click="submitForm()">Get Quotation</button>
<button class="btn btn-xs all-caps b-rad-none btn-success btn-block" @click="submitForm()">Create Booking</button>
</div>
</div>
</div>
@@ -246,7 +246,7 @@
<button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="cancelQuotation()">Cancel</button>
</div>
<div class="col p-l-0">
<button class="btn btn-xs all-caps b-rad-none btn-success btn-block requestModal" data-type="paymentSummary" >Lock Quotation</button>
<button class="btn btn-xs all-caps b-rad-none btn-success btn-block requestModal" data-type="paymentSummary" >Lock Booking</button>
</div>
<modal-component v-if="calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="paymentSummary">
<confirm-quotation-form-component v-on:cancelQuotation="cancelQuotation()" :calculation="calculation" :section="section" :id="item.id" :payment_method="paymentMethod.id" :amount="amount"></confirm-quotation-form-component>
@@ -276,7 +276,7 @@
error: '',
expandPayment: false,
paymentMethod: {
name: 'Cash Deposit',
name: 'Bank Transfer',
id: 'cash',
status: false
},
@@ -42,7 +42,7 @@
</div>
<div class="row m-b-20">
<div class="col">
<div class="font-heading text-danger fs-10 m-b-5">Please upload your payment proof before the quotation expires within 12 hours 30 minutes.</div>
<div class="font-heading text-danger fs-10 m-b-5">Please upload your payment proof before the booking expires within 12 hours 30 minutes.</div>
</div>
</div>
<div class="row m-b-5">
@@ -50,7 +50,7 @@
<button class="btn btn-sm all-caps b-rad-none btn-default bg-master-lighter" data-dismiss="modal">Cancel</button>
</div>
<div class="col-auto">
<button class="btn btn-sm all-caps b-rad-none btn-success" @click="submitForm()">Confirm Quotation</button>
<button class="btn btn-sm all-caps b-rad-none btn-success" @click="submitForm()">Confirm Booking</button>
</div>
</div>
<div class="row text-right">
@@ -7,7 +7,7 @@
<div class="row m-b-20">
<div class="col">
<h3 class="all-caps">Are you Sure?</h3>
<div class="fs-11">Are you sure you want to delete payment quotation? you will not be able to recover your quotation after confirming your action.</div>
<div class="fs-11">Are you sure you want to delete payment booking? you will not be able to recover your booking after confirming your action.</div>
</div>
</div>
<div class="row">
@@ -45,7 +45,7 @@
<div class="col">
<div class="row m-b-10">
<div class="col">
<div class="font-heading fs-11 text-warning m-b-10">Your payment total shown in the photo should tally with payment attempt total.</div>
<div class="font-heading fs-11 text-warning m-b-10">Your payment total shown in the photo should tally with payment booking total.</div>
</div>
</div>
</div>
@@ -104,7 +104,7 @@
<div class="col">
<div class="row m-b-10">
<div class="col">
<div class="font-head fs-10 all-caps">Payment Attempts</div>
<div class="font-head fs-10 all-caps">Payment Bookings</div>
</div>
</div>
<div class="row ">
@@ -169,7 +169,7 @@
<div class="col">
<div class="row m-b-10">
<div class="col">
<div class="font-head fs-10 all-caps">Expired Payment Attempts</div>
<div class="font-head fs-10 all-caps">Expired Payment Bookings</div>
</div>
</div>
<div class="row">
@@ -248,7 +248,7 @@
<div class="col-auto" :class="[{'bg-master-light': item.status === 1}, {'bg-master-lighter': item.status === 2}, {'bg-primary': item.status === 3}, {'pointer': item.status === 3}]">
<div class="row align-items-center h-100">
<div class="col">
<i class="fa" :class="[{'fa-spinner': item.status === 1 || item.status === 2}, {'fa-cloud-download': item.status === 3}, {'fa-ban': item.status === 4}, {'text-white': item.status === 3}, {'text-danger': item.status === 4}]"></i>
<i class="fa" :class="[{'fa-cloud-download': item.status === 3 || item.status === 1 || item.status === 2}, {'fa-ban': item.status === 4}, {'text-white': item.status === 3}, {'muted': item.status === 1 || item.status === 2}, {'text-danger': item.status === 4}]"></i>
</div>
</div>
</div>
@@ -79,7 +79,13 @@
</div>
<div class="row no-margin">
<div v-for="file in item.files" v-bind:key="file.id" class="col-auto no-padding m-r-5">
<document-file-viewr-component :file="file"></document-file-viewr-component>
<document-file-viewr-component :file="file">
<template slot="button">
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
<i class="fa fa-file-image-o fs-10"></i>
</div>
</template>
</document-file-viewr-component>
</div>
</div>
</div>
@@ -1,15 +1,15 @@
<template>
<div class="row parentContainer">
<div class="col">
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5 requestModal pointer" @click="loadFile" data-type="filePreview">
<i class="fa fa-file-image-o fs-10"></i>
<div class="requestModal pointer" @click="loadFile" data-type="filePreview">
<slot name="button" ></slot>
</div>
<modal-component styleType="fill-in" type="filePreview">
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
<div class="row">
<div class="col text-center">
<img :src="src" class="w-100" v-if="type !== 'pdf'">
<iframe v-if="type === 'pdf'" class="pdf-display" :src="'data:application/pdf;base64,'+src"></iframe>
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
</div>
</div>
</modal-component>
@@ -42,7 +42,7 @@
if(!this.loaded) {
this.isLoading = true;
let filePath = this.type === 'pdf' ? this.file.file.file_info.original.file : this.file.file.file_info[0].original.file;
this.submit(this.route('api.storage.document.file', filePath), 'get', 'imagePreviewSection', false, false)
this.submit(this.route('api.storage.document.file', filePath)+'/', 'get', 'imagePreviewSection', false, false)
}
},
renderPdf() {
+1 -1
View File
@@ -27,7 +27,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
Route::group(['middleware' => 'valid.token'], function () {
Route::get('/storage/{fileName}', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
require __DIR__ . '/company.php';