transaction list display
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
import {isCombined, Ledger} from "@/ledger/ledger.ts";
|
||||
import {FolderOpenIcon} from '@heroicons/vue/24/outline';
|
||||
import {RouterLink} from "vue-router";
|
||||
import {routeNames} from "@/routes.ts";
|
||||
|
||||
interface Props {
|
||||
ledger: Ledger;
|
||||
link?: boolean;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@@ -14,6 +17,7 @@ const props = defineProps<Props>();
|
||||
<div class="flex">
|
||||
<FolderOpenIcon v-if="isCombined(ledger)" class="w-4 me-1" />
|
||||
<div v-else class="w-4 me-1"/>
|
||||
<span>{{ ledger.name }}</span>
|
||||
<RouterLink v-if="link" :to="{name: routeNames.listLedgerTransactions, params: {ledgerId: ledger.ledgerId}}">{{ ledger.name }}</RouterLink>
|
||||
<span v-else>{{ ledger.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -6,12 +6,14 @@ import {
|
||||
LedgerResponseTypeEnum,
|
||||
MainLedgerResponse,
|
||||
MainLedgerResponseTypeEnum,
|
||||
TransactionResponse,
|
||||
TransferResponseTypeEnum,
|
||||
UpdateCombinedLedgerRequest,
|
||||
UpdateMainLedgerRequest
|
||||
} from "@/generated/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref, triggerRef} from "vue";
|
||||
import {ledgerApi} from "@/mammon";
|
||||
import {ledgerApi, transactionApi} from "@/mammon";
|
||||
|
||||
export const LedgerTypes = LedgerResponseTypeEnum;
|
||||
|
||||
@@ -20,6 +22,7 @@ export type MainLedger = MainLedgerResponse & {type: MainLedgerResponseTypeEnum}
|
||||
export type CombinedLedger = CombinedLedgerResponse & {type: CombinedLedgerResponseTypeEnum}
|
||||
export type Ledger = MainLedger | CombinedLedger;
|
||||
|
||||
export const TransferTypes = TransferResponseTypeEnum;
|
||||
|
||||
export const systemLedgerRef = 'system';
|
||||
export const systemLedger = {
|
||||
@@ -71,3 +74,5 @@ 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user