When adding fermentables or hops to a product, show the current inventory in the dropdownlist.

Sun, 08 Dec 2019 11:27:19 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 08 Dec 2019 11:27:19 +0100
changeset 564
d5fad7d80899
parent 563
acdd54144838
child 565
dfc850e6ee1f

When adding fermentables or hops to a product, show the current inventory in the dropdownlist.

www/js/prod_edit.js file | annotate | diff | comparison | revisions
--- a/www/js/prod_edit.js	Thu Dec 05 22:47:40 2019 +0100
+++ b/www/js/prod_edit.js	Sun Dec 08 11:27:19 2019 +0100
@@ -635,7 +635,7 @@
      dropDownHeight: 500,
      renderer: function(index, label, value) {
       var datarecord = fermentablelist.records[index];
-      return datarecord.supplier + ' / ' + datarecord.name + ' (' + datarecord.color + ' EBC)';
+      return datarecord.supplier + ' / ' + datarecord.name + ' (' + datarecord.color + ' EBC) (' + Round(datarecord.inventory, 3) + ' kg)';
      }
     });
     $('#faddrowbutton').on('select', function(event) {
@@ -870,7 +870,8 @@
      dropDownHeight: 500,
      renderer: function(index, label, value) {
       var datarecord = hoplist.records[index];
-      return datarecord.origin + ' - ' + datarecord.name + ' / ' + HopFormData[datarecord.form].nl + ' (' + datarecord.alpha + '% &alpha;)';
+      return datarecord.origin + ' - ' + datarecord.name + ' / ' + HopFormData[datarecord.form].nl + ' (' + datarecord.alpha + '% &alpha;) (' +
+       Round(datarecord.inventory * 1000.0, 1) + ' gr)';
      }
     });
     $('#haddrowbutton').on('select', function(event) {

mercurial