diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py
index 1541d6e037..00e2639aea 100644
--- a/InvenTree/order/models.py
+++ b/InvenTree/order/models.py
@@ -978,6 +978,13 @@ class OrderLineItem(models.Model):
validators=[MinValueValidator(0)],
)
+ @property
+ def total_line_price(self):
+ """Return the total price for this line item"""
+
+ if self.price:
+ return self.quantity * self.price
+
reference = models.CharField(max_length=100, blank=True, verbose_name=_('Reference'), help_text=_('Line item reference'))
notes = models.CharField(max_length=500, blank=True, verbose_name=_('Notes'), help_text=_('Line item notes'))
@@ -1094,6 +1101,11 @@ class PurchaseOrderLineItem(OrderLineItem):
help_text=_('Unit purchase price'),
)
+ @property
+ def price(self):
+ """Return the 'purchase_price' field as 'price'"""
+ return self.purchase_price
+
destination = TreeForeignKey(
'stock.StockLocation', on_delete=models.SET_NULL,
verbose_name=_('Destination'),
@@ -1200,6 +1212,11 @@ class SalesOrderLineItem(OrderLineItem):
help_text=_('Unit sale price'),
)
+ @property
+ def price(self):
+ """Return the 'sale_price' field as 'price'"""
+ return self.sale_price
+
shipped = RoundingDecimalField(
verbose_name=_('Shipped'),
help_text=_('Shipped quantity'),
diff --git a/InvenTree/report/templates/report/inventree_po_report.html b/InvenTree/report/templates/report/inventree_po_report.html
index 3da23dfd9f..184ea896e1 100644
--- a/InvenTree/report/templates/report/inventree_po_report.html
+++ b/InvenTree/report/templates/report/inventree_po_report.html
@@ -1,115 +1 @@
-{% extends "report/inventree_report_base.html" %}
-
-{% load i18n %}
-{% load report %}
-{% load barcode %}
-{% load inventree_extras %}
-
-{% block page_margin %}
-margin: 2cm;
-margin-top: 4cm;
-{% endblock %}
-
-{% block bottom_left %}
-content: "v{{report_revision}} - {{ date.isoformat }}";
-{% endblock %}
-
-{% block bottom_center %}
-content: "{% inventree_version shortstring=True %}";
-{% endblock %}
-
-{% block style %}
-
-.header-right {
- text-align: right;
- float: right;
-}
-
-.logo {
- height: 20mm;
- vertical-align: middle;
-}
-
-.thumb-container {
- width: 32px;
- display: inline;
-}
-
-
-.part-thumb {
- max-width: 32px;
- max-height: 32px;
- display: inline;
-}
-
-.part-text {
- display: inline;
-}
-
-table {
- border: 1px solid #eee;
- border-radius: 3px;
- border-collapse: collapse;
- width: 100%;
- font-size: 80%;
-}
-
-table td {
- border: 1px solid #eee;
-}
-
-table td.shrink {
- white-space: nowrap
-}
-
-table td.expand {
- width: 99%
-}
-
-{% endblock %}
-
-{% block header_content %}
-
-
-
-
{% trans "Part" %} | -{% trans "Quantity" %} | -{% trans "Reference" %} | -{% trans "Note" %} | -
---|---|---|---|
-
-
-
- {{ line.part.part.full_name }}
-
- |
- {% decimal line.quantity %} | -{{ line.reference }} | -{{ line.notes }} | -
{% trans "Part" %} | +{% trans "Reference" %} | +{% trans "Quantity" %} | +{% trans "Unit Price" %} | +{% trans "Total Price" %} | +{% trans "Note" %} | +
---|---|---|---|---|---|
+
+
+
+ {{ line.part.part.full_name }}
+
+ |
+ {{ line.reference }} | +{% decimal line.quantity %} | +{% include "price_data.html" with price=line.purchase_price %} | +{% include "price_data.html" with price=line.total_line_price %} | +{{ line.notes }} | +
{% trans "Extra Line Items" %} | |||||
+ | {{ line.reference }} | +{% decimal line.quantity %} | +{% include "price_data.html" with price=line.price %} | +{% include "price_data.html" with price=line.total_line_price %} | +{{ line.notes }} | +
+ | + | + | {% trans "Total" %} | +{% include "price_data.html" with price=order.total_price %} | ++ |
{% trans "Part" %} | -{% trans "Quantity" %} | -{% trans "Reference" %} | -{% trans "Note" %} | -
---|---|---|---|
-
-
-
- {{ line.part.full_name }}
-
- |
- {% decimal line.quantity %} | -{{ line.reference }} | -{{ line.notes }} | -
{% trans "Part" %} | +{% trans "Reference" %} | +{% trans "Quantity" %} | +{% trans "Unit Price" %} | +{% trans "Total Price" %} | +{% trans "Note" %} | +
---|---|---|---|---|---|
+
+
+
+ {{ line.part.full_name }}
+
+ |
+ {{ line.reference }} | +{% decimal line.quantity %} | +{% include "price_data.html" with price=line.sale_price %} | +{% include "price_data.html" with price=line.total_line_price %} | +{{ line.notes }} | +
{% trans "Extra Line Items" %} | |||||
+ | {{ line.reference }} | +{% decimal line.quantity %} | +{% include "price_data.html" with price=line.price %} | +{% include "price_data.html" with price=line.total_line_price %} | +{{ line.notes }} | +
+ | + | + | {% trans "Total" %} | +{% include "price_data.html" with price=order.total_price %} | ++ |