1<?
if (!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !==
true)
die();?><?
3if (!is_array($arOrder))
22$pdf->AddFont(
'Font',
'',
'pt_sans-regular.ttf',
true);
23$pdf->AddFont(
'Font',
'B',
'pt_sans-bold.ttf',
true);
37$pdf->SetDisplayMode(100,
'continuous');
168 array(
"NAME" =>
"ASC"),
173 $arColsCaption =
array(
186 for (
$i = 1;
$i <= 7;
$i++)
196 $arProdProps =
array();
198 array(
"SORT" =>
"ASC",
"ID" =>
"DESC"),
200 "BASKET_ID" => $arBasket[
"ID"],
201 "!CODE" =>
array(
"CATALOG.XML_ID",
"PRODUCT.XML_ID")
205 array(
"ID",
"BASKET_ID",
"NAME",
"VALUE",
"CODE",
"SORT")
207 while ($arBasketProps = $dbBasketProps->GetNext())
209 if (!empty($arBasketProps) && $arBasketProps[
"VALUE"] !=
"")
210 $arProdProps[] = $arBasketProps;
212 $arBasket[
"PROPS"] = $arProdProps;
225 $arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"],
226 $arBasket[
"CURRENCY"],
232 foreach ($arBasket[
"PROPS"] as $vv)
235 for (
$i = 1;
$i <= 7;
$i++)
238 $sum += doubleval($arBasket[
"VATLESS_PRICE"] * $arBasket[
"QUANTITY"]);
239 $vat = max(
$vat, $arBasket[
"VAT_RATE"]);
240 if ($arBasket[
"VAT_RATE"] > 0)
242 if (!isset($vats[$arBasket[
"VAT_RATE"]]))
243 $vats[$arBasket[
"VAT_RATE"]] = 0;
244 $vats[$arBasket[
"VAT_RATE"]] += ($arBasket[
"PRICE"] - $arBasket[
"VATLESS_PRICE"]) * $arBasket[
"QUANTITY"];
249 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"]) > 0)
253 $sDeliveryItem =
"Shipping";
254 if (strlen($arDelivery_tmp[
"NAME"]) > 0)
255 $sDeliveryItem .= sprintf(
" (%s)", $arDelivery_tmp[
"NAME"]);
262 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
263 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
268 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat),
269 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
274 for (
$i = 1;
$i <= 7;
$i++)
278 doubleval(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] / (1 +
$vat)),
284 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE_DELIVERY"] *
$vat / (1 +
$vat),
291 if (
$sum <
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"])
311 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"PRICE"] -
$sum - array_sum($vats),
332 foreach ($vats as $vatRate => $vatSum)
346 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
357 array(
"APPLY_ORDER" =>
"ASC"),
371 (
$arTaxList[
"IS_IN_PRICE"] ==
"Y") ?
"Included " :
"",
377 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
386 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"]) > 0)
396 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SUM_PAID"],
397 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
405 if (DoubleVal(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"]) > 0)
415 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DISCOUNT_VALUE"],
416 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
432 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"],
433 $GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"],
440 for (
$i = 1;
$i <= 7;
$i++)
451for (
$i = 1;
$i <= 7;
$i++)
455 ${
"x$i"} =
$pdf->GetX();
463for (
$i = 0;
$i <= 7;
$i++)
475 for ($j = 1; $j <= 7; $j++)
479 $accumulated += $arRowsWidth_tmp[$j];
480 $arRowsWidth_tmp[$j] =
null;
484 $arRowsWidth_tmp[$j] += $accumulated;
497 $cellWidth = $arRowsWidth_tmp[2];
502 $cellWidth = $arRowsWidth_tmp[6];
507 $pos = (
$pdf->GetStringWidth(
$text) > $cellWidth)
511 $pos = strlen(
$text);
514 $pdf->Cell($arRowsWidth_tmp[1], 15, (
$l == 0) ?
$arCells[
$n][1] :
'', 0, 0,
'C');
519 $pdf->Cell($arRowsWidth_tmp[2], 15, substr(
$text, 0, $pos));
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, substr(
$text, 0, $pos), 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');
557 if (isset($arProps[
$n]) && is_array($arProps[
$n]))
560 foreach ($arProps[
$n] as $property)
562 $pdf->Cell($arRowsWidth_tmp[1], 12,
'');
563 $pdf->Cell($arRowsWidth_tmp[2], 12, $property);
564 $pdf->Cell($arRowsWidth_tmp[3], 12,
'');
565 $pdf->Cell($arRowsWidth_tmp[4], 12,
'');
566 $pdf->Cell($arRowsWidth_tmp[5], 12,
'');
568 $pdf->Cell($arRowsWidth_tmp[6], 12,
'');
569 $pdf->Cell($arRowsWidth_tmp[7], 12,
'', 0, 1);
603 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
613 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
649 "Account Name: %s\n",
660 if (
$bank || $bankAddr || $bankPhone)
679 $pdf->MultiCell(
$width/2, 15, $bankDetails, 0,
'L');
690 if ($signHeight && $signWidth)
692 $ratio = min(37.5/$signHeight, 150/$signWidth);
693 $signHeight = $ratio * $signHeight;
694 $signWidth = $ratio * $signWidth;
711 $pdf->Cell(0, 15,
'',
'B');
717 $pdf->GetX() - 150,
$pdf->GetY() - $signHeight + 15,
718 $signWidth, $signHeight
733 if ($signHeight && $signWidth)
735 $ratio = min(37.5/$signHeight, 150/$signWidth);
736 $signHeight = $ratio * $signHeight;
737 $signWidth = $ratio * $signWidth;
754 $pdf->Cell(0, 15,
'',
'B');
760 $pdf->GetX() - 150,
$pdf->GetY() - $signHeight + 15,
761 $signWidth, $signHeight
777 'Invoice # %s (Issue Date %s).pdf',
778 $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
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
$GLOBALS['_____370096793']