Skip to content

馃悰 [Bug] - <title>incorrectly defaults to showing "Bill" at the top and "Supplier" for the party details, even though it is a customer-facing quote.#1552

Description

@Aditya-dot-cmd

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

  1. Create a new Quotation for a Customer.
  2. Preview or print the Quotation.
  3. Observe that the document title says "Bill" instead of "Quote" or "Quotation". (Mostly in Business Quote, Minimal quote)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions