Merge pull request #898 from ubavic/fix/cashbox_not_updating

fix: cashbox not updating when when updating counts in cash cassettes
This commit is contained in:
Rafael Taranto 2021-11-11 18:32:42 +00:00 committed by GitHub
commit 392b910021

View file

@ -38,12 +38,16 @@ const Wizard = ({ machine, cashoutSettings, locale, onClose, save, error }) => {
const isLastStep = step === LAST_STEP
const onContinue = it => {
const wasCashboxEmptied = it?.wasCashboxEmptied === 'YES'
const cashbox = wasCashboxEmptied ? 0 : machine?.cashbox
const newConfig = R.merge(config, it)
if (isLastStep) {
const wasCashboxEmptied = [
config?.wasCashboxEmptied,
it?.wasCashboxEmptied
].includes('YES')
const cashbox = wasCashboxEmptied ? 0 : machine?.cashbox
if (wasCashboxEmptied) {
createBatch({
variables: {