|
44 | 44 |
|
45 | 45 | <div> |
46 | 46 | {%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> · <b>{{packet['packet_count']}}</b><small>/{{packet['packet_count']}}</small> ks · <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 · <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> · <b>{{packet['packet_count']}}</b><small>/{{packet['packet_count']}}</small> ks · <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 · <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> |
58 | 66 |
|
59 | | - {%end%} |
| 67 | + {%end%} |
| 68 | + {%end%} |
60 | 69 | {% except%} |
61 | 70 | ERROR... |
62 | 71 | {%end%} |
|
0 commit comments