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
|
||||
|
||||
const fields = [
|
||||
'automaticPrint',
|
||||
'paper',
|
||||
'sms',
|
||||
'operatorWebsite',
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ type MachineInfo {
|
|||
|
||||
type ReceiptInfo {
|
||||
paper: Boolean!
|
||||
automaticPrint: Boolean!
|
||||
sms: Boolean!
|
||||
operatorWebsite: Boolean!
|
||||
operatorEmail: Boolean!
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ function poll (req, res, next) {
|
|||
locale,
|
||||
version,
|
||||
receiptPrintingActive: receipt.active,
|
||||
automaticReceiptPrint: receipt.automaticPrint,
|
||||
smsReceiptActive: receipt.sms,
|
||||
enablePaperWalletOnly,
|
||||
twoWayMode: cashOutConfig.active,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,28 @@ const ReceiptPrinting = memo(({ wizard }) => {
|
|||
<Label2>{receiptPrintingConfig.active ? 'Yes' : 'No'}</Label2>
|
||||
</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}>
|
||||
<P>Offer SMS receipt</P>
|
||||
<div className={classes.switch}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue