Skip to content

Commit

Permalink
enable manual printing
Browse files Browse the repository at this point in the history
  • Loading branch information
CappeDiem committed Feb 13, 2024
1 parent 4deed6e commit 3f8e78d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions print.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const hlmLogo = path.join(__dirname, 'hlm.png');
const options = {encoding: "GB18030"}
const printer = new escpos.Printer(usbDevice, options);
const config = require("./config.json");
const {getData} = require("./utils/db");

function print(users) {
console.log("Printing")
Expand Down Expand Up @@ -37,16 +38,14 @@ function print(users) {
})
})
}
async function printDept(users) {
return new Promise((resolve, reject) => {
function printDept(users) {
getData("users", {}, {nocreate: true, all: true}).then(async (user) => {
print(users)
resolve()
return
})
}

module.exports = {
printDept
}
printDept()
function space(str, leading) {
let spaces = " "
return spaces.substring(0, 42 - leading.length - str.length)
Expand Down

0 comments on commit 3f8e78d

Please sign in to comment.