Strict done!!
This commit is contained in:
@ -9,4 +9,18 @@ export class PurchaseEntriesItem {
|
||||
tax: number;
|
||||
discount: number;
|
||||
amount: number;
|
||||
|
||||
public constructor(init?: Partial<PurchaseEntriesItem>) {
|
||||
this.id = '';
|
||||
this.date = '';
|
||||
this.supplier = '';
|
||||
this.url = [];
|
||||
this.product = '';
|
||||
this.quantity = 0;
|
||||
this.rate = 0;
|
||||
this.tax = 0;
|
||||
this.discount = 0;
|
||||
this.amount = 0;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,10 +16,10 @@ import { PurchaseEntriesDataSource } from './purchase-entries-datasource';
|
||||
export class PurchaseEntriesComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: PurchaseEntriesDataSource;
|
||||
info: PurchaseEntries = new PurchaseEntries();
|
||||
dataSource: PurchaseEntriesDataSource = new PurchaseEntriesDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: PurchaseEntries;
|
||||
selectedRowId: string;
|
||||
selectedRowId = '';
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = [
|
||||
'date',
|
||||
@ -48,7 +48,7 @@ export class PurchaseEntriesComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new PurchaseEntriesDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new PurchaseEntriesDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ const serviceName = 'PurchaseEntriesService';
|
||||
export class PurchaseEntriesService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(startDate: string, finishDate): Observable<PurchaseEntries> {
|
||||
list(startDate: string | null, finishDate: string | null): Observable<PurchaseEntries> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
return <Observable<PurchaseEntries>>(
|
||||
|
||||
@ -4,4 +4,11 @@ export class PurchaseEntries {
|
||||
startDate: string;
|
||||
finishDate: string;
|
||||
body: PurchaseEntriesItem[];
|
||||
|
||||
public constructor(init?: Partial<PurchaseEntries>) {
|
||||
this.startDate = '';
|
||||
this.finishDate = '';
|
||||
this.body = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user