ledger balance

This commit is contained in:
Sirttas
2026-06-01 19:22:27 +02:00
parent 42c7e59d63
commit c23ec0cb53
26 changed files with 161 additions and 100 deletions
+5 -1
View File
@@ -1,4 +1,5 @@
import {
BalanceResponse,
CombinedLedgerResponse,
CombinedLedgerResponseTypeEnum,
CreateCombinedLedgerRequest,
@@ -75,7 +76,10 @@ export const useLedgersStore = defineStore('ledgers', () => {
return {ledgers, findById, findAllById, createMain, createCombined, updateMain, updateCombined, refresh};
})
export const findAllTransactionInLeger = (ledger: Ledger | string): Promise<TransactionResponse[]> => transactionApi.finAllTransactionsInLedger(typeof ledger == 'string' ? ledger : ledger.ledgerId).then(response => response.data)
const getLedgerId = (ledger: Ledger | string): string => typeof ledger == 'string' ? ledger : ledger.ledgerId;
export const findAllTransactionInLeger = (ledger: Ledger | string): Promise<TransactionResponse[]> => transactionApi.finAllTransactionsInLedger(getLedgerId(ledger)).then(response => response.data)
export const getLedgerBalance = (ledger: Ledger | string): Promise<BalanceResponse> => ledgerApi.findBalanceByLedgerId(getLedgerId(ledger)).then(response => response.data)
export const useLedgerParam = () => {
const {findById} = useLedgersStore();