mirror of
https://github.com/frappe/books.git
synced 2025-01-09 17:53:56 +00:00
fix: use POS print template width from print settings
This commit is contained in:
parent
8523b613df
commit
aeeebc3b4f
@ -1,5 +1,6 @@
|
|||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import { fyo } from 'src/initFyo';
|
||||||
import { TemplateFile } from 'utils/types';
|
import { TemplateFile } from 'utils/types';
|
||||||
|
|
||||||
export async function getTemplates() {
|
export async function getTemplates() {
|
||||||
@ -13,7 +14,10 @@ export async function getTemplates() {
|
|||||||
const filePath = path.join(paths.root, file);
|
const filePath = path.join(paths.root, file);
|
||||||
const template = await fs.readFile(filePath, 'utf-8');
|
const template = await fs.readFile(filePath, 'utf-8');
|
||||||
const { mtime } = await fs.stat(filePath);
|
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;
|
const height = file?.split('-')[1]?.split('.')[0] === 'POS' ? 22 : 0;
|
||||||
|
|
||||||
templates.push({
|
templates.push({
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
"fieldname": "posPrintWidth",
|
"fieldname": "posPrintWidth",
|
||||||
"label": "Pos Print Width",
|
"label": "Pos Print Width",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"default": 10,
|
"default": 8,
|
||||||
"section": "Customizations"
|
"section": "Customizations"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user