Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Discount for customer #31

Merged
merged 2 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- added new shipping method Zasilkovna
- pick up places are downloaded by cron
- [#15 - Company account with multiple users](https://github.com/shopsys/demoshop/pull/15)
- [#31 - Discount for customer](https://github.com/shopsys/demoshop/pull/31)
- administration of customer now contains discount field with range validation that is reflected into User entity
- prices of products are recalculated for logged customers based on custom discount
- discount works also for companies with multiple users
- `filterFormMacro.html.twig` now counts with discount coeficient

### Changed
- [#1 - Basic changes in docs, readme etc. after copying from project-base](https://github.com/shopsys/demoshop/pull/1) : [@LukasHeinz]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{% block order_items_widget %}

{% import '@ShopsysFramework/Admin/Content/Order/orderItem.html.twig' as orderItemMacro %}

<h2>{{ 'Order items'|trans }}</h2>
<fieldset>
<div class="table-touch-always">
{{ form_errors(form.itemsWithoutTransportAndPayment) }}
<div class="table-touch-always__in">
<table class="table-main">
<thead>
<tr>
<th class="table-col-30">{{ 'Name'|trans }}</th>
<th class="table-col-5">{{ 'Catalogue number'|trans }}</th>
<th class="table-col-15 text-right">{{ 'Unit price including VAT'|trans }}</th>
<th class="table-col-10 text-right">{{ 'Amount'|trans }}</th>
<th class="table-col-10 text-right">{{ 'Unit'|trans }}</th>
<th class="table-col-10 text-right">{{ 'VAT rate (%)'|trans }}</th>
<th class="table-col-15 text-right text-no-wrap">{{ 'Total including VAT'|trans }}</th>
<th class="table-col-15 text-right text-no-wrap">{{ 'Total excluding VAT'|trans }}</th>
<th ></th>
</tr>
</thead>
<tbody
id="js-order-items"
data-prototype="{{ orderItemMacro.orderItem(form.itemsWithoutTransportAndPayment.vars.prototype)|escape }}"
data-order-product-add-url="{{ url('admin_order_addproduct', { orderId: order.id }) }}"
>
{% for productItem in order.productItems %}
{{ orderItemMacro.orderItem(form.itemsWithoutTransportAndPayment[productItem.id], productItem.id, orderItemTotalPricesById, order.currency, productItem) }}
{% endfor %}

{% for orderItemId, orderItemForm in form.itemsWithoutTransportAndPayment %}
{% if not orderItemForm.rendered %}
{{ orderItemMacro.orderItem(orderItemForm, orderItemId, orderItemTotalPricesById, order.currency, null) }}
{% endif %}
{% endfor %}

{{ orderItemMacro.orderTransport(form.orderTransport, order, transportPricesWithVatByTransportId, transportVatPercentsByTransportId) }}
{{ orderItemMacro.orderPayment(form.orderPayment, order, paymentPricesWithVatByPaymentId, paymentVatPercentsByPaymentId) }}
</tbody>
<tfoot>
<tr>
<td colspan="9">
<a id="js-order-item-add" href="#" class="btn btn--plus">
<i class="btn__icon">+</i>
{{ 'Add item'|trans }}
</a>
<a id="js-order-item-add-product" href="#" class="btn btn--plus" data-product-picker-url="{{ url('admin_productpicker_picksingle', {allowMainVariants: false}) }}">
<i class="btn__icon">+</i>
{{ 'Add product'|trans }}
</a>
</td>
</tr>
<tr>
<th colspan="6">
<i class="svg svg-info"></i>
{{ 'Added product will not have any individual discounts'|trans }}
</td>
</tr>
<tr>
<th colspan="6">{{ 'Total'|trans }}:</th>
<th class="text-right">{{ order.totalPriceWithVat|priceWithCurrency(order.currency) }}</th>
<th class="text-right">{{ order.totalPriceWithoutVat|priceWithCurrency(order.currency) }}</th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
</fieldset>
{% endblock order_items_widget %}
Loading