mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
fix wallet bug
This commit is contained in:
@@ -100,7 +100,7 @@ class CreditWalletLogic extends AbstractControllerLogic
|
||||
}
|
||||
|
||||
$wallet = $company->wallets()->first();
|
||||
dd($wallet);
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute($type === 2 ? 'DEBIT-NOTE-' : 'CREDIT-NOTE-');
|
||||
|
||||
$transaction_object = new TransactionObject($billNumber, $type === 2 ? TransactionType::DEBIT_NOTE : TransactionType::CREDIT_NOTE, 1, $wallet->company->id, 1, PaymentMethodType::CASH, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::APPROVED, [], $reference);
|
||||
@@ -109,7 +109,7 @@ dd($wallet);
|
||||
$updateWalletAmount = $type === 2 ? ($wallet->amount - $transaction->amount) : ($wallet->amount + $transaction->amount);
|
||||
|
||||
$walletObject = new WalletObject($wallet->company->id, $wallet->currency_id, $wallet->code, $updateWalletAmount);
|
||||
|
||||
dd($walletObject);
|
||||
$wallet = $this->updatesWallet->execute($wallet, $walletObject);
|
||||
|
||||
return $this->resourceResponse(new WalletResource($wallet));
|
||||
|
||||
Reference in New Issue
Block a user