コード例 #1
0
function receipt_data($x, $y)
{
    global $receipt, $pdf;
    $font_size = 12;
    $yy = $y;
    $xmax = $x + 420;
    $pdf->line($x, $y, $xmax, $y);
    $y -= 8;
    text_align_center($x + 140, $y, 8, iconv("UTF-8", "ISO-8859-2", trans('For what')));
    text_align_center($x + 315, $y, 8, iconv("UTF-8", "ISO-8859-2", trans('Value')));
    text_align_center($x + 385, $y, 8, iconv("UTF-8", "ISO-8859-2", trans('Number')));
    $y -= 2;
    $pdf->line($x, $y, $xmax, $y);
    $y -= $font_size;
    $i = 0;
    if ($receipt['contents']) {
        foreach ($receipt['contents'] as $item) {
            $i++;
            text_align_left($x + 2, $y, $font_size - 2, '<b>' . $i . '.</b>');
            $y = text_wrap($x + 15, $y, 270, $font_size - 2, iconv("UTF-8", "ISO-8859-2", $item['description']), '');
            text_align_right($x + 345, $y + $font_size, $font_size - 2, iconv("UTF-8", "ISO-8859-2", moneyf($item['value'])));
        }
    }
    $y += $font_size / 2;
    $pdf->line($x, $y, $xmax, $y);
    $y -= $font_size;
    text_align_right($x + 275, $y - 6, $font_size - 2, '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Total:')) . '</b>');
    text_align_right($x + 345, $y - 6, $font_size - 2, '<b>' . iconv("UTF-8", "ISO-8859-2", moneyf($receipt['total'])) . '</b>');
    $y -= text_align_center($x + 385, $y, 8, 'Symbole');
    $y -= text_align_center($x + 385, $y, 8, 'PL. KAS. Nr');
    $pdf->line($x, $yy, $x, $y);
    $pdf->line($x + 280, $yy, $x + 280, $y);
    $pdf->line($x + 350, $yy, $x + 350, $y);
    $pdf->line($xmax, $yy, $xmax, $y);
    $pdf->line($x, $y, $xmax, $y);
    $y -= 16;
    text_align_left($x + 2, $y, 8, iconv("UTF-8", "ISO-8859-2", trans('In words:')));
    $y = text_wrap($x + 40, $y, 300, $font_size - 2, iconv("UTF-8", "ISO-8859-2", trans('$a dollars $b cents', to_words(floor($receipt['total'])), to_words($receipt['totalg']))), '');
    $y -= 8;
    $y += $font_size / 2;
    $pdf->line($x, $yy, $x, $y);
    $pdf->line($x + 350, $yy, $x + 350, $y);
    $pdf->line($xmax, $yy, $xmax, $y);
    $pdf->line($x, $y, $xmax, $y);
    return $y;
}
コード例 #2
0
function invoice_footnote($x, $y, $width, $font_size)
{
    global $pdf, $invoice;
    if (!empty($invoice['division_footer'])) {
        $y = $y - $pdf->getFontHeight($font_size);
        //$y = $y - text_align_left($x, $y, $font_size, '<b>'.iconv("UTF-8","ISO-8859-2//TRANSLIT", trans('Notes:')).'</b>');
        $tmp = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $invoice['division_footer']);
        $account = format_bankaccount(bankaccount($invoice['customerid'], $invoice['account']));
        $tmp = str_replace('%bankaccount', $account, $tmp);
        $tmp = preg_split('/\\r?\\n/', $tmp);
        foreach ($tmp as $line) {
            $y = text_wrap($x, $y, $width, $font_size, $line, "full");
        }
    }
}
コード例 #3
0
ファイル: invoice_pdf.php プロジェクト: kornelek/lms
function invoice_footnote($x, $y, $width, $font_size)
{
    global $pdf, $CONFIG;
    if (ConfigHelper::getConfig('invoices.footer')) {
        $y = $y - $pdf->getFontHeight($font_size);
        $y = $y - text_align_left($x, $y, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Notes:')) . '</b>');
        $tmp = iconv("UTF-8", "ISO-8859-2", ConfigHelper::getConfig('invoices.footer'));
        $tmp = explode("\n", $tmp);
        foreach ($tmp as $line) {
            $y = text_wrap($x, $y, $width, $font_size, $line, "full");
        }
    }
}