- $rep->NewLine();
- if ($rep->row - $SysPrefs->pic_height < $rep->bottomMargin)
- $rep->NewPage();
- $rep->AddImage($image, $rep->cols[1], $rep->row - $SysPrefs->pic_height, 0, $SysPrefs->pic_height);
- $rep->row -= $SysPrefs->pic_height;
- $rep->NewLine();
- }
+ $bar_y = $rep->GetY();
+ $barcode = str_pad($trans['stock_id'], 7, '0', STR_PAD_LEFT);
+ $barcode = substr($barcode, 0, 8); // EAN 8 Check digit is auto computed and barcode printed
+ $rep->write1DBarcode($barcode, 'EAN8', $rep->cols[$firstcol++], $bar_y + 22, 22, $SysPrefs->pic_height, 1.2, $style, 'N');
+ }
+ if ($pictures)
+ {
+ $image = company_path() . '/images/' . item_img_name($trans['stock_id']) . '.jpg';
+ if (file_exists($image))
+ {
+ $rep->AddImage($image, $rep->cols[$firstcol], $rep->row - $SysPrefs->pic_height, 0, $SysPrefs->pic_height);
+ }
+ }
+ $rep->row -= $SysPrefs->pic_height;
+ $rep->NewLine();