Beer consumption report done
This commit is contained in:
parent
243c3cb280
commit
8f6c5930ee
|
@ -364,6 +364,7 @@ def includeme(config):
|
|||
|
||||
config.add_route("v1_product_sale_report", "/v1/product-sale-report")
|
||||
config.add_route("v1_bill_settlement_report", "/v1/bill-settlement-report")
|
||||
config.add_route("v1_beer_consumption_report", "/v1/beer-consumption-report")
|
||||
# Done till here
|
||||
|
||||
config.add_route("customer", "/Customer.json")
|
||||
|
@ -402,6 +403,5 @@ def includeme(config):
|
|||
|
||||
# config.add_route('customer_id', '/Customer/{id}.json')
|
||||
|
||||
config.add_route("beer_consumption", "/BeerConsumption.json")
|
||||
|
||||
config.add_static_view("", "barker:static")
|
||||
|
|
|
@ -1,42 +1,64 @@
|
|||
import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from pyramid.httpexceptions import HTTPForbidden
|
||||
from pyramid.view import view_config
|
||||
from sqlalchemy import func
|
||||
|
||||
from barker.models import Inventory, Kot, Product, Settlement, SettleOption, Voucher
|
||||
from barker.models import Inventory, Kot, Product, Voucher, VoucherType
|
||||
from barker.models.validation_exception import ValidationError
|
||||
from barker.views.reports import get_start_date, get_finish_date
|
||||
|
||||
|
||||
@view_config(request_method='GET', route_name='beer_consumption', renderer='json', permission='Beer Consumption',
|
||||
request_param=('s', 'f'))
|
||||
@view_config(
|
||||
request_method="GET",
|
||||
route_name="v1_beer_consumption_report",
|
||||
renderer="json",
|
||||
permission="Beer Consumption",
|
||||
)
|
||||
def beer_consumption(request):
|
||||
start_date = datetime.datetime.strptime(request.GET['s'], '%d-%b-%Y %H:%M')
|
||||
finish_date = datetime.datetime.strptime(request.GET['f'], '%d-%b-%Y %H:%M')
|
||||
start_date = get_start_date(request.GET.get("s", None)) - timedelta(hours=7)
|
||||
finish_date = get_finish_date(request.GET.get("f", None)) - timedelta(hours=7)
|
||||
|
||||
if (datetime.date.today() - start_date.date()).days > 5 and 'Accounts Audit' not in request.effective_principals:
|
||||
raise HTTPForbidden("Accounts Audit")
|
||||
if (
|
||||
datetime.today() - start_date.replace(hour=0)
|
||||
).days > 5 and "Accounts Audit" not in request.effective_principals:
|
||||
raise ValidationError("Accounts Audit")
|
||||
|
||||
list = request.dbsession.query(
|
||||
Voucher.date, Product.id, Product.name, func.sum(Inventory.quantity * Product.quantity)
|
||||
).join(Voucher.kots).join(Kot.inventories).join(Inventory.product).filter(
|
||||
Voucher.date >= start_date,
|
||||
Voucher.date <= finish_date,
|
||||
Voucher.is_void == False,
|
||||
Voucher.settlements.any(Settlement.settled.in_([
|
||||
SettleOption.CASH(),
|
||||
SettleOption.CREDIT_CARD(),
|
||||
SettleOption.BILL_TO_COMPANY(),
|
||||
SettleOption.STAFF(),
|
||||
SettleOption.NO_CHARGE()
|
||||
]))
|
||||
).group_by(
|
||||
Voucher.date, Product.id, Product.name
|
||||
).order_by(
|
||||
Voucher.date, Product.id, Product.name
|
||||
).all()
|
||||
return [{
|
||||
'Date': i[0].strftime('%d-%b-%Y %H:%M:%S'),
|
||||
'ProductID': str(i[1]),
|
||||
'Name': i[2],
|
||||
'Quantity': i[3]
|
||||
} for i in list if i[3] != 0]
|
||||
day = func.date_trunc("day", Voucher.date - timedelta(hours=7)).label("day")
|
||||
sum_ = func.sum(Inventory.quantity * Product.quantity).label("sum")
|
||||
list_ = (
|
||||
request.dbsession.query(day, Product.name, sum_)
|
||||
.join(Voucher.kots)
|
||||
.join(Kot.inventories)
|
||||
.join(Inventory.product)
|
||||
.filter(
|
||||
day >= start_date,
|
||||
day <= finish_date,
|
||||
Voucher.voucher_type.in_(
|
||||
[
|
||||
VoucherType.REGULAR_BILL.value,
|
||||
VoucherType.NO_CHARGE.value,
|
||||
VoucherType.STAFF.value,
|
||||
]
|
||||
),
|
||||
)
|
||||
.group_by(day, Product.name)
|
||||
.having(sum_ != 0)
|
||||
.order_by(day, Product.name)
|
||||
.all()
|
||||
)
|
||||
headers = []
|
||||
data = []
|
||||
for date, name, quantity in list_:
|
||||
if name not in headers:
|
||||
headers.append(name)
|
||||
old = [d for d in data if d["date"] == date.strftime("%d-%b-%Y")]
|
||||
if len(old):
|
||||
old[0][name] = quantity
|
||||
else:
|
||||
data.append({"date": date.strftime("%d-%b-%Y"), name: quantity})
|
||||
return {
|
||||
"startDate": start_date.date().strftime("%d-%b-%Y"),
|
||||
"finishDate": (finish_date - timedelta(days=1)).date().strftime("%d-%b-%Y"),
|
||||
"headers": headers,
|
||||
"data": data,
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@ import {LogoutComponent} from './auth/logout/logout.component';
|
|||
import {HomeComponent} from './home/home.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'beer-consumption-report',
|
||||
loadChildren: () => import('./beer-consumption-report/beer-consumption-report.module').then(mod => mod.BeerConsumptionReportModule)
|
||||
},
|
||||
{
|
||||
path: 'bill-settlement-report',
|
||||
loadChildren: () => import('./bill-settlement-report/bill-settlement-report.module').then(mod => mod.BillSettlementReportModule)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { BeerConsumptionReportItem } from './beer-consumption-report';
|
||||
|
||||
|
||||
export class BeerConsumptionReportDataSource extends DataSource<BeerConsumptionReportItem> {
|
||||
|
||||
constructor(public data: BeerConsumptionReportItem[]) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<BeerConsumptionReportItem[]> {
|
||||
return observableOf(this.data);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
import {inject, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {BeerConsumptionReportResolver} from './beer-consumption-report-resolver.service';
|
||||
|
||||
describe('BeerConsumptionReportResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [BeerConsumptionReportResolver]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([BeerConsumptionReportResolver], (service: BeerConsumptionReportResolver) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
|
@ -0,0 +1,20 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {BeerConsumptionReport} from './beer-consumption-report';
|
||||
import {BeerConsumptionReportService} from './beer-consumption-report.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BeerConsumptionReportResolver implements Resolve<BeerConsumptionReport> {
|
||||
|
||||
constructor(private ser: BeerConsumptionReportService) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<BeerConsumptionReport> {
|
||||
const startDate = route.queryParamMap.get('startDate') || null;
|
||||
const finishDate = route.queryParamMap.get('finishDate') || null;
|
||||
return this.ser.get(startDate, finishDate);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
import {BeerConsumptionReportRoutingModule} from './beer-consumption-report-routing.module';
|
||||
|
||||
describe('BeerConsumptionReportRoutingModule', () => {
|
||||
let pbeerConsumptionReportRoutingModule: BeerConsumptionReportRoutingModule;
|
||||
|
||||
beforeEach(() => {
|
||||
pbeerConsumptionReportRoutingModule = new BeerConsumptionReportRoutingModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(pbeerConsumptionReportRoutingModule).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { BeerConsumptionReportResolver } from './beer-consumption-report-resolver.service';
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
import { BeerConsumptionReportComponent } from './beer-consumption-report.component';
|
||||
|
||||
const BeerConsumptionReportRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: BeerConsumptionReportComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Beer Consumption' // rename to Bill Settlement Report
|
||||
},
|
||||
resolve: {
|
||||
info: BeerConsumptionReportResolver
|
||||
},
|
||||
runGuardsAndResolvers: 'always'
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(BeerConsumptionReportRoutes)
|
||||
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
BeerConsumptionReportResolver
|
||||
]
|
||||
})
|
||||
export class BeerConsumptionReportRoutingModule {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
.right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
<mat-card>
|
||||
<mat-card-title-group>
|
||||
<mat-card-title>Beer Consumption Report</mat-card-title>
|
||||
<button mat-button mat-icon-button (click)="exportCsv()">
|
||||
<mat-icon>save_alt</mat-icon>
|
||||
</button>
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div fxLayout="row" fxLayout.lt-md="column" fxLayoutGap="20px" fxLayoutGap.lt-md="0px"
|
||||
fxLayoutAlign="space-around start">
|
||||
<mat-form-field fxFlex="40">
|
||||
<input matInput [matDatepicker]="startDate" (focus)="startDate.open()" placeholder="Start Date"
|
||||
formControlName="startDate" autocomplete="off">
|
||||
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="40">
|
||||
<input matInput [matDatepicker]="finishDate" (focus)="finishDate.open()" placeholder="Finish Date"
|
||||
formControlName="finishDate" autocomplete="off">
|
||||
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #finishDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<button fxFlex="20" mat-raised-button color="primary" (click)="show()">Show</button>
|
||||
</div>
|
||||
</form>
|
||||
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
|
||||
|
||||
<!-- Date Column -->
|
||||
<ng-container matColumnDef="date">
|
||||
<mat-header-cell *matHeaderCellDef>Time</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.date}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container *ngFor="let col of (info.headers)" matColumnDef="{{col}}">
|
||||
<mat-header-cell *matHeaderCellDef class="right">{{col}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row[col]}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- <!– Name Column –>-->
|
||||
<!-- <ng-container matColumnDef="name">-->
|
||||
<!-- <mat-header-cell *matHeaderCellDef class="right">Name</mat-header-cell>-->
|
||||
<!-- <mat-cell *matCellDef="let row" class="right">{{row.name}}</mat-cell>-->
|
||||
<!-- </ng-container>-->
|
||||
|
||||
<!-- <!– Quantity Column –>-->
|
||||
<!-- <ng-container matColumnDef="quantity">-->
|
||||
<!-- <mat-header-cell *matHeaderCellDef class="right">Quantity</mat-header-cell>-->
|
||||
<!-- <mat-cell *matCellDef="let row" class="right">{{row.quantity | number:'1.2-2'}}</mat-cell>-->
|
||||
<!-- </ng-container>-->
|
||||
|
||||
<mat-header-row *matHeaderRowDef="(displayedColumns)"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: (displayedColumns);"></mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
|
@ -0,0 +1,25 @@
|
|||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {BeerConsumptionReportComponent} from './beer-consumption-report.component';
|
||||
|
||||
describe('BeerConsumptionReportComponent', () => {
|
||||
let component: BeerConsumptionReportComponent;
|
||||
let fixture: ComponentFixture<BeerConsumptionReportComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [BeerConsumptionReportComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BeerConsumptionReportComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,91 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { BeerConsumptionReportDataSource } from './beer-consumption-report-datasource';
|
||||
import { BeerConsumptionReport } from './beer-consumption-report';
|
||||
import { ToCsvService } from '../shared/to-csv.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-beer-consumption-report',
|
||||
templateUrl: './beer-consumption-report.component.html',
|
||||
styleUrls: ['./beer-consumption-report.component.css']
|
||||
})
|
||||
export class BeerConsumptionReportComponent implements OnInit {
|
||||
dataSource: BeerConsumptionReportDataSource;
|
||||
form: FormGroup;
|
||||
info: BeerConsumptionReport;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = ['date'];
|
||||
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private toCsv: ToCsvService
|
||||
) {
|
||||
this.createForm();
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: BeerConsumptionReport }) => {
|
||||
this.info = data.info;
|
||||
this.displayedColumns = ['date'].concat(this.info.headers);
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate()
|
||||
});
|
||||
this.dataSource = new BeerConsumptionReportDataSource(this.info.data);
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
const info = this.getInfo();
|
||||
this.router.navigate(['beer-consumption-report'], {
|
||||
queryParams: {
|
||||
startDate: info.startDate,
|
||||
finishDate: info.finishDate
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
startDate: '',
|
||||
finishDate: ''
|
||||
});
|
||||
}
|
||||
|
||||
getInfo(): BeerConsumptionReport {
|
||||
const formModel = this.form.value;
|
||||
|
||||
return {
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY')
|
||||
};
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
const headers = {
|
||||
Date: 'date',
|
||||
Name: 'name',
|
||||
Type: 'type',
|
||||
Narration: 'narration',
|
||||
Debit: 'debit',
|
||||
Credit: 'credit',
|
||||
Running: 'running',
|
||||
Posted: 'posted'
|
||||
};
|
||||
const csvData = new Blob([this.toCsv.toCsv(headers, this.dataSource.data)], {type: 'text/csv;charset=utf-8;'});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(csvData);
|
||||
link.setAttribute('download', 'beer-consumption-report.csv');
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
import {BeerConsumptionReportModule} from './beer-consumption-report.module';
|
||||
|
||||
describe('BeerConsumptionReportModule', () => {
|
||||
let pbeerConsumptionReportModule: BeerConsumptionReportModule;
|
||||
|
||||
beforeEach(() => {
|
||||
pbeerConsumptionReportModule = new BeerConsumptionReportModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(pbeerConsumptionReportModule).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { SharedModule} from '../shared/shared.module';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { BeerConsumptionReportRoutingModule } from './beer-consumption-report-routing.module';
|
||||
import { BeerConsumptionReportComponent } from './beer-consumption-report.component';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
|
||||
export const MY_FORMATS = {
|
||||
parse: {
|
||||
dateInput: 'DD-MMM-YYYY',
|
||||
},
|
||||
display: {
|
||||
dateInput: 'DD-MMM-YYYY',
|
||||
monthYearLabel: 'MMM YYYY',
|
||||
dateA11yLabel: 'DD-MMM-YYYY',
|
||||
monthYearA11yLabel: 'MMM YYYY',
|
||||
},
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
A11yModule,
|
||||
CommonModule,
|
||||
CdkTableModule,
|
||||
FlexLayoutModule,
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatDatepickerModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatNativeDateModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
SharedModule,
|
||||
BeerConsumptionReportRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
BeerConsumptionReportComponent
|
||||
],
|
||||
providers: [
|
||||
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||
{provide: MAT_DATE_FORMATS, useValue: MY_FORMATS},
|
||||
]
|
||||
})
|
||||
export class BeerConsumptionReportModule {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
import {inject, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {BeerConsumptionReportService} from './beer-consumption-report.service';
|
||||
|
||||
describe('BeerConsumptionReportService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [BeerConsumptionReportService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([BeerConsumptionReportService], (service: BeerConsumptionReportService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { BeerConsumptionReport } from './beer-consumption-report';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
||||
};
|
||||
|
||||
const url = '/v1/beer-consumption-report';
|
||||
const serviceName = 'BeerConsumptionReportService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BeerConsumptionReportService {
|
||||
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
||||
}
|
||||
|
||||
get(startDate: string, finishDate): Observable<BeerConsumptionReport> {
|
||||
const options = {params: new HttpParams()};
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return <Observable<BeerConsumptionReport>>this.http.get<BeerConsumptionReport>(url, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'get'))
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
export class BeerConsumptionReportItem {
|
||||
date: string;
|
||||
name: string;
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
export class BeerConsumptionReport {
|
||||
startDate: string;
|
||||
finishDate: string;
|
||||
headers?: string[];
|
||||
data?: BeerConsumptionReportItem[];
|
||||
}
|
|
@ -26,6 +26,9 @@
|
|||
<mat-card fxLayout="column" class="square-button" matRipple *ngIf="auth.hasPermission('Bill Details')" [routerLink]="['/', 'bill-settlement-report']">
|
||||
<h3 class="item-name">Bill Settlement Report</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button" matRipple *ngIf="auth.hasPermission('Beer Consumption')" [routerLink]="['/', 'beer-consumption-report']">
|
||||
<h3 class="item-name">Beer Consumption Report</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button" matRipple *ngIf="auth.hasPermission('Tables')" [routerLink]="['/', 'tables']">
|
||||
<h3 class="item-name">Tables</h3>
|
||||
</mat-card>
|
||||
|
|
Loading…
Reference in New Issue