Receive payment working.

TODO: Nested subscribe in Receive Payment in sales-home-component.ts should be refactored into something more readable.
This commit is contained in:
Amritanshu
2019-08-09 14:55:38 +05:30
parent 6503982897
commit ff8f4ffb16
16 changed files with 315 additions and 64 deletions

View File

@ -75,4 +75,12 @@ export class VoucherService {
return this.update(voucher, printType, guest_book_id, updateTable);
}
}
receivePayment(id: string, amounts: { id: string; name: string; amount: number }[], updateTable: boolean): Observable<Bill> {
const options = {params: new HttpParams().set('r', "").set('u', updateTable.toString())};
return <Observable<Bill>>this.http.post<Bill>(`${url}/${id}`, amounts, options)
.pipe(
catchError(this.log.handleError(serviceName, 'receivePayment'))
);
}
}