fix: backwards compat on cash-in
This commit is contained in:
parent
0079edb9dc
commit
a99c361ace
1 changed files with 6 additions and 2 deletions
|
|
@ -40,8 +40,12 @@ function insertNewBills (t, billRows, machineTx) {
|
|||
const bills = pullNewBills(billRows, machineTx)
|
||||
if (_.isEmpty(bills)) return Promise.resolve([])
|
||||
|
||||
const dbBills = _.map(cashInLow.massage, bills)
|
||||
const getBillsByDestination = destination => _.filter(it => it.destination_unit === destination)(dbBills)
|
||||
const _dbBills = _.map(cashInLow.massage, bills)
|
||||
// BACKWARDS_COMPATIBILITY 8.1
|
||||
// bills before 8.6 don't have destination_unit
|
||||
const dbBills = _.map(_.defaults({ destination_unit: 'cashbox'}))(_dbBills)
|
||||
|
||||
const getBillsByDestination = destination => _.filter(it => it.destination_unit === destination)(dbBills)
|
||||
|
||||
const columns = ['id', 'fiat', 'fiat_code', 'crypto_code', 'cash_in_fee', 'cash_in_txs_id', 'device_time', 'destination_unit']
|
||||
const sql = pgp.helpers.insert(dbBills, columns, 'bills')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue