Make it possible to provide the purchase price also as a total price (closes #390)

This commit is contained in:
Bernd Bestel
2019-09-27 13:50:16 +02:00
parent 9527305311
commit 765f908966
4 changed files with 31 additions and 2 deletions

View File

@@ -14,6 +14,16 @@
if (!jsonForm.price.toString().isEmpty())
{
price = parseFloat(jsonForm.price).toFixed(2);
if ($("input[name='price-type']:checked").val() == "total-price")
{
price = price / amount;
}
}
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
{
price = 0;
}
var jsonData = {};