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:
@@ -75,12 +75,8 @@ export class EmployeeDetailComponent implements OnInit, AfterViewInit {
|
||||
points: this.item.points || '',
|
||||
isActive: this.item.isActive,
|
||||
costCentre: this.item.costCentre.id ?? '',
|
||||
joiningDate: this.item.joiningDate
|
||||
? moment(this.item.joiningDate, 'DD-MMM-YYYY').toDate()
|
||||
: new Date(),
|
||||
leavingDate: this.item.isActive
|
||||
? null
|
||||
: moment(this.item.leavingDate, 'DD-MMM-YYYY').toDate(),
|
||||
joiningDate: this.item.joiningDate ? moment(this.item.joiningDate, 'DD-MMM-YYYY').toDate() : new Date(),
|
||||
leavingDate: this.item.isActive ? null : moment(this.item.leavingDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -138,9 +134,7 @@ export class EmployeeDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.isActive = formValue.isActive ?? true;
|
||||
this.item.costCentre.id = formValue.costCentre ?? '';
|
||||
this.item.joiningDate = moment(formValue.joiningDate).format('DD-MMM-YYYY');
|
||||
this.item.leavingDate = this.item.isActive
|
||||
? null
|
||||
: moment(formValue.leavingDate).format('DD-MMM-YYYY');
|
||||
this.item.leavingDate = this.item.isActive ? null : moment(formValue.leavingDate).format('DD-MMM-YYYY');
|
||||
return this.item;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user