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');
57 $imgZoom = 96 / $imgDpi;
98 $rsPattern =
'/\s*\d{10,100}\s*/';
199 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"ACCOUNT_NUMBER"],
257 array(
"DATE_INSERT" =>
"ASC",
"NAME" =>
"ASC"),
260 array(
"ID",
"PRICE",
"CURRENCY",
"QUANTITY",
"NAME",
"VAT_RATE",
"MEASURE_NAME")
264 $arCurFormat = CCurrencyLang::GetCurrencyFormat(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"]);
267 $arColsCaption =
array(
280 for (
$i = 1;
$i <= 7;
$i++)
289 $arProdProps =
array();
291 array(
"SORT" =>
"ASC",
"ID" =>
"DESC"),
293 "BASKET_ID" => $arBasket[
"ID"],
294 "!CODE" =>
array(
"CATALOG.XML_ID",
"PRODUCT.XML_ID")
298 array(
"ID",
"BASKET_ID",
"NAME",
"VALUE",
"CODE",
"SORT")
300 while ($arBasketProps = $dbBasketProps->GetNext())
302 if (!empty($arBasketProps) && $arBasketProps[
"VALUE"] !=
"")
303 $arProdProps[] = $arBasketProps;
305 $arBasket[
"PROPS"] = $arProdProps;
307 $productName = $arBasket[
"NAME"];
308 if ($productName ==
"OrderDelivery")
309 $productName =
"Доставка";
310 else if ($productName ==
"OrderDiscount")
311 $productName =
"Скидка";
321 $arBasket[
"PRICE"] * $arBasket[
"QUANTITY"],
322 $arBasket[
"CURRENCY"],
328 foreach ($arBasket[
"PROPS"] as $vv)
331 for (
$i = 1;
$i <= 7;
$i++)
334 $sum += doubleval($arBasket[
"PRICE"] * $arBasket[
"QUANTITY"]);
335 $vat = max(
$vat, $arBasket[
"VAT_RATE"]);
339 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"]) > 0)
343 $sDeliveryItem =
"Доставка";
344 if ($arDelivery_tmp[
"NAME"] <>
'')
345 $sDeliveryItem .= sprintf(
" (%s)", $arDelivery_tmp[
"NAME"]);
352 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"],
353 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
358 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"],
359 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
364 for (
$i = 1;
$i <= 7;
$i++)
367 $sum += doubleval(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"]);
372 if (
$sum <
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"])
389 array(
"APPLY_ORDER" =>
"ASC"),
405 (
$arTaxList[
"IS_IN_PRICE"] ==
"Y") ?
"В том числе " :
"",
413 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
436 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"]) > 0)
446 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"],
447 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
455 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"]) > 0)
465 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"],
466 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
482 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
483 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
490 for (
$i = 1;
$i <= 7;
$i++)
501for (
$i = 1;
$i <= 7;
$i++)
505 ${
"x$i"} =
$pdf->GetX();
513for (
$i = 0;
$i <= 7;
$i++)
525 for ($j = 1; $j <= 7; $j++)
529 $accumulated += $arRowsWidth_tmp[$j];
530 $arRowsWidth_tmp[$j] =
null;
534 $arRowsWidth_tmp[$j] += $accumulated;
547 $cellWidth = $arRowsWidth_tmp[2];
552 $cellWidth = $arRowsWidth_tmp[6];
560 $pdf->Cell($arRowsWidth_tmp[1], 15, (
$l == 0) ?
$arCells[
$n][1] :
'', 0, 0,
'C');
565 $pdf->Cell($arRowsWidth_tmp[2], 15, $string);
570 $pdf->Cell($arRowsWidth_tmp[3], 15, (
$l == 0) ?
$arCells[
$n][3] :
'', 0, 0,
'R');
575 $pdf->Cell($arRowsWidth_tmp[4], 15, (
$l == 0) ?
$arCells[
$n][4] :
'', 0, 0,
'R');
580 $pdf->Cell($arRowsWidth_tmp[5], 15, (
$l == 0) ?
$arCells[
$n][5] :
'', 0, 0,
'R');
587 $pdf->Cell($arRowsWidth_tmp[6], 15, $string, 0, 0,
'R');
589 $pdf->Cell($arRowsWidth_tmp[6], 15, (
$l == 0) ?
$arCells[
$n][6] :
'', 0, 0,
'R');
595 $pdf->Cell($arRowsWidth_tmp[7], 15, (
$l == 0) ?
$arCells[
$n][7] :
'', 0, 0,
'R');
602 if (isset($arProps[
$n]) && is_array($arProps[
$n]))
605 foreach ($arProps[
$n] as $property)
607 $pdf->Cell($arRowsWidth_tmp[1], 12,
'');
608 $pdf->Cell($arRowsWidth_tmp[2], 12, $property);
609 $pdf->Cell($arRowsWidth_tmp[3], 12,
'');
610 $pdf->Cell($arRowsWidth_tmp[4], 12,
'');
611 $pdf->Cell($arRowsWidth_tmp[5], 12,
'');
613 $pdf->Cell($arRowsWidth_tmp[6], 12,
'');
614 $pdf->Cell($arRowsWidth_tmp[7], 12,
'', 0, 1);
635 "Всего наименований %s, на сумму %s",
638 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
639 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
646if (in_array(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
array(
"RUR",
"RUB")))
653 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
654 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
671 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
681 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
696 if ($stampHeight && $stampWidth)
698 if ($stampHeight > 120 || $stampWidth > 120)
700 $ratio = 120 / max($stampHeight, $stampWidth);
701 $stampHeight = $ratio * $stampHeight;
702 $stampWidth = $ratio * $stampWidth;
708 $stampWidth, $stampHeight
723 if ($signHeight && $signWidth)
725 $ratio = min(37.5/$signHeight, 150/$signWidth);
726 $signHeight = $ratio * $signHeight;
727 $signWidth = $ratio * $signWidth;
734 if ($isDirSign &&
$pdf->GetStringWidth($sellerDirPos) <= 160)
735 $pdf->SetY(
$pdf->GetY() + min($signHeight, 30) - 15);
736 $pdf->MultiCell(150, 15, $sellerDirPos, 0,
'L');
743 $pdf->GetX() + 80 - $signWidth/2,
$pdf->GetY() - $signHeight + 15,
744 $signWidth, $signHeight
749 $pdf->Cell(160, 15,
'');
769 if ($signHeight && $signWidth)
771 $ratio = min(37.5/$signHeight, 150/$signWidth);
772 $signHeight = $ratio * $signHeight;
773 $signWidth = $ratio * $signWidth;
781 $pdf->SetY(
$pdf->GetY() + min($signHeight, 30) - 15);
782 $pdf->MultiCell(150, 15, $sellerAccPos, 0,
'L');
789 $pdf->GetX() + 80 - $signWidth/2,
$pdf->GetY() - $signHeight + 15,
790 $signWidth, $signHeight
815 'Schet No %s ot %s.pdf',
816 $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(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
if(!empty($sellerData)) $dest
$arPaySysAction["ENCODING"]
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
Number2Word_Rus($source, $IS_MONEY="Y", $currency="")
$GLOBALS['_____370096793']