diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js
index c3b8ba99..3375158e 100644
--- a/lib/cashbox-batches.js
+++ b/lib/cashbox-batches.js
@@ -4,9 +4,9 @@ const _ = require('lodash/fp')
const uuid = require('uuid')
function createCashboxBatch (deviceId, cashboxCount) {
- if (_.isEqual(0, cashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.')
- const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-in-empty') RETURNING *`
- const sql2 = `
+ if (_.isEqual(0, cashboxCount)) throw new Error('Cash box is empty. Cash box batch could not be created.')
+ const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty') RETURNING *`
+ const sql2 = `
UPDATE bills SET cashbox_batch_id=$1
FROM cash_in_txs
WHERE bills.cash_in_txs_id = cash_in_txs.id AND
@@ -24,12 +24,12 @@ function updateMachineWithBatch (machineContext, oldCashboxCount) {
const isCassetteAmountWithinRange = _.inRange(constants.CASH_OUT_MINIMUM_AMOUNT_OF_CASSETTES, constants.CASH_OUT_MAXIMUM_AMOUNT_OF_CASSETTES + 1, _.size(machineContext.cassettes))
if (!isValidContext && !isCassetteAmountWithinRange)
throw new Error('Insufficient info to create a new cashbox batch')
- if (_.isEqual(0, oldCashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.')
+ if (_.isEqual(0, oldCashboxCount)) throw new Error('Cash box is empty. Cash box batch could not be created.')
return db.tx(t => {
const deviceId = machineContext.deviceId
const batchId = uuid.v4()
- const q1 = t.none(`INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-in-empty')`, [batchId, deviceId])
+ const q1 = t.none(`INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty')`, [batchId, deviceId])
const q2 = t.none(`UPDATE bills SET cashbox_batch_id=$1 FROM cash_in_txs
WHERE bills.cash_in_txs_id = cash_in_txs.id AND
cash_in_txs.device_id = $2 AND
diff --git a/migrations/1617967601902-add-batches-type.js b/migrations/1617967601902-add-batches-type.js
index 20d64368..97532908 100644
--- a/migrations/1617967601902-add-batches-type.js
+++ b/migrations/1617967601902-add-batches-type.js
@@ -3,15 +3,15 @@ var db = require('./db')
exports.up = function (next) {
var sqls = [
`CREATE TYPE cashbox_batch_type AS ENUM(
- 'cash-in-empty',
- 'cash-out-1-refill',
- 'cash-out-1-empty',
- 'cash-out-2-refill',
- 'cash-out-2-empty',
- 'cash-out-3-refill',
- 'cash-out-3-empty',
- 'cash-out-4-refill',
- 'cash-out-4-empty'
+ 'cash-box-empty',
+ 'cash-cassette-1-refill',
+ 'cash-cassette-1-empty',
+ 'cash-cassette-2-refill',
+ 'cash-cassette-2-empty',
+ 'cash-cassette-3-refill',
+ 'cash-cassette-3-empty',
+ 'cash-cassette-4-refill',
+ 'cash-cassette-4-empty'
)`,
`ALTER TABLE cashbox_batches ADD COLUMN operation_type cashbox_batch_type NOT NULL`,
`ALTER TABLE cashbox_batches ADD COLUMN bill_count_override SMALLINT`,
diff --git a/new-lamassu-admin/src/pages/Cashout/WizardStep.js b/new-lamassu-admin/src/pages/Cashout/WizardStep.js
index b910cf01..f292503b 100644
--- a/new-lamassu-admin/src/pages/Cashout/WizardStep.js
+++ b/new-lamassu-admin/src/pages/Cashout/WizardStep.js
@@ -162,14 +162,14 @@ const WizardStep = ({
{lastStep && (
- Cash-out Bill Count
+ Cash Cassette Bill Count
When enabling cash-out, your bill count will be automatically set to
zero. Make sure you physically put cash inside the cash cassettes to
allow the machine to dispense it to your users. If you already did,
- make sure you set the correct cash-out bill count for this machine
- on your Cash Cassettes tab under Maintenance.
+ make sure you set the correct cash cassette bill count for this
+ machine on your Cash Boxes & Cassettes tab under Maintenance.
- Specify if you want your cash-in counts to be reset automatically or
- manually.
+ We can automatically assume you emptied a bill validator's cash box
+ when the machine detects that it has been removed.
{
className={classes.radioButtons}
/>
- Choose this option if you want your cash-in cashbox count to be
- reset automatically when it is physically removed from the machine.
+ Assume the cash box is emptied whenever it's removed, creating a new
+ batch on the history screen and setting its current balance to zero.
{
className={classes.radioButtons}
/>
- Choose this option if you want to edit your cash-in counts manually
- on Lamassu Admin, after you physically remove the bills from the
- cashbox.
+ Cash boxes won't be assumed emptied when removed, nor their counts
+ modified. Instead, to update the count and create a new batch,
+ you'll click the 'Edit' button on this panel.