本文整理汇总了PHP中FrontReport::AddImage方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontReport::AddImage方法的具体用法?PHP FrontReport::AddImage怎么用?PHP FrontReport::AddImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontReport
的用法示例。
在下文中一共展示了FrontReport::AddImage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_profit_and_loss_statement
//.........这里部分代码省略.........
}
if ($account['AccountClassName'] != $classname) {
$rep->Font('bold');
$rep->TextCol(0, 5, $account['AccountClassName']);
$rep->Font();
$rep->row -= $rep->lineHeight + 4;
}
$group = $account['AccountTypeName'];
$rep->TextCol(0, 5, $account['AccountTypeName']);
$rep->Line($rep->row - 4);
$rep->row -= $rep->lineHeight + 4;
}
$classname = $account['AccountClassName'];
$per_balance *= -1;
$acc_balance *= -1;
$totalper += $per_balance;
$totalacc += $acc_balance;
$classper += $per_balance;
$classacc += $acc_balance;
$rep->TextCol(0, 1, $account['account_code']);
$rep->TextCol(1, 2, $account['account_name']);
$rep->TextCol(2, 3, number_format2($per_balance, $dec));
$rep->TextCol(3, 4, number_format2($acc_balance, $dec));
$rep->TextCol(4, 5, number_format2(Achieve($per_balance, $acc_balance), $pdec));
$rep->NewLine();
if ($rep->row < $rep->bottomMargin + 3 * $rep->lineHeight) {
$rep->Line($rep->row - 2);
$rep->Header();
}
}
if ($account['AccountClassName'] != $classname) {
if ($classname != '') {
$closeclass = true;
}
}
if ($account['AccountTypeName'] != $group) {
if ($group != '') {
$rep->Line($rep->row + 6);
$rep->row -= 6;
$rep->TextCol(0, 2, tr('Total') . " " . $group);
$rep->TextCol(2, 3, number_format2($totalper, $dec));
$rep->TextCol(3, 4, number_format2($totalacc, $dec));
$rep->TextCol(4, 5, number_format2(Achieve($totalper, $totalacc), $pdec));
if ($graphics) {
$pg->x[] = $group;
$pg->y[] = abs($totalper);
$pg->z[] = abs($totalacc);
}
$rep->row -= $rep->lineHeight + 4;
if ($closeclass) {
$rep->Line($rep->row + 6);
$calculateper = $salesper + $classper;
$calculateacc = $salesacc + $classacc;
$rep->row -= 6;
$rep->Font('bold');
$rep->TextCol(0, 2, tr('Total') . " " . $classname);
$rep->TextCol(2, 3, number_format2($classper, $dec));
$rep->TextCol(3, 4, number_format2($classacc, $dec));
$rep->TextCol(4, 5, number_format2(Achieve($classper, $classacc), $pdec));
$rep->row -= $rep->lineHeight + 8;
$rep->TextCol(0, 2, tr('Calculated Return'));
$rep->TextCol(2, 3, number_format2($calculateper, $dec));
$rep->TextCol(3, 4, number_format2($calculateacc, $dec));
$rep->TextCol(4, 5, number_format2(Achieve($calculateper, $calculateacc), $pdec));
if ($graphics) {
$pg->x[] = tr('Calculated Return');
$pg->y[] = abs($calculateper);
$pg->z[] = abs($calculateacc);
}
$rep->Font();
$rep->NewLine();
}
}
}
$rep->Line($rep->row);
if ($graphics) {
global $decseps, $graph_skin;
$pg->title = $rep->title;
$pg->axis_x = tr("Group");
$pg->axis_y = tr("Amount");
$pg->graphic_1 = $headers[2];
$pg->graphic_2 = $headers[3];
$pg->type = $graphics;
$pg->skin = $graph_skin;
$pg->built_in = false;
$pg->fontfile = $path_to_root . "reporting/fonts/Vera.ttf";
$pg->latin_notation = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".";
$filename = $comp_path . '/' . user_company() . "/pdf_files/test.png";
$pg->display($filename, true);
$w = $pg->width / 1.5;
$h = $pg->height / 1.5;
$x = ($rep->pageWidth - $w) / 2;
$rep->NewLine(2);
if ($rep->row - $h < $rep->bottomMargin) {
$rep->Header();
}
$rep->AddImage($filename, $x, $rep->row - $h, $w, $h);
}
$rep->End();
}
示例2: print_stock_check
//.........这里部分代码省略.........
$loc = get_location_name($location);
}
if ($shortage) {
$short = _('Yes');
$available = _('Shortage');
} else {
$short = _('No');
$available = _('Available');
}
if ($no_zeros) {
$nozeros = _('Yes');
} else {
$nozeros = _('No');
}
if ($check) {
$cols = array(0, 75, 225, 250, 295, 345, 390, 445, 515);
$headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Check'), _('Demand'), $available, _('On Order'));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
} else {
$cols = array(0, 75, 225, 250, 315, 380, 445, 515);
$headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Demand'), $available, _('On Order'));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right');
}
$params = array(0 => $comments, 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''), 3 => array('text' => _('Only Shortage'), 'from' => $short, 'to' => ''), 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
if ($pictures) {
$user_comp = user_company();
} else {
$user_comp = "";
}
$rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($category, $location, $like);
$catt = '';
while ($trans = db_fetch($res)) {
if ($location == 'all') {
$loc_code = "";
} else {
$loc_code = $location;
}
$demandqty = get_demand_qty($trans['stock_id'], $loc_code);
$demandqty += get_demand_asm_qty($trans['stock_id'], $loc_code);
$onorder = get_on_porder_qty($trans['stock_id'], $loc_code);
$flag = get_mb_flag($trans['stock_id']);
if ($flag == 'M') {
$onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
}
if ($no_zeros && $trans['QtyOnHand'] == 0 && $demandqty == 0 && $onorder == 0) {
continue;
}
if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0) {
continue;
}
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 2, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
$rep->NewLine();
$dec = get_qty_dec($trans['stock_id']);
$rep->TextCol(0, 1, $trans['stock_id']);
$rep->TextCol(1, 2, $trans['description'] . ($trans['inactive'] == 1 ? " (" . _("Inactive") . ")" : ""), -1);
$rep->TextCol(2, 3, $trans['units']);
$rep->AmountCol(3, 4, $trans['QtyOnHand'], $dec);
if ($check) {
$rep->TextCol(4, 5, "_________");
$rep->AmountCol(5, 6, $demandqty, $dec);
$rep->AmountCol(6, 7, $trans['QtyOnHand'] - $demandqty, $dec);
$rep->AmountCol(7, 8, $onorder, $dec);
} else {
$rep->AmountCol(4, 5, $demandqty, $dec);
$rep->AmountCol(5, 6, $trans['QtyOnHand'] - $demandqty, $dec);
$rep->AmountCol(6, 7, $onorder, $dec);
}
if ($pictures) {
$image = company_path() . '/images/' . item_img_name($trans['stock_id']) . '.jpg';
if (file_exists($image)) {
$rep->NewLine();
if ($rep->row - $pic_height < $rep->bottomMargin) {
$rep->NewPage();
}
$rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, 0, $pic_height);
$rep->row -= $pic_height;
$rep->NewLine();
}
}
}
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
示例3: print_price_listing
function print_price_listing()
{
global $path_to_root, $pic_height, $pic_width;
$currency = $_POST['PARAM_0'];
$category = $_POST['PARAM_1'];
$salestype = $_POST['PARAM_2'];
$pictures = $_POST['PARAM_3'];
$showGP = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$destination = $_POST['PARAM_7'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$home_curr = get_company_pref('curr_default');
if ($currency == ALL_TEXT) {
$currency = $home_curr;
}
$curr = get_currency($currency);
$curr_sel = $currency . " - " . $curr['currency'];
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($salestype == ALL_NUMERIC) {
$salestype = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($salestype == 0) {
$stype = _('All');
} else {
$stype = get_sales_type_name($salestype);
}
if ($showGP == 0) {
$GP = _('No');
} else {
$GP = _('Yes');
}
$cols = array(0, 100, 360, 385, 450, 515);
$headers = array(_('Category/Items'), _('Description'), _('UOM'), _('Price'), _('GP %'));
$aligns = array('left', 'left', 'left', 'right', 'right');
$params = array(0 => $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", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$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']);
$rep->TextCol(2, 3, $myrow['units']);
$price = get_price($myrow['stock_id'], $currency, $salestype);
$rep->AmountCol(3, 4, $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(4, 5, number_format2($disp, user_percent_dec()) . " %");
}
if ($pictures) {
$image = company_path() . "/images/" . item_img_name($myrow['stock_id']) . ".jpg";
if (file_exists($image)) {
$rep->NewLine();
if ($rep->row - $pic_height < $rep->bottomMargin) {
$rep->NewPage();
}
$rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, 0, $pic_height);
$rep->row -= $pic_height;
$rep->NewLine();
}
//.........这里部分代码省略.........
示例4: print_aged_supplier_analysis
//.........这里部分代码省略.........
$sql .= " ORDER BY supp_name";
$result = db_query($sql, "The suppliers could not be retrieved");
while ($myrow = db_fetch($result)) {
if (!$convert && $currency != $myrow['curr_code']) {
continue;
}
if ($convert) {
$rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
} else {
$rate = 1.0;
}
$supprec = get_supplier_details($myrow['supplier_id'], $to, $show_all);
if (!$supprec) {
continue;
}
$supprec['Balance'] *= $rate;
$supprec['Due'] *= $rate;
$supprec['Overdue1'] *= $rate;
$supprec['Overdue2'] *= $rate;
$str = array($supprec["Balance"] - $supprec["Due"], $supprec["Due"] - $supprec["Overdue1"], $supprec["Overdue1"] - $supprec["Overdue2"], $supprec["Overdue2"], $supprec["Balance"]);
if ($no_zeros && floatcmp(array_sum($str), 0) == 0) {
continue;
}
$rep->fontSize += 2;
$rep->TextCol(0, 2, $myrow['name']);
if ($convert) {
$rep->TextCol(2, 3, $myrow['curr_code']);
}
$rep->fontSize -= 2;
$total[0] += $supprec["Balance"] - $supprec["Due"];
$total[1] += $supprec["Due"] - $supprec["Overdue1"];
$total[2] += $supprec["Overdue1"] - $supprec["Overdue2"];
$total[3] += $supprec["Overdue2"];
$total[4] += $supprec["Balance"];
for ($i = 0; $i < count($str); $i++) {
$rep->AmountCol($i + 3, $i + 4, $str[$i], $dec);
}
$rep->NewLine(1, 2);
if (!$summaryOnly) {
$res = get_invoices($myrow['supplier_id'], $to, $show_all);
if (db_num_rows($res) == 0) {
continue;
}
$rep->Line($rep->row + 4);
while ($trans = db_fetch($res)) {
$rep->NewLine(1, 2);
$rep->TextCol(0, 1, $systypes_array[$trans['type']], -2);
$rep->TextCol(1, 2, $trans['reference'], -2);
$rep->TextCol(2, 3, sql2date($trans['tran_date']), -2);
foreach ($trans as $i => $value) {
$trans[$i] *= $rate;
}
$str = array($trans["Balance"] - $trans["Due"], $trans["Due"] - $trans["Overdue1"], $trans["Overdue1"] - $trans["Overdue2"], $trans["Overdue2"], $trans["Balance"]);
for ($i = 0; $i < count($str); $i++) {
$rep->AmountCol($i + 3, $i + 4, $str[$i], $dec);
}
}
$rep->Line($rep->row - 8);
$rep->NewLine(2);
}
}
if ($summaryOnly) {
$rep->Line($rep->row + 4);
$rep->NewLine();
}
$rep->fontSize += 2;
$rep->TextCol(0, 3, _('Grand Total'));
$rep->fontSize -= 2;
for ($i = 0; $i < count($total); $i++) {
$rep->AmountCol($i + 3, $i + 4, $total[$i], $dec);
if ($graphics && $i < count($total) - 1) {
$pg->y[$i] = abs($total[$i]);
}
}
$rep->Line($rep->row - 8);
$rep->NewLine();
if ($graphics) {
global $decseps, $graph_skin;
$pg->x = array(_('Current'), $nowdue, $pastdue1, $pastdue2);
$pg->title = $rep->title;
$pg->axis_x = _("Days");
$pg->axis_y = _("Amount");
$pg->graphic_1 = $to;
$pg->type = $graphics;
$pg->skin = $graph_skin;
$pg->built_in = false;
$pg->latin_notation = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".";
$filename = company_path() . "/pdf_files/" . uniqid("") . ".png";
$pg->display($filename, true);
$w = $pg->width / 1.5;
$h = $pg->height / 1.5;
$x = ($rep->pageWidth - $w) / 2;
$rep->NewLine(2);
if ($rep->row - $h < $rep->bottomMargin) {
$rep->NewPage();
}
$rep->AddImage($filename, $x, $rep->row - $h, $w, $h);
}
$rep->End();
}
示例5: print_aged_supplier_analysis
//.........这里部分代码省略.........
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
$nowdue = "1-" . $PastDueDays1 . " " . tr('Days');
$pastdue1 = $PastDueDays1 + 1 . "-" . $PastDueDays2 . " " . tr('Days');
$pastdue2 = tr('Over') . " " . $PastDueDays2 . " " . tr('Days');
$sql = "SELECT supplier_id, supp_name AS name, curr_code FROM suppliers ";
if ($fromsupp != reserved_words::get_all_numeric()) {
$sql .= "WHERE supplier_id={$fromsupp} ";
}
$sql .= "ORDER BY supp_name";
$result = db_query($sql, "The suppliers could not be retrieved");
while ($myrow = db_fetch($result)) {
if (!$convert && $currency != $myrow['curr_code']) {
continue;
}
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['name']);
if ($convert) {
$rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
$rep->TextCol(2, 4, $myrow['curr_code']);
} else {
$rate = 1.0;
}
$rep->fontSize -= 2;
$supprec = get_supplier_details($myrow['supplier_id'], $to);
foreach ($supprec as $i => $value) {
$supprec[$i] *= $rate;
}
$total[0] += $supprec["Balance"] - $supprec["Due"];
$total[1] += $supprec["Due"] - $supprec["Overdue1"];
$total[2] += $supprec["Overdue1"] - $supprec["Overdue2"];
$total[3] += $supprec["Overdue2"];
$total[4] += $supprec["Balance"];
$str = array(number_format2($supprec["Balance"] - $supprec["Due"], $dec), number_format2($supprec["Due"] - $supprec["Overdue1"], $dec), number_format2($supprec["Overdue1"] - $supprec["Overdue2"], $dec), number_format2($supprec["Overdue2"], $dec), number_format2($supprec["Balance"], $dec));
for ($i = 0; $i < count($str); $i++) {
$rep->TextCol($i + 3, $i + 4, $str[$i]);
}
$rep->NewLine(1, 2);
if (!$summaryOnly) {
$res = get_invoices($myrow['supplier_id'], $to);
if (db_num_rows($res) == 0) {
continue;
}
$rep->Line($rep->row + 4);
while ($trans = db_fetch($res)) {
$rep->NewLine(1, 2);
$rep->TextCol(0, 1, $trans['type_name'], -2);
$rep->TextCol(1, 2, $trans['reference'], -2);
$rep->TextCol(2, 3, sql2date($trans['tran_date']), -2);
foreach ($trans as $i => $value) {
$trans[$i] *= $rate;
}
$str = array(number_format2($trans["Balance"] - $trans["Due"], $dec), number_format2($trans["Due"] - $trans["Overdue1"], $dec), number_format2($trans["Overdue1"] - $trans["Overdue2"], $dec), number_format2($trans["Overdue2"], $dec), number_format2($trans["Balance"], $dec));
for ($i = 0; $i < count($str); $i++) {
$rep->TextCol($i + 3, $i + 4, $str[$i]);
}
}
$rep->Line($rep->row - 8);
$rep->NewLine(2);
}
}
if ($summaryOnly) {
$rep->Line($rep->row + 4);
$rep->NewLine();
}
$rep->fontSize += 2;
$rep->TextCol(0, 3, tr('Grand Total'));
$rep->fontSize -= 2;
for ($i = 0; $i < count($total); $i++) {
$rep->TextCol($i + 3, $i + 4, number_format2($total[$i], $dec));
if ($graphics && $i < count($total) - 1) {
$pg->y[$i] = abs($total[$i]);
}
}
$rep->Line($rep->row - 8);
if ($graphics) {
global $decseps, $graph_skin;
$pg->x = array(tr('Current'), $nowdue, $pastdue1, $pastdue2);
$pg->title = $rep->title;
$pg->axis_x = tr("Days");
$pg->axis_y = tr("Amount");
$pg->graphic_1 = $to;
$pg->type = $graphics;
$pg->skin = $graph_skin;
$pg->built_in = false;
$pg->fontfile = $path_to_root . "reporting/fonts/Vera.ttf";
$pg->latin_notation = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".";
$filename = $comp_path . '/' . user_company() . "/pdf_files/test.png";
$pg->display($filename, true);
$w = $pg->width / 1.5;
$h = $pg->height / 1.5;
$x = ($rep->pageWidth - $w) / 2;
$rep->NewLine(2);
if ($rep->row - $h < $rep->bottomMargin) {
$rep->Header();
}
$rep->AddImage($filename, $x, $rep->row - $h, $w, $h);
}
$rep->End();
}
示例6: print_price_listing
function print_price_listing()
{
global $comp_path, $path_to_root, $pic_height, $pic_width;
include_once $path_to_root . "reporting/includes/pdf_report.inc";
$category = $_REQUEST['PARAM_0'];
$salestype = $_REQUEST['PARAM_1'];
$pictures = $_REQUEST['PARAM_2'];
$showGP = $_REQUEST['PARAM_3'];
$comments = $_REQUEST['PARAM_4'];
$dec = user_price_dec();
if ($category == reserved_words::get_all_numeric()) {
$category = 0;
}
if ($salestype == reserved_words::get_all_numeric()) {
$salestype = 0;
}
if ($category == 0) {
$cat = tr('All');
} else {
$cat = get_category_name($category);
}
if ($salestype == 0) {
$stype = tr('All');
} else {
$stype = get_sales_type_name($salestype);
}
if ($showGP == 0) {
$GP = tr('No');
} else {
$GP = tr('Yes');
}
$cols = array(0, 100, 385, 450, 515);
$headers = array(tr('Category/Items'), tr('Description'), tr('Price'), tr('GP %'));
$aligns = array('left', 'left', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => tr('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => tr('Sales Type'), 'from' => $stype, 'to' => ''), 3 => array('text' => tr('Show GP %'), 'from' => $GP, 'to' => ''));
if ($pictures) {
$user_comp = user_company();
} else {
$user_comp = "";
}
$rep = new FrontReport(tr('Price Listing'), "PriceListing.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->Header();
$result = fetch_prices($category, $salestype);
$currcode = '';
$catgor = '';
while ($myrow = db_fetch($result)) {
if ($currcode != $myrow['curr_abrev']) {
$rep->NewLine(2);
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['curr_abrev'] . " " . tr('Prices'));
$currcode = $myrow['curr_abrev'];
$rep->fontSize -= 2;
$rep->NewLine();
}
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']);
$rep->TextCol(2, 3, number_format2($myrow['price'], $dec));
if ($showGP) {
if ($myrow['price'] != 0.0) {
$disp = ($myrow['price'] - $myrow['Standardcost']) * 100 / $myrow['price'];
} 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();
}
示例7: print_sales_quotations
function print_sales_quotations()
{
global $path_to_root, $print_as_quote, $print_invoice_no, $no_zero_lines_amount, $print_item_images_on_quote, $pic_height;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$currency = $_POST['PARAM_2'];
$email = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$pictures = isset($print_item_images_on_quote) && $print_item_images_on_quote == 1;
// If you want a larger image, then increase $pic_height f.i.
// $pic_height += 25;
$cols = array(4, 60, 225, 300, 325, 385, 450, 515);
// $headers in doctext.inc
$aligns = array('left', 'left', 'right', 'left', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_("SALES QUOTATION"), "SalesQuotationBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
$myrow = get_sales_order_header($i, ST_SALESQUOTE);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$branch = get_branch($myrow["branch_code"]);
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
if ($print_invoice_no == 1) {
$rep->filename = "SalesQuotation" . $i . ".pdf";
} else {
$rep->filename = "SalesQuotation" . $myrow['reference'] . ".pdf";
}
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], true);
$rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESQUOTE, $contacts);
//$rep->headerFunc = 'Header2';
$rep->NewPage();
$result = get_sales_order_details($i, ST_SALESQUOTE);
$SubTotal = 0;
$items = $prices = array();
while ($myrow2 = db_fetch($result)) {
$Net = round2((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"], user_price_dec());
$prices[] = $Net;
$items[] = $myrow2['stk_code'];
$SubTotal += $Net;
$DisplayPrice = number_format2($myrow2["unit_price"], $dec);
$DisplayQty = number_format2($myrow2["quantity"], get_qty_dec($myrow2['stk_code']));
$DisplayNet = number_format2($Net, $dec);
if ($myrow2["discount_percent"] == 0) {
$DisplayDiscount = "";
} else {
$DisplayDiscount = number_format2($myrow2["discount_percent"] * 100, user_percent_dec()) . "%";
}
$rep->TextCol(0, 1, $myrow2['stk_code'], -2);
$oldrow = $rep->row;
$rep->TextColLines(1, 2, $myrow2['description'], -2);
$newrow = $rep->row;
$rep->row = $oldrow;
if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0) {
$rep->TextCol(2, 3, $DisplayQty, -2);
$rep->TextCol(3, 4, $myrow2['units'], -2);
$rep->TextCol(4, 5, $DisplayPrice, -2);
$rep->TextCol(5, 6, $DisplayDiscount, -2);
$rep->TextCol(6, 7, $DisplayNet, -2);
}
$rep->row = $newrow;
if ($pictures) {
$image = company_path() . "/images/" . item_img_name($myrow2['stk_code']) . ".jpg";
if (file_exists($image)) {
//$rep->NewLine();
if ($rep->row - $pic_height < $rep->bottomMargin) {
$rep->NewPage();
}
$rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, 0, $pic_height);
$rep->row -= $pic_height;
$rep->NewLine();
}
}
//$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
}
}
if ($myrow['comments'] != "") {
$rep->NewLine();
$rep->TextColLines(1, 5, $myrow['comments'], -2);
}
//.........这里部分代码省略.........
示例8: print_balance_sheet
//.........这里部分代码省略.........
$closeclass = false;
}
}
if ($account['AccountClassName'] != $classname) {
$rep->Font('bold');
$rep->TextCol(0, 5, $account['AccountClassName']);
$rep->Font();
$rep->row -= $rep->lineHeight + 4;
}
$group = $account['AccountTypeName'];
$rep->TextCol(0, 5, $account['AccountTypeName']);
$rep->Line($rep->row - 4);
$rep->row -= $rep->lineHeight + 4;
}
$classname = $account['AccountClassName'];
$totalopen += $prev_balance;
$totalperiod += $curr_balance;
$totalclose = $totalopen + $totalperiod;
$classopen += $prev_balance;
$classperiod += $curr_balance;
$classclose = $classopen + $classperiod;
$rep->TextCol(0, 1, $account['account_code']);
$rep->TextCol(1, 2, $account['account_name']);
$rep->TextCol(2, 3, number_format2($prev_balance, $dec));
$rep->TextCol(3, 4, number_format2($curr_balance, $dec));
$rep->TextCol(4, 5, number_format2($curr_balance + $prev_balance, $dec));
$rep->NewLine();
if ($rep->row < $rep->bottomMargin + 3 * $rep->lineHeight) {
$rep->Line($rep->row - 2);
$rep->Header();
}
}
if ($account['AccountClassName'] != $classname) {
if ($classname != '') {
$closeclass = true;
}
}
if ($account['AccountTypeName'] != $group) {
if ($group != '') {
$rep->Line($rep->row + 6);
$rep->row -= 6;
$rep->TextCol(0, 2, tr('Total') . " " . $group);
$rep->TextCol(2, 3, number_format2($totalopen, $dec));
$rep->TextCol(3, 4, number_format2($totalperiod, $dec));
$rep->TextCol(4, 5, number_format2($totalclose, $dec));
if ($graphics) {
$pg->x[] = $group;
$pg->y[] = abs($totalclose);
}
$rep->row -= $rep->lineHeight + 4;
if ($closeclass) {
$rep->Line($rep->row + 6);
$calculateopen = -$assetsopen - $classopen;
$calculateperiod = -$assetsperiod - $classperiod;
$calculateclose = -$assetsclose - $classclose;
$rep->row -= 6;
$rep->TextCol(0, 2, tr('Calculated Return'));
$rep->TextCol(2, 3, number_format2($calculateopen, $dec));
$rep->TextCol(3, 4, number_format2($calculateperiod, $dec));
$rep->TextCol(4, 5, number_format2($calculateclose, $dec));
if ($graphics) {
$pg->x[] = tr('Calculated Return');
$pg->y[] = abs($calculateclose);
}
$rep->row -= $rep->lineHeight + 4;
$rep->Font('bold');
$rep->TextCol(0, 2, tr('Total') . " " . $classname);
$rep->TextCol(2, 3, number_format2(-$assetsopen, $dec));
$rep->TextCol(3, 4, number_format2(-$assetsperiod, $dec));
$rep->TextCol(4, 5, number_format2(-$assetsclose, $dec));
$rep->Font();
$rep->NewLine();
}
}
}
$rep->Line($rep->row);
if ($graphics) {
global $decseps, $graph_skin;
$pg->title = $rep->title;
$pg->axis_x = tr("Group");
$pg->axis_y = tr("Amount");
$pg->graphic_1 = $to;
$pg->type = $graphics;
$pg->skin = $graph_skin;
$pg->built_in = false;
$pg->fontfile = $path_to_root . "reporting/fonts/Vera.ttf";
$pg->latin_notation = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".";
$filename = $comp_path . '/' . user_company() . "/pdf_files/test.png";
$pg->display($filename, true);
$w = $pg->width / 1.5;
$h = $pg->height / 1.5;
$x = ($rep->pageWidth - $w) / 2;
$rep->NewLine(2);
if ($rep->row - $h < $rep->bottomMargin) {
$rep->Header();
}
$rep->AddImage($filename, $x, $rep->row - $h, $w, $h);
}
$rep->End();
}
示例9: print_stock_check
function print_stock_check()
{
global $comp_path, $path_to_root, $pic_height, $pic_width;
include_once $path_to_root . "reporting/includes/pdf_report.inc";
$category = $_REQUEST['PARAM_0'];
$location = $_REQUEST['PARAM_1'];
$pictures = $_REQUEST['PARAM_2'];
$comments = $_REQUEST['PARAM_3'];
$dec = user_qty_dec();
if ($category == reserved_words::get_all_numeric()) {
$category = 0;
}
if ($category == 0) {
$cat = tr('All');
} else {
$cat = get_category_name($category);
}
if ($location == reserved_words::get_all()) {
$location = 'all';
}
if ($location == 'all') {
$loc = tr('All');
} else {
$loc = $location;
}
$cols = array(0, 100, 305, 375, 445, 515);
$headers = array(tr('Category'), tr('Description'), tr('Quantity'), tr('Demand'), tr('Difference'));
$aligns = array('left', 'left', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => tr('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => tr('Location'), 'from' => $loc, 'to' => ''));
if ($pictures) {
$user_comp = user_company();
} else {
$user_comp = "";
}
$rep = new FrontReport(tr('Stock Check Sheets'), "StockCheckSheet.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->Header();
$res = getTransactions($category, $location);
$catt = '';
while ($trans = db_fetch($res)) {
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 2, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
$demandqty = getDemandQty($trans['stock_id'], $trans['loc_code']);
$demandqty += getDemandAsmQty($trans['stock_id'], $trans['loc_code']);
$rep->NewLine();
$rep->TextCol(0, 1, $trans['stock_id']);
$rep->TextCol(1, 2, $trans['description']);
$rep->TextCol(2, 3, number_format2($trans['QtyOnHand'], $dec));
$rep->TextCol(3, 4, number_format2($demandqty, $dec));
$rep->TextCol(4, 5, number_format2($trans['QtyOnHand'] - $demandqty, $dec));
if ($pictures) {
$image = $comp_path . '/' . $user_comp . '/images/' . $trans['stock_id'] . '.jpg';
if (file_exists($image)) {
$rep->NewLine();
if ($rep->row - $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();
}
}
}
$rep->Line($rep->row - 4);
$rep->End();
}