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:
2023-08-04 21:00:26 +05:30
parent af27bf74ef
commit ac868257b7
194 changed files with 513 additions and 1580 deletions
@@ -41,15 +41,7 @@ export class ClosingStockComponent implements OnInit {
}>;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = [
'product',
'group',
'quantity',
'physical',
'variance',
'department',
'amount',
];
displayedColumns = ['product', 'group', 'quantity', 'physical', 'variance', 'department', 'amount'];
costCentres: CostCentre[];
@@ -66,9 +58,9 @@ export class ClosingStockComponent implements OnInit {
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
costCentre: new FormControl<string | null>(null),
stocks: new FormArray<
FormGroup<{ physical: FormControl<number>; costCentre: FormControl<string | undefined> }>
>([]),
stocks: new FormArray<FormGroup<{ physical: FormControl<number>; costCentre: FormControl<string | undefined> }>>(
[],
),
});
}
@@ -181,10 +173,7 @@ export class ClosingStockComponent implements OnInit {
if (this.info.posted && this.auth.allowed('edit-posted-vouchers')) {
return true;
}
return (
this.info.user.id === (this.auth.user as User).id ||
this.auth.allowed("edit-other-user's-vouchers")
);
return this.info.user.id === (this.auth.user as User).id || this.auth.allowed("edit-other-user's-vouchers");
}
post() {