本文整理汇总了PHP中FrontReport::SetHeaderType方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontReport::SetHeaderType方法的具体用法?PHP FrontReport::SetHeaderType怎么用?PHP FrontReport::SetHeaderType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontReport
的用法示例。
在下文中一共展示了FrontReport::SetHeaderType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_royalty_sales
function print_royalty_sales()
{
$item_id = $_POST['PARAM_0'];
global $path_to_root, $systypes_array;
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$result = fetchRoyalty($item_id);
$name = "";
while ($book = db_fetch($result)) {
$name = $book[1];
}
$params = array(0 => $comments, 1 => array('text' => _('Item'), 'from' => $name));
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(0, 150, 250, 350, 450);
$headers = array(_('Name'), _('ID #'), _('Date'), _('Quantity'), _('Status'));
$aligns = array('left', 'left', 'left', 'left', 'left');
$usr = get_user($user);
$user_id = $usr['user_id'];
$rep = new FrontReport(_('Royalty Sales'), "RoyaltySales", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('Header');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$rep->TextCol(0, 1, $item_id);
$rep->TextCol(2, 4, fetchTitle($item_id));
$rep->NewLine();
$rep->NewLine();
$result = fetchRoyalty($item_id);
while ($myrow = db_fetch($result)) {
$rep->TextCol(0, 1, $myrow[0]);
$rep->TextCol(1, 2, ' ' . $myrow[1]);
$rep->TextCol(2, 3, $myrow[2]);
$rep->TextCol(3, 4, $myrow[3]);
$rep->TextCol(4, 5, 'Closed');
$rep->NewLine();
}
$result1 = fetchCreditMemo($item_id);
while ($myrow1 = db_fetch($result1)) {
if ($myrow1[3] > 0) {
$rep->TextCol(0, 1, $myrow1[0]);
$rep->TextCol(1, 2, ' ' . $myrow1[1]);
$rep->TextCol(2, 3, $myrow1[2]);
$rep->TextCol(3, 4, '- ' . $myrow1[3]);
$rep->TextCol(4, 5, 'Closed');
$rep->NewLine();
}
}
$rep->Line($rep->row + 4);
$rep->End();
}
示例2: print_statements
function print_statements()
{
global $path_to_root, $systypes_array;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$from = date2sql($_POST['PARAM_0']);
$to = date2sql($_POST['PARAM_1']);
$customer = $_POST['PARAM_2'];
$currency = $_POST['PARAM_3'];
$email = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(4, 64, 180, 250, 320, 385, 450, 515);
//$headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_pref('curr_default');
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
if ($email == 0) {
$rep = new FrontReport(_('CUSTOMER ACCOUNT STATEMENT'), "StatementBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
$sql = "SELECT b.debtor_no, b.name AS DebtorName, b.address, b.tax_id, b.curr_code, curdate() AS tran_date, CONCAT (d.name, d.name2) AS contactPerson, d.phone, d.phone2 FROM " . TB_PREF . "debtors_master b INNER JOIN\n" . TB_PREF . "crm_contacts c on b.debtor_no=c.entity_id INNER JOIN " . TB_PREF . "crm_persons d on c.person_id=d.id";
if ($customer != ALL_TEXT) {
$sql .= " WHERE b.debtor_no = " . db_escape($customer);
} else {
$sql .= " ORDER by b.name";
}
$result = db_query($sql, "The customers could not be retrieved");
while ($debtor_row = db_fetch($result)) {
$date = date('Y-m-d');
if ($from != $to) {
// find the latest point where the balance was null
$start = findLatestNullDate($debtor_row['debtor_no'], $from);
// but not earlier than the $to date.
if (date1_greater_date2(sql2date($start), sql2date($to))) {
$start = $to;
}
if (date1_greater_date2(sql2date($from), sql2date($start))) {
$start = $from;
}
} else {
$start = $from;
}
$debtor_row['order_'] = "";
$TransResult = getTransactions($debtor_row['debtor_no'], $start, $date);
$baccount = get_default_bank_account($debtor_row['curr_code']);
$params['bankaccount'] = $baccount['id'];
if (db_num_rows($TransResult) == 0) {
continue;
}
if ($email == 1) {
$rep = new FrontReport("CUSTOMER ACCOUNT STATEMENT", "", user_pagesize(), 9, $orientation);
$rep->title = _('CUSTOMER ACCOUNT STATEMENT');
$rep->filename = "Statement" . $debtor_row['debtor_no'] . ".pdf";
$rep->Info($params, $cols, null, $aligns);
}
$rep->filename = "ST-" . strtr($debtor_row['DebtorName'], " '", "__") . "--" . strtr(Today(), "/", "-") . ".pdf";
$contacts = get_customer_contacts($debtor_row['debtor_no'], 'invoice');
$rep->SetHeaderType(0);
$rep->currency = $cur;
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
//= get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no']);
$rep->SetCommonData($debtor_row, null, null, $baccount, ST_STATEMENT, $contacts);
$rep->NewPage();
$doctype = ST_STATEMENT;
/*
$rep->NewLine();
$rep->fontSize += 2;
$rep->TextCol(0, 7, _("Overdue"));
$rep->fontSize -= 2;
$rep->NewLine(2);
*/
$rep->NewLine(10);
$rep->TextCol(0, 5, $debtor_row['DebtorName']);
$rep->NewLine();
$rep->TextCol(0, 5, $debtor_row['contactPerson']);
$rep->NewLine();
$rep->TextCol(0, 5, $debtor_row['address']);
$rep->NewLine();
$rep->TextCol(0, 5, $debtor_row['phone'] . " " . $debtor_row['phone2']);
$rep->NewLine(5);
$current = false;
$balance = getInitialBalance($debtor_row['debtor_no'], $start);
if (true || Abs($balance) > 1.0E-6) {
// Display initial balance
//$rep->TextCol(1, 4, 'Balance Brought Forward');
if (Abs($balance) < 1.0E-6) {
$rep->SetTextColor(190, 190, 190);
} else {
if ($balance > 0) {
$rep->SetTextColor(190, 0, 0);
}
}
//$rep->TextCol(6, 7, number_format2(-$balance, $dec), -2);
//.........这里部分代码省略.........
示例3: print_invoices
function print_invoices()
{
global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
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'];
$pay_service = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$TotalDiscount = 0;
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$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(_('INVOICE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
if (!exists_customer_trans(ST_SALESINVOICE, $i)) {
continue;
}
$sign = 1;
$myrow = get_customer_trans($i, ST_SALESINVOICE);
$transId = get_payment_id($i);
$urrow = get_customer_trans($transId['trans_no_from'], ST_CUSTPAYMENT);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$branch = get_branch($myrow["branch_code"]);
$sales_order = get_sales_order_header($myrow["order_"], ST_SALESORDER);
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('INVOICE');
$rep->filename = "Invoice" . $myrow['reference'] . ".pdf";
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
$baccount['payment_service'] = $pay_service;
$rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_SALESINVOICE, $contacts);
$rep->NewPage();
$result = get_customer_trans_details(ST_SALESINVOICE, $i);
// print_r($result);
$SubTotal = 0;
while ($myrow2 = db_fetch($result)) {
if ($myrow2["quantity"] == 0) {
continue;
}
$Net = round2($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), user_price_dec());
$SubTotal += $Net;
$DisplayPrice = number_format2($myrow2["unit_price"], $dec);
$DisplayQty = number_format2($sign * $myrow2["quantity"], get_qty_dec($myrow2['stock_id']));
$DisplayNet = number_format2($Net, $dec);
if ($myrow2["discount_percent"] == 0) {
$DisplayDiscount = 0;
} else {
$DisplayDiscount = number_format2($myrow2["discount_percent"] * 100, user_percent_dec()) . "%";
}
$rep->fontSize += 5;
$rep->TextCol(0, 1, $myrow2['stock_id'], -2);
$oldrow = $rep->row;
$rep->TextColLines(1, 5, $myrow2['StockDescription'], -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(5, 6, $DisplayPrice, -2);
//$rep->TextCol(5, 6, $DisplayDiscount, -2);
$rep->TextCol(6, 7, $DisplayNet, -2);
$TotalDiscount += $DisplayPrice * ($DisplayDiscount / 100);
}
$rep->row = $newrow;
//$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
}
$rep->fontSize -= 5;
}
$memo = get_comments_string(ST_SALESINVOICE, $i);
if ($memo != "") {
$rep->NewLine();
$rep->TextColLines(1, 5, $memo, -2);
}
//.........这里部分代码省略.........
示例4: print_po
function print_po()
{
global $path_to_root, $show_po_item_codes;
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();
$cols = array(4, 60, 225, 300, 340, 385, 450, 515);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'right', 'left', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_('PURCHASE ORDER'), "PurchaseOrderBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
$myrow = get_po($i);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('PURCHASE ORDER');
$rep->filename = "PurchaseOrder" . $i . ".pdf";
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$contacts = get_supplier_contacts($myrow['supplier_id'], 'order');
$rep->SetCommonData($myrow, null, $myrow, $baccount, ST_PURCHORDER, $contacts);
$rep->NewPage();
$result = get_po_details($i);
$SubTotal = 0;
$items = $prices = array();
while ($myrow2 = db_fetch($result)) {
$data = get_purchase_data($myrow['supplier_id'], $myrow2['item_code']);
if ($data !== false) {
if ($data['supplier_description'] != "") {
$myrow2['description'] = $data['supplier_description'];
}
if ($data['suppliers_uom'] != "") {
$myrow2['units'] = $data['suppliers_uom'];
}
if ($data['conversion_factor'] != 1) {
$myrow2['unit_price'] = round2($myrow2['unit_price'] * $data['conversion_factor'], user_price_dec());
$myrow2['quantity_ordered'] = round2($myrow2['quantity_ordered'] / $data['conversion_factor'], user_qty_dec());
}
}
$Net = round2($myrow2["unit_price"] * $myrow2["quantity_ordered"], user_price_dec());
$prices[] = $Net;
$items[] = $myrow2['item_code'];
$SubTotal += $Net;
$dec2 = 0;
$DisplayPrice = price_decimal_format($myrow2["unit_price"], $dec2);
$DisplayQty = number_format2($myrow2["quantity_ordered"], get_qty_dec($myrow2['item_code']));
$DisplayNet = number_format2($Net, $dec);
if ($show_po_item_codes) {
$rep->TextCol(0, 1, $myrow2['item_code'], -2);
$rep->TextCol(1, 2, $myrow2['description'], -2);
} else {
$rep->TextCol(0, 2, $myrow2['description'], -2);
}
$rep->TextCol(2, 3, sql2date($myrow2['delivery_date']), -2);
$rep->TextCol(3, 4, $DisplayQty, -2);
$rep->TextCol(4, 5, $myrow2['units'], -2);
$rep->TextCol(5, 6, $DisplayPrice, -2);
$rep->TextCol(6, 7, $DisplayNet, -2);
$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);
}
$DisplaySubTot = number_format2($SubTotal, $dec);
$rep->row = $rep->bottomMargin + 15 * $rep->lineHeight;
$doctype = ST_PURCHORDER;
$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$tax_items = get_tax_for_items($items, $prices, 0, $myrow['tax_group_id'], $myrow['tax_included'], null);
$first = true;
foreach ($tax_items as $tax_item) {
if ($tax_item['Value'] == 0) {
continue;
}
$DisplayTax = number_format2($tax_item['Value'], $dec);
//.........这里部分代码省略.........
示例5: print_subsidiary_ledger
function print_subsidiary_ledger()
{
global $path_to_root, $systypes_array;
$dim = get_company_pref('use_dimension');
$dimension = $dimension2 = 0;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$cat = $_POST['PARAM_2'];
$account = $_POST['PARAM_3'];
$account2 = $_POST['PARAM_4'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
}
$orientation = $orientation ? 'L' : 'P';
$rep = new FrontReport(_('Subsidiary Ledger Report'), "SubsidiaryLedger", user_pagesize(), 9, L);
$dec = user_price_dec();
//$headers = array(_('Type'), _('Ref'), _('#'), _('Date'), _('Dimension')." 1", _('Dimension')." 2",
// _('Person/Item'), _('Debit'), _('Credit'), _('Balance'));
//$cols = array(0, 80, 100, 150, 210, 280, 340, 400, 450, 510, 570);
$cols = array(0, 50, 140, 200, 210, 400, 450, 550, 600, 650);
//------------0--1---2-----3----4----5----6----7----8----9----10-------
//-----------------------dim1-dim2-----------------------------------
//-----------------------dim1----------------------------------------
//-------------------------------------------------------------------
$aligns = array('left', 'left', 'left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
//$headers = array(_('ID'), '', '', '', '', '', '', _('Debit'), _('Credit'), _('Balance'));
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Accounts'), 'from' => $fromacc, 'to' => $fromacc));
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('header3');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
if ($cat == 3) {
$person = get_salesman_name($account);
}
if ($cat == 1) {
$person = get_supplier_name($account);
}
/*$rep->TextCol(0,2, $cat);
$rep->NewLine();*/
$rep->Font('bold');
$rep->TextCol(0, 2, "Name:" . $person);
$rep->NewLine();
$rep->TextCol(0, 1, "ID:");
$rep->TextCol(1, 2, "Src:");
$rep->TextCol(2, 3, "Date:");
$rep->TextCol(4, 5, "Memo:");
$rep->TextCol(5, 6, "Account:");
$rep->TextCol(6, 7, "Debit:");
$rep->TextCol(8, 9, "Credit:");
$rep->Font();
$rep->NewLine(2);
$result = getTransaction($from, $to, $cat, $account, $account2);
$type = '';
while ($myrow = db_fetch($result)) {
if ($myrow['Voided'] == '' && $myrow['amount'] > 0) {
$comments = get_comments_string($myrow['type'], $myrow['type_no']);
$custom = get_custom_no($myrow['type_no'], $myrow['type']);
if ($myrow['type'] == ST_DISBURSEMENT) {
$type = "CD";
}
if ($myrow['type'] == ST_PURCHASEORDER) {
$type = "P.O.";
}
if ($myrow['type'] == ST_SUPPAYMENT) {
$type = "CD";
}
//else
// $type = $systypes_array[$myrow["type"]];
$rep->TextCol(0, 1, "#" . $custom);
$rep->TextCol(1, 2, $type);
$rep->TextCol(2, 3, $myrow['tranDate']);
$rep->TextCol(4, 5, $comments);
$rep->TextCol(5, 6, $myrow['account']);
$dr += $myrow['amount'];
$rep->AmountCol(6, 7, $myrow['amount'], 2);
$rep->NewLine();
} else {
if ($myrow['Voided'] == '' && $myrow['amount'] < 0) {
$cr += $myrow['amount'];
//$rep->AmountCol(8,9, $myrow['amount'], 2);
}
}
}
$rep->NewLine(2);
$rep->Font('bold');
$rep->AmountCol(6, 7, $dr, 2);
$rep->NewLine(2);
$rep->TextCol(1, 2, "Net Activity: ");
$rep->AmountCol(2, 4, $cr, 2);
$rep->End();
}
示例6: print_invoices
function print_invoices()
{
global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
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'];
$pay_service = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$customer = $_POST['PARAM_6'];
$orientation = $_POST['PARAM_7'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$cols = array(4, 40, 60, 100, 200, 250, 300, 320, 400, 450, 500);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
//$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
$company_data = get_company_prefs();
if ($email == 0) {
$rep = new FrontReport(_('INVOICE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
if (!exists_customer_trans(ST_SALESINVOICE, $i)) {
continue;
}
$sign = 1;
$myrow = get_customer_trans($i, ST_SALESINVOICE);
if ($customer && $myrow['debtor_no'] != $customer) {
continue;
}
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$branch = get_branch($myrow["branch_code"]);
$sales_order = get_sales_order_header($myrow["order_"], ST_SALESORDER);
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
//$rep->title = _('INVOICE');
$rep->filename = "Invoice" . $myrow['reference'] . ".pdf";
}
$rep->SetHeaderType(0);
$rep->currency = $cur;
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
//$contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
//$baccount['payment_service'] = $pay_service;
$salesman = get_imc_code($branch['branch_code']);
$pay_term = get_payment_terms($myrow['payment_terms']);
$branch_data = get_branch_accounts($myrow['branch_code']);
$dt = get_discount($branch_data['sales_discount_account'], $myrow['type'], $myrow['trans_no']);
$invoice_no = get_custom_no($myrow['trans_no'], $myrow['type']);
$contact = getContactPerson($myrow['salesman'], $myrow['debtor_no'], $branch['branch_code']);
$rep->NewPage();
$result = get_customer_trans_details(ST_SALESINVOICE, $i);
$SubTotal = 0;
$rep->NewLine(8);
$rep->TextCol(2, 7, _("CHARGE INVOICE # " . $invoice_no));
$rep->TextCol(8, 9, $myrow['TranDate']);
$rep->NewLine();
$rep->TextCol(2, 7, $branch['br_name']);
if ($dt != 0) {
//$display_bulk_discount = (($sub_total - $myrow['Total']) / $sub_total) * 100;
$tot = $myrow['Total'] + $dt;
$dscnt = ($tot - $myrow['Total']) / $tot * 100;
//$dscnt = ($dt / $myrow['Total']) * 100;
$significant = strlen(substr(strrchr($dscnt, "."), 1));
if ($significant > 2) {
$rep->TextCol(7, 9, floor($dscnt) . "%");
} else {
$rep->TextCol(7, 9, $dscnt . "%");
}
}
$rep->NewLine();
$rep->TextCol(2, 7, $branch['branch_ref']);
$rep->TextCol(8, 9, $salesman);
$rep->NewLine();
$rep->TextCol(2, 6, $contact);
if ($pay_term['terms'] == 'Cash Only') {
$rep->TextCol(8, 9, $pay_term['terms']);
} else {
$rep->TextCol(7, 10, $pay_term['terms']);
}
$rep->NewLine();
$oldrow = $rep->row;
$newrow = $rep->row;
$rep->TextColLines(2, 6, $branch['br_address'], -2);
$rep->row = $oldrow;
$rep->NewLine(5);
$rep->Font('bold');
//.........这里部分代码省略.........
示例7: print_statements
function print_statements()
{
global $path_to_root, $systypes_array;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$customer = $_POST['PARAM_0'];
$currency = $_POST['PARAM_1'];
$show_also_allocated = $_POST['PARAM_2'];
$email = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(4, 100, 130, 190, 250, 320, 385, 450, 515);
//$headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_pref('curr_default');
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
if ($email == 0) {
$rep = new FrontReport(_('STATEMENT'), "StatementBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
$sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, curr_code, curdate() AS tran_date FROM " . TB_PREF . "debtors_master";
if ($customer != ALL_TEXT) {
$sql .= " WHERE debtor_no = " . db_escape($customer);
} else {
$sql .= " ORDER by name";
}
$result = db_query($sql, "The customers could not be retrieved");
while ($myrow = db_fetch($result)) {
$date = date('Y-m-d');
$myrow['order_'] = "";
$TransResult = getTransactions($myrow['debtor_no'], $date, $show_also_allocated);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
if (db_num_rows($TransResult) == 0) {
continue;
}
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('STATEMENT');
$rep->filename = "Statement" . $myrow['debtor_no'] . ".pdf";
$rep->Info($params, $cols, null, $aligns);
}
$contacts = get_customer_contacts($myrow['debtor_no'], 'invoice');
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
//= get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no']);
$rep->SetCommonData($myrow, null, null, $baccount, ST_STATEMENT, $contacts);
$rep->NewPage();
$rep->NewLine();
$doctype = ST_STATEMENT;
$rep->fontSize += 2;
$rep->TextCol(0, 8, _("Outstanding Transactions"));
$rep->fontSize -= 2;
$rep->NewLine(2);
while ($myrow2 = db_fetch($TransResult)) {
$DisplayTotal = number_format2(Abs($myrow2["TotalAmount"]), $dec);
$DisplayAlloc = number_format2($myrow2["Allocated"], $dec);
$DisplayNet = number_format2($myrow2["TotalAmount"] - $myrow2["Allocated"], $dec);
$rep->TextCol(0, 1, $systypes_array[$myrow2['type']], -2);
$rep->TextCol(1, 2, $myrow2['reference'], -2);
$rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2);
if ($myrow2['type'] == ST_SALESINVOICE) {
$rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2);
}
if ($myrow2['type'] == ST_SALESINVOICE || $myrow2['type'] == ST_BANKPAYMENT) {
$rep->TextCol(4, 5, $DisplayTotal, -2);
} else {
$rep->TextCol(5, 6, $DisplayTotal, -2);
}
$rep->TextCol(6, 7, $DisplayAlloc, -2);
$rep->TextCol(7, 8, $DisplayNet, -2);
$rep->NewLine();
if ($rep->row < $rep->bottomMargin + 10 * $rep->lineHeight) {
$rep->NewPage();
}
}
$nowdue = "1-" . $PastDueDays1 . " " . _("Days");
$pastdue1 = $PastDueDays1 + 1 . "-" . $PastDueDays2 . " " . _("Days");
$pastdue2 = _("Over") . " " . $PastDueDays2 . " " . _("Days");
$CustomerRecord = get_customer_details($myrow['debtor_no'], null, $show_also_allocated);
$str = array(_("Current"), $nowdue, $pastdue1, $pastdue2, _("Total Balance"));
$str2 = array(number_format2($CustomerRecord["Balance"] - $CustomerRecord["Due"], $dec), number_format2($CustomerRecord["Due"] - $CustomerRecord["Overdue1"], $dec), number_format2($CustomerRecord["Overdue1"] - $CustomerRecord["Overdue2"], $dec), number_format2($CustomerRecord["Overdue2"], $dec), number_format2($CustomerRecord["Balance"], $dec));
$col = array($rep->cols[0], $rep->cols[0] + 110, $rep->cols[0] + 210, $rep->cols[0] + 310, $rep->cols[0] + 410, $rep->cols[0] + 510);
$rep->row = $rep->bottomMargin + (10 * $rep->lineHeight - 6);
for ($i = 0; $i < 5; $i++) {
$rep->TextWrap($col[$i], $rep->row, $col[$i + 1] - $col[$i], $str[$i], 'right');
}
$rep->NewLine();
for ($i = 0; $i < 5; $i++) {
$rep->TextWrap($col[$i], $rep->row, $col[$i + 1] - $col[$i], $str2[$i], 'right');
}
if ($email == 1) {
$rep->End($email, _("Statement") . " " . _("as of") . " " . sql2date($date));
//.........这里部分代码省略.........
示例8: print_royalty_sales
function print_royalty_sales()
{
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$item = $_POST['PARAM_2'];
$status = $_POST['PARAM_3'];
$destination = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
global $path_to_root, $systypes_array;
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$result = fetchRoyalty($item);
$name = "";
while ($book = db_fetch($result)) {
$name = $book[1];
}
$params = array(0 => $comments, 1 => array('text' => _('Item'), 'from' => $name));
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(0, 200, 210, 300, 310, 360, 380, 430, 440, 490, 500, 550);
$headers = array(_('Client'), '', _('IMC'), '', _('Invoice/CM #'), '', _('Date'), '', _('Quantity'), '', _('Status'));
$aligns = array('left', 'left', 'left', 'left', 'right', 'right');
$usr = get_user($user);
$user_id = $usr['user_id'];
$rep = new FrontReport(_('Royalty Sales'), "RoyaltySales", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('Header');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
if ($item == '') {
$no_title_print = false;
$enter = true;
} else {
$no_title_print = true;
$enter = false;
}
if ($no_title_print) {
$rep->Font('bold');
$rep->TextCol(0, 1, $item);
$rep->TextCol(2, 10, fetchTitle($item));
$rep->Font();
}
$total = 0;
$total_invoice_qty = 0;
$total_credit_qty = 0;
$rep->NewLine();
if ($item == "") {
$code = array();
$ItemCode = fetchItemCode();
while ($r = db_fetch($ItemCode)) {
array_push($code, $r[0]);
}
$total = 0;
$total_invoice_qty = 0;
$total_credit_qty = 0;
foreach ($code as $codes) {
$result = fetchRoyalty($codes, $status, $from, $to);
$bookname = fetchTitle($codes);
$rep->Font('bold');
$rep->TextCol(0, 5, $codes . "-" . $bookname);
$rep->Font();
$rep->NewLine();
while ($myrow = db_fetch($result)) {
if ($myrow['alloc'] == $myrow['ov_amount']) {
$stat = 'Closed';
}
if ($myrow['alloc'] < $myrow['ov_amount']) {
$stat = 'Open';
}
$scode = get_code($myrow['salesman']);
$salesman = get_salesman_name($myrow['salesman']);
$total_invoice_qty += $myrow[3];
$clientName = get_customer_name($myrow[0]);
$rep->TextCol(0, 1, $clientName);
$rep->TextCol(2, 3, $scode);
$rep->TextCol(4, 5, ' ' . $myrow['customized_no']);
$rep->TextCol(6, 7, $myrow['tranDate']);
$rep->TextCol(8, 9, $myrow['quantity']);
$rep->TextCol(10, 11, $stat);
$rep->NewLine();
}
$result1 = fetchCreditMemo($codes, $status, $from, $to);
while ($myrow1 = db_fetch($result1)) {
if ($myrow1[3] > 0) {
if ($myrow1['alloc'] == $myrow1['ov_amount']) {
$stat = 'Closed';
}
if ($myrow1['alloc'] < $myrow1['ov_amount']) {
$stat = 'Open';
}
}
$qty = -$myrow1['quantity'];
$total_credit_qty += $qty;
$scode = get_code($myrow1['salesman']);
//.........这里部分代码省略.........
示例9: print_check_voucher
function print_check_voucher()
{
global $path_to_root, $systypes_array;
$trans_no = $_POST['PARAM_0'];
$trans_num = $_POST['PARAM_1'];
$orientation = $_POST['PARAM_2'];
$destination = $_POST['PARAM_3'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
}
$orientation = $orientation ? 'L' : 'P';
$rep = new FrontReport(_('JOURNAL VOUCHER'), "JournalVoucher", user_pagesize(), 9, $orientation);
$dec = user_price_dec();
$cols = array(0, 65, 105, 125, 175, 210, 250, 300, 360, 370);
$aligns = array('left', 'left', 'left', 'center', 'right', 'right', 'right', 'right', 'right');
$rep->SetHeaderType(0);
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
$rep->NewPage();
$res = get_transaction($trans_no);
$myrow = db_fetch($res);
$credit = $debit = 0;
$res2 = get_gl_trans(0, $trans_num);
$res3 = get_gl_trans(0, $trans_num);
$fiscal = get_year();
//to be use
$year_no = substr(sql2date($fiscal['begin']), 8);
//to be use
$transtype = ST_JOURNAL;
$ser = db_fetch(get_used_series($year_no, $transtype));
$num = substr($ser['year'], 2);
$rep->Font('bold');
//$rep->TextCol(7,11, _("ST. MATTHEW'S PUBLISHING CORPORATION"));
$rep->Font();
$rep->NewLine();
// $rep->TextCol(7,11, _("Tel. Nos. 426-5611 * 433-5385 Telefax: 426-1274"));
$rep->NewLine(3);
//$rep->Font('bold');
//$rep->SetFontSize(14);
//$rep->TextCol(3,8, _("JOURNAL VOUCHER"));
$rep->NewLine(5);
$rep->SetFontSize(10);
$rep->TextCol(0, 2, $myrow['tranDate']);
$rep->SetFontSize(12);
$rep->TextCol(6, 8, $num . "-" . str_pad($myrow['customized_no'], 4, 0, STR_PAD_LEFT));
$rep->NewLine(2);
//$rep->Line($rep->row - -10);
// $rep->TextCol(7,8, _("DEBIT"));
//$rep->TextCol(9,10, _("CREDIT"));
//$rep->TextCol(5,7, _("ACCOUNT CODE"));
$rep->SetFontSize(10);
$rep->Font();
//$rep->Line($rep->row - 4);
$rep->NewLine(2);
while ($myrow3 = db_fetch($res3)) {
$accounts = get_gl_accounts($myrow3['account']);
$account = db_fetch($accounts);
if ($myrow3['amount'] > 0) {
$rep->TextCol(0, 3, $account['account_name']);
$rep->TextCol(4, 5, $account['account_code']);
$rep->AmountCol(5, 7, $myrow3['amount'], 2);
$rep->NewLine();
$debit += $myrow3['amount'];
} else {
$rep->TextCol(0, 3, $account['account_name']);
$rep->TextCol(4, 5, $account['account_code']);
$rep->AmountCol(7, 9, abs($myrow3['amount']), 2);
$rep->NewLine();
$credit += abs($myrow3['amount']);
}
}
// $rep->Line($rep->row - -4);
$rep->NewLine(17);
$rep->Font('bold');
//$rep->TextCol(0,4, _("Total"));
$rep->AmountCol(5, 7, $debit, 2);
$rep->AmountCol(7, 9, $credit, 2);
$rep->NewLine(2);
$rep->Font();
$comment = get_comments_string($transtype, $trans_num);
$rep->TextCol(0, 9, $comment);
// $rep->Line($rep->row - 4);
$rep->End();
}
示例10: print_credits
function print_credits()
{
global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates;
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'];
$paylink = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = 2;
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$cols = array(-20, 15, 20, 100, 130, 200, 255, 285, 335, 385, 440, 480, 550, 600);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_('CREDIT NOTE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
if (!exists_customer_trans(ST_CUSTCREDIT, $i)) {
continue;
}
$sign = -1;
$myrow = get_customer_trans($i, ST_CUSTCREDIT);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$branch = get_branch($myrow["branch_code"]);
$branch['disable_branch'] = $paylink;
// helper
$sales_order = null;
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('CREDIT NOTE');
$rep->filename = "CreditNote" . $myrow['reference'] . ".pdf";
}
$rep->SetHeaderType(0);
$rep->currency = $cur;
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
//$contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
//$rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_CUSTCREDIT, $contacts);
$rep->NewPage();
$result = get_customer_trans_details(ST_CUSTCREDIT, $i);
$SubTotal = 0;
//$data = get_custom_no($from, ST_CUSTCREDIT);
$invoice_no = get_sales_invoice_no($myrow['order_'], ST_SALESINVOICE);
$credit_no = get_custom_no($myrow['trans_no'], ST_CUSTCREDIT);
$imc = get_imc_name($branch['branch_code']);
$rep->NewLine(9);
$rep->TextCol(6, 8, $myrow['TranDate']);
$rep->NewLine(1);
$oldrow = $rep->row;
$rep->TextColLines(0, 12, $branch['br_name'], -2);
$newrow = $rep->row;
$rep->row = $oldrow;
$rep->NewLine(3);
$rep->TextCol(0, 3, "Ref. Invoice # " . $invoice_no, -2);
$rep->TextCol(3, 5, "Credit#" . $credit_no, -2);
$rep->TextCol(5, 8, $imc, -2);
$rep->NewLine(2);
$rep->NewLine(2);
while ($myrow2 = db_fetch($result)) {
if ($myrow2["quantity"] == 0) {
continue;
}
$Net = round2($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), user_price_dec());
$SubTotal += $Net;
$DisplayPrice = number_format2($myrow2["unit_price"], $dec);
$DisplayQty = number_format2($sign * $myrow2["quantity"], get_qty_dec($myrow2['stock_id']));
$DisplayNet = number_format2($Net, $dec);
if ($myrow2["discount_percent"] == 0) {
$DisplayDiscount = "";
} else {
$DisplayDiscount = number_format2($myrow2["discount_percent"] * 100, user_percent_dec()) . "%";
}
//$rep->TextCol(4, 5, $myrow2['stock_id'], -2);
$oldrow = $rep->row;
$rep->TextColLines(2, 5, $myrow2['StockDescription'], -2);
$newrow = $rep->row;
$rep->row = $oldrow;
$rep->TextCol(0, 1, $DisplayQty . " " . $myrow2['units'], -2);
$rep->TextCol(6, 7, $DisplayPrice, -2);
$rep->TextCol(7, 8, $DisplayNet, -2);
$rep->row = $newrow;
//$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
//.........这里部分代码省略.........
示例11: print_credits
function print_credits()
{
global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates;
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'];
$paylink = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$cols = array(0, 10, 50, 100, 150, 200, 250, 300, 350, 380, 450, 480, 550, 600);
// $headers in doctext.inc
$aligns = array('center', 'left', 'left', 'left', 'left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_('CREDIT NOTE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
if (!exists_customer_trans(ST_CUSTCREDIT, $i)) {
continue;
}
$sign = -1;
$myrow = get_customer_trans($i, ST_CUSTCREDIT);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$branch = get_branch($myrow["branch_code"]);
$branch['disable_branch'] = $paylink;
// helper
$sales_order = null;
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('CREDIT NOTE');
$rep->filename = "CreditNote" . $myrow['reference'] . ".pdf";
}
$rep->SetHeaderType(0);
$rep->currency = $cur;
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
//$contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
//$rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_CUSTCREDIT, $contacts);
$rep->NewPage();
$result = get_customer_trans_details(ST_CUSTCREDIT, $i);
$SubTotal = 0;
//$data = get_custom_no($from, ST_CUSTCREDIT);
$invoice_no = get_sales_invoice_no($myrow['order_'], ST_SALESINVOICE);
$imc = get_imc_name($branch['branch_code']);
$rep->NewLine(8);
$rep->TextCol(8, 10, "Date : " . $myrow['TranDate']);
$rep->NewLine(2);
$oldrow = $rep->row;
$rep->TextColLines(3, 12, "Client : " . $branch['br_name'], -2);
$newrow = $rep->row;
$rep->row = $oldrow;
$rep->NewLine(2);
$rep->TextCol(3, 5, "Invoice # : " . $invoice_no, -2);
$rep->TextCol(8, 10, "IMC: " . $imc, -2);
$rep->NewLine(2);
$rep->TextCol(3, 4, _("QTY"));
$rep->TextCol(5, 7, _("DESCRIPTION"));
$rep->TextCol(8, 9, _("PRICE"));
$rep->TextCol(9, 10, _("AMOUNT"));
$rep->NewLine(2);
while ($myrow2 = db_fetch($result)) {
if ($myrow2["quantity"] == 0) {
continue;
}
$Net = round2($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]), user_price_dec());
$SubTotal += $Net;
$DisplayPrice = number_format2($myrow2["unit_price"], $dec);
$DisplayQty = number_format2($sign * $myrow2["quantity"], get_qty_dec($myrow2['stock_id']));
$DisplayNet = number_format2($Net, $dec);
if ($myrow2["discount_percent"] == 0) {
$DisplayDiscount = "";
} else {
$DisplayDiscount = number_format2($myrow2["discount_percent"] * 100, user_percent_dec()) . "%";
}
//$rep->TextCol(4, 5, $myrow2['stock_id'], -2);
$oldrow = $rep->row;
$rep->TextColLines(4, 8, $myrow2['StockDescription'], -2);
$newrow = $rep->row;
$rep->row = $oldrow;
$rep->TextCol(3, 4, $DisplayQty . " " . $myrow2['units'], -2);
$rep->TextCol(8, 9, $DisplayPrice, -2);
$rep->TextCol(9, 10, $DisplayNet, -2);
$rep->row = $newrow;
//$rep->NewLine(1);
//.........这里部分代码省略.........
示例12: print_receipts
function print_receipts()
{
global $path_to_root, $systypes_array;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$currency = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
$orientation = $_POST['PARAM_4'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$cols = array(4, 85, 150, 225, 275, 360, 450, 515);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
$rep = new FrontReport(_('RECEIPT'), "ReceiptBulk", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
for ($i = $from; $i <= $to; $i++) {
if ($fno[0] == $tno[0]) {
$types = array($fno[1]);
} else {
$types = array(ST_BANKDEPOSIT, ST_CUSTPAYMENT);
}
foreach ($types as $j) {
$myrow = get_receipt($j, $i);
if (!$myrow) {
continue;
}
$res = get_bank_trans($j, $i);
$baccount = db_fetch($res);
$params['bankaccount'] = $baccount['bank_act'];
$contacts = get_branch_contacts($myrow['branch_code'], 'invoice', $myrow['debtor_no']);
$rep->SetCommonData($myrow, null, $myrow, $baccount, ST_CUSTPAYMENT, $contacts);
$rep->NewPage();
$result = get_allocations_for_receipt($myrow['debtor_no'], $myrow['type'], $myrow['trans_no']);
$doctype = ST_CUSTPAYMENT;
$total_allocated = 0;
$rep->TextCol(0, 4, _("As advance / full / part / payment towards:"), -2);
$rep->NewLine(2);
while ($myrow2 = db_fetch($result)) {
$rep->TextCol(0, 1, $systypes_array[$myrow2['type']], -2);
$rep->TextCol(1, 2, $myrow2['reference'], -2);
$rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2);
$rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2);
$rep->AmountCol(4, 5, $myrow2['Total'], $dec, -2);
$rep->AmountCol(5, 6, $myrow2['Total'] - $myrow2['alloc'], $dec, -2);
$rep->AmountCol(6, 7, $myrow2['amt'], $dec, -2);
$total_allocated += $myrow2['amt'];
$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
}
}
$memo = get_comments_string($j, $i);
if ($memo != "") {
$rep->NewLine();
$rep->TextColLines(1, 5, $memo, -2);
}
$rep->row = $rep->bottomMargin + 15 * $rep->lineHeight;
$rep->TextCol(3, 6, _("Total Allocated"), -2);
$rep->AmountCol(6, 7, $total_allocated, $dec, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Left to Allocate"), -2);
$rep->AmountCol(6, 7, $myrow['Total'] - $total_allocated, $dec, -2);
$rep->NewLine();
$rep->Font('bold');
$rep->TextCol(3, 6, _("TOTAL RECEIPT"), -2);
$rep->AmountCol(6, 7, $myrow['Total'], $dec, -2);
$words = price_in_words($myrow['Total'], ST_CUSTPAYMENT);
if ($words != "") {
$rep->NewLine(1);
$rep->TextCol(0, 7, $myrow['curr_code'] . ": " . $words, -2);
}
$rep->Font();
$rep->NewLine();
$rep->TextCol(6, 7, _("Received / Sign"), -2);
$rep->NewLine();
$rep->TextCol(0, 2, _("By Cash / Cheque* / Draft No."), -2);
$rep->TextCol(2, 4, "______________________________", -2);
$rep->TextCol(4, 5, _("Dated"), -2);
$rep->TextCol(5, 6, "__________________", -2);
$rep->NewLine(1);
$rep->TextCol(0, 2, _("Drawn on Bank"), -2);
$rep->TextCol(2, 4, "______________________________", -2);
$rep->TextCol(4, 5, _("Branch"), -2);
$rep->TextCol(5, 6, "__________________", -2);
//.........这里部分代码省略.........
示例13: print_workorders
function print_workorders()
{
global $path_to_root, $SysPrefs, $dflt_lang;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$email = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
$orientation = $_POST['PARAM_4'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$fno = explode("-", $from);
$tno = explode("-", $to);
$from = min($fno[0], $tno[0]);
$to = max($fno[0], $tno[0]);
$cols = array(4, 60, 190, 255, 320, 385, 450, 515);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_('WORK ORDER'), "WorkOrderBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
$myrow = get_work_order($i);
if ($myrow === false) {
continue;
}
$date_ = sql2date($myrow["date_"]);
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('WORK ORDER');
$rep->filename = "WorkOrder" . $myrow['wo_ref'] . ".pdf";
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$contact = array('email' => $myrow['email'], 'lang' => $dflt_lang, 'name' => $myrow['contact'], 'name2' => '', 'contact');
$rep->SetCommonData($myrow, null, null, '', 26, $contact);
$rep->NewPage();
$result = get_wo_requirements($i);
$rep->TextCol(0, 5, _("Work Order Requirements"), -2);
$rep->NewLine(2);
$has_marked = false;
while ($myrow2 = db_fetch($result)) {
$qoh = 0;
$show_qoh = true;
// if it's a non-stock item (eg. service) don't show qoh
if (!has_stock_holding($myrow2["mb_flag"])) {
$show_qoh = false;
}
if ($show_qoh) {
$qoh = get_qoh_on_date($myrow2["stock_id"], $myrow2["loc_code"], $date_);
}
if ($show_qoh && $myrow2["units_req"] * $myrow["units_issued"] > $qoh && !$SysPrefs->allow_negative_stock()) {
// oops, we don't have enough of one of the component items
$has_marked = true;
} else {
$has_marked = false;
}
if ($has_marked) {
$str = $myrow2['stock_id'] . " ***";
} else {
$str = $myrow2['stock_id'];
}
$rep->TextCol(0, 1, $str, -2);
$rep->TextCol(1, 2, $myrow2['description'], -2);
$rep->TextCol(2, 3, $myrow2['location_name'], -2);
$rep->TextCol(3, 4, $myrow2['WorkCentreDescription'], -2);
$dec = get_qty_dec($myrow2["stock_id"]);
$rep->AmountCol(4, 5, $myrow2['units_req'], $dec, -2);
$rep->AmountCol(5, 6, $myrow2['units_req'] * $myrow['units_issued'], $dec, -2);
$rep->AmountCol(6, 7, $myrow2['units_issued'], $dec, -2);
$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
}
}
$rep->NewLine(1);
$rep->TextCol(0, 5, " *** = " . _("Insufficient stock"), -2);
$memo = get_comments_string(ST_WORKORDER, $i);
if ($memo != "") {
$rep->NewLine();
$rep->TextColLines(1, 5, $memo, -2);
}
if ($email == 1) {
$myrow['DebtorName'] = $myrow['contact'];
$myrow['reference'] = $myrow['wo_ref'];
$rep->End($email);
}
}
if ($email == 0) {
$rep->End();
}
//.........这里部分代码省略.........
示例14: print_employee_payslip
function print_employee_payslip()
{
global $path_to_root, $SysPrefs, $dflt_lang;
include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$email = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
$orientation = $_POST['PARAM_4'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
// $fno = explode("-", $from);
// $tno = explode("-", $to);
// $from = min($fno[0], $tno[0]);
// $to = max($fno[0], $tno[0]);
// $cols = array(4, 60, 190, 200);
$cols = array(4, 50, 50, 50, 50);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'left', 'right');
$params = array('comments' => $comments);
if ($email == 0) {
$rep = new FrontReport(_('PAYSLIP'), "PayslipBulk", user_pagesize(), 9, $orientation);
}
$rep = new FrontReport("Payroll", "", user_pagesize(), 9, $orientation);
$rep->title = _('PAYSLIP');
$rep->filename = "Payslip" . $myrow['payslip_id'] . ".pdf";
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
$myrow = get_payslip($i);
if ($myrow === false) {
continue;
}
$date_ = sql2date($myrow["date_"]);
if ($email == 1) {
$rep = new FrontReport("Payroll", "", user_pagesize(), 9, $orientation);
$rep->title = _('PAYSLIP');
$rep->filename = "Payslip" . $myrow['payslip_id'] . ".pdf";
}
$rep->SetHeaderType('Header_custom');
//display company logo and info on header
//$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$rep->SetCommonData($myrow, null, null, '', 100, $contact);
$rep->NewPage();
$result = get_payslip($i);
//$rep->TextCol(0, 5,_("Breakdown"), -2);
// $rep->NewLine(2);
$rep->TextCol(0, 5, _("Payslip No:") . $myrow['payslip_id'], -2);
$rep->TextCol(2, 6, _("Employee: ") . $myrow['EmpNames'], -2);
$rep->TextCol(3, 6, _("Role Pay: ") . $myrow['role_pay'], -2);
$rep->NewLine(2);
$rep->NewLine(2);
}
if ($email == 0) {
$rep->End();
}
}
示例15: print_cash_flow_statement
//.........这里部分代码省略.........
$destination = $_POST['PARAM_2'];
}
}
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
if ($comments) {
$comments .= ". - ";
}
$comments .= _("Balances in Home Currency");
$title = _("Cash Flow Statement");
$output_filename = "CashFlowStatement";
$fontsize = 7;
$page_size = user_pagesize();
$page_orientation = 'L';
$margins = array('top' => 30, 'bottom' => 34, 'left' => 16, 'right' => 10);
$excelColWidthFactor = 5;
$rep = new FrontReport($title, $output_filename, $page_size, $fontsize, $page_orientation, $margins, $excelColWidthFactor);
$enddate = end_month($date);
$dec = user_price_dec();
// Lay out the columns for this report
//$cols2 = array(0, 70, 127, 184, 232, 280, 328, 376, 424, 472, 520, 568, 616, 664, 712, 760);
//-------------0--1---2----3----4----5----6----7----8----9----10---11---12---13---14---15-
$cols2 = array(0 => 0, 70);
$endline = $rep->endLine - 20;
$wi = ($endline - $cols2[1]) / 14;
// 14 amount columns
for ($i = 2; $i < 17; $i++) {
$cols2[$i] = $cols2[$i - 1] + $wi;
}
$cols = $cols2;
//----------------------------------------------------------------------------------------
$aligns2 = array('left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$headers2 = array();
//$cols = array(0, 70, 127, 184, 232, 280, 328, 376, 424, 472, 520, 568, 616, 664, 712, 760);
//-------------0--1---2----3----4----5----6----7----8----9----10---11---12---13---14---15-
//----------------------------------------------------------------------------------------
$aligns = array('left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$headers = array();
$date = begin_month($date);
$date = add_months($date, -11);
list($da, $mo, $yr) = explode_date_to_dmy($date);
if ($date_system == 1) {
list($yr, $mo, $da) = jalali_to_gregorian($yr, $mo, $da);
} elseif ($date_system == 2) {
list($yr, $mo, $da) = islamic_to_gregorian($yr, $mo, $da);
}
$headers2[0] = 'Account';
$headers[0] = '';
for ($i = 0; $i < 12; $i++) {
$header_row[$i] = $rep->DatePrettyPrint($date, 0, 1);
// Wrap at space between month & year
$wrap_point = strpos($header_row[$i], ' ');
if ($wrap_point) {
$headers2[] = substr($header_row[$i], 0, $wrap_point);
$headers[] = substr($header_row[$i], $wrap_point + 1);
} else {
$headers2[] = '';
$headers[] = $header_row[$i];
}
$date = add_months($date, 1);
}
$header_row[] = _("Fiscal YTD");
$header_row[] = _("12 Mo. to Date");
for ($i = 12; $i < 14; $i++) {
$wrapped_header_text = $rep->TextWrapCalc($header_row[$i], $cols[$i + 2] - $cols[$i + 1], true);
$headers2[] = trim($wrapped_header_text[0]);
$headers[] = trim($wrapped_header_text[1]);
}
if ($dim == 2) {
$params = array(0 => $comments, 1 => array('text' => _("Report Period"), 'from' => '', 'to' => $rep->DatePrettyPrint($enddate)), 2 => array('text' => '', 'from' => '', 'to' => ''), 3 => array('text' => '', 'from' => '', 'to' => ''), 4 => array('text' => _("Dimension 1"), 'from' => get_dimension_string($dimension), 'to' => ''), 5 => array('text' => _("Dimension 2"), 'from' => get_dimension_string($dimension2), 'to' => ''));
} else {
if ($dim == 1) {
$params = array(0 => $comments, 1 => array('text' => _("Report Period"), 'from' => '', 'to' => $rep->DatePrettyPrint($enddate)), 2 => array('text' => '', 'from' => '', 'to' => ''), 3 => array('text' => _('Dimension'), 'from' => get_dimension_string($dimension), 'to' => ''));
} else {
$params = array(0 => $comments, 1 => array('text' => _("Report Period"), 'from' => '', 'to' => $rep->DatePrettyPrint($enddate)));
}
}
// Company logo setting
$companylogoenable = true;
// Footer Settings
$footerenable = true;
$footertext = _('For Management Purposes Only');
$rep->Font();
$rep->SetFillColor(240, 240, 240);
$rep->scaleLogoWidth = true;
$rep->lineHeight = 8;
$rep->SetCellPadding(4);
$rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2, $companylogoenable, $footerenable, $footertext);
$rep->SetHeaderType('Header3');
$rep->NewPage();
$rep->SetDrawColor(0, 0, 0);
$rep->SetLineWidth(0.1);
$rep->row += 8;
display_bank_trans($yr, $mo, $dec, $rep, $dimension, $dimension2, $enddate);
$rep->Font();
$rep->End();
}