1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
template.php
См. документацию.
1<?
2if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
3 die();
4
6
7Loc::loadMessages(__FILE__);
8?>
9<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
10<html>
11<head>
12<title><?=Loc::getMessage('SALE_HPS_BILLKZ_TITLE')?></title>
13<meta http-equiv="Content-Type" content="text/html; charset=<?=LANG_CHARSET?>">
14<style type="text/css">
15 table { border-collapse: collapse; }
16 table.acc td { border: 1pt solid #000000; padding: 0 3pt; line-height: 16pt; }
17 table.acc tr.ntb td { border-top-style: none; }
18 table.acc tr.nbb td { border-bottom-style: none; }
19 table.selbuy td { border: 0 none transparent; padding: 0 3pt; line-height: 16pt; vertical-align: top;}
20 table.it td { border: 1pt solid #000000; padding: 0 3pt; }
21 table.sign td { vertical-align: bottom; height: 50px;}
22 table.header td { padding: 0; vertical-align: top; }
23</style>
24</head>
25
26<?
27
28if ($_REQUEST['BLANK'] == 'Y')
29 $blank = true;
30
31$pageWidth = 595.28;
32$pageHeight = 841.89;
33
34$background = '#ffffff';
35if ($params['BILLKZ_BACKGROUND'])
36{
37 $path = $params['BILLKZ_BACKGROUND'];
38 if (intval($path) > 0)
39 {
40 if ($arFile = CFile::GetFileArray($path))
41 $path = $arFile['SRC'];
42 }
43
44 $backgroundStyle = $params['BILLKZ_BACKGROUND_STYLE'];
45 if (!in_array($backgroundStyle, array('none', 'tile', 'stretch')))
46 $backgroundStyle = 'none';
47
48 if ($path)
49 {
50 switch ($backgroundStyle)
51 {
52 case 'none':
53 $background = "url('" . $path . "') 0 0 no-repeat";
54 break;
55 case 'tile':
56 $background = "url('" . $path . "') 0 0 repeat";
57 break;
58 case 'stretch':
59 $background = sprintf(
60 "url('%s') 0 0 repeat-y; background-size: %.02fpt %.02fpt",
62 );
63 break;
64 }
65 }
66}
67
69 'top' => intval($params['BILLKZ_MARGIN_TOP'] ?: 15) * 72/25.4,
70 'right' => intval($params['BILLKZ_MARGIN_RIGHT'] ?: 15) * 72/25.4,
71 'bottom' => intval($params['BILLKZ_MARGIN_BOTTOM'] ?: 15) * 72/25.4,
72 'left' => intval($params['BILLKZ_MARGIN_LEFT'] ?: 20) * 72/25.4
73);
74
75$width = $pageWidth - $margin['left'] - $margin['right'];
76
77?>
78
79<body style="margin: 0pt; padding: 0pt; background: <?=$background; ?>"<? if ($_REQUEST['PRINT'] == 'Y') { ?> onload="setTimeout(window.print, 0);"<? } ?>>
80
81<div style="margin: 0pt; padding: <?=join('pt ', $margin); ?>pt; width: <?=$width; ?>pt; background: <?=$background; ?>">
82
83<?if ($params['BILLKZ_HEADER_SHOW'] == 'Y'):?>
84 <? if ($params["BILLKZ_PATH_TO_LOGO"] || $params["BILLKZ_COMMENT1"] || $params["BILLKZ_COMMENT2"]) { ?>
85 <table class="header" style="margin-bottom: 10pt; width: 100%">
86 <tr>
87 <td style="min-width: 80pt; padding-right: 5pt; padding-bottom: 5pt; ">
88 <? if ($params["BILLKZ_PATH_TO_LOGO"]) { ?>
89 <? $imgParams = CFile::_GetImgParams($params['BILLKZ_PATH_TO_LOGO']);
90 $dpi = intval($params['BILLKZ_LOGO_DPI']) ?: 96;
91 $imgWidth = $imgParams['WIDTH'] * 96 / $dpi;
92 if ($imgWidth > $pageWidth)
93 $imgWidth = $pageWidth * 0.6;
94 ?>
95 <img src="<?=$imgParams['SRC']; ?>" width="<?=$imgWidth; ?>" />
96 <? } ?>
97 </td>
98 <? if ($params["BILLKZ_COMMENT1"] || $params["BILLKZ_COMMENT2"]) { ?>
99 <td style="width: 10pt;"></td>
100 <td style="text-align: center; vertical-align: middle;">
101 <? if ($params["BILLKZ_COMMENT1"]) { ?>
102 <?=nl2br(HTMLToTxt(preg_replace(
103 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
104 htmlspecialcharsback($params["BILLKZ_COMMENT1"])
105 ), '', array(), 0)); ?>
106 <? if ($params["BILLKZ_COMMENT2"]) { ?>
107 <br><br>
108 <? } ?>
109 <? } ?>
110 <? if ($params["BILLKZ_COMMENT2"]) { ?>
111 <?=nl2br(HTMLToTxt(preg_replace(
112 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
113 htmlspecialcharsback($params["BILLKZ_COMMENT2"])
114 ), '', array(), 0)); ?>
115 <? } ?>
116 </td>
117 <? } ?>
118 </tr>
119 </table>
120 <? } ?>
121
122 <?
123 if ($params["SELLER_COMPANY_BANK_NAME"])
124 {
125 $sellerBankCity = '';
126 if ($params["SELLER_COMPANY_BANK_CITY"])
127 {
128 $sellerBankCity = $params["SELLER_COMPANY_BANK_CITY"];
129 if (is_array($sellerBankCity))
130 $sellerBankCity = implode(', ', $sellerBankCity);
131 else
132 $sellerBankCity = str_replace(array("\r\n", "\n", "\r"), ', ', strval($sellerBankCity));
133 }
134 $sellerBank = sprintf(
135 "%s %s",
136 $params["SELLER_COMPANY_BANK_NAME"],
137 $sellerBankCity
138 );
139 $sellerRs = $params["SELLER_COMPANY_BANK_IIK"];
140 }
141 else
142 {
143 $rsPattern = '/\s*\d{10,100}\s*/';
144
145 $sellerBank = trim(preg_replace($rsPattern, ' ', $params["SELLER_COMPANY_BANK_IIK"]));
146
147 preg_match($rsPattern, $params["SELLER_COMPANY_BANK_IIK"], $matches);
148 $sellerRs = trim($matches[0]);
149 }
150
151 ?>
152 <table class="acc" width="100%">
153 <colgroup>
154 <col width="56%">
155 <col width="19%">
156 <col width="6%">
157 <col width="19%">
158 </colgroup>
159 <tr class="nbb">
160 <td><b><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_BENEFICIARY') ?>:</nobr></b></td>
161 <td colspan="2" style="text-align: center;"><b><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_IIK') ?></nobr></b></td>
162 <td style="text-align: center;"><b><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_KBE') ?></nobr></b></td>
163 </tr>
164 <tr class="ntb nbb">
165 <td><b><?= htmlspecialcharsbx($params["SELLER_COMPANY_NAME"]) ?></b></td>
166 <td colspan="2" style="text-align: center;"><?= $sellerRs ? htmlspecialcharsbx($sellerRs) : '&nbsp;' ?></td>
167 <td style="text-align: center;"><?= $params["SELLER_COMPANY_KBE"] ? htmlspecialcharsbx($params["SELLER_COMPANY_KBE"]) : '&nbsp;' ?></td>
168 </tr>
169 <tr class="ntb">
170 <td><?= $params["SELLER_COMPANY_BIN"] ? Loc::getMessage('SALE_HPS_BILLKZ_BIN').': '.htmlspecialcharsbx($params["SELLER_COMPANY_BIN"]) : '&nbsp;' ?></td>
171 <td colspan="2">&nbsp;</td>
172 <td>&nbsp;</td>
173 </tr>
174 <tr class="ntb nbb">
175 <td><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_BENEFICIARY_BANK') ?>:</nobr></td>
176 <td style="text-align: center;"><b><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_SELLER_BANK_BIK') ?></nobr></b></td>
177 <td colspan="2" style="text-align: center;"><b><nobr><?= Loc::getMessage('SALE_HPS_BILLKZ_PAYMENT_PC') ?></nobr></b></td>
178 </tr>
179 <tr class="ntb">
180 <td><?= $sellerBank ? htmlspecialcharsbx($sellerBank) : '&nbsp;' ?></td>
181 <td style="text-align: center;"><?= $params["SELLER_COMPANY_BANK_BIC"] ? htmlspecialcharsbx($params["SELLER_COMPANY_BANK_BIC"]) : '&nbsp;' ?></td>
182 <td colspan="2" style="text-align: center;"><?= $params["PAYMENT_PC"] ? htmlspecialcharsbx($params["PAYMENT_PC"]) : '&nbsp;' ?></td>
183 </tr>
184 <? if ($params["BILLKZ_ORDER_SUBJECT"]): ?>
185 <tr class="ntb nbb">
186 <td colspan="4"><?= Loc::getMessage('SALE_HPS_BILLKZ_PAYMENT_PURPOSE') ?>:</td>
187 </tr>
188 <tr class="ntb">
189 <td colspan="4"><?= htmlspecialcharsbx($params["BILLKZ_ORDER_SUBJECT"]) ?></td>
190 </tr>
191 <? endif; ?>
192 </table>
194<br>
195<br>
196
197<table width="100%">
198 <colgroup>
199 <col width="50%">
200 <col width="0">
201 <col width="50%">
202 </colgroup>
203<?if ($params['BILLKZ_HEADER']):?>
204 <?
205 $dateValue = $params["PAYMENT_DATE_INSERT"];
206 if ($dateValue instanceof \Bitrix\Main\Type\Date || $dateValue instanceof \Bitrix\Main\Type\DateTime)
207 {
208 $dateValue = mb_strtolower(FormatDate('d F Y', $dateValue->getTimestamp()));
209 $yearPostfix = Loc::getMessage('SALE_HPS_BILLKZ_YEAR_POSTFIX');
210 if (!empty($yearPostfix))
211 $dateValue .= $yearPostfix;
212 unset($yearPostfix);
213 }
214 else if (is_string($dateValue))
215 {
216 $timeStampValue = MakeTimeStamp($dateValue);
217 if ($timeStampValue !== false)
218 $dateValue = mb_strtolower(FormatDate('d F Y', $timeStampValue));
219 unset($timeStampValue);
220 }
221 ?>
222 <tr>
223 <td style="font-size: 1.6em; font-weight: bold;">
224 <nobr><?=htmlspecialcharsbx($params['BILLKZ_HEADER']);?> <?=Loc::getMessage('SALE_HPS_BILLKZ_SELLER_TITLE', array('#PAYMENT_NUM#' => htmlspecialcharsbx($params["ACCOUNT_NUMBER"]), '#PAYMENT_DATE#' => htmlspecialcharsbx($dateValue)));?></nobr>
225 </td>
226 </tr>
227<?endif;?>
228</table>
229<table width="100%" style="margin: 16pt 0;"><tr style="border-bottom: 2pt solid #000000;"><td style="padding: 0;"></td></tr></table>
230<?
231$sellerTitle = $sellerInfo = '';
232if ($params["SELLER_COMPANY_BIN"] || $params["SELLER_COMPANY_IIN"])
233{
234 $sellerInfo .= Loc::getMessage('SALE_HPS_BILLKZ_BIN').' / '.Loc::getMessage('SALE_HPS_BILLKZ_IIN').' ';
235 if ($params["SELLER_COMPANY_BIN"])
236 $sellerInfo .= $params["SELLER_COMPANY_BIN"];
237 else if ($params["SELLER_COMPANY_IIN"])
238 $sellerInfo .= $params["SELLER_COMPANY_IIN"];
239}
240if ($params["SELLER_COMPANY_NAME"])
241{
242 if (!empty($sellerInfo))
243 $sellerInfo .= ', ';
244 $sellerInfo .= $params["SELLER_COMPANY_NAME"];
245}
246if ($params["SELLER_COMPANY_ADDRESS"])
247{
248 $buyerAddr = $params["SELLER_COMPANY_ADDRESS"];
249 if (is_array($buyerAddr))
250 $buyerAddr = implode(', ', $buyerAddr);
251 else
252 $buyerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerAddr));
253 if (!empty($sellerInfo))
254 $sellerInfo .= ', ';
255 $sellerInfo .= $buyerAddr;
256}
257if ($params["SELLER_COMPANY_PHONE"])
258{
259 if (!empty($sellerInfo))
260 $sellerInfo .= ', ';
261 $sellerInfo .= $params["SELLER_COMPANY_PHONE"];
262}
263if (!empty($sellerInfo))
264 $sellerTitle = Loc::getMessage('SALE_HPS_BILLKZ_SELLER_NAME').':';
265
266$buyerTitle = $buyerInfo = '';
267if ($params['BILLKZ_PAYER_SHOW'] == 'Y')
268{
269 if ($params["BUYER_PERSON_COMPANY_BIN"] || $params["BUYER_PERSON_COMPANY_IIN"])
270 {
271 $buyerInfo .= Loc::getMessage('SALE_HPS_BILLKZ_BIN').' / '.Loc::getMessage('SALE_HPS_BILLKZ_IIN').' ';
272 if ($params["BUYER_PERSON_COMPANY_BIN"])
273 $buyerInfo .= $params["BUYER_PERSON_COMPANY_BIN"];
274 else if ($params["BUYER_PERSON_COMPANY_IIN"])
275 $buyerInfo .= $params["BUYER_PERSON_COMPANY_IIN"];
276 }
277 if ($params["BUYER_PERSON_COMPANY_NAME"])
278 {
279 if (!empty($buyerInfo))
280 $buyerInfo .= ', ';
281 $buyerInfo .= $params["BUYER_PERSON_COMPANY_NAME"];
282 }
283 if ($params["BUYER_PERSON_COMPANY_ADDRESS"])
284 {
285 $buyerAddr = $params["BUYER_PERSON_COMPANY_ADDRESS"];
286 if (is_array($buyerAddr))
287 $buyerAddr = implode(', ', $buyerAddr);
288 else
289 $buyerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerAddr));
290 if (!empty($buyerInfo))
291 $buyerInfo .= ', ';
292 $buyerInfo .= $buyerAddr;
293 }
294 if ($params["BUYER_PERSON_COMPANY_PHONE"])
295 {
296 if (!empty($buyerInfo))
297 $buyerInfo .= ', ';
298 $buyerInfo .= $params["BUYER_PERSON_COMPANY_PHONE"];
299 }
300 if ($params["BUYER_PERSON_COMPANY_FAX"])
301 {
302 if (!empty($buyerInfo))
303 $buyerInfo .= ', ';
304 $buyerInfo .= $params["BUYER_PERSON_COMPANY_FAX"];
305 }
306 if ($params["BUYER_PERSON_COMPANY_NAME_CONTACT"])
307 {
308 if (!empty($buyerInfo))
309 $buyerInfo .= ', ';
310 $buyerInfo .= $params["BUYER_PERSON_COMPANY_NAME_CONTACT"];
311 }
312 if (!empty($buyerInfo))
313 $buyerTitle = Loc::getMessage('SALE_HPS_BILLKZ_BUYER_NAME').':';
314}
315?>
316<table class="selbuy" width="100%">
317 <colgroup>
318 <col width="13%">
319 <col width="87%">
320 </colgroup>
321 <tr>
322 <td><?= !empty($sellerTitle) ? htmlspecialcharsbx($sellerTitle) : '&nbsp' ?></td>
323 <td><?= !empty($sellerInfo) ? htmlspecialcharsbx($sellerInfo) : '&nbsp' ?></td>
324 </tr>
325<? if ($params['BILLKZ_PAYER_SHOW'] == 'Y'): ?>
326 <tr><td colspan="2" style="padding: 0; line-height: 7pt;">&nbsp;</td></tr>
327 <tr>
328 <td><?= !empty($buyerTitle) ? htmlspecialcharsbx($buyerTitle) : '&nbsp' ?></td>
329 <td><?= !empty($buyerInfo) ? htmlspecialcharsbx($buyerInfo) : '&nbsp' ?></td>
330 </tr>
331<? endif; ?>
332<? if ($params['BUYER_PERSON_COMPANY_DOGOVOR']): ?>
333 <tr><td colspan="2" style="padding: 0; line-height: 7pt;">&nbsp;</td></tr>
334 <tr>
335 <td><?= Loc::getMessage('SALE_HPS_BILLKZ_BUYER_DOGOVOR') ?>:</td>
336 <td><?= htmlspecialcharsbx($params['BUYER_PERSON_COMPANY_DOGOVOR']) ?></td>
337 </tr>
338<? endif; ?>
339</table>
340<br>
341<?php
344
345$n = 0;
346$sum = 0.00;
349
350$columnList = array('NUMBER', 'NAME', 'QUANTITY', 'MEASURE', 'PRICE', 'VAT_RATE', 'SUM');
352foreach ($columnList as $column)
353{
354 if ($params['BILLKZ_COLUMN_'.$column.'_SHOW'] == 'Y')
355 {
356 $arCols[$column] = array(
357 'NAME' => htmlspecialcharsbx($params['BILLKZ_COLUMN_'.$column.'_TITLE']),
358 'SORT' => $params['BILLKZ_COLUMN_'.$column.'_SORT']
359 );
360 }
361}
362if ($params['USER_COLUMNS'])
363{
364 $columnList = array_merge($columnList, array_keys($params['USER_COLUMNS']));
365 foreach ($params['USER_COLUMNS'] as $id => $val)
366 {
367 $arCols[$id] = array(
368 'NAME' => htmlspecialcharsbx($val['NAME']),
369 'SORT' => $val['SORT']
370 );
371 }
372}
373
374uasort($arCols, function ($a, $b) {return ($a['SORT'] < $b['SORT']) ? -1 : 1;});
375
376$arColumnKeys = array_keys($arCols);
378
379foreach ($params['BASKET_ITEMS'] as $basketItem)
380{
381 $productName = $basketItem["NAME"];
382 if ($productName == "OrderDelivery")
383 $productName = Loc::getMessage('SALE_HPS_BILLKZ_DELIVERY');
384 else if ($productName == "OrderDiscount")
385 $productName = Loc::getMessage('SALE_HPS_BILLKZ_DISCOUNT');
386
387 if ($basketItem['IS_VAT_IN_PRICE'])
388 $basketItemPrice = $basketItem['PRICE'];
389 else
390 $basketItemPrice = $basketItem['PRICE']*(1 + $basketItem['VAT_RATE']);
391
392 $cells[++$n] = array();
393 foreach ($arCols as $columnId => $caption)
394 {
395 $data = null;
396
397 switch ($columnId)
398 {
399 case 'NUMBER':
400 $data = $n;
401 break;
402 case 'NAME':
403 $data = htmlspecialcharsbx($productName);
404 break;
405 case 'QUANTITY':
406 $data = roundEx($basketItem['QUANTITY'], SALE_VALUE_PRECISION);
407 break;
408 case 'MEASURE':
409 $data = $basketItem["MEASURE_NAME"] ? htmlspecialcharsbx($basketItem["MEASURE_NAME"]) : Loc::getMessage('SALE_HPS_BILLKZ_BASKET_MEASURE_DEFAULT');
410 break;
411 case 'PRICE':
412 $data = SaleFormatCurrency($basketItem['PRICE'], $basketItem['CURRENCY'], true);
413 break;
414 case 'VAT_RATE':
415 $data = roundEx($basketItem['VAT_RATE'] * 100, SALE_VALUE_PRECISION)."%";
416 break;
417 case 'SUM':
418 $data = SaleFormatCurrency($basketItemPrice * $basketItem['QUANTITY'], $basketItem['CURRENCY'], true);
419 break;
420 default :
421 $data = ($basketItem[$columnId]) ?: '';
422 }
423 if ($data !== null)
424 $cells[$n][$columnId] = $data;
425 }
426 $props[$n] = array();
427 if ($basketItem['PROPS'])
428 {
429 foreach ($basketItem['PROPS'] as $basketPropertyItem)
430 {
431 if ($basketPropertyItem['CODE'] == 'CATALOG.XML_ID' || $basketPropertyItem['CODE'] == 'PRODUCT.XML_ID')
432 continue;
433 $props[$n][] = htmlspecialcharsbx(sprintf("%s: %s", $basketPropertyItem["NAME"], $basketPropertyItem["VALUE"]));
434 }
435 }
436 $sum += doubleval($basketItem['PRICE'] * $basketItem['QUANTITY']);
437 $vat = max($vat, $basketItem['VAT_RATE']);
438}
439
440if ($vat <= 0)
441{
442 unset($arCols['VAT_RATE']);
444 $arColumnKeys = array_keys($arCols);
445 foreach ($cells as $i => $cell)
446 unset($cells[$i]['VAT_RATE']);
447}
448
449if ($params['PRICE'] > 0)
450{
451 $deliveryItem = Loc::getMessage('SALE_HPS_BILLKZ_DELIVERY');
452
453 if ($params['DELIVERY_NAME'])
454 $deliveryItem .= sprintf(" (%s)", $params['DELIVERY_NAME']);
455 $cells[++$n] = array();
456 foreach ($arCols as $columnId => $caption)
457 {
458 $data = null;
459
460 switch ($columnId)
461 {
462 case 'NUMBER':
463 $data = $n;
464 break;
465 case 'NAME':
466 $data = htmlspecialcharsbx($deliveryItem);
467 break;
468 case 'QUANTITY':
469 $data = 1;
470 break;
471 case 'MEASURE':
472 $data = '';
473 break;
474 case 'PRICE':
475 $data = SaleFormatCurrency($params['DELIVERY_PRICE'], $params['CURRENCY'], true);
476 break;
477 case 'VAT_RATE':
479 break;
480 case 'SUM':
481 $data = SaleFormatCurrency($params['DELIVERY_PRICE'], $params['CURRENCY'], true);
482 break;
483 }
484 if ($data !== null)
485 $cells[$n][$columnId] = $data;
486 }
487 $sum += doubleval($params['DELIVERY_PRICE']);
488}
489
490if ($params['BILLKZ_TOTAL_SHOW'] == 'Y')
491{
493 $eps = 0.0001;
494 if ($params['SUM'] - $sum > $eps)
495 {
496 $cells[++$n] = array();
497 for ($i = 0; $i < $columnCount; $i++)
498 $cells[$n][$arColumnKeys[$i]] = null;
499
500 $cells[$n][$arColumnKeys[$columnCount-2]] = htmlspecialcharsbx(Loc::getMessage('SALE_HPS_BILLKZ_SUBTOTAL'));
502 }
503
504 if ($params['TAXES'])
505 {
506 foreach ($params['TAXES'] as $tax)
507 {
508 $cells[++$n] = array();
509 for ($i = 0; $i < $columnCount; $i++)
510 $cells[$n][$arColumnKeys[$i]] = null;
511
513 "%s%s%s:",
514 ($tax["IS_IN_PRICE"] == "Y") ? Loc::getMessage('SALE_HPS_BILLKZ_INCLUDING') : "",
515 $tax["TAX_NAME"],
516 ($vat <= 0 && $tax["IS_PERCENT"] == "Y")
517 ? sprintf(' (%s%%)', roundEx($tax["VALUE"], SALE_VALUE_PRECISION))
518 : ""
519 ));
520 $cells[$n][$arColumnKeys[$columnCount-1]] = SaleFormatCurrency($tax["VALUE_MONEY"], $params['CURRENCY'], true);
521 }
522 }
523
524 if (!$params['TAXES'])
525 {
526 $cells[++$n] = array();
527 for ($i = 0; $i < $columnCount; $i++)
528 $cells[$n][$i] = null;
529
530 $cells[$n][$arColumnKeys[$columnCount-2]] = htmlspecialcharsbx(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_VAT_RATE'));
531 $cells[$n][$arColumnKeys[$columnCount-1]] = htmlspecialcharsbx(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_VAT_RATE_NO'));
532 }
533 if ($params['SUM_PAID'] > 0)
534 {
535 $cells[++$n] = array();
536 for ($i = 0; $i < $columnCount; $i++)
537 $cells[$n][$arColumnKeys[$i]] = null;
538
539 $cells[$n][$arColumnKeys[$columnCount-2]] = Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_PAID');
540 $cells[$n][$arColumnKeys[$columnCount-1]] = SaleFormatCurrency($params['SUM_PAID'], $params['CURRENCY'], true);
541 }
542 if ($params['DISCOUNT_PRICE'] > 0)
543 {
544 $cells[++$n] = array();
545 for ($i = 0; $i < $columnCount; $i++)
546 $cells[$n][$arColumnKeys[$i]] = null;
547
548 $cells[$n][$arColumnKeys[$columnCount-2]] = Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_DISCOUNT');
549 $cells[$n][$arColumnKeys[$columnCount-1]] = SaleFormatCurrency($params['DISCOUNT_PRICE'], $params['CURRENCY'], true);
550 }
551
552 $cells[++$n] = array();
553 for ($i = 0; $i < $columnCount; $i++)
554 $cells[$n][$arColumnKeys[$i]] = null;
555
556 $cells[$n][$arColumnKeys[$columnCount-2]] = Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_SUM');
557 $cells[$n][$arColumnKeys[$columnCount-1]] = SaleFormatCurrency($params['SUM'], $params['CURRENCY'], true);
558}
559?>
560<table class="it" width="100%">
561 <tr>
562 <?foreach ($arCols as $columnId => $col):?>
563 <td><?=$col['NAME'];?></td>
565 </tr>
566<?
567
569for ($n = 1; $n <= $rowsCnt; $n++):
570
571 $accumulated = 0;
572?>
573 <tr valign="top">
574 <?foreach ($arCols as $columnId => $col):?>
575 <?
576 if (!is_null($cells[$n][$columnId]))
577 {
578 if ($columnId === 'NUMBER')
579 {?>
580 <td align="center"><?=$cells[$n][$columnId];?></td>
581 <?}
582 elseif ($columnId === 'NAME')
583 {
584 ?>
585 <td align="<?=($n > $cntBasketItem) ? 'right' : 'left';?>"
586 style="word-break: break-word; word-wrap: break-word; <? if ($accumulated) {?>border-width: 0pt 1pt 0pt 0pt; <? } ?>"
587 <? if ($accumulated) { ?>colspan="<?=($accumulated+1); ?>"<? $accumulated = 0; } ?>>
588 <?=$cells[$n][$columnId]; ?>
589 <? if (isset($props[$n]) && is_array($props[$n])) { ?>
590 <? foreach ($props[$n] as $property) { ?>
591 <br>
592 <small><?=$property; ?></small>
593 <? } ?>
594 <? } ?>
595 </td>
596 <?}
597 else
598 {
599 if (!is_null($cells[$n][$columnId]))
600 {
601 if ($columnId != 'VAT_RATE' || $vat > 0 || is_null($cells[$n][$columnId]) || $n > $cntBasketItem)
602 { ?>
603 <td align="right"
604 <? if ($accumulated) { ?>
605 style="border-width: 0pt 1pt 0pt 0pt"
606 colspan="<?=(($columnId == 'VAT_RATE' && $vat <= 0) ? $accumulated : $accumulated+1); ?>"
607 <? $accumulated = 0; } ?>>
608 <?if ($columnId == 'SUM' || $columnId == 'PRICE'):?>
609 <nobr><?=$cells[$n][$columnId];?></nobr>
610 <?else:?>
611 <?=$cells[$n][$columnId]; ?>
612 <?endif;?>
613 </td>
614 <? }
615 }
616 else
617 {
618 $accumulated++;
619 }
620 }
621 }
622 else
623 {
624 $accumulated++;
625 }
626 ?>
627 <?endforeach;?>
628 </tr>
629
631</table>
632<br>
633
634<?if ($params['BILLKZ_TOTAL_SHOW'] == 'Y'):?>
635 <?=Loc::getMessage(
636 'SALE_HPS_BILLKZ_BASKET_TOTAL',
637 array(
638 '#BASKET_COUNT#' => $cntBasketItem,
639 '#BASKET_PRICE#' => SaleFormatCurrency($params['SUM'], $params['CURRENCY'], false),
640 )
641 );?>
642 <br>
643
644 <b>
645 <?
646
647 if (in_array($params['CURRENCY'], array("RUR", "RUB", "UAH", "KZT", "BYR", "BYN")))
648 {
649 echo Number2Word_Rus($params['SUM'], "Y", $params['CURRENCY']);
650 }
651 else
652 {
654 $params['SUM'],
655 $params['CURRENCY'],
656 false
657 );
658 }
659
660 ?>
661 </b>
662<?endif;?>
663<table width="100%" style="margin: 16pt 0;"><tr style="border-bottom: 2pt solid #000000;"><td style="padding: 0;"></td></tr></table>
664<?if ($params['BILLKZ_SIGN_SHOW'] == 'Y'):?>
665 <?
666 $executorInfo = '';
668 if ($params['SELLER_COMPANY_ACCOUNTANT_NAME'])
669 {
670 if ($params['SELLER_COMPANY_ACCOUNTANT_POSITION'])
671 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_POSITION'];
672 if (!empty($executorInfo))
673 $executorInfo .= ' ';
674 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_NAME'];
675 $signParamName = 'SELLER_COMPANY_ACC_SIGN';
676 }
677 else if ($params['SELLER_COMPANY_DIRECTOR_NAME'])
678 {
679 if ($params['SELLER_COMPANY_DIRECTOR_POSITION'])
680 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_POSITION'];
681 if (!empty($executorInfo))
682 $executorInfo .= ' ';
683 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_NAME'];
684 $signParamName = 'SELLER_COMPANY_DIR_SIGN';
685 }
686 else if ($params['SELLER_COMPANY_ACCOUNTANT_POSITION'])
687 {
688 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_POSITION'];
689 $signParamName = 'SELLER_COMPANY_ACC_SIGN';
690 }
691 else if ($params['SELLER_COMPANY_DIRECTOR_POSITION'])
692 {
693 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_POSITION'];
694 $signParamName = 'SELLER_COMPANY_DIR_SIGN';
695 }
696 else
697 {
698 $executorInfo = str_pad('', 6 * 35, '&nbsp;');
699 }
700 ?>
701 <? if (!$blank) { ?>
702 <div style="position: relative; "><?
703 echo CFile::ShowImage($params["BILLKZ_PATH_TO_STAMP"], 160, 160, 'style="position: absolute; left: 40pt; "');
704 ?></div>
705 <? } ?>
706 <div style="position: relative">
707 <table class="sign" style="width: 100%; margin-top: 50pt;">
708 <colgroup>
709 <col width="18%">
710 <col width="50%">
711 <col width="32%">
712 </colgroup>
713 <tr>
714 <td style="white-space: nowrap;"><b><?= Loc::getMessage("SALE_HPS_BILLKZ_EXECUTOR") ?></b></td>
715 <td style="border-bottom: 1pt solid #000000; text-align: center;">
716 <?= $blank ? '&nbsp;' : CFile::ShowImage($params[$signParamName], 200, 50) ?>
717 </td>
718 <td style="white-space: nowrap; padding-left: 8pt;">
719 <?= !empty($executorInfo) ? ' / '.htmlspecialcharsbx($executorInfo).' / ' : '&nbsp;' ?>
720 </td>
721 </tr>
722 </table>
723 </div>
724<?endif;?>
725
726</div>
727
728</body>
729</html>
$path
Определения access_edit.php:21
$sum
Определения checkout.php:6
static ShowImage($strImage, $iMaxW=0, $iMaxH=0, $sParams=null, $strImageUrl="", $bPopup=false, $sPopupTitle=false, $iSizeWHTTP=0, $iSizeHHTTP=0, $strImageUrlTemplate="")
Определения file.php:1805
static _GetImgParams($strImage, $iSizeWHTTP=0, $iSizeHHTTP=0)
Определения file.php:1726
$data['IS_AVAILABLE']
Определения .description.php:13
collapse(node)
Определения ebay_mip_setup.php:316
& nbsp
Определения epilog_main_admin.php:38
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
<? 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
Определения options.php:1473
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
endif
Определения csv_new_setup.php:990
roundEx($value, $prec=0)
Определения tools.php:4635
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)
Определения tools.php:871
htmlspecialcharsback($str)
Определения tools.php:2693
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
Определения tools.php:2587
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
MakeTimeStamp($datetime, $format=false)
Определения tools.php:538
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
Определения prolog_main_admin.php:255
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
die
Определения quickway.php:367
$i
Определения factura.php:643
font style
Определения invoice.php:442
</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."%"
Определения waybill.php:936
$background
Определения html.php:27
$pageWidth
Определения html.php:24
if( $arBasket=$dbBasket->Fetch()) if($vat > 0) $rowsCnt
Определения html.php:430
$width
Определения html.php:68
if(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
Определения html.php:61
$pageHeight
Определения html.php:25
$cells
Определения template.php:268
$arColumnKeys
Определения template.php:310
$columnList
Определения template.php:276
$sellerBank
Определения template.php:134
$vat
Определения template.php:273
$columnCount
Определения template.php:311
$props
Определения template.php:269
$sellerRs
Определения template.php:137
$arCols
Определения template.php:277
endfor
Определения template.php:569
$cntBasketItem
Определения template.php:274
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
if($params['BILLKZ_SIGN_SHOW']=='Y') $signParamName
Определения template.php:667
$buyerTitle
Определения template.php:266
$sellerTitle
Определения template.php:231
text align
Определения template.php:556
else $a
Определения template.php:137
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
Определения include.php:142
const SALE_VALUE_PRECISION
Определения include.php:46
$val
Определения options.php:1793
Number2Word_Rus($source, $IS_MONEY="Y", $currency="")
Определения include.php:2
$matches
Определения index.php:22
$n
Определения update_log.php:107
$blank
Определения template_pdf.php:11