fix invoice complete bug

This commit is contained in:
Omair Saleh
2022-10-18 10:44:15 +08:00
parent 5fcd11e84c
commit 88cf72eb75
3 changed files with 5 additions and 5 deletions
@@ -103,7 +103,7 @@ class CallbackBillplzLogic
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED);
if($transaction->amount - $invoice->amount < 0.01) {
if(($invoice->amount - $transaction->amount) < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
@@ -81,7 +81,7 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic
$status = $request->route('status');
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('transaction_id')]);
$status === 'approve' ? $this->approvesDocument->execute($transaction->documents()->first()) : $this->rejectsDocument->execute($transaction->documents()->first());
$this->updatesTransactionStatus->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
@@ -90,7 +90,7 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic
$invoice = $transaction->owner;
$packingList = $invoice->owner;
if($transaction->amount - $invoice->amount < 0.01) {
if(($invoice->amount - $transaction->amount) < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
@@ -108,4 +108,4 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic
return $this->response([]);
}
}
}
@@ -17,7 +17,7 @@
<div class="col p-r-0">
<validation-wrapper-component :validator="$v.parameters.amount">
<label>Amount</label>
<input class="form-control text-black" style="cursor: not-allowed;" v-model="parameters.amount" v-money="{decimal: '.',thousands: '', precision: 2}">
<input class="form-control text-black" v-model="parameters.amount" v-money="{decimal: '.',thousands: '', precision: 2}">
</validation-wrapper-component>
</div>
<div class="col-auto b-r b-t b-b b-grey">