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.
This commit is contained in:
Matt Brown 2022-06-06 23:03:15 +12:00 committed by GitHub
parent 88a0e38b69
commit 121c5d107e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 12 deletions

View File

@ -60,6 +60,7 @@
<td>Max: {% include "price.html" with price=max_total_bom_price %}</td>
</tr>
{% endif %}
{% endif %}
{% if min_total_bom_purchase_price %}
<tr>
<td><strong>{% trans 'Unit Purchase Price' %}</strong></td>
@ -82,6 +83,8 @@
</td>
</tr>
{% endif %}
{% if min_total_bom_price or min_total_bom_purchase_price %}
{% else %}
<tr>
<td colspan='3'>
@ -122,7 +125,7 @@
</table>
{% 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 %}
<div class='alert alert-danger alert-block'>
{% trans 'No pricing information is available for this part.' %}

View File

@ -64,9 +64,9 @@
<td>Max: {% include "price.html" with price=max_total_bom_price %}</td>
</tr>
{% endif %}
{% endif %}
{% if min_total_bom_purchase_price %}
{% if min_total_bom_purchase_price %}
<tr>
<td></td>
<td>{% trans 'Unit Purchase Price' %}</td>
@ -81,15 +81,17 @@
<td>Max: {% include "price.html" with price=max_total_bom_purchase_price %}</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
{% if not part.has_complete_bom_pricing %}
<tr>
<td colspan='4'>
<span class='warning-msg'><em>{% trans 'Note: BOM pricing is incomplete for this part' %}</em></span>
</td>
</tr>
{% endif %}
{% if not part.has_complete_bom_pricing %}
<tr>
<td colspan='4'>
<span class='warning-msg'><em>{% trans 'Note: BOM pricing is incomplete for this part' %}</em></span>
</td>
</tr>
{% endif %}
{% if min_total_bom_price or min_total_bom_purchase_price %}
{% else %}
<tr>
<td colspan='4'>
@ -131,7 +133,7 @@
{% endif %}
</table>
{% 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 %}
<div class='alert alert-danger alert-block'>
{% trans 'No pricing information is available for this part.' %}