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