Purchase Entries Done!!

This commit is contained in:
tanshu
2020-05-14 14:39:19 +05:30
parent e62bb0a825
commit da58528768
6 changed files with 95 additions and 31 deletions

View File

@ -32,7 +32,7 @@
<!-- Supplier Column -->
<ng-container matColumnDef="supplier">
<mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</mat-header-cell>
<mat-cell *matCellDef="let row"><a [routerLink]="['/', row.url, row.id]">{{row.supplier}}</a></mat-cell>
<mat-cell *matCellDef="let row"><a [routerLink]="row.url">{{row.supplier}}</a></mat-cell>
</ng-container>
<!-- Product Column -->

View File

@ -32,12 +32,7 @@ export class PurchaseEntriesComponent implements OnInit {
}
ngOnInit() {
this.route.data.pipe(map(
(data: { info: PurchaseEntries }) => {
data.info.body = data.info.body.map(x => ({...x, url: x['type'].replace(/ /g, '-').toLowerCase()}));
return data;
}
)).subscribe((data: { info: PurchaseEntries }) => {
this.route.data.subscribe((data: { info: PurchaseEntries }) => {
this.info = data.info;
this.form.setValue({
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),

View File

@ -1,7 +1,9 @@
export class PurchaseEntriesItem {
id: string;
date: string;
supplier: string;
url: string[];
product: string;
quantity: number;
rate: number;