Added session support, but right now it is defaulting to 2 week long session

Reports working:
 Ledger
 Balance Sheet
 Profit & Loss
 Closing Stock
This commit is contained in:
tanshu
2020-05-12 02:57:48 +05:30
parent 6dbab6442f
commit 85d05392b8
8 changed files with 181 additions and 108 deletions

View File

@ -21,14 +21,9 @@ export class ProfitLossService {
}
list(startDate: string, finishDate): Observable<ProfitLoss> {
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<ProfitLoss>>this.http.get<ProfitLoss>(url, options)
startDate = startDate ? `/${startDate}` : '';
finishDate = finishDate ? `/${finishDate}` : '';
return <Observable<ProfitLoss>>this.http.get<ProfitLoss>(`${url}${startDate}${finishDate}`)
.pipe(
catchError(this.log.handleError(serviceName, 'list'))
);