Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    • Referral Program
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to show prices including tax on POS receipt?

Subscribe

Get notified when there's activity on this post

This question has been flagged
posticketreportingodoo8.0
1 Reply
20648 Views
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys,

I would like to have the POS receipt include the tax-amount in the price per product.
For example if you would buy a product thats costs 1.00 and the tax rate is 21% I want the line to show 1.21€.
In point_of_sale/static/src/xml/pos.xml is the PosTicket which displays the ticket in the browser (and makes the PDF too if you wish). So I've changed this:

                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(orderline.get_display_price())"/>
                    </td>

With this:

                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(orderline.get_price_with_tax())"/>
                    </td>

When I now print the ticket in browser everything is fine and the price is shown with the tax amount included in the price on a line. For example:

However, when I now print this ticket with my receipt printer the prices are still shown without these taxes included on the lines. So my question is.. which report is then responsible for the ticket and how can I make it show the prices including taxes? I can't find it anywhere under the reports.. In browser and on PDF it works fine but not when I print the ticket out with the ticket printer. I assume this is controlled/changed by another report?

With kind regards,
Yenthe

1
Avatar
Discard
Shawn Varghese

Nice find. I've removed my earlier comments, to avoid confusing anyone.

Yenthe Van Ginneken (Mainframe Monkey)
Author

Thanks Shawn! I've removed mine too and only left my answer there. Hopefully this can help others! It had me confused for hours.

Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Author Best Answer

Alright found the solution myself.
Odoo went in a bit of a weird way here really. The ticket that is shown in your browser and that is printed in the PDF is not the same XML code as for the ticket that the ticket prints.
PosTicket is responsible for printing it on screen and in the PDF and XmlReceipt is responsible for printing with the ticket printer.

If you want to show prices with taxes when the ticket prints it should be like this:

<value><t t-esc='Math.abs(line.price_display + line.tax)' /></value>

In place of:

<value><t t-esc='line.price_display' /></value>

The code that prints out the ticket on screen and in your PDF is from PosTicket in pos.xml (addons/point_of_sale/static/src/xml/pos.xml):

<t t-name="PosTicket">
        <div class="pos-sale-ticket">
            
            <div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
                Date.CultureInfo.formatPatterns.longTime)"/> <t t-esc="order.get('name')"/></div>
            <br />
            <t t-esc="widget.pos.company.name"/><br />
            Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
            User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br />
            Shop: <t t-esc="widget.pos.shop.name"/><br />
            <br />
            <t t-if="widget.pos.config.receipt_header">
                <div style='text-align:center'>
                    <t t-esc="widget.pos.config.receipt_header" />
                </div>
                <br />
            </t>
            <table>
                <colgroup>
                    <col width='50%' />
                    <col width='25%' />
                    <col width='25%' />
                </colgroup>
                <tr t-foreach="orderlines" t-as="orderline">
                    <td>
                        <t t-esc="orderline.get_product().display_name"/>
                         <t t-if="orderline.get_discount() > 0">
                            <div class="pos-disc-font">
                                With a <t t-esc="orderline.get_discount()"/>% discount
                            </div>
                        </t>
                    </td>
                    <td class="pos-right-align">
                        <t t-esc="orderline.get_quantity_str_with_unit()"/>
                    </td>
                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(orderline.get_price_with_tax())"/>
                    </td>
                </tr>
            </table>
            <br />
            <table>
                <tr>
                    <td>Subtotal:</td>
                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(order.getSubtotal())"/>
                    </td>
                </tr>
                <t t-foreach="order.getTaxDetails()" t-as="taxdetail">
                    <tr>
                        <td><t t-esc="taxdetail.tax.name" /></td>
                        <td class="pos-right-align">
                            <t t-esc="widget.format_currency(taxdetail.amount)" />
                        </td>
                    </tr>
                </t>
                <tr>
                    <td>Discount:</td>
                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(order.getDiscountTotal())"/>
                    </td>
                </tr>
                <tr class="emph">
                    <td>Total:</td>
                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(order.getTotalTaxIncluded())"/>
                    </td>
                </tr>
            </table>
            <br />
            <table>
                <tr t-foreach="paymentlines" t-as="line">
                    <td>
                        <t t-esc="line.name"/>
                    </td>
                    <td class="pos-right-align">
                        <t t-esc="widget.format_currency(line.get_amount())"/>
                    </td>
                </tr>
            </table>
            <br />
            <table>
                <tr><td>Change: </td><td class="pos-right-align">
                    <t t-esc="widget.format_currency(order.getChange())"/>
                    </td></tr>
            </table>
            <t t-if="widget.pos.config.receipt_footer">
                <br />
                <div style='text-align:center'>
                    <t t-esc="widget.pos.config.receipt_footer" />
                </div>
            </t>
        </div>
    </t>

The code that prints out the ticket from the ticker printer comes from XmlReceipt in pos.xml (addons/point_of_sale/static/src/xml/pos.xml):

    <t t-name="XmlReceipt">
        <receipt align='center' width='40' value-thousands-separator='' >
            <t t-if='receipt.company.logo'>
                <img t-att-src='receipt.company.logo' />
                <br/>
            </t>
            <t t-if='!receipt.company.logo'>
                <h1><t t-esc='receipt.company.name' /></h1>
                <br/>
            </t>
            <div font='b'>
                <t t-if='receipt.shop.name'>
                    <div><t t-esc='receipt.shop.name' /></div>
                </t>
                <t t-if='receipt.company.contact_address'>
                    <div><t t-esc='receipt.company.contact_address' /></div>
                </t>
                <t t-if='receipt.company.phone'>
                    <div>Tel:<t t-esc='receipt.company.phone' /></div>
                </t>
                <t t-if='receipt.company.vat'>
                    <div>VAT:<t t-esc='receipt.company.vat' /></div>
                </t>
                <t t-if='receipt.company.email'>
                    <div><t t-esc='receipt.company.email' /></div>
                </t>
                <t t-if='receipt.company.website'>
                    <div><t t-esc='receipt.company.website' /></div>
                </t>
                <t t-if='receipt.header'>
                    <div><t t-esc='receipt.header' /></div>
                </t>
                <t t-if='receipt.cashier'>
                    <div>--------------------------------</div>
                    <div>Served by <t t-esc='receipt.cashier' /></div>
                </t>
            </div>
            <br /><br />

            <!-- Orderlines -->

            <div line-ratio='0.6'>
                <t t-foreach='receipt.orderlines' t-as='line'>
                    <t t-set='simple' t-value='line.discount === 0 and line.unit_name === "Unit(s)" and line.quantity === 1' />
                    <t t-if='simple'>
                        <line>
                            <left><t t-esc='line.product_name' /></left>
                            <right><value><t t-esc='line.price_display' /></value></right>
                        </line>
                    </t>
                    <t t-if='!simple'>
                        <line><left><t t-esc='line.product_name' /></left></line>
                        <t t-if='line.discount !== 0'>
                            <line indent='1'><left>Discount: <t t-esc='line.discount' />%</left></line>
                        </t>
                        <line indent='1'>
                            <left>
                                <value value-decimals='3' value-autoint='on'>
                                    <t t-esc='line.quantity' />
                                </value>
                                <t t-if='line.unit_name !== "Unit(s)"'>
                                    <t t-esc='line.unit_name' /> 
                                </t>
                                <!--x 
                                <value value-decimals='2'>
                                    <t t-esc='Math.abs(line.price + line.tax)' />
                                </value>-->
                            </left>
                            <right>
                                <value><t t-esc='Math.abs(line.price_display + line.tax)' /></value>
                            </right>
                        </line>
                    </t>
                </t>
            </div>

            <!-- Subtotal -->

            <t t-set='taxincluded' t-value='Math.abs(receipt.subtotal - receipt.total_with_tax) &lt;= 0.000001' />
            <t t-if='!taxincluded'>
                <line><right>--------</right></line>
                <line><left>Subtotal</left><right> <value><t t-esc="receipt.subtotal" /></value></right></line>
                <t t-foreach='receipt.tax_details' t-as='tax'>
                    <line>
                        <left><t t-esc='tax.name' /></left>
                        <right><value><t t-esc='tax.amount' /></value></right>
                    </line>
                </t>
            </t>

            <!-- Total -->

            <line><right>--------</right></line>
            <line size='double-height'>
                <left><pre>        TOTAL</pre></left>
                <right><value><t t-esc='receipt.total_with_tax' /></value></right>
            </line>
            <br/><br/>

            <!-- Payment Lines -->

            <t t-foreach='receipt.paymentlines' t-as='line'>
                <line>
                    <left><t t-esc='line.journal' /></left>
                    <right><value><t t-esc='line.amount'/></value></right>
                </line>
            </t>
            <br/> 

            <line size='double-height'>
                <left><pre>        CHANGE</pre></left>
                <right><value><t t-esc='receipt.change' /></value></right>
            </line>
            <br/>
            
            <!-- Extra Payment Info -->

            <t t-if='receipt.total_discount'>
                <line>
                    <left>Discounts</left>
                    <right><value><t t-esc='receipt.total_discount'/></value></right>
                </line>
            </t>
            <t t-if='taxincluded'>
                <t t-foreach='receipt.tax_details' t-as='tax'>
                    <line>
                        <left><t t-esc='tax.name' /></left>
                        <right><value><t t-esc='tax.amount' /></value></right>
                    </line>
                </t>
            </t>

            <!-- Footer -->
            <t t-if='receipt.footer'>
                <br/>
                <pre><t t-esc='receipt.footer' /></pre>
                <br/>
                <br/>
            </t>

            <br/>
            <div font='b'>
                <div><t t-esc='receipt.name' /></div>
                <div><t t-esc='receipt.date.localestring' /></div>
            </div>

        </receipt>
    </t>

3
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Is there a module to add Internal Reference to POS Product List and Receipt in Odoo 18?
pos ticket
Avatar
Avatar
1
Apr 25
3416
Como editar el ticket que se imprime una vez registrado el pago en POS
pos ticket
Avatar
0
Feb 25
3545
Odoo 8 Reporting : Change default "Total" label Solved
reporting odoo8.0
Avatar
Avatar
1
Mar 22
9373
What happen when POS tickets ran out (multicompany)
pos ticket
Avatar
0
Sep 17
4692
How to modify the Posbox printed tickets, i.e bigger company logo ?
pos ticket
Avatar
Avatar
1
Mar 15
8584
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now