1<?
if (!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !==
true)
die();?><?
4if (!is_array($arOrder))
26$pdf->AddFont(
'Font',
'',
'pt_sans-regular.ttf',
true);
27$pdf->AddFont(
'Font',
'B',
'pt_sans-bold.ttf',
true);
41$pdf->SetDisplayMode(100,
'continuous');
56 $imgZoom = 96 / $imgDpi;
124 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"ACCOUNT_NUMBER"]
162 array(
"DATE_INSERT" =>
"ASC",
"NAME" =>
"ASC"),
165 array(
"ID",
"PRICE",
"CURRENCY",
"QUANTITY",
"NAME",
"VAT_RATE",
"MEASURE_NAME")
169 $arColsCaption =
array(
182 for (
$i = 1;
$i <= 7;
$i++)
192 $arProdProps =
array();
194 array(
"SORT" =>
"ASC",
"ID" =>
"DESC"),
196 "BASKET_ID" => $arBasket[
"ID"],
197 "!CODE" =>
array(
"CATALOG.XML_ID",
"PRODUCT.XML_ID")
201 array(
"ID",
"BASKET_ID",
"NAME",
"VALUE",
"CODE",
"SORT")
203 while ($arBasketProps = $dbBasketProps->GetNext())
205 if (!empty($arBasketProps) && $arBasketProps[
"VALUE"] !=
"")
206 $arProdProps[] = $arBasketProps;
208 $arBasket[
"PROPS"] = $arProdProps;
211 if (isset($arBasket[
'VAT_INCLUDED']) && $arBasket[
'VAT_INCLUDED'] ===
'Y')
214 $arBasket[
"VATLESS_PRICE"] = $arBasket[
"PRICE"];
216 $productName = $arBasket[
"NAME"];
217 if ($productName ==
"OrderDelivery")
218 $productName =
"Schifffahrt";
219 else if ($productName ==
"OrderDiscount")
220 $productName =
"Rabatt";
230 $arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"],
231 $arBasket[
"CURRENCY"],
237 foreach ($arBasket[
"PROPS"] as $vv)
240 for (
$i = 1;
$i <= 7;
$i++)
243 $sum += doubleval($arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"]);
244 $vat = max(
$vat, $arBasket[
"VAT_RATE"]);
245 if ($arBasket[
"VAT_RATE"] > 0)
247 if (!isset($vats[$arBasket[
"VAT_RATE"]]))
248 $vats[$arBasket[
"VAT_RATE"]] = 0;
249 $vats[$arBasket[
"VAT_RATE"]] += ($arBasket[
"PRICE"] - $arBasket[
"VATLESS_PRICE"]) * $arBasket[
"QUANTITY"];
254 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"]) > 0)
258 $sDeliveryItem =
"Schifffahrt";
259 if ($arDelivery_tmp[
"NAME"] <>
'')
260 $sDeliveryItem .= sprintf(
" (%s)", $arDelivery_tmp[
"NAME"]);
267 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
268 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
273 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
274 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
279 for (
$i = 1;
$i <= 7;
$i++)
283 doubleval(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat)),
289 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] *
$vat / (1 +
$vat),
296 if (
$sum <
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"])
315 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"] -
$sum - array_sum($vats),
336 foreach ($vats as $vatRate => $vatSum)
350 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
361 array(
"APPLY_ORDER" =>
"ASC"),
375 (
$arTaxList[
"IS_IN_PRICE"] ==
"Y") ?
"inkl." :
"zzgl.",
381 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
390 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"]) > 0)
400 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"],
401 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
409 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"]) > 0)
419 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"],
420 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
436 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
437 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
444 for (
$i = 1;
$i <= 7;
$i++)
455for (
$i = 1;
$i <= 7;
$i++)
459 ${
"x$i"} =
$pdf->GetX();
467for (
$i = 0;
$i <= 7;
$i++)
479 for ($j = 1; $j <= 7; $j++)
483 $accumulated += $arRowsWidth_tmp[$j];
484 $arRowsWidth_tmp[$j] =
null;
488 $arRowsWidth_tmp[$j] += $accumulated;
501 $cellWidth = $arRowsWidth_tmp[2];
506 $cellWidth = $arRowsWidth_tmp[6];
514 $pdf->Cell($arRowsWidth_tmp[1], 15, (
$l == 0) ?
$arCells[
$n][1] :
'', 0, 0,
'C');
519 $pdf->Cell($arRowsWidth_tmp[2], 15, $string);
524 $pdf->Cell($arRowsWidth_tmp[3], 15, (
$l == 0) ?
$arCells[
$n][3] :
'', 0, 0,
'R');
529 $pdf->Cell($arRowsWidth_tmp[4], 15, (
$l == 0) ?
$arCells[
$n][4] :
'', 0, 0,
'R');
534 $pdf->Cell($arRowsWidth_tmp[5], 15, (
$l == 0) ?
$arCells[
$n][5] :
'', 0, 0,
'R');
540 $pdf->Cell($arRowsWidth_tmp[6], 15, $string, 0, 0,
'R');
542 $pdf->Cell($arRowsWidth_tmp[6], 15, (
$l == 0) ?
$arCells[
$n][6] :
'', 0, 0,
'R');
548 $pdf->Cell($arRowsWidth_tmp[7], 15, (
$l == 0) ?
$arCells[
$n][7] :
'', 0, 0,
'R');
555 if (isset($arProps[
$n]) && is_array($arProps[
$n]))
558 foreach ($arProps[
$n] as $property)
560 $pdf->Cell($arRowsWidth_tmp[1], 12,
'');
561 $pdf->Cell($arRowsWidth_tmp[2], 12, $property);
562 $pdf->Cell($arRowsWidth_tmp[3], 12,
'');
563 $pdf->Cell($arRowsWidth_tmp[4], 12,
'');
564 $pdf->Cell($arRowsWidth_tmp[5], 12,
'');
566 $pdf->Cell($arRowsWidth_tmp[6], 12,
'');
567 $pdf->Cell($arRowsWidth_tmp[7], 12,
'', 0, 1);
597 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
607 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
621 if ($stampHeight && $stampWidth)
623 if ($stampHeight > 120 || $stampWidth > 120)
625 $ratio = 120 / max($stampHeight, $stampWidth);
626 $stampHeight = $ratio * $stampHeight;
627 $stampWidth = $ratio * $stampWidth;
633 $stampWidth, $stampHeight
645 if ($signHeight && $signWidth)
647 $ratio = min(37.5/$signHeight, 150/$signWidth);
648 $signHeight = $ratio * $signHeight;
649 $signWidth = $ratio * $signWidth;
656 if ($isDirSign &&
$pdf->GetStringWidth($sellerDirPos) <= 160)
657 $pdf->SetY(
$pdf->GetY() + min($signHeight, 30) - 15);
658 $pdf->MultiCell(150, 15, $sellerDirPos, 0,
'L');
665 $pdf->GetX() + 80 - $signWidth/2,
$pdf->GetY() - $signHeight + 15,
666 $signWidth, $signHeight
671 $pdf->Cell(160, 15,
'');
691 if ($signHeight && $signWidth)
693 $ratio = min(37.5/$signHeight, 150/$signWidth);
694 $signHeight = $ratio * $signHeight;
695 $signWidth = $ratio * $signWidth;
703 $pdf->SetY(
$pdf->GetY() + min($signHeight, 30) - 15);
704 $pdf->MultiCell(150, 15, $sellerAccPos, 0,
'L');
711 $pdf->GetX() + 80 - $signWidth/2,
$pdf->GetY() - $signHeight + 15,
712 $signWidth, $signHeight
826 'Rechnung Nr. %s (Datum %s).pdf',
827 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"ACCOUNT_NUMBER"],
static GetParamValue($key, $defaultValue=null)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetPropsList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetList($arOrder=array("TAX_NAME"=> "ASC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static prepareToPdf($string)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
ConvertDateTime($datetime, $to_format=false, $from_site=false, $bSearchInSitesOnly=false)
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
for( $i=0, $max=count( $arBasketIDs);$i< $max;$i++) if($arOrder['DELIVERY_VAT_RATE'] > 0) if(is_array( $arBasketOrder) &&!empty( $arBasketOrder)) if(floatval($arOrder["DISCOUNT_VALUE"]) > 0) $arTaxList
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if( $arBasket=$dbBasket->Fetch()) if($vat > 0) $rowsCnt
if(CSalePaySystemAction::GetParamValue("DATE_PAY_BEFORE", false)) $dbBasket
if(!empty($sellerData)) $bankAccNo
if(!empty($bankData)) $sellerEuInn
if(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
for($n=1; $n<=$rowsCnt; $n++) if(CSalePaySystemAction::GetParamValue("COMMENT1", false)||CSalePaySystemAction::GetParamValue("COMMENT2", false)) if(! $blank) if(CSalePaySystemAction::GetParamValue("SELLER_DIR_POS", false)) if(CSalePaySystemAction::GetParamValue("SELLER_ACC_POS", false)) $sellerName
if(!empty($sellerData)) $sellerPhone
if(!empty($sellerData)) $dest
$arPaySysAction["ENCODING"]
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
$GLOBALS['_____370096793']