Implemented notes and Userfields for stock entries (closes #443)

This commit is contained in:
Bernd Bestel
2022-03-30 17:32:53 +02:00
parent 2983687f34
commit d3a39270de
18 changed files with 438 additions and 107 deletions

View File

@@ -286,10 +286,16 @@ function OnLocationChange(locationId, stockId)
{
if ($("#specific_stock_entry option[value='" + stockEntry.stock_id + "']").length == 0)
{
var noteTxt = "";
if (stockEntry.note != null && !stockEntry.note.isEmpty())
{
noteTxt = " " + stockEntry.note;
}
$("#specific_stock_entry").append($("<option>", {
value: stockEntry.stock_id,
amount: stockEntry.amount,
text: __t("Amount: %1$s; Due on %2$s; Bought on %3$s", stockEntry.amount, moment(stockEntry.best_before_date).format("YYYY-MM-DD"), moment(stockEntry.purchased_date).format("YYYY-MM-DD")) + "; " + openTxt
text: __t("Amount: %1$s; Due on %2$s; Bought on %3$s", stockEntry.amount, moment(stockEntry.best_before_date).format("YYYY-MM-DD"), moment(stockEntry.purchased_date).format("YYYY-MM-DD")) + "; " + openTxt + noteTxt
}));
}