Merge pull request #1769 from RafaelTaranto/backport/automatic-receipt-printiung

LAM-411 feat: add automatic receipt printing toggle
This commit is contained in:
Rafael Taranto 2024-11-29 13:50:26 +00:00 committed by GitHub
commit c64675a745
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}>