diff --git a/ui/hv2-ui/src/app/ledger/ledger.component.html b/ui/hv2-ui/src/app/ledger/ledger.component.html index 0698b09..dd1981f 100644 --- a/ui/hv2-ui/src/app/ledger/ledger.component.html +++ b/ui/hv2-ui/src/app/ledger/ledger.component.html @@ -5,6 +5,16 @@ - +
+ Konto auswählen: + + + Mieter + {{p.description}} + + +
+ +
\ No newline at end of file diff --git a/ui/hv2-ui/src/app/ledger/ledger.component.ts b/ui/hv2-ui/src/app/ledger/ledger.component.ts index 711f5d1..c8871ef 100644 --- a/ui/hv2-ui/src/app/ledger/ledger.component.ts +++ b/ui/hv2-ui/src/app/ledger/ledger.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { AccountComponent } from '../account/account.component'; +import { AccountService } from '../data-object-service'; import { Account } from '../data-objects'; import { ExtApiService } from '../ext-data-object-service'; import { MessageService } from '../message.service'; @@ -11,23 +12,23 @@ import { MessageService } from '../message.service'; }) export class LedgerComponent implements OnInit { - fallbackAccount: Account - fallbackAccountId: number + accounts: Account[] + accountId: number - @ViewChild('fallbackAccountComponent') fallbackAccountComponent: AccountComponent + @ViewChild('accountComponent') accountComponent: AccountComponent constructor( - private extApiService: ExtApiService, + private accountService: AccountService, private messageService: MessageService ) { } async getAccount(): Promise { try { - this.messageService.add("Trying to load fallback account") - this.fallbackAccount = await this.extApiService.getAccountByDescription('fallback_account') - this.messageService.add("Account loaded") + this.messageService.add("Trying to load accounts") + this.accounts = await this.accountService.getAccounts() + this.messageService.add("Accounts loaded") } catch (err) { this.messageService.add(JSON.stringify(err, undefined, 4)) } @@ -35,7 +36,6 @@ export class LedgerComponent implements OnInit { async ngOnInit(): Promise { await this.getAccount() - this.fallbackAccountId = this.fallbackAccount.id } }