Выводит сделку у списаных/произведенных компонентов
All checks were successful
Deploy MES Core / deploy (push) Successful in 12s
All checks were successful
Deploy MES Core / deploy (push) Successful in 12s
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
<li>
|
||||
{{ c.stock_item.material.full_name|default:c.stock_item.material.name }}
|
||||
({% if c.stock_item.current_length and c.stock_item.current_width %}{{ c.stock_item.current_length|floatformat:"-g" }}×{{ c.stock_item.current_width|floatformat:"-g" }}{% elif c.stock_item.current_length %}{{ c.stock_item.current_length|floatformat:"-g" }}{% else %}—{% endif %})
|
||||
{% if c.stock_item.deal_id %}<span class="text-muted">(сделка № {{ c.stock_item.deal.number }})</span>{% endif %}
|
||||
{{ c.quantity|floatformat:"-g" }} шт
|
||||
</li>
|
||||
{% elif c.stock_item_id and c.stock_item.entity_id %}
|
||||
|
||||
@@ -5180,8 +5180,10 @@ class LegacyWriteOffsView(LoginRequiredMixin, TemplateView):
|
||||
'tasks__task__material',
|
||||
'consumptions__material',
|
||||
'consumptions__stock_item__material',
|
||||
'consumptions__stock_item__deal',
|
||||
'results__stock_item__material',
|
||||
'results__stock_item__entity',
|
||||
'results__stock_item__deal',
|
||||
'remnants__material',
|
||||
)
|
||||
)
|
||||
@@ -5206,6 +5208,8 @@ class LegacyWriteOffsView(LoginRequiredMixin, TemplateView):
|
||||
si = res.stock_item
|
||||
if res.kind == 'finished':
|
||||
label = str(getattr(si, 'entity', None) or '—')
|
||||
if getattr(si, 'deal_id', None) and getattr(getattr(si, 'deal', None), 'number', None):
|
||||
label = f"{label} (сделка № {si.deal.number})"
|
||||
produced[label] = produced.get(label, 0.0) + float(si.quantity)
|
||||
elif res.kind == 'remnant':
|
||||
label = str(getattr(si, 'material', None) or '—')
|
||||
@@ -6186,8 +6190,10 @@ class WriteOffsView(LoginRequiredMixin, TemplateView):
|
||||
'tasks__task__material',
|
||||
'consumptions__material',
|
||||
'consumptions__stock_item__material',
|
||||
'consumptions__stock_item__deal',
|
||||
'results__stock_item__material',
|
||||
'results__stock_item__entity',
|
||||
'results__stock_item__deal',
|
||||
'remnants__material',
|
||||
)
|
||||
)
|
||||
@@ -6212,6 +6218,8 @@ class WriteOffsView(LoginRequiredMixin, TemplateView):
|
||||
si = res.stock_item
|
||||
if res.kind == 'finished':
|
||||
label = str(getattr(si, 'entity', None) or '—')
|
||||
if getattr(si, 'deal_id', None) and getattr(getattr(si, 'deal', None), 'number', None):
|
||||
label = f"{label} (сделка № {si.deal.number})"
|
||||
produced[label] = produced.get(label, 0.0) + float(si.quantity)
|
||||
elif res.kind == 'remnant':
|
||||
label = str(getattr(si, 'material', None) or '—')
|
||||
|
||||
Reference in New Issue
Block a user