How to add unit price and total price when printing purchase order as pdf? #4439
-
How to add unit price and total price when printing purchase order as pdf? {% decimal line.purchase_price %} does not work... not much seems to be working |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
Can you share your entire template? |
Beta Was this translation helpful? Give feedback.
-
it ain't working for you as well, i wanna display this in the po:[image:
image.png]
…On Fri, Mar 3, 2023 at 12:25 AM Oliver ***@***.***> wrote:
Seems to work fine on my end:
[image: image]
<https://user-images.githubusercontent.com/10080325/222638385-087f7dae-59cd-4ba0-b2bc-070e83502d9f.png>
I had to tweak your example to get it to work:
{% extends "report/inventree_po_report.html" %}
{% load i18n %}
{% load inventree_extras %}
{% load report %}
{% load barcode %}
{% block page_content %}
<h3 style="text-transform:uppercase;">{% trans "Items" %}</h3><table class='table table-striped table-condensed'>
<thead>
<tr>
<th>Description</th>
<th>QTEE/QTY</th>
<th>Prix/Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
{% for line in lines.all %}
<tr>
<td>
<div class='thumb-container'>
<img src='{% part_image line.part.part %}' class='part-thumb'>
</div>
<div class='part-text'>
{{ line.part.part.full_name }}
</td>
<td>{% decimal line.quantity %} PMP</td>
<td>{{ line.purchase_price }} {{ line.purchase_price_currency}} </td>
<td>{{ line.total_price }} {{ line.purchase_price_currency}} </td>
</tr>
{% endfor %}
</div>
</tbody></table>
{% endblock %}
—
Reply to this email directly, view it on GitHub
<#4439 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXZLLWWTQR3GAFVZMBQ7LLW2F6DXANCNFSM6AAAAAAVN5EYJU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
is there a way to multiply the unit price by the quantity directly on
the report's html file
…On Fri, Mar 3, 2023 at 1:52 AM Oliver ***@***.***> wrote:
Do you mean that the "total price" is not rendering correctly?
The PurchaseOrderLineItem model does not have a method called
*total_price* which is why it is not showing anything. We would need to
add that functionality to allow rendering here
—
Reply to this email directly, view it on GitHub
<#4439 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXZLLR7GHYQ7YEASIIH3JTW2GIJFANCNFSM6AAAAAAVN5EYJU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
is there a way to change decimals only on PO reports, if I put pricing decilmals to 2, it messes up all the table views of the site, decimals should be 2 on the report and 4 on the whole site. right now reports are taking in account 4 decimals: |
Beta Was this translation helpful? Give feedback.
Can you share your entire template?