Strict done!!
This commit is contained in:
@ -4,4 +4,9 @@ export class BalanceSheetItem {
|
||||
amount?: number;
|
||||
subAmount?: number;
|
||||
order: number;
|
||||
|
||||
public constructor(init?: Partial<BalanceSheetItem>) {
|
||||
this.order = 0;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,9 +16,9 @@ import { BalanceSheetDataSource } from './balance-sheet-datasource';
|
||||
export class BalanceSheetComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: BalanceSheetDataSource;
|
||||
info: BalanceSheet = new BalanceSheet();
|
||||
dataSource: BalanceSheetDataSource = new BalanceSheetDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: BalanceSheet;
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['group', 'name', 'subAmount', 'total'];
|
||||
|
||||
@ -37,7 +37,7 @@ export class BalanceSheetComponent implements OnInit {
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
});
|
||||
this.dataSource = new BalanceSheetDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new BalanceSheetDataSource(this.info.body, this.paginator, this.sort);
|
||||
}
|
||||
|
||||
show() {
|
||||
|
||||
@ -16,7 +16,7 @@ const serviceName = 'BalanceSheetService';
|
||||
export class BalanceSheetService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(date: string): Observable<BalanceSheet> {
|
||||
list(date: string | null): Observable<BalanceSheet> {
|
||||
const listUrl = date === null ? url : `${url}/${date}`;
|
||||
return <Observable<BalanceSheet>>(
|
||||
this.http
|
||||
|
||||
@ -4,4 +4,10 @@ export class BalanceSheet {
|
||||
date: string;
|
||||
body: BalanceSheetItem[];
|
||||
footer?: BalanceSheetItem;
|
||||
|
||||
public constructor(init?: Partial<BalanceSheet>) {
|
||||
this.date = '';
|
||||
this.body = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user