From bb55e121576a5b5d225bfc68c5062f386cc32db9 Mon Sep 17 00:00:00 2001 From: Holger Cremer Date: Thu, 26 Jul 2018 20:09:26 +0200 Subject: adds an inventory function --- src/pdf-stock/pdf-stock.vala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pdf-stock/pdf-stock.vala') diff --git a/src/pdf-stock/pdf-stock.vala b/src/pdf-stock/pdf-stock.vala index e971f78..ac51c23 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() { + public uint8[] generate(bool allProducts) { 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; -- cgit v1.2.3