feat: add automatic receipt printing toggle

This commit is contained in:
Sérgio Salgado 2022-07-04 18:27:04 +01:00 committed by Rafael
parent c5f3caab2f
commit 818813718e
4 changed files with 25 additions and 0 deletions

View file

@ -36,6 +36,7 @@ const addReceiptInfo = receiptInfo => ret => {
if (!receiptInfo) return ret
const fields = [
'automaticPrint',
'paper',
'sms',
'operatorWebsite',

View file

@ -38,6 +38,7 @@ type MachineInfo {
type ReceiptInfo {
paper: Boolean!
automaticPrint: Boolean!
sms: Boolean!
operatorWebsite: Boolean!
operatorEmail: Boolean!

View file

@ -114,6 +114,7 @@ function poll (req, res, next) {
locale,
version,
receiptPrintingActive: receipt.active,
automaticReceiptPrint: receipt.automaticPrint,
smsReceiptActive: receipt.sms,
enablePaperWalletOnly,
twoWayMode: cashOutConfig.active,

View file

@ -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}>