format for latest standard
This commit is contained in:
parent
4108efd9c7
commit
c2af183911
77 changed files with 1697 additions and 1693 deletions
|
|
@ -10,13 +10,13 @@ module.exports = {getMachineName, getMachines, getMachineNames, setMachine}
|
|||
|
||||
function getMachines () {
|
||||
return db.any('select * from devices where display=TRUE order by created')
|
||||
.then(rr => rr.map(r => ({
|
||||
deviceId: r.device_id,
|
||||
cashbox: r.cashbox,
|
||||
cassette1: r.cassette1,
|
||||
cassette2: r.cassette2,
|
||||
paired: r.paired
|
||||
})))
|
||||
.then(rr => rr.map(r => ({
|
||||
deviceId: r.device_id,
|
||||
cashbox: r.cashbox,
|
||||
cassette1: r.cassette1,
|
||||
cassette2: r.cassette2,
|
||||
paired: r.paired
|
||||
})))
|
||||
}
|
||||
|
||||
function getConfig (defaultConfig) {
|
||||
|
|
@ -27,17 +27,17 @@ function getConfig (defaultConfig) {
|
|||
|
||||
function getMachineNames (config) {
|
||||
return Promise.all([getMachines(), getConfig(config)])
|
||||
.then(([machines, config]) => {
|
||||
const addName = r => {
|
||||
const machineScoped = configManager.machineScoped(r.deviceId, config)
|
||||
const name = machineScoped.machineName
|
||||
const cashOut = machineScoped.cashOutEnabled
|
||||
.then(([machines, config]) => {
|
||||
const addName = r => {
|
||||
const machineScoped = configManager.machineScoped(r.deviceId, config)
|
||||
const name = machineScoped.machineName
|
||||
const cashOut = machineScoped.cashOutEnabled
|
||||
|
||||
return _.assign(r, {name, cashOut})
|
||||
}
|
||||
return _.assign(r, {name, cashOut})
|
||||
}
|
||||
|
||||
return _.map(addName, machines)
|
||||
})
|
||||
return _.map(addName, machines)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -52,10 +52,10 @@ function getMachineNames (config) {
|
|||
*/
|
||||
function getMachineName (machineId) {
|
||||
return settingsLoader.loadRecentConfig()
|
||||
.then(config => {
|
||||
const machineScoped = configManager.machineScoped(machineId, config)
|
||||
return machineScoped.machineName
|
||||
})
|
||||
.then(config => {
|
||||
const machineScoped = configManager.machineScoped(machineId, config)
|
||||
return machineScoped.machineName
|
||||
})
|
||||
}
|
||||
|
||||
function resetCashOutBills (rec) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue