From 121c5d107e1ad1f1d7cee9d2c8ca106a1c49c7ee Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Mon, 6 Jun 2022 23:03:15 +1200 Subject: [PATCH] Separate unit cost and purchase price in BOM (#3141) It's possible for a part to have purchase price information, but not supplier pricing (aka unit prices), but the current BOM price display logic will only show the purchase prices when supplier prices are also available. It seems reasonable to separate these two pieces of information - even when no supplier pricing is available, seeing the purchase prices for BOM components is useful on its own. --- .../part/templates/part/part_pricing.html | 5 +++- InvenTree/part/templates/part/prices.html | 24 ++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/InvenTree/part/templates/part/part_pricing.html b/InvenTree/part/templates/part/part_pricing.html index f61df368d4..b6f45fa8e9 100644 --- a/InvenTree/part/templates/part/part_pricing.html +++ b/InvenTree/part/templates/part/part_pricing.html @@ -60,6 +60,7 @@ Max: {% include "price.html" with price=max_total_bom_price %} {% endif %} + {% endif %} {% if min_total_bom_purchase_price %} {% trans 'Unit Purchase Price' %} @@ -82,6 +83,8 @@ {% endif %} + + {% if min_total_bom_price or min_total_bom_purchase_price %} {% else %} @@ -122,7 +125,7 @@ {% endif %} -{% if min_unit_buy_price or min_unit_bom_price %} +{% if min_unit_buy_price or min_unit_bom_price or min_unit_bom_purchase_price %} {% else %}
{% trans 'No pricing information is available for this part.' %} diff --git a/InvenTree/part/templates/part/prices.html b/InvenTree/part/templates/part/prices.html index 13761f4ca1..7ea93d6fdd 100644 --- a/InvenTree/part/templates/part/prices.html +++ b/InvenTree/part/templates/part/prices.html @@ -64,9 +64,9 @@ Max: {% include "price.html" with price=max_total_bom_price %} {% endif %} + {% endif %} - - {% if min_total_bom_purchase_price %} + {% if min_total_bom_purchase_price %} {% trans 'Unit Purchase Price' %} @@ -81,15 +81,17 @@ Max: {% include "price.html" with price=max_total_bom_purchase_price %} {% endif %} - {% endif %} + {% endif %} - {% if not part.has_complete_bom_pricing %} - - - {% trans 'Note: BOM pricing is incomplete for this part' %} - - - {% endif %} + {% if not part.has_complete_bom_pricing %} + + + {% trans 'Note: BOM pricing is incomplete for this part' %} + + + {% endif %} + + {% if min_total_bom_price or min_total_bom_purchase_price %} {% else %} @@ -131,7 +133,7 @@ {% endif %} - {% if min_unit_buy_price or min_unit_bom_price %} + {% if min_unit_buy_price or min_unit_bom_price or min_unit_bom_purchase_price %} {% else %}
{% trans 'No pricing information is available for this part.' %}