diff options
author | Sebastian Reichel <sre@ring0.de> | 2018-08-31 00:31:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-31 00:31:08 +0200 |
commit | 684e9dd1ef04301287e99590254e71907e67f785 (patch) | |
tree | c008d2878905e03df7a8bf8bd3330762cc2d8f43 /src/pdf-stock/pdf-stock.vala | |
parent | 3fc3ea6c6df237dbdf48d14703118b747bf5d647 (diff) | |
parent | 8f2ba2050ee78d0e4a47f1277c6bc4422d06170c (diff) | |
download | serial-barcode-scanner-684e9dd1ef04301287e99590254e71907e67f785.tar.bz2 |
Merge pull request #43 from smilix/better_inventory
Better inventory
Diffstat (limited to 'src/pdf-stock/pdf-stock.vala')
-rw-r--r-- | src/pdf-stock/pdf-stock.vala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pdf-stock/pdf-stock.vala b/src/pdf-stock/pdf-stock.vala index 2edba88..6270c43 100644 --- a/src/pdf-stock/pdf-stock.vala +++ b/src/pdf-stock/pdf-stock.vala @@ -154,7 +154,7 @@ public class StockPDF { return Cairo.Status.SUCCESS; } - public uint8[] generate() throws DBusError, IOError { + public uint8[] generate(bool allProducts) throws DBusError, IOError { data = null; var surface = new Cairo.PdfSurface.for_stream(pdf_write, a4w, a4h); @@ -187,6 +187,9 @@ public class StockPDF { render_table_header(); foreach(var p in stock) { + if (!allProducts && p.amount <= 0) { + continue; + } render_table_row(p); y += eanh + 6; |