Ejemplo n.º 1
0
function invoice_data($x, $y, $width, $font_size, $margin)
{
    global $invoice, $pdf;
    $pdf->setlinestyle(0.5);
    $pdf->line($x, $y, $x + $width, $y);
    $v = 1;
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('No.')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Name of Product, Commodity or Service:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Product ID:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Unit:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Amount:')) . '</b>';
    if (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount'])) {
        $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Discount:')) . '</b>';
    }
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Unitary Net Value:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Net Value:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Tax Rate:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Tax Value:')) . '</b>';
    $t_data[$v++] = '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Gross Value:')) . '</b>';
    for ($i = 1; $i < $v; $i++) {
        $t_justify[$i] = "center";
    }
    for ($i = 1; $i < $v; $i++) {
        $t_width[$i] = getWrapTextWidth($font_size, $t_data[$i]) + 2 * $margin + 2;
    }
    // tutaj jeszcze trzeba będzie sprawdzić jaką szerokość mają pola w tabelce później
    if ($invoice['content']) {
        foreach ($invoice['content'] as $item) {
            $v = 2;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['description']));
            $tt_width[$v++] = $pdf->getTextWidth($font_size, $item['prodid']);
            $tt_width[$v++] = $pdf->getTextWidth($font_size, $item['content']);
            $tt_width[$v++] = $pdf->getTextWidth($font_size, sprintf('%.2f', $item['count']));
            if (!empty($invoice['pdiscount'])) {
                $tt_width[$v] = $pdf->getTextWidth($font_size, sprintf('%.2f %%', $item['pdiscount']));
            }
            if (!empty($invoice['vdiscount'])) {
                $tmp_width = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['vdiscount'])));
                if ($tmp_width > $tt_width[$v]) {
                    $tt_width[$v] = $tmp_width;
                }
            }
            if (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount'])) {
                $v++;
            }
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['basevalue']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totalbase']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel'])) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totaltax']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']))) + 6;
            for ($i = 2; $i < $v; $i++) {
                if ($tt_width[$i] + 2 * $margin + 2 > $t_width[$i]) {
                    $t_width[$i] = $tt_width[$i] + 2 * $margin + 2;
                }
            }
        }
    }
    if (isset($invoice['invoice']['content'])) {
        foreach ($invoice['invoice']['content'] as $item) {
            $v = 2;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['description']));
            $tt_width[$v++] = $pdf->getTextWidth($font_size, $item['prodid']);
            $tt_width[$v++] = $pdf->getTextWidth($font_size, $item['content']);
            $tt_width[$v++] = $pdf->getTextWidth($font_size, sprintf('%.2f', $item['count']));
            if (!empty($invoice['pdiscount'])) {
                $tt_width[$v] = $pdf->getTextWidth($font_size, sprintf('%.2f %%', $item['pdiscount']));
            }
            if (!empty($invoice['vdiscount'])) {
                $tmp_width = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['vdiscount'])));
                if ($tmp_width > $tt_width[$v]) {
                    $tt_width[$v] = $tmp_width;
                }
            }
            if (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount'])) {
                $v++;
            }
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['basevalue']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totalbase']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel'])) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totaltax']))) + 6;
            $tt_width[$v++] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']))) + 6;
            for ($i = 2; $i < $v; $i++) {
                if ($tt_width[$i] + 2 * $margin + 2 > $t_width[$i]) {
                    $t_width[$i] = $tt_width[$i] + 2 * $margin + 2;
                }
            }
        }
    }
    // Kolumna 2 będzie miała rozmiar ustalany dynamicznie
    $t_width[2] = $width - ($t_width[1] + $t_width[3] + $t_width[4] + $t_width[5] + $t_width[6] + $t_width[7] + $t_width[8] + $t_width[9] + $t_width[10] + (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? $t_width[11] : 0) + 2 * $margin * (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 11 : 10));
    $y = invoice_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
    $t_justify[11] = $t_justify[10] = $t_justify[9] = $t_justify[8] = $t_justify[7] = $t_justify[6] = $t_justify[5] = "right";
    $t_justify[2] = 'left';
    if (isset($invoice['invoice'])) {
        // we have credit note, so first print corrected invoice data
        $xx = $x;
        $y = $y - text_align_left($x, $y - 10, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Was:')) . '</b>');
        $y -= 6;
        $pdf->line($x, $y, $x + $width, $y);
        $lp = 1;
        if ($invoice['invoice']['content']) {
            foreach ($invoice['invoice']['content'] as $item) {
                $v = 1;
                $t_data[$v++] = $lp;
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['description']);
                $t_data[$v++] = $item['prodid'];
                $t_data[$v++] = $item['content'];
                $t_data[$v++] = sprintf('%.2f', $item['count']);
                $item['pdiscount'] = floatval($item['pdiscount']);
                $item['vdiscount'] = floatval($item['vdiscount']);
                if (!empty($item['pdiscount'])) {
                    $t_data[$v++] = sprintf('%.2f %%', $item['pdiscount']);
                } elseif (!empty($item['vdiscount'])) {
                    $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['vdiscount']));
                } elseif (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount'])) {
                    $t_data[$v++] = '';
                }
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['basevalue']));
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totalbase']));
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel']);
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totaltax']));
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']));
                $lp++;
                $y = invoice_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
            }
        }
        $x = $x + (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 7 : 6) * 2 * $margin + $t_width[1] + $t_width[2] + $t_width[3] + $t_width[4] + $t_width[5] + $t_width[6] + (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? $t_width[7] : 0);
        $fy = $y - $margin - $pdf->GetFontHeight($font_size);
        text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Total:')) . '</b>');
        $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
        $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['invoice']['totalbase']));
        $t_data[$v++] = "<b>x</b>";
        $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['invoice']['totaltax']));
        $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['invoice']['total']));
        $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
        $y -= 5;
        $fy = $y - $margin - $pdf->GetFontHeight($font_size);
        text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('in it:')) . '</b>');
        $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
        $pdf->line($x, $y, $x + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + 8 * $margin, $y);
        if ($invoice['invoice']['taxest']) {
            foreach ($invoice['invoice']['taxest'] as $item) {
                $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['base']));
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel']);
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['tax']));
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']));
                $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
            }
        }
        $x = $xx;
        if ($invoice['reason'] != '') {
            $y = $y - text_align_left($x, $y - 10, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Reason:') . ' ' . $invoice['reason']) . '</b>');
            $y -= 10;
        }
        $y = $y - text_align_left($x, $y - 10, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Corrected to:')) . '</b>');
        $y -= 5;
        $pdf->line($x, $y, $x + $width, $y);
    }
    $lp = 1;
    if ($invoice['content']) {
        foreach ($invoice['content'] as $item) {
            $v = 1;
            $t_data[$v++] = $lp;
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['description']);
            $t_data[$v++] = $item['prodid'];
            $t_data[$v++] = $item['content'];
            $t_data[$v++] = sprintf('%.2f', $item['count']);
            $item['pdiscount'] = floatval($item['pdiscount']);
            $item['vdiscount'] = floatval($item['vdiscount']);
            if (!empty($item['pdiscount'])) {
                $t_data[$v++] = sprintf('%.2f %%', $item['pdiscount']);
            } elseif (!empty($item['vdiscount'])) {
                $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['vdiscount']));
            } elseif (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount'])) {
                $t_data[$v++] = '';
            }
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['basevalue']));
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totalbase']));
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel']);
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['totaltax']));
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']));
            $lp++;
            $y = invoice_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
        }
    }
    $return[1] = $y;
    $x = $x + (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 7 : 6) * 2 * $margin + $t_width[1] + $t_width[2] + $t_width[3] + $t_width[4] + $t_width[5] + $t_width[6] + (!empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? $t_width[7] : 0);
    $fy = $y - $margin - $pdf->GetFontHeight($font_size);
    text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Total:')) . '</b>');
    $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
    $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['totalbase']));
    $t_data[$v++] = "<b>x</b>";
    $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['totaltax']));
    $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($invoice['total']));
    $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
    $y = $y - 5;
    $fy = $y - $margin - $pdf->GetFontHeight($font_size);
    text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('in it:')) . '</b>');
    $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
    $pdf->line($x, $y, $x + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + 8 * $margin, $y);
    if ($invoice['taxest']) {
        foreach ($invoice['taxest'] as $item) {
            $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['base']));
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", $item['taxlabel']);
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['tax']));
            $t_data[$v++] = iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($item['total']));
            $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
        }
    }
    if (isset($invoice['invoice'])) {
        $total = $invoice['total'] - $invoice['invoice']['total'];
        $totalbase = $invoice['totalbase'] - $invoice['invoice']['totalbase'];
        $totaltax = $invoice['totaltax'] - $invoice['invoice']['totaltax'];
        $y = $y - 5;
        $fy = $y - $margin - $pdf->GetFontHeight($font_size);
        $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
        $pdf->line($x, $y, $x + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + $t_width[$v++] + 8 * $margin, $y);
        text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Difference value:')) . '</b>');
        $v = !empty($invoice['pdiscount']) || !empty($invoice['vdiscount']) ? 8 : 7;
        $t_data[$v++] = ($totalbase > 0 ? '+' : '') . iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($totalbase));
        $t_data[$v++] = "<b>x</b>";
        $t_data[$v++] = ($totaltax > 0 ? '+' : '') . iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($totaltax));
        $t_data[$v++] = ($total > 0 ? '+' : '') . iconv("UTF-8", "ISO-8859-2//TRANSLIT", moneyf($total));
        $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
    }
    $return[2] = $y;
    return $return;
}
Ejemplo n.º 2
0
function invoice_data($x, $y, $width, $font_size, $margin)
{
    global $invoice, $pdf;
    $pdf->setlinestyle(0.5);
    $pdf->line($x, $y, $x + $width, $y);
    $t_data[1] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('No.')) . '</b>';
    $t_data[2] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Name of Product, Commodity or Service:')) . '</b>';
    $t_data[3] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Product ID:')) . '</b>';
    $t_data[4] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Unit:')) . '</b>';
    $t_data[5] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Amount:')) . '</b>';
    $t_data[6] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Unitary Net Value:')) . '</b>';
    $t_data[7] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Net Value:')) . '</b>';
    $t_data[8] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Tax Rate:')) . '</b>';
    $t_data[9] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Tax Value:')) . '</b>';
    $t_data[10] = '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Gross Value:')) . '</b>';
    for ($i = 1; $i <= 10; $i++) {
        $t_justify[$i] = "left";
    }
    for ($i = 1; $i <= 10; $i++) {
        $t_width[$i] = $pdf->getTextWidth($font_size, $t_data[$i]) + 2 * $margin + 1;
    }
    // tutaj jeszcze trzeba b�dzie sprawdzi� jak� szeroko�� maj� pola w tabelce pu�niej
    if ($invoice['content']) {
        foreach ($invoice['content'] as $item) {
            $tt_width[2] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", $item['description']));
            $tt_width[3] = $pdf->getTextWidth($font_size, $item['prodid']);
            $tt_width[4] = $pdf->getTextWidth($font_size, $item['content']);
            $tt_width[5] = $pdf->getTextWidth($font_size, $item['count']);
            $tt_width[6] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", moneyf($item['basevalue'])));
            $tt_width[7] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", moneyf($item['totalbase'])));
            $tt_width[8] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", $item['taxlabel']));
            $tt_width[9] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", moneyf($item['totaltax'])));
            $tt_width[10] = $pdf->getTextWidth($font_size, iconv("UTF-8", "ISO-8859-2", moneyf($item['total'])));
            for ($i = 2; $i <= 5; $i++) {
                if ($tt_width[$i] + 2 * margin + 2 > $t_width[$i]) {
                    $t_width[$i] = $tt_width[$i] + 2 * margin + 2;
                }
            }
        }
    }
    // Kolumna 2 b�dzie mia�a rozmiar ustalany dynamicznie
    $t_width[2] = $width - ($t_width[1] + $t_width[3] + $t_width[4] + $t_width[5] + $t_width[6] + $t_width[7] + $t_width[8] + $t_width[9] + $t_width[10] + 20 * $margin);
    $y = invoice_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
    $t_justify[10] = $t_justify[9] = $t_justify[8] = $t_justify[7] = $t_justify[6] = $t_justify[5] = "right";
    $lp = 1;
    if ($invoice['content']) {
        foreach ($invoice['content'] as $item) {
            $t_data[1] = $lp;
            $t_data[2] = iconv("UTF-8", "ISO-8859-2", $item['description']);
            $t_data[3] = $item['prodid'];
            $t_data[4] = $item['content'];
            $t_data[5] = $item['count'];
            $t_data[6] = iconv("UTF-8", "ISO-8859-2", moneyf($item['basevalue']));
            $t_data[7] = iconv("UTF-8", "ISO-8859-2", moneyf($item['totalbase']));
            $t_data[8] = iconv("UTF-8", "ISO-8859-2", $item['taxlabel']);
            $t_data[9] = iconv("UTF-8", "ISO-8859-2", moneyf($item['totaltax']));
            $t_data[10] = iconv("UTF-8", "ISO-8859-2", moneyf($item['total']));
            $lp++;
            $y = invoice_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
        }
    }
    $return[1] = $y;
    $x = $x + 12 * $margin + $t_width[1] + $t_width[2] + $t_width[3] + $t_width[4] + $t_width[5] + $t_width[6];
    $fy = $y - $margin - $pdf->GetFontHeight($font_size);
    text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2", trans('Total:')) . '</b>');
    $t_data[7] = iconv("UTF-8", "ISO-8859-2", moneyf($invoice['totalbase']));
    $t_data[8] = "<b>x</b>";
    $t_data[9] = iconv("UTF-8", "ISO-8859-2", moneyf($invoice['totaltax']));
    $t_data[10] = iconv("UTF-8", "ISO-8859-2", moneyf($invoice['total']));
    $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
    $y = $y - 5;
    $fy = $y - $margin - $pdf->GetFontHeight($font_size);
    text_align_right($x - $margin, $fy, $font_size, '<b>' . iconv("UTF-8", "ISO-8859-2", trans('in it:')) . '</b>');
    $pdf->line($x, $y, $x + $t_width[7] + $t_width[8] + $t_width[9] + $t_width[10] + 8 * $margin, $y);
    if ($invoice['taxest']) {
        foreach ($invoice['taxest'] as $item) {
            $t_data[7] = iconv("UTF-8", "ISO-8859-2", moneyf($item['base']));
            $t_data[8] = iconv("UTF-8", "ISO-8859-2", $item['taxlabel']);
            $t_data[9] = iconv("UTF-8", "ISO-8859-2", moneyf($item['tax']));
            $t_data[10] = iconv("UTF-8", "ISO-8859-2", moneyf($item['total']));
            $y = invoice_short_data_row($x, $y, $width, $font_size, $margin, $t_data, $t_width, $t_justify);
        }
    }
    $return[2] = $y;
    return $return;
}