diff options
author | Johannes Rudolph <johannes.rudolph@gmx.com> | 2018-01-05 16:56:42 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2018-06-28 01:52:53 +0200 |
commit | b46dffb399fa7752c82b8186df3e6d5f22a5315e (patch) | |
tree | 7deb06f7eaf73d9766641737296b3a0e81b34b29 /src/pdf-stock | |
parent | b665d1cbb089615672fc661d539afcf1eb594f55 (diff) | |
download | serial-barcode-scanner-b46dffb399fa7752c82b8186df3e6d5f22a5315e.tar.bz2 |
database: add method to retrieve product details with prices
Diffstat (limited to 'src/pdf-stock')
-rw-r--r-- | src/pdf-stock/pdf-stock.vala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pdf-stock/pdf-stock.vala b/src/pdf-stock/pdf-stock.vala index e971f78..1d16e4a 100644 --- a/src/pdf-stock/pdf-stock.vala +++ b/src/pdf-stock/pdf-stock.vala @@ -40,7 +40,7 @@ public class StockPDF { EAN ean; Cairo.Context ctx; Pango.Layout layout; - StockEntry[] stock; + DetailedProduct[] stock; /* pdf data */ private uint8[] data; @@ -99,7 +99,7 @@ public class StockPDF { ctx.restore(); } - private void render_table_row(StockEntry product) throws BarcodeError { + private void render_table_row(DetailedProduct product) throws BarcodeError { ctx.set_line_width(0.8); /* borders */ @@ -117,7 +117,7 @@ public class StockPDF { /* EAN */ ctx.move_to(col1 + padding, y + padding); - ean.draw(product.id); + ean.draw(@"$(product.ean)"); /* Product Name */ ctx.move_to(col2 + padding, y); @@ -125,7 +125,7 @@ public class StockPDF { layout.set_wrap(Pango.WrapMode.WORD_CHAR); layout.set_spacing((int) (-padding * Pango.SCALE)); layout.set_width((int) (col3-col2) * Pango.SCALE); - var text = @"$(product.id)\n$(product.name)"; + var text = @"$(product.ean)\n$(product.name)"; layout.set_text(text, text.length); Pango.cairo_update_layout(ctx, layout); Pango.cairo_show_layout(ctx, layout); |