more ledger stuff
This commit is contained in:
parent
2b883aee02
commit
797151d547
@ -5,8 +5,29 @@
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
<app-account [selectedAccountId]="accountId" [shallBeRentPayment]="false"></app-account>
|
||||
|
||||
<mat-accordion>
|
||||
<mat-expansion-panel (opened)="collapseIncomeDetails = true"
|
||||
(closed)="collapseIncomeDetails = false">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
Einnahmen
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<app-account [selectedAccountId]="incomeAccountId" [shallBeRentPayment]="false"></app-account>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel (opened)="collapseExpenseDetails = true"
|
||||
(closed)="collapseExpenseDetails = false">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
Ausgaben
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<app-account [selectedAccountId]="expenseAccountId" [shallBeRentPayment]="false"></app-account>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
@ -1,5 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AccountService } from '../data-object-service';
|
||||
import { Account } from '../data-objects';
|
||||
import { ExtApiService } from '../ext-data-object-service';
|
||||
import { MessageService } from '../message.service';
|
||||
@ -11,8 +10,14 @@ import { MessageService } from '../message.service';
|
||||
})
|
||||
export class LedgerComponent implements OnInit {
|
||||
|
||||
account: Account
|
||||
accountId: number
|
||||
incomeAccount: Account
|
||||
incomeAccountId: number
|
||||
expenseAccount: Account
|
||||
expenseAccountId: number
|
||||
|
||||
collapseIncomeDetails: boolean = false
|
||||
collapseExpenseDetails: boolean = false
|
||||
|
||||
|
||||
constructor(
|
||||
private extApiService: ExtApiService,
|
||||
@ -22,7 +27,8 @@ export class LedgerComponent implements OnInit {
|
||||
async getAccount(): Promise<void> {
|
||||
try {
|
||||
this.messageService.add("Trying to load ledger account")
|
||||
this.account = await this.extApiService.getAccountByDescription('Ledger')
|
||||
this.incomeAccount = await this.extApiService.getAccountByDescription('LedgerIncome')
|
||||
this.expenseAccount = await this.extApiService.getAccountByDescription('LedgerExpense')
|
||||
this.messageService.add("Account loaded")
|
||||
} catch (err) {
|
||||
this.messageService.add(JSON.stringify(err, undefined, 4))
|
||||
@ -31,7 +37,8 @@ export class LedgerComponent implements OnInit {
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
await this.getAccount()
|
||||
this.accountId = this.account.id
|
||||
this.incomeAccountId = this.incomeAccount.id
|
||||
this.expenseAccountId = this.expenseAccount.id
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user