Void Bill Working
This commit is contained in:
@ -12,6 +12,7 @@ import { VoucherService } from './bills/voucher.service';
|
||||
import { ToasterService } from "../core/toaster.service";
|
||||
import { tap } from "rxjs/operators";
|
||||
import { Table } from "../core/table";
|
||||
import {observableToBeFn} from "rxjs/internal/testing/TestScheduler";
|
||||
|
||||
@Injectable()
|
||||
export class BillService {
|
||||
@ -192,7 +193,7 @@ export class BillService {
|
||||
return this.bill.voucherType;
|
||||
}
|
||||
|
||||
receivePayment(amounts: { id: string; name: string; amount: number }[]) {
|
||||
receivePayment(amounts: { id: string; name: string; amount: number }[]): Observable<boolean> {
|
||||
return this.ser.receivePayment(this.bill.id, amounts, true).pipe(
|
||||
tap(x => console.log(x))
|
||||
);
|
||||
@ -202,6 +203,10 @@ export class BillService {
|
||||
return this.ser.moveTable(this.bill.id, table);
|
||||
}
|
||||
|
||||
voidBill(reason: string): Observable<boolean> {
|
||||
return this.ser.voidBill(this.bill.id, reason, true);
|
||||
}
|
||||
|
||||
netAmount() {
|
||||
return math.round(this.bill.kots.reduce(
|
||||
(ka: number, k: Kot) => ka + k.inventories.reduce(
|
||||
|
||||
Reference in New Issue
Block a user