This commit is contained in:
2025-12-07 22:42:23 +01:00
parent d33b908775
commit 8faaef1ef5
3 changed files with 15 additions and 14 deletions

View File

@@ -1,9 +1,9 @@
import { FastifyInstance } from "fastify";
import {createInvoicePDF, createTimeSheetPDF} from "../utils/pdf";
import {encodeBase64ToNiimbot, generateLabel, useNextNumberRangeNumber} from "../utils/functions";
//import {encodeBase64ToNiimbot, generateLabel, useNextNumberRangeNumber} from "../utils/functions";
import dayjs from "dayjs";
import { ready as zplReady } from 'zpl-renderer-js'
import { renderZPL } from "zpl-image";
//import { ready as zplReady } from 'zpl-renderer-js'
//import { renderZPL } from "zpl-image";
import customParseFormat from "dayjs/plugin/customParseFormat.js";
import isoWeek from "dayjs/plugin/isoWeek.js";
@@ -155,7 +155,7 @@ export default async function functionRoutes(server: FastifyInstance) {
}
})
server.post('/print/zpl/preview', async (req, reply) => {
/*server.post('/print/zpl/preview', async (req, reply) => {
const { zpl, widthMm = 50, heightMm = 30, dpmm = 8, asBase64 = false } = req.body as {zpl:string,widthMm:number,heightMm:number,dpmm:number,asBase64:string}
console.log(widthMm,heightMm,dpmm)
@@ -192,6 +192,6 @@ export default async function functionRoutes(server: FastifyInstance) {
console.error('[ZPL Preview Error]', err)
return reply.code(500).send({ error: err.message || 'Failed to render ZPL' })
}
})
})*/
}

View File

@@ -7,7 +7,7 @@ export default async function staffTimeRoutes(server: FastifyInstance) {
server.post(
'/staff/time',
async (req, reply) => {
const { started_at, stopped_at, type = 'work', description, user_id } = req.body
const { started_at, stopped_at, type = 'work', description, user_id } = req.body as any
const userId = req.user.user_id
const tenantId = req.user.tenant_id