$comments, 1 => array('text' => _('Currency'), 'from' => $curr_sel, 'to' => ''), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => _('Sales Type'), 'from' => $stype, 'to' => ''), 4 => array( 'text' => _('Show GP %'),'from' => $GP,'to' => '')); if ($pictures) $user_comp = user_company(); else $user_comp = ""; $rep = new FrontReport(_('Price Listing'), "PriceListing.pdf", user_pagesize()); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->Header(); $result = fetch_items($category); $catgor = ''; $_POST['sales_type_id'] = $salestype; while ($myrow=db_fetch($result)) { if ($catgor != $myrow['description']) { $rep->Line($rep->row - $rep->lineHeight); $rep->NewLine(2); $rep->fontSize += 2; $rep->TextCol(0, 3, $myrow['category_id'] . " - " . $myrow['description']); $catgor = $myrow['description']; $rep->fontSize -= 2; $rep->NewLine(); } $rep->NewLine(); $rep->TextCol(0, 1, $myrow['stock_id']); $rep->TextCol(1, 2, $myrow['name']); $price = get_price($myrow['stock_id'], $currency, $salestype); $rep->TextCol(2, 3, number_format2($price, $dec)); if ($showGP) { $price2 = get_price($myrow['stock_id'], $home_curr, $salestype); if ($price2 != 0.0) $disp = ($price2 - $myrow['Standardcost']) * 100 / $price2; else $disp = 0.0; $rep->TextCol(3, 4, number_format2($disp, user_percent_dec()) . " %"); } if ($pictures) { $image = $comp_path . '/'. $user_comp . "/images/" . $myrow['stock_id'] . ".jpg"; if (file_exists($image)) { $rep->NewLine(); if ($rep->row - $pic_height < $rep->bottomMargin) $rep->Header(); $rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, $pic_width, $pic_height); $rep->row -= $pic_height; $rep->NewLine(); } } else $rep->NewLine(0, 1); } $rep->Line($rep->row - 4); $rep->End(); } ?>