5 Commits
0.1.2 ... 0.2.0

6 changed files with 31 additions and 24 deletions

View File

@ -116,7 +116,7 @@ $$;
CREATE TRIGGER maintain_ledger_trigger
AFTER INSERT ON account_entry_t
FOR EACH ROW
WHEN (NEW.account != 1000 AND NEW.account_entry_category NOT IN (3, 4))
WHEN (NEW.account != 1000 AND NEW.account_entry_category NOT IN (3, 4, 29))
EXECUTE FUNCTION maintain_ledger();

View File

@ -31,13 +31,13 @@
Saldo: {{saldo?.saldo | number:'1.2-2'}} €
</div>
<div id="secondBlock">
<table mat-table [dataSource]="accountEntriesDataSource" matSort #zftable>
<table mat-table [dataSource]="accountEntriesDataSource" #zftable>
<ng-container matColumnDef="createdAt">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Datum</th>
<th mat-header-cell *matHeaderCellDef >Datum</th>
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.created_at | date}}</td>
</ng-container>
<ng-container matColumnDef="fiscalYear">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Jahr</th>
<th mat-header-cell *matHeaderCellDef >Jahr</th>
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.fiscal_year}}</td>
</ng-container>
<ng-container matColumnDef="description">
@ -45,7 +45,7 @@ Saldo: {{saldo?.saldo | number:'1.2-2'}} €
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.description}}</td>
</ng-container>
<ng-container matColumnDef="document_no">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Belegnummer</th>
<th mat-header-cell *matHeaderCellDef >Belegnummer</th>
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.document_no}}</td>
</ng-container>
<ng-container matColumnDef="amount">
@ -53,11 +53,11 @@ Saldo: {{saldo?.saldo | number:'1.2-2'}} €
<td mat-cell *matCellDef="let element" class="rightaligned">{{element.rawAccountEntry.amount | number:'1.2-2'}} €</td>
</ng-container>
<ng-container matColumnDef="category">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Kategorie</th>
<th mat-header-cell *matHeaderCellDef >Kategorie</th>
<td mat-cell *matCellDef="let element">{{element.accountEntryCategory}}</td>
</ng-container>
<ng-container matColumnDef="overhead_relevant">
<th mat-header-cell *matHeaderCellDef mat-sort-header>BK relevant</th>
<th mat-header-cell *matHeaderCellDef >BK relevant</th>
<td mat-cell *matCellDef="let element">{{element.overheadRelevant}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="accountEntriesDisplayedColumns"></tr>

View File

@ -3,7 +3,6 @@ import { Component, Input, OnInit, OnChanges, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatButton } from '@angular/material/button';
import { MatExpansionPanel } from '@angular/material/expansion';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { AccountEntryCategoryService, AccountEntryService, AccountService } from '../data-object-service';
import { Account, AccountEntry, AccountEntryCategory, NULL_AccountEntry } from '../data-objects';
@ -32,7 +31,6 @@ export class AccountComponent implements OnInit {
@Input() shallBeRentPayment: boolean
@ViewChild('addAccountEntryButton') addAccountEntryButton: MatButton
@ViewChild(MatSort) sort: MatSort;
account: Account
accountEntries: DN_AccountEntry[]
@ -157,6 +155,9 @@ export class AccountComponent implements OnInit {
this.presetDescription = new FormControl("Miete")
this.messageService.add(`shall be rentpayment`)
this.messageService.add(`AccountComponent.init d, account: ${this.selectedAccountId}`)
} else {
this.presetCategory = new FormControl()
this.presetDescription = new FormControl()
}
this.messageService.add(`AccountComponent.init, account: ${this.selectedAccountId}`)
@ -172,8 +173,4 @@ export class AccountComponent implements OnInit {
this.init()
}
ngAfterViewInit(): void {
this.accountEntriesDataSource.sort = this.sort;
}
}

View File

@ -1,5 +1,5 @@
// export const serviceBaseUrl = "https://api.hv.nober.de";
export const serviceBaseUrl = "http://172.16.3.96:8080";
export const serviceBaseUrl = "https://api.hv.nober.de";
// export const serviceBaseUrl = "http://172.16.3.96:8080";
// export const serviceBaseUrl = "http://localhost:8080"
export const authserviceBaseUrl = "https://authservice.hottis.de"
export const applicationId = "hv2"

View File

@ -5,6 +5,16 @@
</mat-card-title>
</mat-card-header>
<mat-card-content>
<app-account #fallbackAccountComponent [selectedAccountId]="fallbackAccountId" [shallBeRentPayment]="false"></app-account>
<div>
<span>Konto auswählen: </span>
<mat-form-field appearance="outline">
<mat-select #mapSelect [(ngModel)]="accountId" name="account">
<mat-label>Mieter</mat-label>
<mat-option *ngFor="let p of accounts" [value]="p.id">{{p.description}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<app-account [selectedAccountId]="accountId" [shallBeRentPayment]="false"></app-account>
</mat-card-content>
</mat-card>

View File

@ -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<void> {
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<void> {
await this.getAccount()
this.fallbackAccountId = this.fallbackAccount.id
}
}