Expected Behavior
Sales-side documents like Quotations and Sales Orders should be labeled correctly as "Customer" and "Quote", not default to purchasing terminology.
The problematic code
In the print template Vue component, the ternary operators are currently written like this:
{{ doc.entryType === 'SalesInvoice' ? 'Invoice' : 'Bill' }}
{{ doc.entryType === 'SalesInvoice' ? 'Customer' : 'Supplier' }}
Proposed solution
Update the ternary checks to use an array .includes() so it catches all sales-related document types before falling back to the purchasing terms.
Example fix for the Document Title:
{{ ['Quotation', 'SalesQuote'].includes(doc.entryType) ? 'Quote' : doc.entryType === 'SalesInvoice' ? 'Invoice' : 'Bill' }}
Example fix for the Party Label:
{{ ['SalesInvoice', 'SalesQuote', 'Quotation', 'SalesOrder', 'DeliveryNote'].includes(doc.entryType) ? 'Customer' : 'Supplier' }}
Current Behavior
In the default print template, the logic used to determine document titles and party labels relies on a strict fallback check against 'SalesInvoice'. Because of this, when printing a Quotation (or other sales-side documents), the template fails the strict check and incorrectly defaults to showing "Bill" at the top and "Supplier" for the party details, even though it is a customer-facing quote.
Steps to Reproduce
- Create a new Quotation for a Customer.
- Preview or print the Quotation.
- Observe that the document title says "Bill" instead of "Quote" or "Quotation". (Mostly in Business Quote, Minimal quote)
- Observe that the party label says "Supplier" instead of "Customer" . (Mostly in Business Quote, Minimal quote)
FrappeBooks Version
0.36.0
Path or Feature name
SalesQuote
Country
IN
Language
EN
OS
Windows 11, Linux x86_64
Additional OS Info
WIN11 & FEDORA
Expected Behavior
Sales-side documents like Quotations and Sales Orders should be labeled correctly as "Customer" and "Quote", not default to purchasing terminology.
The problematic code
In the print template Vue component, the ternary operators are currently written like this:
{{ doc.entryType === 'SalesInvoice' ? 'Invoice' : 'Bill' }}{{ doc.entryType === 'SalesInvoice' ? 'Customer' : 'Supplier' }}Proposed solution
Update the ternary checks to use an array
.includes()so it catches all sales-related document types before falling back to the purchasing terms.Example fix for the Document Title:
{{ ['Quotation', 'SalesQuote'].includes(doc.entryType) ? 'Quote' : doc.entryType === 'SalesInvoice' ? 'Invoice' : 'Bill' }}Example fix for the Party Label:
{{ ['SalesInvoice', 'SalesQuote', 'Quotation', 'SalesOrder', 'DeliveryNote'].includes(doc.entryType) ? 'Customer' : 'Supplier' }}Current Behavior
In the default print template, the logic used to determine document titles and party labels relies on a strict fallback check against
'SalesInvoice'. Because of this, when printing a Quotation (or other sales-side documents), the template fails the strict check and incorrectly defaults to showing "Bill" at the top and "Supplier" for the party details, even though it is a customer-facing quote.Steps to Reproduce
FrappeBooks Version
0.36.0
Path or Feature name
SalesQuote
Country
IN
Language
EN
OS
Windows 11, Linux x86_64
Additional OS Info
WIN11 & FEDORA