From a79ce7e2b75a6852966ca809925d0256ba2c3e29 Mon Sep 17 00:00:00 2001 From: JiaSheng Date: Tue, 15 Aug 2023 22:56:42 +0800 Subject: [PATCH 1/3] transaction not tally --- .../FetchCompanyTransactionStatementLogic.php | 9 +++++++++ .../CustomerTransactionHistorySectionComponent.vue | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Transactions/ControllersLogic/FetchCompanyTransactionStatementLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/FetchCompanyTransactionStatementLogic.php index c16ac453..a078a01d 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/FetchCompanyTransactionStatementLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/FetchCompanyTransactionStatementLogic.php @@ -55,6 +55,15 @@ class FetchCompanyTransactionStatementLogic extends AbstractControllerLogic ->where('owner_type', Wallet::class) ->where('type', '!=', TransactionType::PAYMENT); }) + ->orWhere(function ($query) use ($companyId) { + $query + ->where('type', TransactionType::INVOICE) + ->where('owner_type', Booking::class) + ->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]) + ->whereHas('booking', function ($query) use ($companyId) { + $query->where('company_id', $companyId); + }); + }) ->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]) ->orderBy('created_at', 'desc') ->get(); diff --git a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index 7b0aee28..026a76c5 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -24,7 +24,8 @@
{{item.created_at}}
{{ convertTransactionType(item.type) }} {{ item.payment_reference ? ' - ' + item.payment_reference : '' }}
{{item.booking_marking}}
-
{{[5, 9].includes(parseFloat(item.type)) ? (Math.round((parseFloat(item.amount) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : ''}}
+
{{[5, 9].includes(parseFloat(item.type)) ? (Math.round((parseFloat(item.amount) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : ''}}
+
{{(Math.round(((parseFloat(item.amount) / parseFloat(item.currency_rate) + parseFloat(item.service_charge)) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
{{[1, 11].includes(parseFloat(item.type)) ? '- ' + (Math.round((parseFloat(item.amount) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : ''}}
{{remainingBalance(index)}}
@@ -104,7 +105,11 @@ export default { if(this.transaction){ let transactions = this.transaction.slice().reverse(); transactions.slice(0, transactions.length - index).map(function(transaction) { - [1, 11].includes(transaction.type) ? tempBalance -= (transaction.amount) : tempBalance += (transaction.amount); + if (transaction.type === 2) { + tempBalance += (transaction.amount / transaction.currency_rate + transaction.service_charge); + } else { + [1, 11].includes(transaction.type) ? tempBalance -= (transaction.amount) : tempBalance += (transaction.amount); + } return tempBalance }, 0); } From 00c2672d16de4a004c225f93d0d221925be49715 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Thu, 17 Aug 2023 23:19:03 +0800 Subject: [PATCH 2/3] update invoice amount --- resources/views/pages/pdfs/invoice.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/pages/pdfs/invoice.blade.php b/resources/views/pages/pdfs/invoice.blade.php index 98d6dc05..db6c42c5 100644 --- a/resources/views/pages/pdfs/invoice.blade.php +++ b/resources/views/pages/pdfs/invoice.blade.php @@ -79,11 +79,11 @@ @foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail) @php - $exactUnitPrice = bcdiv($transaction_detail->price, $transaction->currency_rate, 5); + $exactUnitPrice = bcdiv($transaction_detail->price, $transaction->currency_rate, 7); $itemTotal = bcmul($exactUnitPrice, $transaction_detail->quantity, 5); $displayedItemTotal = bcmul($exactUnitPrice, $transaction_detail->quantity, 2); $displayedSubtotal = bcadd($displayedSubtotal, $displayedItemTotal, 2); - $subtotal = bcadd($subtotal, $displayedItemTotal, 2); + $subtotal = bcadd($subtotal, $itemTotal, 5); @endphp {{ $key + 1 }} @@ -130,7 +130,7 @@ @endif @php - $displayedTotal = bcadd(bcadd(bcadd($displayedSubtotal, $transaction->service_charge, 2), $transaction->tax, 2), $voucherDiscount, 2); + $displayedTotal = bcadd(bcadd(bcadd($subtotal, $transaction->service_charge, 5), $transaction->tax, 5), $voucherDiscount, 5); $expectedTotal = bcadd(bcadd(bcadd($subtotal, $transaction->service_charge, 5), $transaction->tax, 5), $voucherDiscount, 5); $discrepancy = bcsub($displayedTotal, $expectedTotal, 5); $total = bcadd(bcadd(bcadd($subtotal, $transaction->service_charge, 5), $transaction->tax, 5), $voucherDiscount, 5); From dbae9687d60e5a3b548686487b44956884588045 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 18 Aug 2023 13:56:22 +0800 Subject: [PATCH 3/3] update c2c terms and condition text --- .../companies/elements/NewServiceAnnouncementComponent.vue | 4 ++-- .../components/general/forms/C2cConfirmationFormComponent.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/assets/vue/components/companies/elements/NewServiceAnnouncementComponent.vue b/resources/assets/vue/components/companies/elements/NewServiceAnnouncementComponent.vue index 2857ff1f..5b2fd27a 100644 --- a/resources/assets/vue/components/companies/elements/NewServiceAnnouncementComponent.vue +++ b/resources/assets/vue/components/companies/elements/NewServiceAnnouncementComponent.vue @@ -85,8 +85,8 @@
-

Bank Transfer Security: Safeguard Your Transactions with Corporate Account Payment (公对公转账)

-

This payment is designed to facilitate CNY payments from a corporate bank account to your suppliers' corporate bank accounts.

+

Bank Transfer Security: Safeguard Your Transactions with Enterprise Account Payment (公对公转账)

+

This payment is designed to facilitate CNY payments from an enterprise bank account to your suppliers' enterprise bank accounts

With this method, you can:

  • Enjoy a worry-free transaction experience
  • diff --git a/resources/assets/vue/components/general/forms/C2cConfirmationFormComponent.vue b/resources/assets/vue/components/general/forms/C2cConfirmationFormComponent.vue index 4d2998bc..1c4c9647 100644 --- a/resources/assets/vue/components/general/forms/C2cConfirmationFormComponent.vue +++ b/resources/assets/vue/components/general/forms/C2cConfirmationFormComponent.vue @@ -8,7 +8,7 @@

    To activate the service, please take note of the following important details:

      -
    1. The minimum transfer amount for each transaction is CNY 10,000.
    2. +
    3. First point: The minimum amount is CNY 10,000 for each transfer.
    4. The purchase order must be filled in before making payments.
    5. The processing time for each transaction is 3-7 working days.