Tax is added directly to product for sale
Auth guard and auth service simplified and fixed so that user is updated upon login Home component changed to use square buttons Fixed showing the totals in the bill ng linted the project
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
import { FormArray, FormBuilder, FormGroup } from "@angular/forms";
|
||||
import { distinctUntilChanged } from "rxjs/operators";
|
||||
import { ReceivePaymentDatasource } from "./receive-payment-datasource";
|
||||
import { PrintType } from "../bills/bill";
|
||||
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { distinctUntilChanged } from 'rxjs/operators';
|
||||
import { ReceivePaymentDatasource } from './receive-payment-datasource';
|
||||
import { PrintType } from '../bills/bill';
|
||||
|
||||
@Component({
|
||||
selector: 'app-receive-payment',
|
||||
@ -15,22 +15,22 @@ export class ReceivePaymentComponent {
|
||||
REGULAR_BILL: [
|
||||
{
|
||||
id: 2,
|
||||
name: "Cash",
|
||||
name: 'Cash',
|
||||
amount: 0
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Credit Card",
|
||||
name: 'Credit Card',
|
||||
amount: 0
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: "Bill To Company",
|
||||
name: 'Bill To Company',
|
||||
amount: 0
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "Tip",
|
||||
name: 'Tip',
|
||||
amount: 0
|
||||
}
|
||||
]
|
||||
@ -38,14 +38,14 @@ export class ReceivePaymentComponent {
|
||||
NO_CHARGE: [
|
||||
{
|
||||
id: 4,
|
||||
name: "No Charge",
|
||||
name: 'No Charge',
|
||||
amount: 0
|
||||
}
|
||||
],
|
||||
STAFF: [
|
||||
{
|
||||
id: 10,
|
||||
name: "Staff Account",
|
||||
name: 'Staff Account',
|
||||
amount: 0
|
||||
}
|
||||
]
|
||||
@ -71,7 +71,7 @@ export class ReceivePaymentComponent {
|
||||
this.choices[this.type].map(
|
||||
x => this.fb.group({
|
||||
name: [x.name],
|
||||
amount: [""]
|
||||
amount: ['']
|
||||
})
|
||||
)
|
||||
));
|
||||
@ -91,7 +91,7 @@ export class ReceivePaymentComponent {
|
||||
(z, i) => array.controls[i].valueChanges.pipe(
|
||||
distinctUntilChanged()
|
||||
).subscribe(x => {
|
||||
this.choices[this.type].find(s => s.name == x.name).amount = (x.amount === "" ? 0 : parseInt(x.amount, 10));
|
||||
this.choices[this.type].find(s => s.name == x.name).amount = (x.amount === '' ? 0 : parseInt(x.amount, 10));
|
||||
this.balance = this.amount - this.choices[this.type].reduce((a, c) => a + c.amount, 0);
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user