Fix: Receive Payment
Since the amount Behaviour Subject pipe was not being subscribed to and the original Behaviour Subject as being subscribed, amountVal was not being populated. Now it will be. This was creating problem where amount in receive payment was always 0 Added a check in the backend so that if any part of bill remains unsettled, it will give an error instead of silently accepting and removing the entry.
This commit is contained in:
@ -117,12 +117,12 @@ export class VoucherService {
|
||||
receivePayment(
|
||||
id: string,
|
||||
amounts: { id: number; name: string; amount: number }[],
|
||||
name: string,
|
||||
reason: string,
|
||||
updateTable: boolean,
|
||||
): Observable<boolean> {
|
||||
const options = { params: new HttpParams().set('u', updateTable.toString()) };
|
||||
return this.http
|
||||
.post<boolean>(`${url}/receive-payment/${id}`, { name, amounts }, options)
|
||||
.post<boolean>(`${url}/receive-payment/${id}`, { reason, amounts }, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'receivePayment'))) as Observable<boolean>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user