Chore: Reformatted everthing
Fix: Product ledger was not totalling. This is because for some reason, pydantic was sending the data as string when the field was nullable
This commit is contained in:
@@ -2,12 +2,7 @@
|
||||
<mat-card-header>
|
||||
<mat-card-title-group>
|
||||
<mat-card-title>Account</mat-card-title>
|
||||
<mat-icon
|
||||
matSuffix
|
||||
(click)="item.isStarred = !item.isStarred"
|
||||
class="pointer"
|
||||
[class.gold]="item.isStarred"
|
||||
>
|
||||
<mat-icon matSuffix (click)="item.isStarred = !item.isStarred" class="pointer" [class.gold]="item.isStarred">
|
||||
{{ item.isStarred ? 'star' : 'star_border' }}
|
||||
</mat-icon>
|
||||
</mat-card-title-group>
|
||||
@@ -38,9 +33,7 @@
|
||||
</div>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-checkbox formControlName="isActive" class="flex-auto mr-5">Is Active?</mat-checkbox>
|
||||
<mat-checkbox formControlName="isReconcilable" class="flex-auto"
|
||||
>Is Reconcilable?</mat-checkbox
|
||||
>
|
||||
<mat-checkbox formControlName="isReconcilable" class="flex-auto">Is Reconcilable?</mat-checkbox>
|
||||
</div>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
@@ -56,8 +49,6 @@
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary" (click)="save()" class="mr-5">Save</button>
|
||||
<button mat-raised-button color="warn" (click)="confirmDelete()" *ngIf="!!item.id">
|
||||
Delete
|
||||
</button>
|
||||
<button mat-raised-button color="warn" (click)="confirmDelete()" *ngIf="!!item.id">Delete</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
@@ -37,10 +37,7 @@ export class AccountListComponent implements OnInit, AfterViewInit {
|
||||
filter: new FormControl<string>('', { nonNullable: true }),
|
||||
});
|
||||
// Listen to Filter Change
|
||||
this.filter = this.form.controls.filter.valueChanges.pipe(
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
this.filter = this.form.controls.filter.valueChanges.pipe(debounceTime(150), distinctUntilChanged());
|
||||
|
||||
this.dataSource = new AccountListDataSource(this.list, this.filter);
|
||||
}
|
||||
@@ -49,9 +46,7 @@ export class AccountListComponent implements OnInit, AfterViewInit {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Account[]; accountTypes: AccountType[] };
|
||||
this.accountTypes = data.accountTypes;
|
||||
data.list.forEach(
|
||||
(x) => (x.typeName = this.accountTypes.find((y) => y.id === x.type)?.name ?? ''),
|
||||
);
|
||||
data.list.forEach((x) => (x.typeName = this.accountTypes.find((y) => y.id === x.type)?.name ?? ''));
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new AccountListDataSource(this.list, this.filter, this.paginator, this.sort);
|
||||
|
||||
@@ -16,8 +16,7 @@ const accountRoutes: Routes = [
|
||||
path: '',
|
||||
component: AccountListComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Accounts',
|
||||
@@ -31,8 +30,7 @@ const accountRoutes: Routes = [
|
||||
path: 'new',
|
||||
component: AccountDetailComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Accounts',
|
||||
@@ -47,8 +45,7 @@ const accountRoutes: Routes = [
|
||||
path: ':id',
|
||||
component: AccountDetailComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Accounts',
|
||||
|
||||
@@ -19,8 +19,8 @@ export class AccountTypeService {
|
||||
) {}
|
||||
|
||||
list(): Observable<AccountType[]> {
|
||||
return this.http
|
||||
.get<AccountType[]>(url)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<AccountType[]>;
|
||||
return this.http.get<AccountType[]>(url).pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<
|
||||
AccountType[]
|
||||
>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user