Strict done!!
This commit is contained in:
@@ -4,9 +4,7 @@ import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Product } from '../core/product';
|
||||
import { ToCsvService } from '../shared/to-csv.service';
|
||||
|
||||
import { RawMaterialCost } from './raw-material-cost';
|
||||
@@ -20,22 +18,20 @@ import { RawMaterialCostDataSource } from './raw-material-cost-datasource';
|
||||
export class RawMaterialCostComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: RawMaterialCostDataSource;
|
||||
info: RawMaterialCost = new RawMaterialCost();
|
||||
dataSource: RawMaterialCostDataSource = new RawMaterialCostDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: RawMaterialCost;
|
||||
debitQuantity: number;
|
||||
debitAmount: number;
|
||||
creditQuantity: number;
|
||||
creditAmount: number;
|
||||
runningQuantity: number;
|
||||
runningAmount: number;
|
||||
debitQuantity = 0;
|
||||
debitAmount = 0;
|
||||
creditQuantity = 0;
|
||||
creditAmount = 0;
|
||||
runningQuantity = 0;
|
||||
runningAmount = 0;
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[];
|
||||
displayedColumns: string[] = [];
|
||||
columnsNoId = ['name', 'issue', 'sale', 'rmc'];
|
||||
columnsId = ['name', 'group', 'quantity', 'net', 'gross'];
|
||||
|
||||
products: Observable<Product[]>;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
@@ -58,7 +54,7 @@ export class RawMaterialCostComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new RawMaterialCostDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new RawMaterialCostDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,10 +71,10 @@ export class RawMaterialCostComponent implements OnInit {
|
||||
prepareSubmit(): RawMaterialCost {
|
||||
const formModel = this.form.value;
|
||||
|
||||
return {
|
||||
return new RawMaterialCost({
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
|
||||
Reference in New Issue
Block a user