当前位置: 首页>>代码示例>>PHP>>正文


PHP FrontReport::DatePrettyPrint方法代码示例

本文整理汇总了PHP中FrontReport::DatePrettyPrint方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontReport::DatePrettyPrint方法的具体用法?PHP FrontReport::DatePrettyPrint怎么用?PHP FrontReport::DatePrettyPrint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrontReport的用法示例。


在下文中一共展示了FrontReport::DatePrettyPrint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_check

function print_check()
{
    global $path_to_root, $systypes_array, $print_invoice_no;
    // Get the payment
    $from = $_POST['PARAM_0'];
    $destination = $_POST['PARAM_1'];
    $trans_no = explode("-", $from);
    $dec = user_price_dec();
    if ($destination) {
        include_once $path_to_root . "/reporting/includes/excel_report.inc";
    } else {
        include_once $path_to_root . "/reporting/includes/pdf_report.inc";
    }
    $from_trans = get_remittance($trans_no[1], $trans_no[0]);
    // Get check information
    $total_amt = $from_trans['Total'];
    $date = sql2date($from_trans['tran_date']);
    $memo = get_comments_string($trans_no[1], $trans_no[0]);
    // Begin the report
    $rep = new FrontReport(_('Printable Check'), "PrintableCheck", user_pagesize());
    $rep->SetHeaderType(null);
    $rep->NewPage();
    // Set the font
    $rep->Font('', 'courier');
    $rep->fontSize = 12;
    //////////////////
    // Check portion
    $rep->NewLine(1, 0, 76);
    $rep->cols = array(63, 340, 470, 565);
    $rep->aligns = array('left', 'left', 'right', 'right');
    // Pay to
    $rep->TextCol(0, 1, $from_trans['supp_name']);
    // Date
    $rep->DateCol(1, 2, $rep->DatePrettyPrint($date, 0, 0));
    // Amount (numeric)
    $rep->TextCol(2, 3, '***' . number_format2(-$total_amt, $dec));
    // Amount (words)
    $rep->NewLine(1, 0, 23);
    $rep->TextCol(0, 2, $from_trans['curr_code'] . ": " . price_in_words(-$total_amt, ST_CHEQUE));
    // Memo
    $rep->NewLine(1, 0, 78);
    $rep->TextCol(0, 1, $memo);
    $rep->company = get_company_prefs();
    /////////////////////
    // Item details x 2
    for ($section = 1; $section <= 2; $section++) {
        $rep->fontSize = 12;
        // Move down to the correct section
        $rep->row = $section == 1 ? 505 : 255;
        $rep->cols = array(20, 340, 470, 588);
        $rep->aligns = array('left', 'left', 'right', 'right');
        // Pay to
        $rep->Font('b');
        $rep->TextCol(0, 1, $from_trans['supp_name']);
        $rep->Font();
        // Date
        $rep->DateCol(1, 2, $rep->DatePrettyPrint($date, 0, 0));
        // Amount (numeric)
        $rep->TextCol(2, 3, number_format2(-$total_amt, 2));
        // Add Trans # + Reference
        $rep->NewLine();
        if ($print_invoice_no == 0) {
            $tno = $from_trans['reference'];
        } else {
            $tno = $from_trans['trans_no'];
        }
        $rep->TextCol(0, 3, sprintf(_("Payment # %s - from Customer: %s - %s"), $tno, $from_trans['supp_account_no'], $rep->company['coy_name']));
        // Add memo
        $rep->NewLine();
        $rep->TextCol(0, 3, _("Memo: ") . $memo);
        // TODO: Do we want to set a limit on # of item details?  (Max is probably 6-7)
        // Get item details
        $result = get_allocations_for_remittance($from_trans['supplier_id'], $from_trans['type'], $from_trans['trans_no']);
        // Fill in details
        $rep->NewLine(2);
        $rep->fontSize = 10;
        // Use different columns now for the additional info
        $rep->cols = array(20, 160, 235, 290, 370, 480, 588);
        $rep->aligns = array('left', 'left', 'left', 'right', 'right', 'right');
        // Add headers
        $rep->Font('b');
        $rep->TextCol(0, 1, _("Type/Id"));
        $rep->TextCol(1, 2, _("Trans Date"));
        $rep->TextCol(2, 3, _("Due Date"));
        $rep->TextCol(3, 4, _("Total Amount"));
        $rep->TextCol(4, 5, _("Left to Allocate"));
        $rep->TextCol(5, 6, _("This Allocation"));
        $rep->NewLine();
        $rep->Font();
        $total_allocated = 0;
        while ($item = db_fetch($result)) {
            $rep->TextCol(0, 1, $systypes_array[$item['type']] . " " . $item['supp_reference']);
            $rep->TextCol(1, 2, sql2date($item['tran_date']));
            $rep->TextCol(2, 3, sql2date($item['due_date']));
            $rep->AmountCol(3, 4, $item['Total'], $dec);
            $rep->AmountCol(4, 5, $item['Total'] - $item['alloc'], $dec);
            $rep->AmountCol(5, 6, $item['amt'], $dec);
            $total_allocated += $item['amt'];
            $rep->NewLine(1, 0, $rep->lineHeight + 3);
            // Space it out
//.........这里部分代码省略.........
开发者ID:nativebandung,项目名称:frontaccounting,代码行数:101,代码来源:rep_check_print.php

示例2: print_annual_balance_breakdown_detail

function print_annual_balance_breakdown_detail()
{
    global $path_to_root, $date_system;
    $dim = get_company_pref('use_dimension');
    $dimension = $dimension2 = 0;
    if ($dim == 2) {
        $date = $_POST['PARAM_0'];
        $dimension = $_POST['PARAM_1'];
        $dimension2 = $_POST['PARAM_2'];
        $comments = $_POST['PARAM_3'];
        $destination = $_POST['PARAM_4'];
    } else {
        if ($dim == 1) {
            $date = $_POST['PARAM_0'];
            $dimension = $_POST['PARAM_1'];
            $comments = $_POST['PARAM_3'];
            $destination = $_POST['PARAM_4'];
        } else {
            $date = $_POST['PARAM_0'];
            $comments = $_POST['PARAM_3'];
            $destination = $_POST['PARAM_4'];
        }
    }
    if ($destination) {
        include_once $path_to_root . "/reporting/includes/excel_report.inc";
    } else {
        include_once $path_to_root . "/reporting/includes/pdf_report.inc";
    }
    $title = _("Annual Balance Breakdown - Detailed");
    $output_filename = "AnnualBalanceBreakDownDetail";
    $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]) / 12;
    // 12 amount columns
    for ($i = 2; $i < 15; $i++) {
        $cols2[$i] = $cols2[$i - 1] + $wi;
    }
    $cols = $cols2;
    //----------------------------------------------------------------------------------------
    $aligns2 = array('left', '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');
    $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 Year Begin";
    $header_row[] = "Fiscal YTD";
    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
//.........这里部分代码省略.........
开发者ID:rusli-nasir,项目名称:frontaccounting,代码行数:101,代码来源:rep_annual_balance_breakdown.php

示例3: print_cash_flow_statement

function print_cash_flow_statement()
{
    global $path_to_root, $date_system, $comp_path;
    $dim = get_company_pref('use_dimension');
    $dimension = $dimension2 = 0;
    if ($dim == 2) {
        $date = $_POST['PARAM_0'];
        $dimension = $_POST['PARAM_1'];
        $dimension2 = $_POST['PARAM_2'];
        $comments = $_POST['PARAM_3'];
        $destination = $_POST['PARAM_4'];
    } else {
        if ($dim == 1) {
            $date = $_POST['PARAM_0'];
            $dimension = $_POST['PARAM_1'];
            $comments = $_POST['PARAM_2'];
            $destination = $_POST['PARAM_3'];
        } else {
            $date = $_POST['PARAM_0'];
            $comments = $_POST['PARAM_1'];
            $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)));
        }
    }
//.........这里部分代码省略.........
开发者ID:blestab,项目名称:frontaccounting,代码行数:101,代码来源:rep_cash_flow_statement.php


注:本文中的FrontReport::DatePrettyPrint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。