ledger
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Kategorie</mat-label>
|
||||
<mat-select [(ngModel)]="newAccountEntry.account_entry_category" name="category" disabled="shallBeRentPayment">
|
||||
<mat-select [(ngModel)]="newAccountEntry.account_entry_category" name="category" [disabled]="shallBeRentPayment">
|
||||
<mat-option *ngFor="let p of accountEntryCategories" [value]="p.id">{{p.description}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
@ -1,5 +1,5 @@
|
||||
export const serviceBaseUrl = "https://api.hv.nober.de";
|
||||
// export const serviceBaseUrl = "https://api.hv.nober.de";
|
||||
// export const serviceBaseUrl = "http://172.16.10.38:5000";
|
||||
// export const serviceBaseUrl = "http://localhost:8080"
|
||||
export const serviceBaseUrl = "http://localhost:8080"
|
||||
export const authserviceBaseUrl = "https://authservice.hottis.de"
|
||||
export const applicationId = "hv2"
|
||||
|
@ -6,7 +6,7 @@ import { MessageService } from './message.service';
|
||||
import { serviceBaseUrl } from './config';
|
||||
|
||||
|
||||
import { Fee, OverheadAdvance } from './data-objects';
|
||||
import { Account, Fee, OverheadAdvance } from './data-objects';
|
||||
import { Saldo, Tenant_with_Saldo } from './ext-data-objects';
|
||||
|
||||
|
||||
@ -19,6 +19,11 @@ export class ExtApiService {
|
||||
return this.http.get<OverheadAdvance[]>(`${serviceBaseUrl}/v1/overhead_advances/flat/${id}`).toPromise()
|
||||
}
|
||||
|
||||
async getAccountByDescription(description: string): Promise<Account> {
|
||||
this.messageService.add(`ExtApiService: get account by description ${description}`);
|
||||
return this.http.get<Account>(`${serviceBaseUrl}/v1/accounts/bydescription/${description}`).toPromise()
|
||||
}
|
||||
|
||||
async getFeeByTenancies(id: number): Promise<Fee[]> {
|
||||
this.messageService.add(`ExtApiService: get fees by flat ${id}`);
|
||||
return this.http.get<Fee[]>(`${serviceBaseUrl}/v1/fees/tenancy/${id}`).toPromise()
|
||||
|
@ -1 +1,12 @@
|
||||
<p>ledger works!</p>
|
||||
<mat-card class="defaultCard">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
Buchführung
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
<app-account [selectedAccountId]="accountId" [shallBeRentPayment]="false"></app-account>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
@ -1,4 +1,8 @@
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ledger',
|
||||
@ -7,9 +11,27 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class LedgerComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
account: Account
|
||||
accountId: number
|
||||
|
||||
ngOnInit(): void {
|
||||
constructor(
|
||||
private extApiService: ExtApiService,
|
||||
private messageService: MessageService
|
||||
) { }
|
||||
|
||||
async getAccount(): Promise<void> {
|
||||
try {
|
||||
this.messageService.add("Trying to load ledger account")
|
||||
this.account = await this.extApiService.getAccountByDescription('Ledger')
|
||||
this.messageService.add("Account loaded")
|
||||
} catch (err) {
|
||||
this.messageService.add(JSON.stringify(err, undefined, 4))
|
||||
}
|
||||
}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
await this.getAccount()
|
||||
this.accountId = this.account.id
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user