diff --git a/brewman/brewman/routers/reports/profit_loss.py b/brewman/brewman/routers/reports/profit_loss.py index 1b743ba6..7863236f 100644 --- a/brewman/brewman/routers/reports/profit_loss.py +++ b/brewman/brewman/routers/reports/profit_loss.py @@ -33,7 +33,7 @@ def report_blank( startDate=get_start_date(request.session), finishDate=get_finish_date(request.session), body=[], - footer=None, + footer=schemas.ProfitLossItem(group="", total=0, order=0), ) diff --git a/brewman/brewman/routers/reports/purchases.py b/brewman/brewman/routers/reports/purchases.py index 605b4c1a..3c1effd0 100644 --- a/brewman/brewman/routers/reports/purchases.py +++ b/brewman/brewman/routers/reports/purchases.py @@ -34,7 +34,7 @@ def report_blank( startDate=get_start_date(request.session), finishDate=get_finish_date(request.session), body=[], - footer=None, + footer=schemas.PurchasesItem(name="Total", quantity=0, rate=0, url=[], amount=0), ) diff --git a/brewman/brewman/schemas/profit_loss.py b/brewman/brewman/schemas/profit_loss.py index 26ae3cd3..e23d39a6 100644 --- a/brewman/brewman/schemas/profit_loss.py +++ b/brewman/brewman/schemas/profit_loss.py @@ -25,7 +25,7 @@ class ProfitLoss(BaseModel): start_date: date finish_date: date body: List[ProfitLossItem] - footer: Optional[ProfitLossItem] + footer: ProfitLossItem class Config: anystr_strip_whitespace = True diff --git a/brewman/brewman/schemas/purchases.py b/brewman/brewman/schemas/purchases.py index 263b7401..739f270e 100644 --- a/brewman/brewman/schemas/purchases.py +++ b/brewman/brewman/schemas/purchases.py @@ -1,6 +1,6 @@ from datetime import date, datetime from decimal import Decimal -from typing import List, Optional, Union +from typing import List, Union from pydantic import validator from pydantic.main import BaseModel @@ -24,7 +24,7 @@ class Purchases(BaseModel): start_date: date finish_date: date body: List[PurchasesItem] - footer: Optional[PurchasesItem] + footer: PurchasesItem class Config: anystr_strip_whitespace = True diff --git a/brewman/brewman/schemas/rate_contract.py b/brewman/brewman/schemas/rate_contract.py index 907c9a8d..9eeafc3b 100644 --- a/brewman/brewman/schemas/rate_contract.py +++ b/brewman/brewman/schemas/rate_contract.py @@ -32,6 +32,18 @@ class RateContractBlank(BaseModel): return value return datetime.strptime(value, "%d-%b-%Y").date() + @validator("valid_from", pre=True) + def parse_valid_from(cls, value: Union[date, str]) -> date: + if isinstance(value, date): + return value + return datetime.strptime(value, "%d-%b-%Y").date() + + @validator("valid_till", pre=True) + def parse_valid_till(cls, value: Union[date, str]) -> date: + if isinstance(value, date): + return value + return datetime.strptime(value, "%d-%b-%Y").date() + class RateContractIn(RateContractBlank): vendor: AccountLink diff --git a/brewman/brewman/schemas/voucher.py b/brewman/brewman/schemas/voucher.py index e3505bd0..e72040ff 100644 --- a/brewman/brewman/schemas/voucher.py +++ b/brewman/brewman/schemas/voucher.py @@ -43,7 +43,7 @@ class Voucher(VoucherIn): last_edit_date: Optional[datetime] user: Optional[UserLink] posted: Optional[bool] - poster_id: Optional[uuid.UUID] + poster: Optional[str] journals: List[Journal] inventories: List[Inventory] vendor: Optional[AccountLink] diff --git a/overlord/.browserslistrc b/overlord/.browserslistrc deleted file mode 100644 index 427441dc..00000000 --- a/overlord/.browserslistrc +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# For the full list of supported browsers by the Angular framework, please see: -# https://angular.io/guide/browser-support - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -last 1 Chrome version -last 1 Firefox version -last 2 Edge major versions -last 2 Safari major versions -last 2 iOS major versions -Firefox ESR -not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. diff --git a/overlord/angular.json b/overlord/angular.json index 4c2f0a46..0d85ee28 100644 --- a/overlord/angular.json +++ b/overlord/angular.json @@ -121,5 +121,13 @@ "@angular-eslint/schematics" ], "analytics": "0309c8d2-99a2-4dd3-b63e-9a0a43611460" + }, + "schematics": { + "@angular-eslint/schematics:application": { + "setParserOptionsProject": true + }, + "@angular-eslint/schematics:library": { + "setParserOptionsProject": true + } } } diff --git a/overlord/package.json b/overlord/package.json index 68b24fb6..6b2e05a0 100644 --- a/overlord/package.json +++ b/overlord/package.json @@ -14,44 +14,44 @@ }, "private": true, "dependencies": { - "@angular/animations": "^14.2.10", - "@angular/cdk": "^14.2.7", - "@angular/common": "^14.2.10", - "@angular/compiler": "^14.2.10", - "@angular/core": "^14.2.10", - "@angular/forms": "^14.2.10", - "@angular/material": "^14.2.7", - "@angular/material-moment-adapter": "^14.2.7", - "@angular/platform-browser": "^14.2.10", - "@angular/platform-browser-dynamic": "^14.2.10", - "@angular/router": "^14.2.10", + "@angular/animations": "^15.0.3", + "@angular/cdk": "^15.0.2", + "@angular/common": "^15.0.3", + "@angular/compiler": "^15.0.3", + "@angular/core": "^15.0.3", + "@angular/forms": "^15.0.3", + "@angular/material": "^15.0.2", + "@angular/material-moment-adapter": "^15.0.2", + "@angular/platform-browser": "^15.0.3", + "@angular/platform-browser-dynamic": "^15.0.3", + "@angular/router": "^15.0.3", "@ngx-loading-bar/core": "^6.0.2", "@ngx-loading-bar/http-client": "^6.0.2", "@ngx-loading-bar/router": "^6.0.2", "@types/mousetrap": "1.6.11", "angular2-hotkeys": "^13.1.0", - "mathjs": "^11.3.3", + "mathjs": "^11.5.0", "moment": "^2.29.4", "rxjs": "^6.6.7", "tslib": "^2.1.0", "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "^14.2.9", - "@angular-eslint/builder": "^14.2.0", - "@angular-eslint/eslint-plugin": "^14.2.0", - "@angular-eslint/eslint-plugin-template": "^14.2.0", - "@angular-eslint/schematics": "^14.2.0", - "@angular-eslint/template-parser": "^14.2.0", - "@angular/cli": "^14.2.9", - "@angular/compiler-cli": "^14.2.10", - "@angular/language-service": "^14.2.10", + "@angular-devkit/build-angular": "^15.0.3", + "@angular-eslint/builder": "^15.1.0", + "@angular-eslint/eslint-plugin": "^15.1.0", + "@angular-eslint/eslint-plugin-template": "^15.1.0", + "@angular-eslint/schematics": "^15.1.0", + "@angular-eslint/template-parser": "^15.1.0", + "@angular/cli": "^15.0.3", + "@angular/compiler-cli": "^15.0.3", + "@angular/language-service": "^15.0.3", "@types/jasmine": "~4.3.0", - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "^5.43.0", - "@typescript-eslint/parser": "^5.43.0", + "@types/node": "^18.11.13", + "@typescript-eslint/eslint-plugin": "^5.46.0", + "@typescript-eslint/parser": "^5.46.0", "autoprefixer": "^10.4.13", - "eslint": "^8.26.0", + "eslint": "^8.28.0", "eslint-plugin-import": "2.26.0", "eslint-plugin-unused-imports": "^2.0.0", "husky": "^8.0.2", @@ -62,13 +62,13 @@ "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "^2.0.0", - "lint-staged": "^13.0.3", + "lint-staged": "^13.1.0", "postcss": "^8.4.19", - "prettier": "^2.7.1", + "prettier": "^2.8.1", "standard-version": "^9.5.0", "tailwindcss": "^3.2.4", "ts-node": "^9.1.1", - "typescript": "~4.6.4" + "typescript": "~4.8.4" }, "husky": { "hooks": { diff --git a/overlord/src/app/account/account-detail/account-detail.component.html b/overlord/src/app/account/account-detail/account-detail.component.html index 5bbceba5..e5f01ef3 100644 --- a/overlord/src/app/account/account-detail/account-detail.component.html +++ b/overlord/src/app/account/account-detail/account-detail.component.html @@ -1,5 +1,5 @@ -