Product sale report can now be section wise
This commit is contained in:
@@ -19,7 +19,7 @@ export class ProductSaleReportService {
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
|
||||
get(startDate: string | null, finishDate: string | null): Observable<ProductSaleReport> {
|
||||
get(startDate: string | null, finishDate: string | null, section: string | null): Observable<ProductSaleReport> {
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
@@ -27,12 +27,15 @@ export class ProductSaleReportService {
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
if (section !== null) {
|
||||
options.params = options.params.set('section', section);
|
||||
}
|
||||
return this.http
|
||||
.get<ProductSaleReport>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'get'))) as Observable<ProductSaleReport>;
|
||||
}
|
||||
|
||||
print(startDate: string | null, finishDate: string | null): Observable<boolean> {
|
||||
print(startDate: string | null, finishDate: string | null, section: string | null): Observable<boolean> {
|
||||
const printUrl = `${url}/print`;
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
@@ -41,6 +44,9 @@ export class ProductSaleReportService {
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
if (section !== null) {
|
||||
options.params = options.params.set('section', section);
|
||||
}
|
||||
return this.http
|
||||
.get<boolean>(printUrl, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'print'))) as Observable<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user