mirror of
https://github.com/frappe/books.git
synced 2025-03-31 23:41:32 +00:00
feat: Add submitted field to Docs on print templates
This commit is contained in:
parent
c10edc7132
commit
47d90d8756
@ -37,8 +37,6 @@ export async function getPrintTemplatePropValues(
|
|||||||
const fyo = doc.fyo;
|
const fyo = doc.fyo;
|
||||||
const values: PrintValues = { doc: {}, print: {} };
|
const values: PrintValues = { doc: {}, print: {} };
|
||||||
values.doc = await getPrintTemplateDocValues(doc);
|
values.doc = await getPrintTemplateDocValues(doc);
|
||||||
(values.doc as PrintTemplateData).entryType = doc.schema.name;
|
|
||||||
(values.doc as PrintTemplateData).entryLabel = doc.schema.label;
|
|
||||||
|
|
||||||
const printSettings = await fyo.doc.getDoc(ModelNameEnum.PrintSettings);
|
const printSettings = await fyo.doc.getDoc(ModelNameEnum.PrintSettings);
|
||||||
const printValues = await getPrintTemplateDocValues(
|
const printValues = await getPrintTemplateDocValues(
|
||||||
@ -72,8 +70,6 @@ export function getPrintTemplatePropHints(schemaName: string, fyo: Fyo) {
|
|||||||
const hints: PrintTemplateHint = {};
|
const hints: PrintTemplateHint = {};
|
||||||
const schema = fyo.schemaMap[schemaName]!;
|
const schema = fyo.schemaMap[schemaName]!;
|
||||||
hints.doc = getPrintTemplateDocHints(schema, fyo);
|
hints.doc = getPrintTemplateDocHints(schema, fyo);
|
||||||
hints.doc.entryType = fyo.t`Entry Type`;
|
|
||||||
hints.doc.entryLabel = fyo.t`Entry Label`;
|
|
||||||
|
|
||||||
const printSettingsHints = getPrintTemplateDocHints(
|
const printSettingsHints = getPrintTemplateDocHints(
|
||||||
fyo.schemaMap[ModelNameEnum.PrintSettings]!,
|
fyo.schemaMap[ModelNameEnum.PrintSettings]!,
|
||||||
@ -159,6 +155,10 @@ function getPrintTemplateDocHints(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hints.submitted = fyo.t`Submitted`;
|
||||||
|
hints.entryType = fyo.t`Entry Type`;
|
||||||
|
hints.entryLabel = fyo.t`Entry Label`;
|
||||||
|
|
||||||
if (Object.keys(links).length) {
|
if (Object.keys(links).length) {
|
||||||
hints.links = links;
|
hints.links = links;
|
||||||
}
|
}
|
||||||
@ -204,6 +204,10 @@ async function getPrintTemplateDocValues(doc: Doc, fieldnames?: string[]) {
|
|||||||
values[fieldname] = table;
|
values[fieldname] = table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
values.submitted = doc.submitted
|
||||||
|
values.entryType = doc.schema.name;
|
||||||
|
values.entryLabel = doc.schema.label;
|
||||||
|
|
||||||
// Set Formatted Doc Link Data
|
// Set Formatted Doc Link Data
|
||||||
await doc.loadLinks();
|
await doc.loadLinks();
|
||||||
const links: PrintTemplateData = {};
|
const links: PrintTemplateData = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user