2if (!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !==
true)
7Loc::loadMessages(__FILE__);
9<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
12<
title><?=Loc::getMessage(
'SALE_HPS_BILL_TITLE')?></
title>
13<meta
http-equiv=
"Content-Type" content=
"text/html; charset=<?=LANG_CHARSET?>">
14<
style type=
"text/css">
16 table.acc td { border: 1pt solid #000000; padding: 0pt 3pt; line-
height: 21pt; }
17 table.it td { border: 1pt solid #000000; padding: 0pt 3pt; }
18 table.sign td { font-weight: bold; vertical-
align: bottom; }
19 table.header td { padding: 0pt; vertical-
align:
top; }
35 if (intval(
$path) > 0)
37 if ($arFile = CFile::GetFileArray(
$path))
38 $path = $arFile[
'SRC'];
41 $backgroundStyle =
$params[
'BILL_BACKGROUND_STYLE'];
42 if (!in_array($backgroundStyle,
array(
'none',
'tile',
'stretch')))
43 $backgroundStyle =
'none';
47 switch ($backgroundStyle)
57 "url('%s') 0 0 repeat-y; background-size: %.02fpt %.02fpt",
66 'top' => intval(
$params[
'BILL_MARGIN_TOP'] ?: 15) * 72/25.4,
67 'right' => intval(
$params[
'BILL_MARGIN_RIGHT'] ?: 15) * 72/25.4,
68 'bottom' => intval(
$params[
'BILL_MARGIN_BOTTOM'] ?: 15) * 72/25.4,
69 'left' => intval(
$params[
'BILL_MARGIN_LEFT'] ?: 20) * 72/25.4
76<body
style=
"margin: 0pt; padding: 0pt; background: <?=$background; ?>"<?
if (
$_REQUEST[
'PRINT'] ==
'Y') { ?> onload=
"setTimeout(window.print, 0);"<? } ?>>
78<div
style=
"margin: 0pt; padding: <?=join('pt ', $margin); ?>pt; width: <?=$width; ?>pt; background: <?=$background; ?>">
80<?
if (
$params[
'BILL_HEADER_SHOW'] ==
'Y'):?>
81 <table
class=
"header">
83 <?
if (
$params[
"BILL_PATH_TO_LOGO"]) { ?>
84 <td
style=
"padding-right: 5pt; padding-bottom: 5pt; ">
85 <? $imgParams = CFile::_GetImgParams(
$params[
'BILL_PATH_TO_LOGO']);
86 $dpi = intval(
$params[
'BILL_LOGO_DPI']) ?: 96;
87 $imgWidth = $imgParams[
'WIDTH'] * 96 / $dpi;
91 <img src=
"<?=$imgParams['SRC']; ?>" width=
"<?=$imgWidth; ?>" />
96 if (
$params[
"SELLER_COMPANY_ADDRESS"]) {
104 <?
if (
$params[
"SELLER_COMPANY_PHONE"]) { ?>
112 if (
$params[
"SELLER_COMPANY_BANK_NAME"])
114 $sellerBankCity =
'';
115 if (
$params[
"SELLER_COMPANY_BANK_CITY"])
117 $sellerBankCity =
$params[
"SELLER_COMPANY_BANK_CITY"];
118 if (is_array($sellerBankCity))
119 $sellerBankCity = implode(
', ', $sellerBankCity);
121 $sellerBankCity = str_replace(
array(
"\r\n",
"\n",
"\r"),
', ', strval($sellerBankCity));
125 $params[
"SELLER_COMPANY_BANK_NAME"],
132 $rsPattern =
'/\s*\d{10,100}\s*/';
136 preg_match($rsPattern,
$params[
"SELLER_COMPANY_BANK_ACCOUNT"],
$matches);
141 <table
class=
"acc" width=
"100%">
150 <?
if (
$params[
"SELLER_COMPANY_INN"]) { ?>
157 <?
if (
$params[
"SELLER_COMPANY_KPP"]) { ?>
166 <?=Loc::getMessage(
"SALE_HPS_BILL_SELLER_ACC"); ?>
176 <?=Loc::getMessage(
'SALE_HPS_BILL_SELLER_NAME')?><br>
182 <?=Loc::getMessage(
'SALE_HPS_BILL_SELLER_BANK_NAME')?><br>
186 <?=Loc::getMessage(
'SALE_HPS_BILL_SELLER_BANK_BIK');?><br>
187 <?=Loc::getMessage(
'SALE_HPS_BILL_SELLER_ACC_CORR')?><br>
205<?
if (
$params[
'BILL_HEADER']):?>
208 <td
style=
"font-size: 2em; font-weight: bold; text-align: center">
216<?
if (
$params[
"BILL_ORDER_SUBJECT"]) { ?>
223<?
if (
$params[
"PAYMENT_DATE_PAY_BEFORE"]) { ?>
237if (
$params[
'BILL_PAYER_SHOW'] ==
'Y'):
238 if (
$params[
"BUYER_PERSON_COMPANY_NAME"]) {
240 if (
$params[
"BUYER_PERSON_COMPANY_INN"])
242 if (
$params[
"BUYER_PERSON_COMPANY_ADDRESS"])
244 $buyerAddr =
$params[
"BUYER_PERSON_COMPANY_ADDRESS"];
245 if (is_array($buyerAddr))
246 $buyerAddr = implode(
', ', $buyerAddr);
248 $buyerAddr = str_replace(
array(
"\r\n",
"\n",
"\r"),
', ', strval($buyerAddr));
251 if (
$params[
"BUYER_PERSON_COMPANY_PHONE"])
253 if (
$params[
"BUYER_PERSON_COMPANY_FAX"])
255 if (
$params[
"BUYER_PERSON_COMPANY_NAME_CONTACT"])
281 if (
$params[
'BILL_COLUMN_'.$column.
'_SHOW'] ==
'Y')
283 $caption =
$params[
'BILL_COLUMN_'.$column.
'_TITLE'];
285 if (in_array($column, [
'PRICE',
'SUM']))
287 $caption .=
', '.$currency;
292 'SORT' =>
$params[
'BILL_COLUMN_'.$column.
'_SORT']
303 'SORT' =>
$val[
'SORT']
308uasort(
$arCols,
function (
$a, $b) {
return (
$a[
'SORT'] < $b[
'SORT']) ? -1 : 1;});
315 foreach (
$params[
'BASKET_ITEMS'] as $basketItem)
317 $productName = $basketItem[
"NAME"];
318 if ($productName ==
"OrderDelivery")
319 $productName = Loc::getMessage(
'SALE_HPS_BILL_DELIVERY');
320 else if ($productName ==
"OrderDiscount")
321 $productName = Loc::getMessage(
'SALE_HPS_BILL_DISCOUNT');
323 if ($basketItem[
'IS_VAT_IN_PRICE'])
324 $basketItemPrice = $basketItem[
'PRICE'];
326 $basketItemPrice = $basketItem[
'PRICE']*(1 + $basketItem[
'VAT_RATE']);
329 foreach (
$arCols as $columnId => $caption)
345 $data = $basketItem[
"MEASURE_NAME"] ?
htmlspecialcharsbx($basketItem[
"MEASURE_NAME"]) : Loc::getMessage(
'SALE_HPS_BILL_BASKET_MEASURE_DEFAULT');
357 $data = ($basketItem[$columnId]) ?:
'';
364 if ($basketItem[
'PROPS'])
366 foreach ($basketItem[
'PROPS'] as $basketPropertyItem)
368 if ($basketPropertyItem[
'CODE'] ==
'CATALOG.XML_ID' || $basketPropertyItem[
'CODE'] ==
'PRODUCT.XML_ID')
373 $sum += doubleval($basketItem[
'PRICE'] * $basketItem[
'QUANTITY']);
374 $vat = max(
$vat, $basketItem[
'VAT_RATE']);
387if (
$params[
'DELIVERY_PRICE'] > 0)
389 $deliveryItem = Loc::getMessage(
'SALE_HPS_BILL_DELIVERY');
394 foreach (
$arCols as $columnId => $caption)
428if (
$params[
'BILL_TOTAL_SHOW'] ==
'Y')
444 foreach (
$params[
'TAXES'] as $tax)
452 ($tax[
"IS_IN_PRICE"] ==
"Y") ? Loc::getMessage(
'SALE_HPS_BILL_INCLUDING') :
"",
454 (
$vat <= 0 && $tax[
"IS_PERCENT"] ==
"Y")
481 if (
$params[
'DISCOUNT_PRICE'] > 0)
499<table
class=
"it" width=
"100%">
501 <?
foreach (
$arCols as $columnId => $col):?>
502 <td><?=$col[
'NAME'];?></td>
513 <?
foreach (
$arCols as $columnId => $col):?>
515 if (!is_null(
$cells[
$n][$columnId]))
517 if ($columnId ===
'NUMBER')
521 elseif ($columnId ===
'NAME')
524 <td
align=
"<?=($n > $cntBasketItem) ? 'right' : 'left';?>"
525 style=
"word-break: break-word; word-wrap: break-word; <? if ($accumulated) {?>border-width: 0pt 1pt 0pt 0pt; <? } ?>"
526 <?
if ($accumulated) { ?>colspan=
"<?=($accumulated+1); ?>"<? $accumulated = 0; } ?>>
529 <?
foreach (
$props[
$n] as $property) { ?>
531 <small><?=$property; ?></small>
538 if (!is_null(
$cells[
$n][$columnId]))
543 <?
if ($accumulated) { ?>
544 style=
"border-width: 0pt 1pt 0pt 0pt"
545 colspan=
"<?=(($columnId == 'VAT_RATE' && $vat <= 0) ? $accumulated : $accumulated+1); ?>"
546 <? $accumulated = 0; } ?>>
547 <?
if ($columnId ==
'SUM' || $columnId ==
'PRICE'):?>
548 <nobr><?=
$cells[
$n][$columnId];?></nobr>
573<?
if (
$params[
'BILL_TOTAL_SHOW'] ==
'Y'):?>
575 'SALE_HPS_BILL_BASKET_TOTAL',
606<b><?=Loc::getMessage(
'SALE_HPS_BILL_COND_COMM')?></b>
608 <?
if (
$params[
"BILL_COMMENT1"]) { ?>
610 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
612 ),
'',
array(), 0)); ?>
616 <?
if (
$params[
"BILL_COMMENT2"]) { ?>
618 array(
'#</div>\s*<div[^>]*>#i',
'#</?div>#i'),
array(
'<br>',
'<br>'),
620 ),
'',
array(), 0)); ?>
629<?
if (
$params[
'BILL_SIGN_SHOW'] ==
'Y'):?>
634 'style="position: absolute; left: 40pt; "'
638 <div
style=
"position: relative">
640 <?
if (
$params[
"SELLER_COMPANY_DIRECTOR_POSITION"]) { ?>
643 <td
style=
"width: 160pt; border: 1pt solid #000000; border-width: 0pt 0pt 1pt 0pt; text-align: center; ">
649 <?
if (
$params[
"SELLER_COMPANY_DIRECTOR_NAME"]) { ?>
654 <tr><td colspan=
"3">&
nbsp;</td></tr>
656 <?
if (
$params[
"SELLER_COMPANY_ACCOUNTANT_POSITION"]) { ?>
659 <td
style=
"width: 160pt; border: 1pt solid #000000; border-width: 0pt 0pt 1pt 0pt; text-align: center; ">
665 <?
if (
$params[
"SELLER_COMPANY_ACCOUNTANT_NAME"]) { ?>
static ShowImage($strImage, $iMaxW=0, $iMaxH=0, $sParams=null, $strImageUrl="", $bPopup=false, $sPopupTitle=false, $iSizeWHTTP=0, $iSizeHHTTP=0, $strImageUrlTemplate="")
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
<? if( $useEditor3):?>< tr class="heading">< td colspan="2"><? echo GetMessage("FILEMAN_OPTION_SPELL_SET");?></td ></tr ><? if(function_exists( 'pspell_config_create')):$use_pspell_checked=(COption::GetOptionString( $module_id, "use_pspell", "Y")=="Y") ? "checked" :"";?>< tr >< td valign="top">< label for="use_pspell"><?echo GetMessage("FILEMAN_OPTION_USE_PSPELL");?></label >< br >< a title="<?echo GetMessage("FILEMAN_OPTION_ADDISH_DICS_TITLE");?> http
ConvertDateTime($datetime, $to_format=false, $from_site=false, $bSearchInSitesOnly=false)
htmlspecialcharsback($str)
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
</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('BACKGROUND', false)) $margin
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
Number2Word_Rus($source, $IS_MONEY="Y", $currency="")