fix premise account stuff
This commit is contained in:
parent
28e505f570
commit
3c97fb3582
@ -40,7 +40,7 @@
|
||||
<input matInput name="city" [(ngModel)]="premise.city"/>
|
||||
</mat-form-field>
|
||||
</div><div>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-form-field appearance="outline" *ngIf="premise.account">
|
||||
<mat-label>Betriebskostenkonto</mat-label>
|
||||
<input matInput name="street" [(ngModel)]="premise.account"/>
|
||||
</mat-form-field>
|
||||
|
@ -50,6 +50,12 @@ export class PremiseDetailsComponent implements OnInit {
|
||||
this.messageService.add(JSON.stringify(this.premise, undefined, 4))
|
||||
if (this.premise.id == 0) {
|
||||
this.messageService.add("about to insert new premise")
|
||||
this.overheadAccount = {
|
||||
"id": 0,
|
||||
"description": `overhead_account_${this.premise.description}`
|
||||
}
|
||||
this.overheadAccount = await this.accountService.postAccount(this.overheadAccount)
|
||||
this.premise.account = this.overheadAccount.id
|
||||
this.premise = await this.premiseService.postPremise(this.premise)
|
||||
this.messageService.add(`Successfully added premises with id ${this.premise.id}`)
|
||||
} else {
|
||||
|
@ -68,18 +68,18 @@
|
||||
<input matInput name="iban" [(ngModel)]="tenant.iban"/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!--
|
||||
<div>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-form-field appearance="outline" *ngIf="tenant.account">
|
||||
<mat-label>Account ID</mat-label>
|
||||
<input matInput name="account_id" [readonly]="true" [ngModel]="account.id"/>
|
||||
<input matInput name="account_id" [readonly]="true" [ngModel]="tenant.account"/>
|
||||
</mat-form-field>
|
||||
<!--
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Account Description</mat-label>
|
||||
<input matInput name="account_desc" [readonly]="true" [ngModel]="account.description"/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
-->
|
||||
-->
|
||||
</div>
|
||||
<button #submitButton type="submit" mat-raised-button color="primary">Speichern</button>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user