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
+1 -1
View File
@@ -136,7 +136,7 @@ defineExpose({ open });
</template>
<style scoped>
@reference "tailwindcss";
@reference "@/style.css";
button.switch {
@apply flex items-center px-4 rounded-md bg-slate-600;
+1 -1
View File
@@ -26,7 +26,7 @@ const ledgerId = computed({
</template>
<style scoped>
@reference "tailwindcss";
@reference "@/style.css";
.system-ledger {
@apply text-emerald-400;
+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();