Browse Source

Color green coffee rows red if remaining quantity is negative

Neal Wilson 5 years ago
parent
commit
a8b9c38784
Signed by: neal <neal@typica.us> GPG Key ID: D6F25C90DD5819DF
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      config/Windows/newbatch.xml

+ 8
- 0
config/Windows/newbatch.xml View File

343
                                 }
343
                                 }
344
                                 displayValue -= change;
344
                                 displayValue -= change;
345
                             }
345
                             }
346
+							var rowColor = QBrush("black");
347
+							if(displayValue < 0)
348
+							{
349
+								rowColor = QBrush("red");
350
+							}
346
                             var bagCount = (displayValue / bagConversion).toFixed(2);
351
                             var bagCount = (displayValue / bagConversion).toFixed(2);
347
                             switch(unitBox.currentIndex)
352
                             switch(unitBox.currentIndex)
348
                             {
353
                             {
362
                                 table.setData(r, 2, displayValue, 0);
367
                                 table.setData(r, 2, displayValue, 0);
363
                                 table.setData(r, 2, displayValue, 2);
368
                                 table.setData(r, 2, displayValue, 2);
364
                                 table.resizeColumnToContents(2);
369
                                 table.resizeColumnToContents(2);
370
+								table.setData(r, 0, rowColor, 9);
371
+								table.setData(r, 1, rowColor, 9);
372
+								table.setData(r, 2, rowColor, 9);
365
                             }
373
                             }
366
                         }
374
                         }
367
                     }
375
                     }

Loading…
Cancel
Save