Fixes and changelog for #767

This commit is contained in:
Bernd Bestel 2020-04-22 18:00:25 +02:00
parent 1ea26cadcc
commit fbb8999513
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 13 additions and 6 deletions

View File

@ -1,8 +1,14 @@
### Stock fixes
### Stock improvements/fixes
- Optimized/clarified what the total/unit price is on the purchase page (thanks @kriddles)
- On the purchase page the amount field is now displayed above/before the best before date for better `TAB` handling (thanks @kriddles)
- Changed that when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is disabled, products now get internally a best before of "never expires" (aka `2999-12-31`) instead of today (thanks @kriddles)
- Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB`
### Calendar fixes
- Fixed a PHP warning when using the "Share/Integrate calendar (iCal)" button (thanks @tsia)
### API fixes
- Fixed (again) that CORS was broken
### General & other improvements
- UI refresh / style improvements (thanks @zsarnett)

View File

@ -1795,3 +1795,6 @@ msgstr ""
msgid "By default the amount to be added to the shopping list is `needed amount - stock amount - shopping list amount` - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list"
msgstr ""
msgid "means %1$s per %2$s"
msgstr ""

View File

@ -360,18 +360,16 @@ function refreshPriceHint()
if ($("input[name='price-type']:checked").val() == "total-price")
{
var priceTypeUnitPrice = $("#price-type-unit-price");
var priceTypeUnitPriceLabel = $("[for=" + priceTypeUnitPrice.attr("id") + "]");
var price = $('#price').val() / $('#amount').val();
var price = parseFloat($('#price').val()) / parseFloat($('#amount').val());
$('#price-hint').text('(will result with ' + priceTypeUnitPriceLabel.text() + ' cost of ' + price.toFixed(2) + ')');
$('#price-hint').text(__t('means %1$s per %2$s', price.toLocaleString({ minimumFractionDigits: 2, maximumFractionDigits: 2 }), document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name")));
}
else
{
if (document.getElementById("amount_qu_unit").getAttribute("qu-factor-purchase-to-stock") > 1)
{
var price = $('#price').val() / document.getElementById("amount_qu_unit").getAttribute("qu-factor-purchase-to-stock");
$('#price-hint').text('(will result with ' + document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name") + ' cost of ' + price.toFixed(2) + ')');
$('#price-hint').text(__t('means %1$s per %2$s', price.toLocaleString({ minimumFractionDigits: 2, maximumFractionDigits: 2 }), document.getElementById("amount_qu_unit").getAttribute("quantity-unit-stock-name")));
}
else
{