Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
b748ba7a77
|
|||
ab365c65a1 |
@ -1365,7 +1365,7 @@ SELECT
|
|||||||
,description
|
,description
|
||||||
,account
|
,account
|
||||||
,created_at
|
,created_at
|
||||||
,due_at
|
,fiscal_year
|
||||||
,amount
|
,amount
|
||||||
,document_no
|
,document_no
|
||||||
,account_entry_category
|
,account_entry_category
|
||||||
@ -1383,7 +1383,7 @@ def insert_account_entry(user, token_info, **args):
|
|||||||
v_description = body["description"]
|
v_description = body["description"]
|
||||||
v_account = body["account"]
|
v_account = body["account"]
|
||||||
v_created_at = body["created_at"]
|
v_created_at = body["created_at"]
|
||||||
v_due_at = body["due_at"]
|
v_fiscal_year = body["fiscal_year"]
|
||||||
v_amount = body["amount"]
|
v_amount = body["amount"]
|
||||||
v_document_no = body["document_no"]
|
v_document_no = body["document_no"]
|
||||||
v_account_entry_category = body["account_entry_category"]
|
v_account_entry_category = body["account_entry_category"]
|
||||||
@ -1394,7 +1394,7 @@ INSERT INTO account_entry_t
|
|||||||
description
|
description
|
||||||
,account
|
,account
|
||||||
,created_at
|
,created_at
|
||||||
,due_at
|
,fiscal_year
|
||||||
,amount
|
,amount
|
||||||
,document_no
|
,document_no
|
||||||
,account_entry_category
|
,account_entry_category
|
||||||
@ -1413,7 +1413,7 @@ INSERT INTO account_entry_t
|
|||||||
v_description
|
v_description
|
||||||
,v_account
|
,v_account
|
||||||
,v_created_at
|
,v_created_at
|
||||||
,v_due_at
|
,v_fiscal_year
|
||||||
,v_amount
|
,v_amount
|
||||||
,v_document_no
|
,v_document_no
|
||||||
,v_account_entry_category
|
,v_account_entry_category
|
||||||
@ -1432,7 +1432,7 @@ SELECT
|
|||||||
,description
|
,description
|
||||||
,account
|
,account
|
||||||
,created_at
|
,created_at
|
||||||
,due_at
|
,fiscal_year
|
||||||
,amount
|
,amount
|
||||||
,document_no
|
,document_no
|
||||||
,account_entry_category
|
,account_entry_category
|
||||||
@ -1453,7 +1453,7 @@ SELECT
|
|||||||
,description
|
,description
|
||||||
,account
|
,account
|
||||||
,created_at
|
,created_at
|
||||||
,due_at
|
,fiscal_year
|
||||||
,amount
|
,amount
|
||||||
,document_no
|
,document_no
|
||||||
,account_entry_category
|
,account_entry_category
|
||||||
@ -1474,7 +1474,7 @@ SELECT
|
|||||||
,description
|
,description
|
||||||
,account
|
,account
|
||||||
,created_at
|
,created_at
|
||||||
,due_at
|
,fiscal_year
|
||||||
,amount
|
,amount
|
||||||
,document_no
|
,document_no
|
||||||
,account_entry_category
|
,account_entry_category
|
||||||
|
@ -1793,9 +1793,8 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
created_at:
|
created_at:
|
||||||
type: string
|
type: string
|
||||||
due_at:
|
fiscal_year:
|
||||||
type: string
|
type: integer
|
||||||
nullable: true
|
|
||||||
amount:
|
amount:
|
||||||
type: number
|
type: number
|
||||||
document_no:
|
document_no:
|
||||||
|
@ -5,6 +5,6 @@ from flask_cors import CORS
|
|||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
app = connexion.App('hv2-api')
|
app = connexion.App('hv2-api')
|
||||||
app.add_api('./openapi.yaml')
|
app.add_api('./openapi.yaml', options = {"swagger_ui": True})
|
||||||
CORS(app.app)
|
CORS(app.app)
|
||||||
app.run(port=8080)
|
app.run(port=8080)
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
{ "name": "description", "sqltype": "varchar(1024)", "notnull": true },
|
{ "name": "description", "sqltype": "varchar(1024)", "notnull": true },
|
||||||
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
||||||
{ "name": "created_at", "sqltype": "timestamp", "notnull": true, "default": "now()", "selector": 0 },
|
{ "name": "created_at", "sqltype": "timestamp", "notnull": true, "default": "now()", "selector": 0 },
|
||||||
{ "name": "due_at", "sqltype": "timestamp", "notnull": false },
|
{ "name": "fiscal_year", "sqltype": "integer", "notnull": true },
|
||||||
{ "name": "amount", "sqltype": "numeric(10,2)", "notnull": true },
|
{ "name": "amount", "sqltype": "numeric(10,2)", "notnull": true },
|
||||||
{ "name": "document_no", "sqltype": "integer", "unique": true },
|
{ "name": "document_no", "sqltype": "integer", "unique": true },
|
||||||
{ "name": "account_entry_category", "sqltype": "integer", "notnull": true, "foreignkey": true }
|
{ "name": "account_entry_category", "sqltype": "integer", "notnull": true, "foreignkey": true }
|
||||||
|
@ -150,7 +150,7 @@ CREATE TABLE account_entry_t (
|
|||||||
,description varchar(1024) not null
|
,description varchar(1024) not null
|
||||||
,account integer not null references account_t (id)
|
,account integer not null references account_t (id)
|
||||||
,created_at timestamp not null default now()
|
,created_at timestamp not null default now()
|
||||||
,due_at timestamp
|
,fiscal_year integer not null
|
||||||
,amount numeric(10,2) not null
|
,amount numeric(10,2) not null
|
||||||
,document_no integer unique
|
,document_no integer unique
|
||||||
,account_entry_category integer not null references account_entry_category_t (id)
|
,account_entry_category integer not null references account_entry_category_t (id)
|
||||||
|
@ -6,11 +6,9 @@
|
|||||||
<mat-datepicker-toggle matSuffix [for]="createdAtPicker"></mat-datepicker-toggle>
|
<mat-datepicker-toggle matSuffix [for]="createdAtPicker"></mat-datepicker-toggle>
|
||||||
<mat-datepicker #createdAtPicker></mat-datepicker>
|
<mat-datepicker #createdAtPicker></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline" id="addEntryfield">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Fälligkeit</mat-label>
|
<mat-label>Jahr</mat-label>
|
||||||
<input matInput ngModel name="dueAt" [matDatepicker]="dueAtPicker" [formControl]="presetDueAt"/>
|
<input matInput type="number" name="fiscalYear" [formControl]="presetFiscalYear" ngModel/>
|
||||||
<mat-datepicker-toggle matSuffix [for]="dueAtPicker"></mat-datepicker-toggle>
|
|
||||||
<mat-datepicker #dueAtPicker></mat-datepicker>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline" *ngIf="!shallBeRentPayment">
|
<mat-form-field appearance="outline" *ngIf="!shallBeRentPayment">
|
||||||
<mat-label>Kategorie</mat-label>
|
<mat-label>Kategorie</mat-label>
|
||||||
@ -38,9 +36,9 @@ Saldo: {{saldo?.saldo | number:'1.2-2'}} €
|
|||||||
<th mat-header-cell *matHeaderCellDef>Datum</th>
|
<th mat-header-cell *matHeaderCellDef>Datum</th>
|
||||||
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.created_at | date}}</td>
|
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.created_at | date}}</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="dueAt">
|
<ng-container matColumnDef="fiscalYear">
|
||||||
<th mat-header-cell *matHeaderCellDef>Fälligkeit</th>
|
<th mat-header-cell *matHeaderCellDef>Jahr</th>
|
||||||
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.due_at | date}}</td>
|
<td mat-cell *matCellDef="let element">{{element.rawAccountEntry.fiscal_year}}</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="description">
|
<ng-container matColumnDef="description">
|
||||||
<th mat-header-cell *matHeaderCellDef>Beschreibung</th>
|
<th mat-header-cell *matHeaderCellDef>Beschreibung</th>
|
||||||
|
@ -34,14 +34,14 @@ export class AccountComponent implements OnInit {
|
|||||||
account: Account
|
account: Account
|
||||||
accountEntries: DN_AccountEntry[]
|
accountEntries: DN_AccountEntry[]
|
||||||
accountEntriesDataSource: MatTableDataSource<DN_AccountEntry>
|
accountEntriesDataSource: MatTableDataSource<DN_AccountEntry>
|
||||||
accountEntriesDisplayedColumns: string[] = [ "description", "document_no", "amount", "createdAt", "dueAt", "category", "overhead_relevant" ]
|
accountEntriesDisplayedColumns: string[] = [ "description", "document_no", "amount", "createdAt", "fiscalYear", "category", "overhead_relevant" ]
|
||||||
saldo: Saldo
|
saldo: Saldo
|
||||||
|
|
||||||
accountEntryCategories: AccountEntryCategory[]
|
accountEntryCategories: AccountEntryCategory[]
|
||||||
accountEntryCategoriesMap: Map<number, AccountEntryCategory>
|
accountEntryCategoriesMap: Map<number, AccountEntryCategory>
|
||||||
accountEntryCategoriesInverseMap: Map<string, AccountEntryCategory>
|
accountEntryCategoriesInverseMap: Map<string, AccountEntryCategory>
|
||||||
|
|
||||||
presetDueAt: FormControl
|
presetFiscalYear: FormControl
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
@ -99,7 +99,7 @@ export class AccountComponent implements OnInit {
|
|||||||
description: formData.value.description,
|
description: formData.value.description,
|
||||||
account: this.account.id,
|
account: this.account.id,
|
||||||
created_at: formData.value.createdAt,
|
created_at: formData.value.createdAt,
|
||||||
due_at: formData.value.dueAt,
|
fiscal_year: formData.value.fiscalYear,
|
||||||
amount: formData.value.amount,
|
amount: formData.value.amount,
|
||||||
id: 0,
|
id: 0,
|
||||||
document_no: uniquenumber.number,
|
document_no: uniquenumber.number,
|
||||||
@ -148,11 +148,7 @@ export class AccountComponent implements OnInit {
|
|||||||
private async init(): Promise<void> {
|
private async init(): Promise<void> {
|
||||||
let currentDate = new Date()
|
let currentDate = new Date()
|
||||||
let y = currentDate.getFullYear().toString()
|
let y = currentDate.getFullYear().toString()
|
||||||
let m = (currentDate.getMonth()+1).toString()
|
this.presetFiscalYear = new FormControl(`${y}`)
|
||||||
if (m.length == 1) {
|
|
||||||
m = `0${m}`
|
|
||||||
}
|
|
||||||
this.presetDueAt = new FormControl(`${y}-${m}-01`)
|
|
||||||
this.messageService.add(`AccountComponent.init, account: ${this.selectedAccountId}`)
|
this.messageService.add(`AccountComponent.init, account: ${this.selectedAccountId}`)
|
||||||
this.getAccount()
|
this.getAccount()
|
||||||
await this.getAccountEntryCategories()
|
await this.getAccountEntryCategories()
|
||||||
|
@ -193,7 +193,7 @@ export interface AccountEntry {
|
|||||||
description: string
|
description: string
|
||||||
account: number
|
account: number
|
||||||
created_at: string
|
created_at: string
|
||||||
due_at: string
|
fiscal_year: number
|
||||||
amount: number
|
amount: number
|
||||||
document_no: number
|
document_no: number
|
||||||
account_entry_category: number
|
account_entry_category: number
|
||||||
@ -203,7 +203,7 @@ export const NULL_AccountEntry: AccountEntry = {
|
|||||||
,description: ''
|
,description: ''
|
||||||
,account: undefined
|
,account: undefined
|
||||||
,created_at: ''
|
,created_at: ''
|
||||||
,due_at: ''
|
,fiscal_year: undefined
|
||||||
,amount: undefined
|
,amount: undefined
|
||||||
,document_no: undefined
|
,document_no: undefined
|
||||||
,account_entry_category: undefined
|
,account_entry_category: undefined
|
||||||
|
Reference in New Issue
Block a user