Settle Options are now stored in the Database and can be updated

This commit is contained in:
2020-12-13 09:44:32 +05:30
parent d65379a068
commit 27aa4d12a6
72 changed files with 1326 additions and 551 deletions

View File

@ -3,6 +3,7 @@ import { User } from '../../core/user';
import { GuestBook } from '../../guest-book/guest-book';
import { Kot } from './kot';
import { VoucherType } from './voucher-type';
export class Bill {
id: string | undefined;
@ -18,7 +19,7 @@ export class Bill {
guest: GuestBook;
// settlements: any[];
voidReason: string;
voucherType: string;
voucherType: VoucherType;
serial: number;
kots: Kot[];
// reprints: any[];
@ -48,7 +49,7 @@ export class Bill {
this.guest = new GuestBook();
// this.settlements = [];
this.voidReason = '';
this.voucherType = '';
this.voucherType = VoucherType.Kot;
this.serial = 0;
this.kots = [];
// this.reprints = [];

View File

@ -1,7 +1,7 @@
export enum VoucherType {
Kot = 'KOT',
Bill = 'REGULAR_BILL',
NoCharge = 'NO_CHARGE',
Staff = 'STAFF',
Void = 'VOID',
Kot = 0,
Bill = 1,
NoCharge = 2,
Staff = 4,
Void = 8,
}

View File

@ -57,7 +57,7 @@ export class VoucherService {
updateTable: boolean,
): Observable<boolean> {
const options = {
params: new HttpParams().set('p', voucherType).set('u', updateTable.toString()),
params: new HttpParams().set('p', voucherType.toString()).set('u', updateTable.toString()),
};
if (guestBookId !== null) {
options.params = options.params.set('g', guestBookId);
@ -74,7 +74,7 @@ export class VoucherService {
updateTable: boolean,
): Observable<boolean> {
const options = {
params: new HttpParams().set('p', voucherType).set('u', updateTable.toString()),
params: new HttpParams().set('p', voucherType.toString()).set('u', updateTable.toString()),
};
if (guestBookId !== null) {
options.params = options.params.set('g', guestBookId);