2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix: extra resources build link

- display links upto two levels
- mark template strings for translation
This commit is contained in:
18alantom 2023-03-14 12:54:05 +05:30
parent 8ff4a97790
commit 7a22ab8946
5 changed files with 24 additions and 25 deletions

View File

@ -5,7 +5,7 @@ extraResources:
[ [
{ from: 'log_creds.txt', to: '../creds/log_creds.txt' }, { from: 'log_creds.txt', to: '../creds/log_creds.txt' },
{ from: 'translations', to: '../translations' }, { from: 'translations', to: '../translations' },
{ from: 'translations', to: '../translations' }, { from: 'templates', to: '../templates' },
] ]
mac: mac:
type: distribution type: distribution

View File

@ -116,9 +116,9 @@ function getPrintTemplateDocHints(
schema: Schema, schema: Schema,
fyo: Fyo, fyo: Fyo,
fieldnames?: string[], fieldnames?: string[],
isLink?: boolean linkLevel?: number
): PrintTemplateData { ): PrintTemplateData {
isLink ??= false; linkLevel ??= 0;
const hints: PrintTemplateData = {}; const hints: PrintTemplateData = {};
const links: PrintTemplateData = {}; const links: PrintTemplateData = {};
@ -134,17 +134,14 @@ function getPrintTemplateDocHints(
} }
hints[fieldname] = label ?? fieldname; hints[fieldname] = label ?? fieldname;
if (fieldtype === FieldTypeEnum.Table) {
}
const { target } = field as TargetField; const { target } = field as TargetField;
const targetSchema = fyo.schemaMap[target]; const targetSchema = fyo.schemaMap[target];
if (fieldtype === FieldTypeEnum.Link && targetSchema && !isLink) { if (fieldtype === FieldTypeEnum.Link && targetSchema && linkLevel < 2) {
links[fieldname] = getPrintTemplateDocHints( links[fieldname] = getPrintTemplateDocHints(
targetSchema, targetSchema,
fyo, fyo,
undefined, undefined,
true linkLevel + 1
); );
} }

View File

@ -56,11 +56,13 @@
<section class="mt-8 text-base"> <section class="mt-8 text-base">
<!-- Heading Row --> <!-- Heading Row -->
<section class="text-gray-600 w-full flex border-b"> <section class="text-gray-600 w-full flex border-b">
<div class="py-4 w-5/12">Item</div> <div class="py-4 w-5/12">{{ t`Item` }}</div>
<div class="py-4 text-right w-2/12" v-if="doc.showHSN">HSN/SAC</div> <div class="py-4 text-right w-2/12" v-if="doc.showHSN">
<div class="py-4 text-right w-1/12">Quantity</div> {{ t`HSN/SAC` }}
<div class="py-4 text-right w-3/12">Rate</div> </div>
<div class="py-4 text-right w-3/12">Amount</div> <div class="py-4 text-right w-1/12">{{ t`Quantity` }}</div>
<div class="py-4 text-right w-3/12">{{ t`Rate` }}</div>
<div class="py-4 text-right w-3/12">{{ t`Amount` }}</div>
</section> </section>
<!-- Body Rows --> <!-- Body Rows -->
@ -84,7 +86,7 @@
<!-- Invoice Terms --> <!-- Invoice Terms -->
<section class="w-1/2"> <section class="w-1/2">
<h3 class="text-sm tracking-widest text-gray-600 mt-2" v-if="doc.terms"> <h3 class="text-sm tracking-widest text-gray-600 mt-2" v-if="doc.terms">
Notes {{ t`Notes` }}
</h3> </h3>
<p class="my-4 text-lg whitespace-pre-line">{{ doc.terms }}</p> <p class="my-4 text-lg whitespace-pre-line">{{ doc.terms }}</p>
</section> </section>

View File

@ -56,11 +56,11 @@
<section class="px-12 pt-12 text-lg"> <section class="px-12 pt-12 text-lg">
<!-- Heading Row --> <!-- Heading Row -->
<section class="mb-4 flex font-semibold"> <section class="mb-4 flex font-semibold">
<div class="w-4/12">Item</div> <div class="w-4/12">{{ t`Item` }}</div>
<div class="w-2/12 text-right" v-if="doc.showHSN">HSN/SAC</div> <div class="w-2/12 text-right" v-if="doc.showHSN">{{ t`HSN/SAC` }}</div>
<div class="w-2/12 text-right">Quantity</div> <div class="w-2/12 text-right">{{ t`Quantity` }}</div>
<div class="w-3/12 text-right">Rate</div> <div class="w-3/12 text-right">{{ t`Rate` }}</div>
<div class="w-3/12 text-right">Amount</div> <div class="w-3/12 text-right">{{ t`Amount` }}</div>
</section> </section>
<!-- Body Rows --> <!-- Body Rows -->

View File

@ -94,11 +94,11 @@
text-gray-800 text-gray-800
" "
> >
<div class="w-4/12 text-left">Item</div> <div class="w-4/12 text-left">{{ t`Item` }}</div>
<div class="w-2/12 text-right" v-if="doc.showHSN">HSN/SAC</div> <div class="w-2/12 text-right" v-if="doc.showHSN">{{ t`HSN/SAC` }}</div>
<div class="w-2/12 text-right">Quantity</div> <div class="w-2/12 text-right">{{ t`Quantity` }}</div>
<div class="w-3/12 text-right">Rate</div> <div class="w-3/12 text-right">{{ t`Rate` }}</div>
<div class="w-3/12 text-right">Amount</div> <div class="w-3/12 text-right">{{ t`Amount`}}</div>
</section> </section>
<!-- Body Rows --> <!-- Body Rows -->
@ -116,7 +116,7 @@
<!-- Invoice Terms --> <!-- Invoice Terms -->
<section class="w-1/2" v-if="doc.terms"> <section class="w-1/2" v-if="doc.terms">
<h3 class="uppercase text-sm tracking-widest font-semibold text-gray-800"> <h3 class="uppercase text-sm tracking-widest font-semibold text-gray-800">
Notes {{ t`Notes` }}
</h3> </h3>
<p class="mt-4 text-lg whitespace-pre-line">{{ doc.terms }}</p> <p class="mt-4 text-lg whitespace-pre-line">{{ doc.terms }}</p>
</section> </section>