Skip to content

Commit

Permalink
bug #234 [UI/UX] Refund float price (TheGrimmChester)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

Use number type field instead of the text type. 
The web browser will send the value formatted correctly if we use 8.5 or 8,5. 
Right now on master if we put 8,5, only 8.0 is refunded but with this fix, the decimals seperated by comma are taken into account.

Commits
-------

e7861a0 Fix issue #225
  • Loading branch information
GSadee authored Dec 22, 2020
2 parents d72aa8a + e7861a0 commit f053acc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Resources/views/_shipping.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="ui labeled input">
<div class="ui label">{{ order.currencyCode|sylius_currency_symbol }}</div>
{% set inputName = "sylius_refund_shipments["~shipment.id~"][amount]" %}
<input data-refund-input type="text" name="{{ inputName }}" {% if not can_unit_be_refunded(shipment.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT')) %} disabled{% endif %}/>
<input data-refund-input type="number" step="0.01" name="{{ inputName }}" {% if not can_unit_be_refunded(shipment.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT')) %} disabled{% endif %}/>
</div>
</td>
<td class="aligned collapsing">
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/_unitInput.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

<div class="ui labeled input">
<div class="ui label">{{ order.currencyCode|sylius_currency_symbol }}</div>
<input data-refund-input type="text" name="{{ inputName }}" {% if not can_unit_be_refunded(unit.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::ORDER_ITEM_UNIT')) %} disabled{% endif %}/>
<input data-refund-input type="number" step="0.01" name="{{ inputName }}" {% if not can_unit_be_refunded(unit.id, constant('Sylius\\RefundPlugin\\Model\\RefundType::ORDER_ITEM_UNIT')) %} disabled{% endif %}/>
</div>

0 comments on commit f053acc

Please sign in to comment.