1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
template_pdf.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><?
2
4Loc::loadMessages(__FILE__);
5
6$arPaySysAction["ENCODING"] = "";
7
9 die();
10
11if ($_REQUEST['BLANK'] == 'Y')
12 $blank = true;
13
15$pdf = new CSalePdf('P', 'pt', 'A4');
16
17if ($params['BILLKZ_BACKGROUND'])
18{
19 $pdf->SetBackground(
20 $params['BILLKZ_BACKGROUND'],
21 $params['BILLKZ_BACKGROUND_STYLE']
22 );
23}
24
25$pageWidth = $pdf->GetPageWidth();
26$pageHeight = $pdf->GetPageHeight();
27
28$pdf->AddFont('Font', '', 'pt_sans-regular.ttf', true);
29$pdf->AddFont('Font', 'B', 'pt_sans-bold.ttf', true);
30
31$fontFamily = 'Font';
32$fontSize = 10.5;
35
37 'top' => intval($params['BILLKZ_MARGIN_TOP'] ?: 15) * 72/25.4,
38 'right' => intval($params['BILLKZ_MARGIN_RIGHT'] ?: 15) * 72/25.4,
39 'bottom' => intval($params['BILLKZ_MARGIN_BOTTOM'] ?: 15) * 72/25.4,
40 'left' => intval($params['BILLKZ_MARGIN_LEFT'] ?: 20) * 72/25.4
41);
42
43$width = $pageWidth - $margin['left'] - $margin['right'];
44
45$pdf->SetDisplayMode(100, 'continuous');
46$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
47$pdf->SetAutoPageBreak(true, $margin['bottom']);
48
49$pdf->AddPage();
50
51
52$x0 = $pdf->GetX();
53$y0 = $pdf->GetY();
56
57if ($params['BILLKZ_HEADER_SHOW'] == 'Y')
58{
59 if ($params['BILLKZ_PATH_TO_LOGO'])
60 {
61 list($imageHeight, $imageWidth) = $pdf->GetImageSize($params['BILLKZ_PATH_TO_LOGO']);
62
63 $imgDpi = intval($params['BILLKZ_LOGO_DPI']) ?: 96;
64 $imgZoom = 96 / $imgDpi;
65
66 $logoHeight = $imageHeight * $imgZoom + 5;
67 $logoWidth = $imageWidth * $imgZoom + 5;
68 if ($logoWidth >= $width)
69 {
70 $imgDpi = 96 * $imageWidth/($width*0.6 + 5);
71 $imgZoom = 96 / $imgDpi;
72
73 $logoHeight = $imageHeight * $imgZoom + 5;
74 $logoWidth = $imageWidth * $imgZoom + 5;
75 }
76
77 $pdf->Image($params['BILLKZ_PATH_TO_LOGO'], $pdf->GetX(), $pdf->GetY(), -$imgDpi, -$imgDpi);
78 }
79
80 $textLeftMargin = $logoWidth + 10;
81 if ($textLeftMargin < 95)
82 $textLeftMargin = 95;
83
84 $pdf->SetFont($fontFamily, '', $fontSize);
85
86 $textWidth = $width - $textLeftMargin;
87 if ($textWidth >= 20)
88 {
89 if ($params["BILLKZ_COMMENT1"])
90 {
92 preg_replace(
93 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'),
94 array('<br>', '<br>'),
95 CSalePdf::prepareToPdf($params["BILLKZ_COMMENT1"])
96 ), '', array(), 0
97 );
98 while ($pdf->GetStringWidth($text))
99 {
100 list($string, $text) = $pdf->splitString($text, $textWidth);
101 $pdf->SetX($pdf->GetX() + $textLeftMargin);
102 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'C');
103 $pdf->Ln();
104 }
105 }
106 if ($params["BILLKZ_COMMENT2"])
107 {
108 $pdf->Ln();
110 preg_replace(
111 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'),
112 array('<br>', '<br>'),
113 CSalePdf::prepareToPdf($params["BILLKZ_COMMENT2"])
114 ), '', array(), 0
115 );
116 while ($pdf->GetStringWidth($text))
117 {
118 list($string, $text) = $pdf->splitString($text, $textWidth);
119 $pdf->SetX($pdf->GetX() + $textLeftMargin);
120 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'C');
121 $pdf->Ln();
122 }
123 }
124 }
125 $pdf->SetY(max($y0 + $logoHeight, $pdf->GetY()));
126 $pdf->Ln();
127
128 if ($params["SELLER_COMPANY_BANK_NAME"])
129 {
130 $sellerBankCity = '';
131 if ($params["SELLER_COMPANY_BANK_CITY"])
132 {
133 $sellerBankCity = $params["SELLER_COMPANY_BANK_CITY"];
134 if (is_array($sellerBankCity))
135 $sellerBankCity = implode(', ', $sellerBankCity);
136 else
137 $sellerBankCity = str_replace(array("\r\n", "\n", "\r"), ', ', strval($sellerBankCity));
138 }
139 $sellerBank = sprintf(
140 "%s %s",
141 $params["SELLER_COMPANY_BANK_NAME"],
142 $sellerBankCity
143 );
144 $sellerRs = $params["SELLER_COMPANY_BANK_IIK"];
145 }
146 else
147 {
148 $rsPattern = '/\s*\d{10,100}\s*/';
149
150 $sellerBank = trim(preg_replace($rsPattern, ' ', $params["SELLER_COMPANY_BANK_IIK"]));
151
152 preg_match($rsPattern, $params["SELLER_COMPANY_BANK_IIK"], $matches);
153 $sellerRs = trim($matches[0]);
154 }
155
156 $colInfo = array(
157 array('prc' => 56),
158 array('prc' => 25),
159 array('prc' => 19)
160 );
161 foreach ($colInfo as $n => $info)
162 $colInfo[$n]['width'] = $width * $info['prc'] / 100;
163 $x0 = $pdf->GetX();
164 $y0 = $pdf->GetY();
165 $pdf->SetFont($fontFamily, 'B', $fontSize);
166 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_BENEFICIARY').':');
167 $pdf->Cell($colInfo[0]['width'], $lineHeight, $text);
168 $x1 = $x0 + $colInfo[0]['width'];
169 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_IIK'));
170 $pdf->Cell($colInfo[1]['width'], $lineHeight, $text, 0, 0, 'C');
171 $x2 = $x1 + $colInfo[1]['width'];
172 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_KBE'));
173 $pdf->Cell($colInfo[2]['width'], $lineHeight, $text, 0, 0, 'C');
174 $x3 = $x2 + $colInfo[2]['width'];
175 $y1 = $y0 + $lineHeight;
176 $pdf->Line($x0, $y0, $x3, $y0);
177 $pdf->Ln();
178 $text = CSalePdf::prepareToPdf($params["SELLER_COMPANY_NAME"] ?: ' ');
179 while ($pdf->GetStringWidth($text) > 0)
180 {
181 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
182 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
183 if ($text)
184 $pdf->Ln();
185 }
186 $pdf->Ln();
187 $y2 = $pdf->GetY();
188 $pdf->SetFont($fontFamily, '', $fontSize);
190 $params["SELLER_COMPANY_BIN"] ? Loc::getMessage('SALE_HPS_BILLKZ_BIN').': '.$params["SELLER_COMPANY_BIN"] : ' '
191 );
192 while ($pdf->GetStringWidth($text) > 0)
193 {
194 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
195 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
196 if ($text)
197 $pdf->Ln();
198 }
199 $pdf->Ln();
200 $y3 = $pdf->GetY();
201 $dy = ($y2 - $y1 - $lineHeight) / 2;
202 $pdf->SetXY($x1, $y1 + $dy);
203 $pdf->Cell($colInfo[1]['width'], $lineHeight, CSalePdf::prepareToPdf($sellerRs ?: ' '), 0, 0, 'C');
204 $text = CSalePdf::prepareToPdf($params["SELLER_COMPANY_KBE"] ? $params["SELLER_COMPANY_KBE"] : ' ');
205 $pdf->Cell($colInfo[2]['width'], $lineHeight, $text, 0, 0, 'C');
206 $pdf->Line($x2, $y0, $x2, $y3);
207 $pdf->Line($x0, $y3, $x3, $y3);
208 $pdf->SetXY($x0, $y3);
209 $colInfo = array(
210 array('prc' => 56),
211 array('prc' => 19),
212 array('prc' => 25)
213 );
214 foreach ($colInfo as $n => $info)
215 $colInfo[$n]['width'] = $width * $info['prc'] / 100;
216 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_BENEFICIARY_BANK').':');
217 $pdf->Cell($colInfo[0]['width'], $lineHeight, $text);
218 $x1 = $x0 + $colInfo[0]['width'];
219 $pdf->SetFont($fontFamily, 'B', $fontSize);
220 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_SELLER_BANK_BIK'));
221 $pdf->Cell($colInfo[1]['width'], $lineHeight, $text, 0, 0, 'C');
222 $x2 = $x1 + $colInfo[1]['width'];
223 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_PAYMENT_PC'));
224 $pdf->Cell($colInfo[2]['width'], $lineHeight, $text, 0, 0, 'C');
225 $x3 = $x2 + $colInfo[2]['width'];
226 $y4 = $y3 + $lineHeight;
227 $pdf->Ln();
228 $pdf->SetFont($fontFamily, '', $fontSize);
230 while ($pdf->GetStringWidth($text) > 0)
231 {
232 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
233 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
234 if ($text)
235 $pdf->Ln();
236 }
237 $pdf->Ln();
238 $y5 = $pdf->GetY();
239 $dy = ($y5 - $y4 - $lineHeight) / 2;
240 $pdf->SetXY($x1, $y4 + $dy);
241 $text = CSalePdf::prepareToPdf($params["SELLER_COMPANY_BANK_BIC"] ?: ' ');
242 $pdf->Cell($colInfo[1]['width'], $lineHeight, $text, 0, 0, 'C');
243 $text = CSalePdf::prepareToPdf($params["PAYMENT_PC"] ?: ' ');
244 $pdf->Cell($colInfo[2]['width'], $lineHeight, $text, 0, 0, 'C');
245 $pdf->Line($x1, $y0, $x1, $y5);
246 $pdf->Line($x2, $y3, $x2, $y5);
247 $pdf->Line($x0, $y5, $x3, $y5);
248 $pdf->SetXY($x0, $y5);
249 $y6 = $y5;
250 if ($params["BILLKZ_ORDER_SUBJECT"])
251 {
252 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_PAYMENT_PURPOSE').':');
253 $pdf->Cell($width, $lineHeight, $text);
254 $pdf->Ln();
255 $text = CSalePdf::prepareToPdf($params["BILLKZ_ORDER_SUBJECT"]);
256 while ($pdf->GetStringWidth($text) > 0)
257 {
258 list($string, $text) = $pdf->splitString($text, $width);
259 $pdf->Cell($width, $lineHeight, $string);
260 if ($text)
261 $pdf->Ln();
262 }
263 $pdf->Ln();
264 $y6 = $pdf->GetY();
265 }
266 $pdf->Line($x0, $y0, $x0, $y6);
267 $pdf->Line($x3, $y0, $x3, $y6);
268 $pdf->Line($x0, $y6, $x3, $y6);
269 $pdf->Ln();
270 $pdf->Ln();
271 if ($params['BILLKZ_HEADER'])
272 {
273 $dateValue = $params["PAYMENT_DATE_INSERT"];
274 if ($dateValue instanceof \Bitrix\Main\Type\Date || $dateValue instanceof \Bitrix\Main\Type\DateTime)
275 {
276 $dateValue = mb_strtolower(FormatDate('d F Y', $dateValue->getTimestamp()));
277 $yearPostfix = Loc::getMessage('SALE_HPS_BILLKZ_YEAR_POSTFIX');
278 if (!empty($yearPostfix))
279 $dateValue .= $yearPostfix;
280 unset($yearPostfix);
281 }
282 else if (is_string($dateValue))
283 {
284 $timeStampValue = MakeTimeStamp($dateValue);
285 if ($timeStampValue !== false)
286 $dateValue = mb_strtolower(FormatDate('d F Y', $timeStampValue));
287 unset($timeStampValue);
288 }
289 $pdf->SetFont($fontFamily, 'B', $fontSize * 1.6);
291 $params['BILLKZ_HEADER'].' '.
292 Loc::getMessage(
293 'SALE_HPS_BILLKZ_SELLER_TITLE',
294 array(
295 '#PAYMENT_NUM#' => $params["ACCOUNT_NUMBER"],
296 '#PAYMENT_DATE#' => $dateValue
297 )
298 )
299 );
300 while ($pdf->GetStringWidth($text) > 0)
301 {
302 list($string, $text) = $pdf->splitString($text, $width);
303 $pdf->Cell($width, $lineHeight, $string);
304 if ($text)
305 $pdf->Ln();
306 }
307 $pdf->SetFont($fontFamily, '', $fontSize);
308 }
309 $pdf->Ln();
310 $pdf->Ln();
311 $y7 = $pdf->GetY();
312 $pdf->SetLineWidth($defaultLineWidth * 2);
313 $pdf->Line($x0, $y7, $x0 + $width, $y7);
314 $pdf->SetLineWidth($defaultLineWidth);
315 unset($y7);
316 $pdf->Ln();
317}
318$sellerTitle = $sellerInfo = '';
319if ($params["SELLER_COMPANY_BIN"] || $params["SELLER_COMPANY_IIN"])
320{
321 $sellerInfo .= Loc::getMessage('SALE_HPS_BILLKZ_BIN').' / '.Loc::getMessage('SALE_HPS_BILLKZ_IIN').' ';
322 if ($params["SELLER_COMPANY_BIN"])
323 $sellerInfo .= $params["SELLER_COMPANY_BIN"];
324 else if ($params["SELLER_COMPANY_IIN"])
325 $sellerInfo .= $params["SELLER_COMPANY_IIN"];
326}
327if ($params["SELLER_COMPANY_NAME"])
328{
329 if (!empty($sellerInfo))
330 $sellerInfo .= ', ';
331 $sellerInfo .= $params["SELLER_COMPANY_NAME"];
332}
333if ($params["SELLER_COMPANY_ADDRESS"])
334{
335 $buyerAddr = $params["SELLER_COMPANY_ADDRESS"];
336 if (is_array($buyerAddr))
337 $buyerAddr = implode(', ', $buyerAddr);
338 else
339 $buyerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerAddr));
340 if (!empty($sellerInfo))
341 $sellerInfo .= ', ';
342 $sellerInfo .= $buyerAddr;
343}
344if ($params["SELLER_COMPANY_PHONE"])
345{
346 if (!empty($sellerInfo))
347 $sellerInfo .= ', ';
348 $sellerInfo .= $params["SELLER_COMPANY_PHONE"];
349}
350if (!empty($sellerInfo))
351 $sellerTitle = Loc::getMessage('SALE_HPS_BILLKZ_SELLER_NAME').':';
352
353$buyerTitle = $buyerInfo = '';
354if ($params['BILLKZ_PAYER_SHOW'] == 'Y')
355{
356 if ($params["BUYER_PERSON_COMPANY_BIN"] || $params["BUYER_PERSON_COMPANY_IIN"])
357 {
358 $buyerInfo .= Loc::getMessage('SALE_HPS_BILLKZ_BIN').' / '.Loc::getMessage('SALE_HPS_BILLKZ_IIN').' ';
359 if ($params["BUYER_PERSON_COMPANY_BIN"])
360 $buyerInfo .= $params["BUYER_PERSON_COMPANY_BIN"];
361 else if ($params["BUYER_PERSON_COMPANY_IIN"])
362 $buyerInfo .= $params["BUYER_PERSON_COMPANY_IIN"];
363 }
364 if ($params["BUYER_PERSON_COMPANY_NAME"])
365 {
366 if (!empty($buyerInfo))
367 $buyerInfo .= ', ';
368 $buyerInfo .= $params["BUYER_PERSON_COMPANY_NAME"];
369 }
370 if ($params["BUYER_PERSON_COMPANY_ADDRESS"])
371 {
372 $buyerAddr = $params["BUYER_PERSON_COMPANY_ADDRESS"];
373 if (is_array($buyerAddr))
374 $buyerAddr = implode(', ', $buyerAddr);
375 else
376 $buyerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerAddr));
377 if (!empty($buyerInfo))
378 $buyerInfo .= ', ';
379 $buyerInfo .= $buyerAddr;
380 }
381 if ($params["BUYER_PERSON_COMPANY_PHONE"])
382 {
383 if (!empty($buyerInfo))
384 $buyerInfo .= ', ';
385 $buyerInfo .= $params["BUYER_PERSON_COMPANY_PHONE"];
386 }
387 if ($params["BUYER_PERSON_COMPANY_FAX"])
388 {
389 if (!empty($buyerInfo))
390 $buyerInfo .= ', ';
391 $buyerInfo .= $params["BUYER_PERSON_COMPANY_FAX"];
392 }
393 if ($params["BUYER_PERSON_COMPANY_NAME_CONTACT"])
394 {
395 if (!empty($buyerInfo))
396 $buyerInfo .= ', ';
397 $buyerInfo .= $params["BUYER_PERSON_COMPANY_NAME_CONTACT"];
398 }
399 if (!empty($buyerInfo))
400 $buyerTitle = Loc::getMessage('SALE_HPS_BILLKZ_BUYER_NAME').':';
401}
403 array('prc' => 13),
404 array('prc' => 87)
405);
406foreach ($colInfo as $n => $info)
407 $colInfo[$n]['width'] = $width * $info['prc'] / 100;
408$y8 = $pdf->GetY();
410while ($pdf->GetStringWidth($text) > 0)
411{
412 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
413 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
414 if ($text)
415 $pdf->Ln();
416}
417$pdf->Ln();
418$y9 = $pdf->GetY();
419$x1 = $x0 + $colInfo[0]['width'];
420$pdf->SetXY($x1, $y8);
421$text = CSalePdf::prepareToPdf($sellerInfo ?: ' ');
422while ($pdf->GetStringWidth($text) > 0)
423{
424 list($string, $text) = $pdf->splitString($text, $colInfo[1]['width']);
425 $pdf->Cell($colInfo[1]['width'], $lineHeight, $string);
426 if ($text)
427 {
428 $pdf->Ln();
429 $pdf->SetX($x1);
430 }
431}
432$pdf->Ln();
433$y9 = max($y9, $pdf->GetY());
434$y10 = $y9 + 9;
435$pdf->SetY($y10);
437while ($pdf->GetStringWidth($text) > 0)
438{
439 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
440 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
441 if ($text)
442 $pdf->Ln();
443}
444$pdf->Ln();
445$y11 = $pdf->GetY();
446$pdf->SetXY($x1, $y10);
447$text = CSalePdf::prepareToPdf($buyerInfo ?: ' ');
448while ($pdf->GetStringWidth($text) > 0)
449{
450 list($string, $text) = $pdf->splitString($text, $colInfo[1]['width']);
451 $pdf->Cell($colInfo[1]['width'], $lineHeight, $string);
452 if ($text)
453 {
454 $pdf->Ln();
455 $pdf->SetX($x1);
456 }
457}
458$pdf->Ln();
459$y11 = max($y11, $pdf->GetY());
460$y12 = $y11 + 9;
461if ($params['BUYER_PERSON_COMPANY_DOGOVOR'])
462{
463 $pdf->SetY($y12);
464 $text = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_BUYER_DOGOVOR').':');
465 while ($pdf->GetStringWidth($text) > 0)
466 {
467 list($string, $text) = $pdf->splitString($text, $colInfo[0]['width']);
468 $pdf->Cell($colInfo[0]['width'], $lineHeight, $string);
469 if ($text)
470 $pdf->Ln();
471 }
472 $pdf->Ln();
473 $y13 = $pdf->GetY();
474 $pdf->SetXY($x1, $y12);
475 $text = CSalePdf::prepareToPdf($params['BUYER_PERSON_COMPANY_DOGOVOR'] ?: ' ');
476 while ($pdf->GetStringWidth($text) > 0)
477 {
478 list($string, $text) = $pdf->splitString($text, $colInfo[1]['width']);
479 $pdf->Cell($colInfo[1]['width'], $lineHeight, $string);
480 if ($text)
481 {
482 $pdf->Ln();
483 $pdf->SetX($x1);
484 }
485 }
486 $pdf->Ln();
487}
488$pdf->Ln();
489
490$arCurFormat = CCurrencyLang::GetCurrencyFormat($params['CURRENCY']);
491$currency = preg_replace('/(^|[^&])#/', '${1}', $arCurFormat['FORMAT_STRING']);
492 $currency = strip_tags($currency);
493
494$columnList = array('NUMBER', 'NAME', 'QUANTITY', 'MEASURE', 'PRICE', 'VAT_RATE', 'SUM');
497foreach ($columnList as $column)
498{
499 if ($params['BILLKZ_COLUMN_'.$column.'_SHOW'] == 'Y')
500 {
501 $arCols[$column] = array(
502 'NAME' => CSalePdf::prepareToPdf($params['BILLKZ_COLUMN_'.$column.'_TITLE']),
503 'SORT' => $params['BILLKZ_COLUMN_'.$column.'_SORT']
504 );
505 }
506}
507if ($params['USER_COLUMNS'])
508{
509 $columnList = array_merge($columnList, array_keys($params['USER_COLUMNS']));
510 foreach ($params['USER_COLUMNS'] as $id => $val)
511 {
512 $arCols[$id] = array(
513 'NAME' => CSalePdf::prepareToPdf($val['NAME']),
514 'SORT' => $val['SORT']
515 );
516 }
517}
518
519uasort($arCols, function ($a, $b) {return ($a['SORT'] < $b['SORT']) ? -1 : 1;});
520
521$arColumnKeys = array_keys($arCols);
523
524if (count($params['BASKET_ITEMS']) > 0)
525{
526 $arCells = array();
527 $arProps = array();
528
529 $n = 0;
530 $sum = 0.00;
531 $vat = 0;
532 foreach ($params['BASKET_ITEMS'] as $basketItem)
533 {
534 $productName = $basketItem["NAME"];
535 if ($productName == "OrderDelivery")
536 $productName = Loc::getMessage('SALE_HPS_BILLKZ_DELIVERY');
537 else if ($productName == "OrderDiscount")
538 $productName = Loc::getMessage('SALE_HPS_BILLKZ_DISCOUNT');
539
540 if ($basketItem['IS_VAT_IN_PRICE'])
541 $basketItemPrice = $basketItem['PRICE'];
542 else
543 $basketItemPrice = $basketItem['PRICE']*(1 + $basketItem['VAT_RATE']);
544
545 $arCells[++$n] = array();
546 foreach ($arCols as $columnId => $caption)
547 {
548 $data = null;
549
550 switch ($columnId)
551 {
552 case 'NUMBER':
554 $arCols[$columnId]['IS_DIGIT'] = true;
555 break;
556 case 'NAME':
557 $data = CSalePdf::prepareToPdf($productName);
558 break;
559 case 'QUANTITY':
560 $data = CSalePdf::prepareToPdf(roundEx($basketItem['QUANTITY'], SALE_VALUE_PRECISION));
561 $arCols[$columnId]['IS_DIGIT'] = true;
562 break;
563 case 'MEASURE':
564 $data = CSalePdf::prepareToPdf($basketItem["MEASURE_NAME"] ? $basketItem["MEASURE_NAME"] : Loc::getMessage('SALE_HPS_BILLKZ_BASKET_MEASURE_DEFAULT'));
565 $arCols[$columnId]['IS_DIGIT'] = true;
566 break;
567 case 'PRICE':
568 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItem['PRICE'], $basketItem['CURRENCY'], true));
569 $arCols[$columnId]['IS_DIGIT'] = true;
570 break;
571 case 'VAT_RATE':
572 $data = CSalePdf::prepareToPdf(roundEx($basketItem['VAT_RATE']*100, SALE_VALUE_PRECISION)."%");
573 $arCols[$columnId]['IS_DIGIT'] = true;
574 break;
575 case 'SUM':
576 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemPrice * $basketItem['QUANTITY'], $basketItem['CURRENCY'], true));
577 $arCols[$columnId]['IS_DIGIT'] = true;
578 break;
579 default:
580 if (preg_match('/[^0-9 ,\.]/', $basketItem[$columnId]) === 0)
581 {
582 if (!array_key_exists('IS_DIGIT', $arCols[$columnId]))
583 $arCols[$columnId]['IS_DIGIT'] = true;
584 }
585 else
586 {
587 $arCols[$columnId]['IS_DIGIT'] = false;
588 }
589 $data = ($basketItem[$columnId]) ? CSalePdf::prepareToPdf($basketItem[$columnId]) : '';
590 }
591 if ($data !== null)
592 $arCells[$n][$columnId] = $data;
593 }
594
595 $arProps[$n] = array();
596 foreach ($basketItem['PROPS'] as $basketPropertyItem)
597 {
598 if ($basketPropertyItem['CODE'] == 'CATALOG.XML_ID' || $basketPropertyItem['CODE'] == 'PRODUCT.XML_ID')
599 continue;
600
601 $arProps[$n][] = $pdf::prepareToPdf(sprintf("%s: %s", $basketPropertyItem["NAME"], $basketPropertyItem["VALUE"]));
602 }
603
604 $sum += doubleval($basketItem['PRICE'] * $basketItem['QUANTITY']);
605 $vat = max($vat, $basketItem['VAT_RATE']);
606 }
607
608 if ($vat <= 0)
609 {
610 unset($arCols['VAT_RATE']);
612 $arColumnKeys = array_keys($arCols);
613 foreach ($arCells as $i => $cell)
614 unset($arCells[$i]['VAT_RATE']);
615 }
616
617 if ($params['DELIVERY_PRICE'] > 0)
618 {
619 $sDeliveryItem = Loc::getMessage('SALE_HPS_BILLKZ_DELIVERY');
620 if ($params['DELIVERY_NAME'])
621 $sDeliveryItem .= sprintf(" (%s)", $params['DELIVERY_NAME']);
622 $arCells[++$n] = array();
623 foreach ($arCols as $columnId => $col)
624 {
625 $data = null;
626
627 switch ($columnId)
628 {
629 case 'NUMBER':
631 break;
632 case 'NAME':
633 $data = CSalePdf::prepareToPdf($sDeliveryItem);
634 break;
635 case 'QUANTITY':
637 break;
638 case 'MEASURE':
640 break;
641 case 'PRICE':
642 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($params['DELIVERY_PRICE'], $params['CURRENCY'], true));
643 break;
644 case 'VAT_RATE':
646 break;
647 case 'SUM':
648 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($params['DELIVERY_PRICE'], $params['CURRENCY'], true));
649 break;
650 default:
651 $data = '';
652 }
653 if ($data !== null)
654 $arCells[$n][$columnId] = $data;
655 }
656
657 $sum += doubleval($params['DELIVERY_PRICE']);
658 }
659
661 if ($params['BILLKZ_TOTAL_SHOW'] == 'Y')
662 {
663 $eps = 0.0001;
664 if ($params['SUM'] - $sum > $eps)
665 {
666 $arCells[++$n] = array();
667 for ($i = 0; $i < $columnCount; $i++)
668 $arCells[$n][$arColumnKeys[$i]] = null;
669
670 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_SUBTOTAL'));
672 }
673
674 if ($params['TAXES'])
675 {
676 foreach ($params['TAXES'] as $tax)
677 {
678 $arCells[++$n] = array();
679 for ($i = 0; $i < $columnCount; $i++)
680 $arCells[$n][$arColumnKeys[$i]] = null;
681
683 "%s%s%s:",
684 ($tax["IS_IN_PRICE"] == "Y") ? Loc::getMessage('SALE_HPS_BILLKZ_INCLUDING') : "",
685 $tax["TAX_NAME"],
686 ($vat <= 0 && $tax["IS_PERCENT"] == "Y") ? sprintf(' (%s%%)', roundEx($tax["VALUE"], SALE_VALUE_PRECISION)) : ""
687 ));
688 $arCells[$n][$arColumnKeys[$columnCount-1]] = CSalePdf::prepareToPdf(SaleFormatCurrency($tax["VALUE_MONEY"], $params['CURRENCY'], true));
689 }
690 }
691
692 if (!$params['TAXES'])
693 {
694 $arCells[++$n] = array();
695 for ($i = 0; $i < $columnCount; $i++)
696 $arCells[$n][$arColumnKeys[$i]] = null;
697
698 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_VAT_RATE'));
699 $arCells[$n][$arColumnKeys[$columnCount-1]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_VAT_RATE_NO'));
700 }
701
702 if ($params['SUM_PAID'] > 0)
703 {
704 $arCells[++$n] = array();
705 for ($i = 0; $i < $columnCount; $i++)
706 $arCells[$n][$arColumnKeys[$i]] = null;
707
708 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_PAID'));
710 }
711
712 if ($params['DISCOUNT_PRICE'] > 0)
713 {
714 $arCells[++$n] = array();
715 for ($i = 0; $i < $columnCount; $i++)
716 $arCells[$n][$arColumnKeys[$i]] = null;
717
718 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_DISCOUNT'));
720 }
721
722
723 $arCells[++$n] = array();
724 for ($i = 0; $i < $columnCount; $i++)
725 $arCells[$n][$arColumnKeys[$i]] = null;
726
727 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLKZ_TOTAL_SUM'));
729 }
730
731 $rowsInfo = $pdf->calculateRowsWidth($arCols, $arCells, $cntBasketItem, $width);
732 $arRowsWidth = $rowsInfo['ROWS_WIDTH'];
733 $arRowsContentWidth = $rowsInfo['ROWS_CONTENT_WIDTH'];
734}
735
736$x0 = $pdf->GetX();
737$y0 = $pdf->GetY();
738
739$k = 0;
741{
742 $newLine = false;
743 foreach ($arCols as $columnId => $column)
744 {
745 list($string, $arCols[$columnId]['NAME']) = $pdf->splitString($column['NAME'], $arRowsWidth[$columnId]);
746 if ($vat > 0 || $columnId !== 'VAT_RATE')
747 $pdf->Cell($arRowsWidth[$columnId], 20, $string, 0, 0, $k ? 'L' : 'C');
748
749 if ($arCols[$columnId]['NAME'])
750 {
751 $k++;
752 $newLine = true;
753 }
754
755 $i = array_search($columnId, $arColumnKeys);
756 ${"x".($i+1)} = $pdf->GetX();
757 }
758
759 $pdf->Ln();
760}
761while($newLine);
762
763$y5 = $pdf->GetY();
764
765$pdf->Line($x0, $y0, ${"x".$columnCount}, $y0);
766for ($i = 0; $i <= $columnCount; $i++)
767{
768 if ($vat > 0 || $arColumnKeys[$i] != 'VAT_RATE')
769 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
770}
771$pdf->Line($x0, $y5, ${'x'.$columnCount}, $y5);
772
774for ($n = 1; $n <= $rowsCnt; $n++)
775{
776 $arRowsWidth_tmp = $arRowsWidth;
777 $arRowsContentWidth_tmp = $arRowsContentWidth;
778 $accumulated = 0;
779 $accumulatedContent = 0;
780 foreach ($arCols as $columnId => $column)
781 {
782 if (is_null($arCells[$n][$columnId]))
783 {
784 $accumulated += $arRowsWidth_tmp[$columnId];
785 $arRowsWidth_tmp[$columnId] = null;
786 $accumulatedContent += $arRowsContentWidth_tmp[$columnId];
787 $arRowsContentWidth_tmp[$columnId] = null;
788 }
789 else
790 {
791 $arRowsWidth_tmp[$columnId] += $accumulated;
792 $arRowsContentWidth_tmp[$columnId] += $accumulatedContent;
793 $accumulated = 0;
794 $accumulatedContent = 0;
795 }
796 }
797
798 $x0 = $pdf->GetX();
799 $y0 = $pdf->GetY();
800
801 $pdf->SetFont($fontFamily, '', $fontSize);
802
803 $l = 0;
804 do
805 {
806 $newLine = false;
807 foreach ($arCols as $columnId => $column)
808 {
809 $string = '';
810 if (!is_null($arCells[$n][$columnId]))
811 list($string, $arCells[$n][$columnId]) = $pdf->splitString($arCells[$n][$columnId], $arRowsContentWidth_tmp[$columnId]);
812
813 $rowWidth = $arRowsWidth_tmp[$columnId];
814
815 if (in_array($columnId, array('QUANTITY', 'MEASURE', 'PRICE', 'SUM')))
816 {
817 if (!is_null($arCells[$n][$columnId]))
818 {
819 $pdf->Cell($rowWidth, 15, $string, 0, 0, 'R');
820 }
821 }
822 elseif ($columnId == 'NUMBER')
823 {
824 if (!is_null($arCells[$n][$columnId]))
825 $pdf->Cell($rowWidth, 15, ($l == 0) ? $string : '', 0, 0, 'C');
826 }
827 elseif ($columnId == 'NAME')
828 {
829 if (!is_null($arCells[$n][$columnId]))
830 $pdf->Cell($rowWidth, 15, $string, 0, 0, ($n > $cntBasketItem) ? 'R' : '');
831 }
832 elseif ($columnId == 'VAT_RATE')
833 {
834 if (!is_null($arCells[$n][$columnId]))
835 $pdf->Cell($rowWidth, 15, ($l == 0) ? $string : '', 0, 0, 'R');
836 }
837 else
838 {
839 if (!is_null($arCells[$n][$columnId]))
840 {
841 $pdf->Cell($rowWidth, 15, $string, 0, 0, ($n > $cntBasketItem) ? 'R' : 'L');
842 }
843 }
844
845 if ($l == 0)
846 {
847 $pos = array_search($columnId, $arColumnKeys);
848 ${'x'.($pos+1)} = $pdf->GetX();
849 }
850
851 if ($arCells[$n][$columnId])
852 $newLine = true;
853 }
854
855 $pdf->Ln();
856 $l++;
857 }
858 while($newLine);
859
860 if ($params['BILLKZ_COLUMN_NAME_SHOW'] == 'Y')
861 {
862 if (isset($arProps[$n]) && is_array($arProps[$n]))
863 {
864 $pdf->SetFont($fontFamily, '', $fontSize - 2);
865 foreach ($arProps[$n] as $property)
866 {
867 $i = 0;
868 $line = 0;
869 foreach ($arCols as $columnId => $caption)
870 {
871 $i++;
872 if ($i == $columnCount)
873 $line = 1;
874 if ($columnId == 'NAME')
875 $pdf->Cell($arRowsWidth_tmp[$columnId], 12, $property, 0, $line);
876 else
877 $pdf->Cell($arRowsWidth_tmp[$columnId], 12, '', 0, $line);
878 }
879 }
880 }
881 }
882
883 $y5 = $pdf->GetY();
884
885 if ($y0 > $y5)
886 $y0 = $margin['top'];
887
888 for ($i = ($n > $cntBasketItem) ? $columnCount - 1 : 0; $i <= $columnCount; $i++)
889 {
890 if ($vat > 0 || $arColumnKeys[$i] != 'VAT_RATE')
891 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
892 }
893
894 $pdf->Line(($n <= $cntBasketItem) ? $x0 : ${'x'.($columnCount-1)}, $y5, ${'x'.$columnCount}, $y5);
895}
896$pdf->Ln();
897
898if ($params['BILLKZ_TOTAL_SHOW'] == 'Y')
899{
900 $pdf->SetFont($fontFamily, '', $fontSize);
901 $pdf->Write($lineHeight, CSalePdf::prepareToPdf(Loc::getMessage(
902 'SALE_HPS_BILLKZ_BASKET_TOTAL',
903 array(
904 '#BASKET_COUNT#' => $cntBasketItem,
905 '#BASKET_PRICE#' => strip_tags(SaleFormatCurrency($params['SUM'], $params['CURRENCY'], false))
906 )
907 )));
908 $pdf->Ln();
909
910 $pdf->SetFont($fontFamily, 'B', $fontSize);
911 if (in_array($params['CURRENCY'], array("RUR", "RUB", "UAH", "KZT", "BYR", "BYN")))
912 {
913 $pdf->Write(
915 CSalePdf::prepareToPdf(Number2Word_Rus($params['SUM'], "Y", $params['CURRENCY']))
916 );
917 }
918 else
919 {
921 $params['SUM'],
922 $params['CURRENCY'],
923 false
924 ))));
925 }
926 $pdf->SetFont($fontFamily, '', $fontSize);
927 $pdf->Ln();
928 $pdf->Ln();
929}
930
931$y14 = $pdf->GetY();
932$pdf->SetLineWidth($defaultLineWidth * 2);
933$pdf->Line($x0, $y14, $x0 + $width, $y14);
934$pdf->SetLineWidth($defaultLineWidth);
935$pdf->Ln();
936
937if ($params['BILLKZ_SIGN_SHOW'] == 'Y')
938{
939 $executorInfo = '';
940 $signParamName = '';
941 if ($params['SELLER_COMPANY_ACCOUNTANT_NAME'])
942 {
943 if ($params['SELLER_COMPANY_ACCOUNTANT_POSITION'])
944 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_POSITION'];
945 if (!empty($executorInfo))
946 $executorInfo .= ' ';
947 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_NAME'];
948 $signParamName = 'SELLER_COMPANY_ACC_SIGN';
949 }
950 else if ($params['SELLER_COMPANY_DIRECTOR_NAME'])
951 {
952 if ($params['SELLER_COMPANY_DIRECTOR_POSITION'])
953 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_POSITION'];
954 if (!empty($executorInfo))
955 $executorInfo .= ' ';
956 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_NAME'];
957 $signParamName = 'SELLER_COMPANY_DIR_SIGN';
958 }
959 else if ($params['SELLER_COMPANY_ACCOUNTANT_POSITION'])
960 {
961 $executorInfo .= $params['SELLER_COMPANY_ACCOUNTANT_POSITION'];
962 $signParamName = 'SELLER_COMPANY_ACC_SIGN';
963 }
964 else if ($params['SELLER_COMPANY_DIRECTOR_POSITION'])
965 {
966 $executorInfo .= $params['SELLER_COMPANY_DIRECTOR_POSITION'];
967 $signParamName = 'SELLER_COMPANY_DIR_SIGN';
968 }
969 else
970 {
971 $executorInfo = str_pad('', 6 * 35, ' ');
972 }
973 $stampHeight = $stampWidth = 0;
974 if (!$blank && $params['BILLKZ_PATH_TO_STAMP'])
975 {
976 list($stampHeight, $stampWidth) = $pdf->GetImageSize($params['BILLKZ_PATH_TO_STAMP']);
977
978 if ($stampHeight && $stampWidth)
979 {
980 if ($stampHeight > 120 || $stampWidth > 120)
981 {
982 $ratio = 120 / max($stampHeight, $stampWidth);
983 $stampHeight = $ratio * $stampHeight;
984 $stampWidth = $ratio * $stampWidth;
985 }
986
987 $imageY = $pdf->GetY();
988 $pageNumBefore = $pdf->PageNo();
989
990 $pdf->Image(
991 $params['BILLKZ_PATH_TO_STAMP'],
992 $margin['left']+40, null,
993 $stampWidth, $stampHeight
994 );
995
996 $pageNumAfter = $pdf->PageNo();
997 if ($pageNumAfter === $pageNumBefore)
998 $pdf->SetY($imageY);
999 else
1000 $pdf->SetY($pdf->GetY() - $stampHeight);
1001 unset($imageY, $pageNumBefore, $pageNumAfter);
1002 }
1003 }
1004
1005 $signHeight = $signWidth = 0;
1006 $isSign = false;
1007 if (!$blank && $params[$signParamName])
1008 {
1009 list($signHeight, $signWidth) = $pdf->GetImageSize($params[$signParamName]);
1010
1011 if ($signHeight && $signWidth)
1012 {
1013 $ratio = min(37.5/$signHeight, 150/$signWidth);
1014 $signHeight = $ratio * $signHeight;
1015 $signWidth = $ratio * $signWidth;
1016
1017 $isSign = true;
1018 }
1019 }
1020
1021 $colInfo = array(
1022 array('prc' => 18),
1023 array('prc' => 50),
1024 array('prc' => 32)
1025 );
1026 foreach ($colInfo as $n => $info)
1027 $colInfo[$n]['width'] = $width * $info['prc'] / 100;
1028 $y15 = $pdf->GetY();
1029 $pdf->SetY($y15 + max(($stampHeight ?: 150), $signHeight, $lineHeight) / 2);
1030 $pdf->SetFont($fontFamily, 'B', $fontSize);
1031 $text = CSalePdf::prepareToPdf(Loc::getMessage("SALE_HPS_BILLKZ_EXECUTOR"));
1032 $pdf->Cell($colInfo[0]['width'], $lineHeight, $text);
1033 $pdf->SetFont($fontFamily, '', $fontSize);
1034 $x1 = $x0 + $colInfo[0]['width'];
1035 $x2 = $x1 + $colInfo[1]['width'];
1036 $x3 = $x2 + $colInfo[2]['width'];
1037 $y16 = $pdf->GetY();
1038 $y17 = $y16 + $lineHeight + 1;
1039 $text = CSalePdf::prepareToPdf('/ '.($executorInfo ?: str_pad('', 6 * 35, ' ')).' /');
1040 $maxTextWidth = $width / 2;
1041 $textWidth = $pdf->GetStringWidth($text);
1042 if ($textWidth > $maxTextWidth)
1043 {
1044 $colInfo[1]['width'] = $width - $colInfo[0]['width'] - $maxTextWidth;
1045 $colInfo[2]['width'] = $maxTextWidth;
1046 $x2 = $x1 + $colInfo[1]['width'];
1047 $x3 = $x2 + $colInfo[2]['width'];
1048 }
1049 else if ($textWidth > $colInfo[2]['width'])
1050 {
1051 $colInfo[1]['width'] = $width - $colInfo[0]['width'] - $textWidth;
1052 $colInfo[2]['width'] = $textWidth;
1053 $x2 = $x1 + $colInfo[1]['width'];
1054 $x3 = $x2 + $colInfo[2]['width'];
1055 }
1056 $pdf->Line($x1, $y17, $x2, $y17);
1057 $pdf->SetX($x2);
1058 while ($pdf->GetStringWidth($text) > 0)
1059 {
1060 list($string, $text) = $pdf->splitString($text, $colInfo[2]['width']);
1061 $pdf->Cell($colInfo[2]['width'], $lineHeight, $string);
1062 if ($text)
1063 {
1064 $pdf->Ln();
1065 $pdf->SetX($x2);
1066 }
1067 }
1068 if ($isSign)
1069 {
1070 $pdf->Image(
1072 $x1 + ($colInfo[1]['width'] - $signWidth) / 2,
1073 $pdf->GetY() - $signHeight + $lineHeight,
1074 $signWidth, $signHeight
1075 );
1076 }
1077}
1078
1079$dest = 'I';
1080if ($_REQUEST['GET_CONTENT'] == 'Y')
1081 $dest = 'S';
1082else if ($_REQUEST['DOWNLOAD'] == 'Y')
1083 $dest = 'D';
1084
1085$fileName = sprintf(
1086 'Schet No %s ot %s.pdf',
1087 str_replace(
1088 array(
1089 chr(0), chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), chr(7), chr(8), chr(9), chr(10), chr(11),
1090 chr(12), chr(13), chr(14), chr(15), chr(16), chr(17), chr(18), chr(19), chr(20), chr(21), chr(22),
1091 chr(23), chr(24), chr(25), chr(26), chr(27), chr(28), chr(29), chr(30), chr(31),
1092 '"', '*', '/', ':', '<', '>', '?', '\\', '|'
1093 ),
1094 '_',
1095 strval($params["ACCOUNT_NUMBER"])
1096 ),
1097 ConvertDateTime($params['PAYMENT_DATE_INSERT'], 'YYYY-MM-DD')
1098);
1099
1100$trFileName = CUtil::translit($fileName, 'ru', array('max_len' => 1024, 'safe_chars' => '.', 'replace_space' => '-'));
1101
1102return $pdf->Output($trFileName, $dest, $fileName);
$sum
Определения checkout.php:6
Определения pdf.php:312
static isPdfAvailable()
Определения pdf.php:316
static prepareToPdf($string)
Определения pdf.php:324
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$l
Определения options.php:783
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info
Определения backup.php:924
ConvertDateTime($datetime, $to_format=false, $from_site=false, $bSearchInSitesOnly=false)
Определения tools.php:724
roundEx($value, $prec=0)
Определения tools.php:4635
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)
Определения tools.php:871
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
Определения tools.php:2587
MakeTimeStamp($datetime, $format=false)
Определения tools.php:538
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$fileName
Определения quickway.php:305
die
Определения quickway.php:367
$text
Определения template_pdf.php:79
$textWidth
Определения template_pdf.php:80
$i
Определения factura.php:643
</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
$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
$logoWidth
Определения pdf.php:49
$y5
Определения pdf.php:464
$logoHeight
Определения pdf.php:48
if(!empty($sellerData)) $dest
Определения pdf.php:818
$fontSize
Определения pdf.php:30
$pdf
Определения pdf.php:13
$arPaySysAction["ENCODING"]
Определения pdf.php:2
$fontFamily
Определения pdf.php:29
$x0
Определения pdf.php:452
$y0
Определения pdf.php:47
$vatRateColumn
Определения template.php:278
$currency
Определения template.php:266
$arCurFormat
Определения template.php:265
$arColumnKeys
Определения template.php:310
$columnList
Определения template.php:276
$sellerBank
Определения template.php:134
$vat
Определения template.php:273
$columnCount
Определения template.php:311
$sellerRs
Определения template.php:137
$arCols
Определения template.php:277
$cntBasketItem
Определения template.php:274
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$arCells
Определения template.php:223
if($params['BILLKZ_SIGN_SHOW']=='Y') $signParamName
Определения template.php:667
$buyerTitle
Определения template.php:266
$sellerTitle
Определения template.php:231
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
$y1
Определения pdf.php:133
$y3
Определения pdf.php:159
$y2
Определения pdf.php:144
$x2
Определения pdf.php:124
$x3
Определения pdf.php:126
$y4
Определения pdf.php:168
$matches
Определения index.php:22
$trFileName
Определения template_pdf.php:929
$k
Определения template_pdf.php:567
$n
Определения update_log.php:107
$arRowsContentWidth
Определения template_pdf.php:447
$defaultLineWidth
Определения template_pdf.php:32
$arRowsWidth
Определения template_pdf.php:446
$lineHeight
Определения template_pdf.php:33
$blank
Определения template_pdf.php:11
if($params['BILLKZ_PAYER_SHOW']=='Y') $colInfo
Определения template_pdf.php:402
$y12
Определения template_pdf.php:460
$x1
Определения template_pdf.php:419
if($params['BILLKZ_TOTAL_SHOW']=='Y') $y14
Определения template_pdf.php:931
$y11
Определения template_pdf.php:445
$y10
Определения template_pdf.php:434
$y8
Определения template_pdf.php:408
$y9
Определения template_pdf.php:418