Ejemplo n.º 1
0
$margin = array('top' => intval(CSalePaySystemAction::GetParamValue('MARGIN_TOP', false) ?: 15) * 72 / 25.4, 'right' => intval(CSalePaySystemAction::GetParamValue('MARGIN_RIGHT', false) ?: 15) * 72 / 25.4, 'bottom' => intval(CSalePaySystemAction::GetParamValue('MARGIN_BOTTOM', false) ?: 15) * 72 / 25.4, 'left' => intval(CSalePaySystemAction::GetParamValue('MARGIN_LEFT', false) ?: 20) * 72 / 25.4);
$width = $pageWidth - $margin['left'] - $margin['right'];
$pdf->SetDisplayMode(100, 'continuous');
$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
$pdf->SetAutoPageBreak(true, $margin['bottom']);
$pdf->AddPage();
$y0 = $pdf->GetY();
$logoHeight = 0;
$logoWidth = 0;
if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false)) {
    list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false));
    $imgDpi = intval(CSalePaySystemAction::GetParamValue('LOGO_DPI', false)) ?: 96;
    $imgZoom = 96 / $imgDpi;
    $logoHeight = $imageHeight * $imgZoom + 5;
    $logoWidth = $imageWidth * $imgZoom + 5;
    $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false), $pdf->GetX(), $pdf->GetY(), -$imgDpi, -$imgDpi);
}
$pdf->Ln(10);
$pdf->SetFont($fontFamily, 'B', $fontSize * 3);
$pdf->SetX($pdf->GetX() + $logoWidth);
$pdf->MultiCell(0, 30, CSalePdf::prepareToPdf(CSalePaySystemAction::GetParamValue("SELLER_NAME", false)), 0, 'L');
$pdf->Ln();
$pdf->SetY(max($y0 + $logoHeight, $pdf->GetY()));
$pdf->Ln(10);
$pdf->SetFont($fontFamily, 'B', $fontSize - 2);
$seller = CSalePaySystemAction::GetParamValue("SELLER_NAME", false);
if (CSalePaySystemAction::GetParamValue("SELLER_ADDRESS", false)) {
    $seller .= ' - ';
    $seller .= CSalePaySystemAction::GetParamValue("SELLER_ADDRESS", false);
    $seller .= '  ';
}
Ejemplo n.º 2
0
$fontFamily = 'Font';
$fontSize = 10.5;
$margin = array('top' => intval(CSalePaySystemAction::GetParamValue('MARGIN_TOP') ?: 15) * 72 / 25.4, 'right' => intval(CSalePaySystemAction::GetParamValue('MARGIN_RIGHT') ?: 15) * 72 / 25.4, 'bottom' => intval(CSalePaySystemAction::GetParamValue('MARGIN_BOTTOM') ?: 15) * 72 / 25.4, 'left' => intval(CSalePaySystemAction::GetParamValue('MARGIN_LEFT') ?: 20) * 72 / 25.4);
$width = $pageWidth - $margin['left'] - $margin['right'];
$pdf->SetDisplayMode(100, 'continuous');
$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
$pdf->SetAutoPageBreak(true, $margin['bottom']);
$pdf->AddPage();
$y0 = $pdf->GetY();
$logoHeight = 0;
$logoWidth = 0;
if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO')) {
    list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'));
    $logoHeight = $imageHeight + 5;
    $logoWidth = $imageWidth + 5;
    $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'), $pdf->GetX(), $pdf->GetY());
}
$pdf->SetFont($fontFamily, 'B', $fontSize);
$pdf->SetX($pdf->GetX() + $logoWidth);
$pdf->Write(15, CSalePdf::prepareToPdf(CSalePaySystemAction::GetParamValue("SELLER_NAME")));
$pdf->Ln();
if (CSalePaySystemAction::GetParamValue("SELLER_ADDRESS")) {
    $pdf->SetX($pdf->GetX() + $logoWidth);
    $pdf->Write(15, CSalePdf::prepareToPdf(CSalePaySystemAction::GetParamValue("SELLER_ADDRESS")));
    $pdf->Ln();
}
if (CSalePaySystemAction::GetParamValue("SELLER_PHONE")) {
    $pdf->SetX($pdf->GetX() + $logoWidth);
    $pdf->Write(15, CSalePdf::prepareToPdf(sprintf("Tel.: %s", CSalePaySystemAction::GetParamValue("SELLER_PHONE"))));
    $pdf->Ln();
}
Ejemplo n.º 3
0
		CSalePdf::prepareToPdf(($vat <= 0 ? 'Ціна без ПДВ, ' : 'Ціна з ПДВ, ').$currency),
		CSalePdf::prepareToPdf('Ставка ПДВ'),
		CSalePdf::prepareToPdf(($vat <= 0 ? 'Сума без ПДВ, ' : 'Сума з ПДВ, ').$currency)
	);
	for ($i = 1; $i <= 7; $i++)
		$arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arColsCaption[$i]));

	for ($i = 1; $i <= 7; $i++)
		$arRowsWidth[$i] += 10;
	if (!$showVat)
		$arRowsWidth[6] = 0;
	$arRowsWidth[2] = $width - (array_sum($arRowsWidth)-$arRowsWidth[2]);
}
$pdf->Ln();

$x0 = $pdf->GetX();
$y0 = $pdf->GetY();

