Raw Material Cost Done!!
This commit is contained in:
@ -30,45 +30,45 @@
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<a [href]="row.url" *ngIf="row.url">
|
||||
<a *ngIf="row.url" [routerLink]="row.url" [queryParams]="{startDate: info.startDate, finishDate: info.finishDate}">
|
||||
{{row.name}}
|
||||
</a>
|
||||
<span *ngIf="!row.url">{{row.name}}</span>
|
||||
</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef><span *ngIf="info.footer">{{info.footer.name}}</span></mat-footer-cell>
|
||||
<mat-footer-cell *matFooterCellDef>{{info.footer?.name}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Issue Column -->
|
||||
<ng-container matColumnDef="issue">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Issue</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.issue | currency:'INR'}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer.issue | currency:'INR'}}</mat-footer-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer?.issue | currency:'INR'}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Sale Column -->
|
||||
<ng-container matColumnDef="sale">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Sale</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.sale | currency:'INR'}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer.sale | currency:'INR'}}</mat-footer-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer?.sale | currency:'INR'}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Rmc Column -->
|
||||
<ng-container matColumnDef="rmc">
|
||||
<mat-header-cell *matHeaderCellDef class="right">RMC</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.rmc | percent:'1.2-2'}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer.rmc | percent:'1.2-2'}}</mat-footer-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">{{info.footer?.rmc | percent:'1.2-2'}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Group Column -->
|
||||
<ng-container matColumnDef="group">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Group</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [href]="row.url">{{row.group}}</a></mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.group}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="quantity">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Quantity Quantity</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Quantity</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.quantity | number:'1.2-2'}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -21,7 +21,6 @@ export class RawMaterialCostService {
|
||||
}
|
||||
|
||||
list(id: string, startDate: string, finishDate): Observable<RawMaterialCost> {
|
||||
const listUrl = (id === null) ? url : `${url}/${id}`;
|
||||
const options = {params: new HttpParams()};
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
@ -29,6 +28,7 @@ export class RawMaterialCostService {
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
const listUrl = (id === null) ? ( (startDate || finishDate) ? `${url}/data` : url) : `${url}/${id}`;
|
||||
return <Observable<RawMaterialCost>>this.http.get<RawMaterialCost>(listUrl, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
|
||||
Reference in New Issue
Block a user