mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
fixing bugs
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ class CreatePaymentProofDocumentLogic extends AbstractControllerLogic
|
||||
|
||||
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
|
||||
|
||||
$object = new DocumentObject(DocumentType::CUSTOMER_PAYMENT_PROOF, $request->input('files'), '', ApprovalStatus::APPROVED, 'china_bank_slip');
|
||||
$object = new DocumentObject(DocumentType::CURRENCY_VENDOR_PAYMENT_PROOF, $request->input('files'), '', ApprovalStatus::APPROVED, 'china_bank_slip');
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($transaction, $object);
|
||||
|
||||
@@ -18,6 +18,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Document;
|
||||
use Meneses\LaravelLaravelMpdf\Facades\LaravelLaravelMpdf;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
|
||||
@@ -83,10 +84,10 @@ class CreateInvoiceTransactionProcessor
|
||||
->first();
|
||||
|
||||
if ($po_order_transaction) {
|
||||
$paymant_amount = $this->calculatesBookingPaidAmount->execute($booking, $booking->fix_currency_id);
|
||||
$payment_amount = $this->calculatesBookingPaidAmount->execute($booking, $booking->fix_currency_id);
|
||||
$booking_amount = $booking->fix_amount;
|
||||
|
||||
if ((float) $booking_amount === (float) $paymant_amount) {
|
||||
if ((float) $booking_amount === (float) $payment_amount) {
|
||||
|
||||
$transaction = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
@@ -113,7 +114,7 @@ class CreateInvoiceTransactionProcessor
|
||||
$transaction->receiver,
|
||||
$transaction->recipient_bank_account_id,
|
||||
$transaction->payment_method,
|
||||
$paymant_amount,
|
||||
$payment_amount,
|
||||
$booking_amount,
|
||||
$transaction->currency_id,
|
||||
$transaction->original_currency_id,
|
||||
@@ -146,17 +147,19 @@ class CreateInvoiceTransactionProcessor
|
||||
ApprovalStatus::COMPLETED,
|
||||
'deliver_orders'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
|
||||
|
||||
$payment_order_pdf = LaravelMpdf::loadView('pages.pdfs.payment_order', ['invoice_transaction' => $invoice_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
|
||||
$invoice_pdf = LaravelMpdf::loadView('pages.pdfs.invoice', ['invoice_transaction' => $invoice_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
|
||||
$document_object = new DocumentObject(
|
||||
DocumentType::PAYMENT_ORDER,
|
||||
[chunk_split('data:application/pdf;base64,'.base64_encode($payment_order_pdf->output()))],
|
||||
DocumentType::INVOICE,
|
||||
[chunk_split('data:application/pdf;base64,'.base64_encode($invoice_pdf->output()))],
|
||||
'',
|
||||
ApprovalStatus::COMPLETED,
|
||||
'payment_orders'
|
||||
'invoices'
|
||||
);
|
||||
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
@@ -172,7 +175,7 @@ class CreateInvoiceTransactionProcessor
|
||||
$transaction->receiver,
|
||||
$transaction->recipient_bank_account_id,
|
||||
$transaction->payment_method,
|
||||
$paymant_amount,
|
||||
$payment_amount,
|
||||
$booking_amount,
|
||||
$transaction->currency_id,
|
||||
$transaction->original_currency_id,
|
||||
|
||||
@@ -28,7 +28,7 @@ class GeneratesTransactionBillNumber
|
||||
public function execute(string $prefix): string {
|
||||
$date = carbon::now();
|
||||
|
||||
$billNumber = $prefix.$date->format('Y').$date->format('m').$date->format('d').mt_rand(10000, 99999);
|
||||
$billNumber = $prefix.$date->format('Y').$date->format('m').'-'.mt_rand(10000, 99999);
|
||||
|
||||
return !$this->checksIfTransactionBillNumberExists->execute($billNumber) ? $billNumber : self::execute($prefix);
|
||||
|
||||
|
||||
@@ -19,6 +19,6 @@ final class DocumentType {
|
||||
|
||||
public const PURCHASE_ORDER = 'PURCHASE_ORDER';
|
||||
public const DELIVER_ORDER = 'DELIVER_ORDER';
|
||||
public const PAYMENT_ORDER = 'PAYMENT_ORDER';
|
||||
public const INVOICE = 'INVOICE';
|
||||
public const SUPPLIER_DELIVER_ORDER = 'SUPPLIER_DELIVER_ORDER';
|
||||
}
|
||||
|
||||
@@ -36,10 +36,12 @@ class BookingResource extends JsonResource
|
||||
'fixed_currency' => new CurrencyResource($this->fixedCurrency),
|
||||
'convertible_currency' => new CurrencyResource($this->convertibleCurrency),
|
||||
'conversion_currency' => new CurrencyResource($this->conversionCurrency),
|
||||
'purchase_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::PURCHASE_ORDER)->first()),
|
||||
'deliver_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER)->first()),
|
||||
'payment_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::PAYMENT_ORDER)->first()),
|
||||
'supplier_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()),
|
||||
'documents' => [
|
||||
'purchase_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::PURCHASE_ORDER)->first()),
|
||||
'deliver_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER)->first()),
|
||||
'invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::INVOICE)->first()),
|
||||
'supplier_delivery_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()),
|
||||
],
|
||||
'status' => $this->status,
|
||||
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y'),
|
||||
$this->mergeWhen($this->relationLoaded('transactions'), [
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div class="row p-t-10 p-b-10" v-if="item && item.status === 3">
|
||||
<div class="col p-b-10 bg-white text-center"><h4>Order Completed</h4></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
+110
-61
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user