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;
177 array(
"DATE_INSERT" =>
"ASC",
"NAME" =>
"ASC"),
180 array(
"ID",
"PRICE",
"CURRENCY",
"QUANTITY",
"NAME",
"VAT_RATE",
"MEASURE_NAME")
184 $arColsCaption =
array(
197 for (
$i = 1;
$i <= 7;
$i++)
207 $arProdProps =
array();
209 array(
"SORT" =>
"ASC",
"ID" =>
"DESC"),
211 "BASKET_ID" => $arBasket[
"ID"],
212 "!CODE" =>
array(
"CATALOG.XML_ID",
"PRODUCT.XML_ID")
216 array(
"ID",
"BASKET_ID",
"NAME",
"VALUE",
"CODE",
"SORT")
218 while ($arBasketProps = $dbBasketProps->GetNext())
220 if (!empty($arBasketProps) && $arBasketProps[
"VALUE"] !=
"")
221 $arProdProps[] = $arBasketProps;
223 $arBasket[
"PROPS"] = $arProdProps;
226 if (isset($arBasket[
'VAT_INCLUDED']) && $arBasket[
'VAT_INCLUDED'] ===
'Y')
229 $arBasket[
"VATLESS_PRICE"] = $arBasket[
"PRICE"];
231 $productName = $arBasket[
"NAME"];
232 if ($productName ==
"OrderDelivery")
233 $productName =
"Shipping";
234 else if ($productName ==
"OrderDiscount")
235 $productName =
"Discount";
245 $arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"],
246 $arBasket[
"CURRENCY"],
252 foreach ($arBasket[
"PROPS"] as $vv)
255 for (
$i = 1;
$i <= 7;
$i++)
258 $sum += doubleval($arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"]);
259 $vat = max(
$vat, $arBasket[
"VAT_RATE"]);
260 if ($arBasket[
"VAT_RATE"] > 0)
262 if (!isset($vats[$arBasket[
"VAT_RATE"]]))
263 $vats[$arBasket[
"VAT_RATE"]] = 0;
264 $vats[$arBasket[
"VAT_RATE"]] += ($arBasket[
"PRICE"] - $arBasket[
"VATLESS_PRICE"]) * $arBasket[
"QUANTITY"];
269 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"]) > 0)
273 $sDeliveryItem =
"Shipping";
274 if ($arDelivery_tmp[
"NAME"] <>
'')
275 $sDeliveryItem .= sprintf(
" (%s)", $arDelivery_tmp[
"NAME"]);
282 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
283 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
288 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
289 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
294 for (
$i = 1;
$i <= 7;
$i++)
298 doubleval(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat)),
304 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] *
$vat / (1 +
$vat),
311 if (
$sum <
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"])
331 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"] -
$sum - array_sum($vats),
352 foreach ($vats as $vatRate => $vatSum)
366 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
377 array(
"APPLY_ORDER" =>
"ASC"),
391 (
$arTaxList[
"IS_IN_PRICE"] ==
"Y") ?
"Included " :
"",
397 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
406 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"]) > 0)
416 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"],
417 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
425 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"]) > 0)
435 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"],
436 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
452 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
453 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
460 for (
$i = 1;
$i <= 7;
$i++)
471for (
$i = 1;
$i <= 7;
$i++)
475 ${
"x$i"} =
$pdf->GetX();
483for (
$i = 0;
$i <= 7;
$i++)
495 for ($j = 1; $j <= 7; $j++)
499 $accumulated += $arRowsWidth_tmp[$j];
500 $arRowsWidth_tmp[$j] =
null;
504 $arRowsWidth_tmp[$j] += $accumulated;
517 $cellWidth = $arRowsWidth_tmp[2];
522 $cellWidth = $arRowsWidth_tmp[6];
530 $pdf->Cell($arRowsWidth_tmp[1], 15, (
$l == 0) ?
$arCells[
$n][1] :
'', 0, 0,
'C');
535 $pdf->Cell($arRowsWidth_tmp[2], 15, $string);
540 $pdf->Cell($arRowsWidth_tmp[3], 15, (
$l == 0) ?
$arCells[
$n][3] :
'', 0, 0,
'R');
545 $pdf->Cell($arRowsWidth_tmp[4], 15, (
$l == 0) ?
$arCells[
$n][4] :
'', 0, 0,
'R');
550 $pdf->Cell($arRowsWidth_tmp[5], 15, (
$l == 0) ?
$arCells[
$n][5] :
'', 0, 0,
'R');
556 $pdf->Cell($arRowsWidth_tmp[6], 15, $string, 0, 0,
'R');
558 $pdf->Cell($arRowsWidth_tmp[6], 15, (
$l == 0) ?
$arCells[
$n][6] :
'', 0, 0,
'R');
564 $pdf->Cell($arRowsWidth_tmp[7], 15, (
$l == 0) ?
$arCells[
$n][7] :
'', 0, 0,
'R');
571 if (isset($arProps[
$n]) && is_array($arProps[
$n]))
574 foreach ($arProps[
$n] as $property)
576 $pdf->Cell($arRowsWidth_tmp[1], 12,
'');
577 $pdf->Cell($arRowsWidth_tmp[2], 12, $property);
578 $pdf->Cell($arRowsWidth_tmp[3], 12,
'');
579 $pdf->Cell($arRowsWidth_tmp[4], 12,
'');
580 $pdf->Cell($arRowsWidth_tmp[5], 12,
'');
582 $pdf->Cell($arRowsWidth_tmp[6], 12,
'');
583 $pdf->Cell($arRowsWidth_tmp[7], 12,
'', 0, 1);
617 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
627 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
643 if ($stampHeight && $stampWidth)
645 if ($stampHeight > 120 || $stampWidth > 120)
647 $ratio = 120 / max($stampHeight, $stampWidth);
648 $stampHeight = $ratio * $stampHeight;
649 $stampWidth = $ratio * $stampWidth;
655 $stampWidth, $stampHeight
681 "Account Name: %s\n",
692 if (
$bank || $bankAddr || $bankPhone)
711 $pdf->MultiCell(
$width/2, 15, $bankDetails, 0,
'L');
724 if ($signHeight && $signWidth)
726 $ratio = min(37.5/$signHeight, 150/$signWidth);
727 $signHeight = $ratio * $signHeight;
728 $signWidth = $ratio * $signWidth;
745 $pdf->Cell(0, 15,
'',
'B');
751 $pdf->GetX() - 150,
$pdf->GetY() - $signHeight + 15,
752 $signWidth, $signHeight
770 if ($signHeight && $signWidth)
772 $ratio = min(37.5/$signHeight, 150/$signWidth);
773 $signHeight = $ratio * $signHeight;
774 $signWidth = $ratio * $signWidth;
791 $pdf->Cell(0, 15,
'',
'B');
797 $pdf->GetX() - 150,
$pdf->GetY() - $signHeight + 15,
798 $signWidth, $signHeight
815 'Invoice # %s (Issue Date %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(!empty($sellerData)) $bankAccNo
if(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
if(!empty($sellerData)) $dest
$arPaySysAction["ENCODING"]
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
$GLOBALS['_____370096793']