Show shopping informations in part details

This commit is contained in:
Jan Böhmer 2019-08-02 12:17:56 +02:00
parent 855eace81d
commit c2b4d100f0
11 changed files with 250 additions and 44 deletions

View file

@ -0,0 +1,67 @@
<div class="table-responsive">
<table class="table table-striped table-header table-hover">
<thead>
<tr>
<th>{% trans %}part.supplier.name{% endtrans %}</th>
<th>{% trans %}part.supplier.partnr{% endtrans %}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for order in part.orderdetails %}
<tr class="{% if order.obsolete %}table-danger{% endif %}">
<td>{{ order.supplier.name }}</td>
<td>{% if order.supplierProductUrl is not empty %}
<a href="{{ order.supplierProductUrl }}" target="_blank" class="link-external">{{ order.supplierPartNr }}</a>
{% else %}
{{ order.supplierPartNr }}
{% endif %}
</td>
<td>
{% if order.pricedetails is not empty %}
<table class="table table-bordered table-sm table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>{% trans %}part.order.minamount{% endtrans %}</th>
<th>{% trans %}part.order.price{% endtrans %}</th>
<th>{% trans %}part.order.single_price{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for detail in order.pricedetails %}
<tr>
<td>
{{ detail.MinDiscountQuantity }}
</td>
<td>
{{ detail.Price | moneyFormat }} <i>{% trans %}part.order.price_per{% endtrans %}</i> {{ detail.PriceRelatedQuantity }}
</td>
<td>
{{ detail.PricePerUnit | moneyFormat}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</td>
<td> {# Action for order information #}
<div class="btn-group">
<button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-boundary="window">
Action
</button>
<div class="dropdown-menu">
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ order.iD }}</span>
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ order.addedDate | localizeddate("short")}}</span>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#"><i class="fas fa-edit fa-fw"></i> {% trans %}edit.caption_short{% endtrans %}</a>
<a class="dropdown-item" href="#"><i class="fas fa-trash fa-fw"></i> {% trans %}delete.caption{% endtrans %}</a>
</div>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View file

@ -112,9 +112,11 @@
<div class="tab-pane fade {% if part.comment is empty %} show active{% endif %}" id="attachments" role="tabpanel" aria-labelledby="profile-tab">
Test
</div>
<div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="profile-tab">
<div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="profile-tab">
{% include "Parts/_order_infos.html.twig" %}
</div>
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="profile-tab">
TODO
</div>
@ -128,22 +130,22 @@
{% if is_granted('create', part) %}
<br>
<div class="btn-group mt-2">
<a class="btn btn-primary" href="{{ part|entityURL('clone') }}">
<i class="fas fa-clone"></i>
{% trans %}part.clone.btn{% endtrans %}
</a>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<div class="dropdown-menu" role="menu">
<a class="dropdown-item" href="{{ part|entityURL('create') }}">
<i class="fas fa-plus-square"></i>
{% trans %}part.create.btn{% endtrans %}
<br>
<div class="btn-group mt-2">
<a class="btn btn-primary" href="{{ part|entityURL('clone') }}">
<i class="fas fa-clone"></i>
{% trans %}part.clone.btn{% endtrans %}
</a>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<div class="dropdown-menu" role="menu">
<a class="dropdown-item" href="{{ part|entityURL('create') }}">
<i class="fas fa-plus-square"></i>
{% trans %}part.create.btn{% endtrans %}
</a>
</div>
</div>
</div>
{% endif %}
</div>