Browse Source

Have production trend dashboard only consider approved batches

Neal Wilson 7 years ago
parent
commit
56f8764561
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      config/Windows/navigation.xml

+ 2
- 2
config/Windows/navigation.xml View File

799
         }
799
         }
800
         var outputChangeRow = function(output, query, p1, p2) {
800
         var outputChangeRow = function(output, query, p1, p2) {
801
             var u = unitData();
801
             var u = unitData();
802
-            query.prepare("SELECT sum(roasted_quantity)/:conversion FROM roasting_log WHERE time > 'now'::date - '" + p1 + " days'::interval");
802
+            query.prepare("SELECT sum(roasted_quantity)/:conversion FROM roasting_log WHERE approval = true AND time > 'now'::date - '" + p1 + " days'::interval");
803
             query.bind(":conversion", u.conversion);
803
             query.bind(":conversion", u.conversion);
804
             query.exec();
804
             query.exec();
805
             query.next();
805
             query.next();
806
             var current = Number(query.value(0));
806
             var current = Number(query.value(0));
807
             output.writeTextElement("td", "" + current.toFixed(0) + u.unittext);
807
             output.writeTextElement("td", "" + current.toFixed(0) + u.unittext);
808
-            query.prepare("SELECT sum(roasted_quantity)/:conversion FROM roasting_log WHERE time > 'now'::date - '" + p2 + " days'::interval AND time < 'now'::date - '" + p1 + " days'::interval");
808
+            query.prepare("SELECT sum(roasted_quantity)/:conversion FROM roasting_log WHERE approval = true AND time > 'now'::date - '" + p2 + " days'::interval AND time < 'now'::date - '" + p1 + " days'::interval");
809
             query.bind(":conversion", u.conversion);
809
             query.bind(":conversion", u.conversion);
810
             query.exec();
810
             query.exec();
811
             query.next();
811
             query.next();

Loading…
Cancel
Save