feat: add automatic receipt printing toggle
This commit is contained in:
parent
c5f3caab2f
commit
818813718e
4 changed files with 25 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ const addReceiptInfo = receiptInfo => ret => {
|
||||||
if (!receiptInfo) return ret
|
if (!receiptInfo) return ret
|
||||||
|
|
||||||
const fields = [
|
const fields = [
|
||||||
|
'automaticPrint',
|
||||||
'paper',
|
'paper',
|
||||||
'sms',
|
'sms',
|
||||||
'operatorWebsite',
|
'operatorWebsite',
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ type MachineInfo {
|
||||||
|
|
||||||
type ReceiptInfo {
|
type ReceiptInfo {
|
||||||
paper: Boolean!
|
paper: Boolean!
|
||||||
|
automaticPrint: Boolean!
|
||||||
sms: Boolean!
|
sms: Boolean!
|
||||||
operatorWebsite: Boolean!
|
operatorWebsite: Boolean!
|
||||||
operatorEmail: Boolean!
|
operatorEmail: Boolean!
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ function poll (req, res, next) {
|
||||||
locale,
|
locale,
|
||||||
version,
|
version,
|
||||||
receiptPrintingActive: receipt.active,
|
receiptPrintingActive: receipt.active,
|
||||||
|
automaticReceiptPrint: receipt.automaticPrint,
|
||||||
smsReceiptActive: receipt.sms,
|
smsReceiptActive: receipt.sms,
|
||||||
enablePaperWalletOnly,
|
enablePaperWalletOnly,
|
||||||
twoWayMode: cashOutConfig.active,
|
twoWayMode: cashOutConfig.active,
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,28 @@ const ReceiptPrinting = memo(({ wizard }) => {
|
||||||
<Label2>{receiptPrintingConfig.active ? 'Yes' : 'No'}</Label2>
|
<Label2>{receiptPrintingConfig.active ? 'Yes' : 'No'}</Label2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={classes.switchRow}>
|
||||||
|
<P>Automatic receipt printing</P>
|
||||||
|
<div className={classes.switch}>
|
||||||
|
<Switch
|
||||||
|
disabled={!receiptPrintingConfig.active}
|
||||||
|
checked={receiptPrintingConfig.automaticPrint}
|
||||||
|
onChange={event =>
|
||||||
|
saveConfig({
|
||||||
|
variables: {
|
||||||
|
config: toNamespace(
|
||||||
|
namespaces.RECEIPT,
|
||||||
|
R.merge(receiptPrintingConfig, {
|
||||||
|
automaticPrint: event.target.checked
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Label2>{receiptPrintingConfig.automaticPrint ? 'Yes' : 'No'}</Label2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className={classes.switchRow}>
|
<div className={classes.switchRow}>
|
||||||
<P>Offer SMS receipt</P>
|
<P>Offer SMS receipt</P>
|
||||||
<div className={classes.switch}>
|
<div className={classes.switch}>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue