2
0
mirror of https://github.com/frappe/books.git synced 2025-01-09 01:44:15 +00:00

fix: use POS print template width from print settings

This commit is contained in:
AbleKSaju 2025-01-03 10:10:54 +05:30
parent 8523b613df
commit aeeebc3b4f
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import fs from 'fs/promises';
import path from 'path';
import { fyo } from 'src/initFyo';
import { TemplateFile } from 'utils/types';
export async function getTemplates() {
@ -13,7 +14,10 @@ export async function getTemplates() {
const filePath = path.join(paths.root, file);
const template = await fs.readFile(filePath, 'utf-8');
const { mtime } = await fs.stat(filePath);
const width = file?.split('-')[1]?.split('.')[0] === 'POS' ? 8 : 0;
const width =
file?.split('-')[1]?.split('.')[0] === 'POS'
? (fyo.singles.PrintSettings?.posPrintWidth as number)
: 0;
const height = file?.split('-')[1]?.split('.')[0] === 'POS' ? 22 : 0;
templates.push({

View File

@ -131,7 +131,7 @@
"fieldname": "posPrintWidth",
"label": "Pos Print Width",
"fieldtype": "Float",
"default": 10,
"default": 8,
"section": "Customizations"
}
]