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
@@ -14,25 +14,12 @@ export class EntriesResolver {
resolve(route: ActivatedRouteSnapshot): Observable<Report> {
const start_date = route.queryParamMap.get('s');
const finish_date = route.queryParamMap.get('f');
const posted =
route.queryParamMap.get('p') === null ? null : route.queryParamMap.get('p') === 'true';
const page_size =
route.queryParamMap.get('ps') === null ? 50 : +(route.queryParamMap.get('ps') as string);
const page_index =
route.queryParamMap.get('pi') === null ? 0 : +(route.queryParamMap.get('pi') as string);
const posted = route.queryParamMap.get('p') === null ? null : route.queryParamMap.get('p') === 'true';
const page_size = route.queryParamMap.get('ps') === null ? 50 : +(route.queryParamMap.get('ps') as string);
const page_index = route.queryParamMap.get('pi') === null ? 0 : +(route.queryParamMap.get('pi') as string);
const sort = route.queryParamMap.get('a') ?? 'date';
const direction = route.queryParamMap.get('d') ?? 'desc';
const issue_vouchers =
route.queryParamMap.get('i') === null ? false : route.queryParamMap.get('i') === 'true';
return this.ser.list(
start_date,
finish_date,
posted,
page_size,
page_index,
sort,
direction,
issue_vouchers,
);
const issue_vouchers = route.queryParamMap.get('i') === null ? false : route.queryParamMap.get('i') === 'true';
return this.ser.list(start_date, finish_date, posted, page_size, page_index, sort, direction, issue_vouchers);
}
}
@@ -12,8 +12,7 @@ const entriesRoutes: Routes = [
path: '',
component: EntriesComponent,
canActivate: [
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
inject(AuthGuard).canActivate(route, state),
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
],
data: {
permission: 'Ledger',
@@ -7,23 +7,13 @@
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
<mat-form-field class="flex-auto basis-2/5 mr-5">
<mat-label>Create / Last Edit Date From</mat-label>
<input
matInput
[matDatepicker]="startDate"
formControlName="startDate"
autocomplete="off"
/>
<input matInput [matDatepicker]="startDate" formControlName="startDate" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
<mat-datepicker #startDate></mat-datepicker>
</mat-form-field>
<mat-form-field class="flex-auto basis-2/5 mr-5">
<mat-label>Create / Last Edit Date Till</mat-label>
<input
matInput
[matDatepicker]="finishDate"
formControlName="finishDate"
autocomplete="off"
/>
<input matInput [matDatepicker]="finishDate" formControlName="finishDate" autocomplete="off" />
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
<mat-datepicker #finishDate></mat-datepicker>
</mat-form-field>
@@ -32,11 +22,7 @@
</button>
</div>
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
<mat-radio-group
class="flex-auto basis-2/5 mr-5"
formControlName="posted"
(change)="togglePosted($event)"
>
<mat-radio-group class="flex-auto basis-2/5 mr-5" formControlName="posted" (change)="togglePosted($event)">
<mat-radio-button class="my-margin" [value]="true"> Posted </mat-radio-button>
<mat-radio-button class="my-margin" [value]="false"> Not Posted </mat-radio-button>
<mat-radio-button class="my-margin" [value]="null"> All </mat-radio-button>
@@ -26,15 +26,7 @@ export class EntriesComponent implements OnInit {
issue: FormControl<boolean>;
}>;
displayedColumns = [
'date',
'voucherType',
'narration',
'debitNames',
'creditNames',
'amount',
'user',
];
displayedColumns = ['date', 'voucherType', 'narration', 'debitNames', 'creditNames', 'amount', 'user'];
posted: boolean | null = null;
issue = false;
+1 -6
View File
@@ -6,12 +6,7 @@ import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import {
DateAdapter,
MAT_DATE_FORMATS,
MAT_DATE_LOCALE,
MatNativeDateModule,
} from '@angular/material/core';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatIconModule } from '@angular/material/icon';