for ($i = 1; $i <= 7; $i++)
{
	if ($showVat || $i != 6)
		$pdf->Cell($arRowsWidth[$i], 20, $arColsCaption[$i], 0, 0, 'C');
	${"x$i"} = $pdf->GetX();
}

$pdf->Ln();

$y5 = $pdf->GetY();

$pdf->Line($x0, $y0, $x7, $y0);
for ($i = 0; $i <= 7; $i++)
Ejemplo n.º 4
0
    $arCurFormat = CCurrencyLang::GetCurrencyFormat($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"]);
    $currency = trim(str_replace('#', '', $arCurFormat['FORMAT_STRING']));
    $arColsCaption = array(1 => CSalePdf::prepareToPdf('№'), CSalePdf::prepareToPdf('Товар/Послуга'), CSalePdf::prepareToPdf('Кіл-сть'), CSalePdf::prepareToPdf('Од.'), CSalePdf::prepareToPdf(($vat <= 0 ? 'Ціна без ПДВ, ' : 'Ціна з ПДВ, ') . $currency), CSalePdf::prepareToPdf('Ставка ПДВ'), CSalePdf::prepareToPdf(($vat <= 0 ? 'Сума без ПДВ, ' : 'Сума з ПДВ, ') . $currency));
    for ($i = 1; $i <= 7; $i++) {
        $arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arColsCaption[$i]));
    }
    for ($i = 1; $i <= 7; $i++) {
        $arRowsWidth[$i] += 10;
    }
    if (!$showVat) {
        $arRowsWidth[6] = 0;
    }
    $arRowsWidth[2] = $width - (array_sum($arRowsWidth) - $arRowsWidth[2]);
}
$pdf->Ln();
$x0 = $pdf->GetX();
$y0 = $pdf->GetY();
for ($i = 1; $i <= 7; $i++) {
    if ($showVat || $i != 6) {
        $pdf->Cell($arRowsWidth[$i], 20, $arColsCaption[$i], 0, 0, 'C');
    }
    ${"x{$i}"} = $pdf->GetX();
}
$pdf->Ln();
$y5 = $pdf->GetY();
$pdf->Line($x0, $y0, $x7, $y0);
for ($i = 0; $i <= 7; $i++) {
    if ($showVat || $i != 6) {
        $pdf->Line(${"x{$i}"}, $y0, ${"x{$i}"}, $y5);
    }
}
Ejemplo n.º 5
0
$pdf->SetAutoPageBreak(true, $margin['bottom']);

$pdf->AddPage();

$y0 = $pdf->GetY();
$logoHeight = 0;
$logoWidth = 0;

if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'))
{
	list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'));

	$logoHeight = $imageHeight + 5;
	$logoWidth  = $imageWidth + 5;

	$pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'), $pdf->GetX(), $pdf->GetY());
}

$pdf->Ln(10);

$pdf->SetFont($fontFamily, 'B', $fontSize*3);

$pdf->SetX($pdf->GetX() + $logoWidth);
$pdf->MultiCell(0, 30, CSalePdf::prepareToPdf(CSalePaySystemAction::GetParamValue("SELLER_NAME")), 0, 'L');
$pdf->Ln();
$pdf->SetY(max($y0 + $logoHeight, $pdf->GetY()));

$pdf->Ln(10);


$pdf->SetFont($fontFamily, 'B', $fontSize-2);
Ejemplo n.º 6
0
$margin = array('top' => intval(CSalePaySystemAction::GetParamValue('MARGIN_TOP', false) ?: 15) * 72 / 25.4, 'right' => intval(CSalePaySystemAction::GetParamValue('MARGIN_RIGHT', false) ?: 15) * 72 / 25.4, 'bottom' => intval(CSalePaySystemAction::GetParamValue('MARGIN_BOTTOM', false) ?: 15) * 72 / 25.4, 'left' => intval(CSalePaySystemAction::GetParamValue('MARGIN_LEFT', false) ?: 20) * 72 / 25.4);
$width = $pageWidth - $margin['left'] - $margin['right'];
$pdf->SetDisplayMode(100, 'continuous');
$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
$pdf->SetAutoPageBreak(true, $margin['bottom']);
$pdf->AddPage();
$y0 = $pdf->GetY();
$logoHeight = 0;
$logoWidth = 0;
if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false)) {
    list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false));
    $imgDpi = intval(CSalePaySystemAction::GetParamValue('LOGO_DPI', false)) ?: 96;
    $imgZoom = 96 / $imgDpi;
    $logoHeight = $imageHeight * $imgZoom + 5;
    $logoWidth = $imageWidth * $imgZoom + 5;
    $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false), $pdf->GetX(), $pdf->GetY(), -$imgDpi, -$imgDpi);
}
$pdf->SetFont($fontFamily, 'B', $fontSize);
$sellerName = CSalePaySystemAction::GetParamValue("SELLER_NAME", false);
if ($sellerName) {
    list($string, $text) = $pdf->splitString(CSalePdf::prepareToPdf($sellerName), $width - 10);
    $pdf->Cell($width, 15, $string, 0, 0, 'R');
    $pdf->Ln();
}
$sellerAddress = CSalePaySystemAction::GetParamValue("SELLER_ADDRESS", false);
if ($sellerAddress) {
    list($string, $text) = $pdf->splitString(CSalePdf::prepareToPdf($sellerAddress), $width - 10);
    $pdf->Cell($width, 15, $string, 0, 0, 'R');
    $pdf->Ln();
}
$sellerPhone = CSalePaySystemAction::GetParamValue("SELLER_PHONE", false);