Skip to content

Commit eaf2cdd

Browse files
committed
Merge branch 'dev' of github.com:UniversalScientificTechnologies/OpenIntranet into dev
2 parents 78ddb7e + 28e91ee commit eaf2cdd

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

src/OpenIntranet/templates/production.bom_table.hbs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,28 @@
4444

4545
<div>
4646
{%try%}
47-
{%for packets in row['packets'] %}
48-
{% set count = 0 %}
49-
{%for packet in packets['packets'] %}
50-
{% set this_warehouse = bool(packet['packets']['position'][0]['warehouse'] == current_warehouse) %}
51-
{% if this_warehouse %} <div> <span class="text-muted hover-packet" packet_id="{{packet['packets']['_id']}}"><i class="bi bi-box-seam"></i> {{str(packet['packets']['_id'])[-4:]}}</span> &middot; <b>{{packet['packet_count']}}</b><small>/{{packet['packet_count']}}</small> ks &middot; <span class="text-muted" data-toggle="tooltip" data-placement="top" title="{{ packet['packets']['position'][0]['text']}}">(<i class="bi bi-inboxes"></i> {{ packet['packets']['position'][0]['name']}})</span></div> {%end%}
52-
{%set count += packet['packet_count'] %}
53-
{%end%}
54-
<hr style="margin: 2px;">
55-
<div><span data-toggle="tooltip" data-placement="top" title="V tomto skladě" unit_required="{{len(row['Ref'])}}" unit_available="{{count}}" class="count_validation"><i class="bi bi-shop"></i> {{count}} ks</span> <span data-toggle="tooltip" data-placement="top" title="Ostatní sklady" class="text-muted"><i class="bi bi-building"></i> {{packets['component_count'] - count}} ks</span></div>
56-
<hr style="margin: 2px;">
57-
<div> {%if packets['component_count']%} <i class="bi bi-cash-stack"> </i>{{ round(packets['component_price']/packets['component_count']*len(row['Ref']), 2) }} Czk &middot; <span class="text-muted"><i class="bi bi-cash"> </i>{{ round(packets['component_price']/packets['component_count'], 2) }} Czk/ks </span>{%else%} <span class="text-muted">Není možné určit cenu.</span> {%end%}</div>
47+
{% if not len(row['packets']) %}
48+
<div>
49+
<i class="bi bi-exclamation-square"></i> Není ve skladu
50+
<span unit_required="{{len(row['Ref'])}}" unit_available="0" class="count_validation"></span>
51+
</div>
52+
{%else%}
53+
{%for packets in row['packets'] %}
54+
{% set count = 0 %}
55+
{% for packet in packets['packets'] %}
56+
{% set this_warehouse = bool(packet['packets']['position'][0]['warehouse'] == current_warehouse) %}
57+
{% if this_warehouse %}
58+
<div> <span class="text-muted hover-packet" packet_id="{{packet['packets']['_id']}}"><i class="bi bi-box-seam"></i> {{str(packet['packets']['_id'])[-4:]}}</span> &middot; <b>{{packet['packet_count']}}</b><small>/{{packet['packet_count']}}</small> ks &middot; <span class="text-muted" data-toggle="tooltip" data-placement="top" title="{{ packet['packets']['position'][0]['text']}}">(<i class="bi bi-inboxes"></i> {{ packet['packets']['position'][0]['name']}})</span></div>
59+
{%set count += packet['packet_count'] %}
60+
{%end%}
61+
{%end%}
62+
<hr style="margin: 2px;">
63+
<div><span data-toggle="tooltip" data-placement="top" title="V tomto skladě" unit_required="{{len(row['Ref'])}}" unit_available="{{count}}" class="count_validation"><i class="bi bi-shop"></i> {{count}} ks</span> <span data-toggle="tooltip" data-placement="top" title="Ostatní sklady" class="text-muted"><i class="bi bi-building"></i> {{packets['component_count'] - count}} ks</span></div>
64+
<hr style="margin: 2px;">
65+
<div> {%if packets['component_count']%} <i class="bi bi-cash-stack"> </i>{{ round(packets['component_price']/packets['component_count']*len(row['Ref']), 2) }} Czk &middot; <span class="text-muted"><i class="bi bi-cash"> </i>{{ round(packets['component_price']/packets['component_count'], 2) }} Czk/ks </span>{%else%} <span class="text-muted">Není možné určit cenu.</span> {%end%}</div>
5866

59-
{%end%}
67+
{%end%}
68+
{%end%}
6069
{% except%}
6170
ERROR...
6271
{%end%}

src/OpenIntranet/templates/production.flow.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,16 @@ F{% extends "base.hbs" %}
287287
update_multiplication(multiplication);
288288
$(".count_validation").each(function(){
289289
var table_row = $(this).closest('td');
290+
console.log($(this));
290291
table_row.removeClass("bg-danger");
291292
table_row.removeClass("bg-warning");
293+
table_row.removeClass("bg-secondary");
292294
293295
if(Number($(this).attr("unit_required"))*multiplication > Number($(this).attr("unit_available"))) {
294296
table_row.addClass("bg-danger");
295297
} else if (Number($(this).attr("unit_required"))*(multiplication+1) > Number($(this).attr("unit_available"))) {
296298
table_row.addClass("bg-warning");
297299
}
298-
299300
});
300301
}
301302

0 commit comments

Comments
 (0)