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
11$blank = ($_REQUEST['BLANK'] == 'Y');
12
14$pdf = new CSalePdf('P', 'pt', 'A4');
15
16if ($params['BILLBY_BACKGROUND'])
17{
18 $pdf->SetBackground(
19 $params['BILLBY_BACKGROUND'],
20 $params['BILLBY_BACKGROUND_STYLE']
21 );
22}
23
24$pageWidth = $pdf->GetPageWidth();
25$pageHeight = $pdf->GetPageHeight();
26
27$pdf->AddFont('Font', '', 'pt_sans-regular.ttf', true);
28$pdf->AddFont('Font', 'B', 'pt_sans-bold.ttf', true);
29
30$fontFamily = 'Font';
31$fontSize = 10.5;
34
36 'top' => intval($params['BILLBY_MARGIN_TOP'] ?: 15) * 72/25.4,
37 'right' => intval($params['BILLBY_MARGIN_RIGHT'] ?: 15) * 72/25.4,
38 'bottom' => intval($params['BILLBY_MARGIN_BOTTOM'] ?: 15) * 72/25.4,
39 'left' => intval($params['BILLBY_MARGIN_LEFT'] ?: 20) * 72/25.4
40);
41
42$width = $pageWidth - $margin['left'] - $margin['right'];
43
44$pdf->SetDisplayMode(100, 'continuous');
45$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
46$pdf->SetAutoPageBreak(true, $margin['bottom']);
47
48$pdf->AddPage();
49
50
51$x0 = $pdf->GetX();
52$y0 = $pdf->GetY();
55
57if ($params['BILLBY_HEADER_SHOW'] == 'Y')
58{
59 if ($params['BILLBY_PATH_TO_LOGO'])
60 {
61 list($imageHeight, $imageWidth) = $pdf->GetImageSize($params['BILLBY_PATH_TO_LOGO']);
62
63 $imgMargin = 5;
64 $imgDpi = intval($params['BILLBY_LOGO_DPI']) ?: 96;
65 $imgZoom = 96 / $imgDpi;
66
67 $logoHeight = $imageHeight * $imgZoom + $imgMargin;
68 $logoWidth = $imageWidth * $imgZoom + $imgMargin;
69 if ($logoWidth >= $width)
70 {
71 $imgDpi = 96 * $imageWidth/($width*0.6 + 5);
72 $imgZoom = 96 / $imgDpi;
73
74 $logoHeight = $imageHeight * $imgZoom + $imgMargin;
75 $logoWidth = $imageWidth * $imgZoom + $imgMargin;
76 }
77
79
80 $pdf->Image($params['BILLBY_PATH_TO_LOGO'], $x0 + $textWidth + $imgMargin, $pdf->GetY(), -$imgDpi, -$imgDpi);
81 }
82
83 $pdf->SetFont($fontFamily, '', $fontSize);
84
85 if ($textWidth >= 20)
86 {
87 // region Seller info
89 $sellerInfoName = '';
90 if ($params["SELLER_COMPANY_NAME"])
91 {
92 $sellerInfoName .= $params["SELLER_COMPANY_NAME"];
93 if (!empty($sellerInfoName))
95 }
96 unset($sellerInfoName);
98 if ($params['SELLER_COMPANY_INN'])
99 {
100 $sellerInfoTaxId .= Loc::getMessage('SALE_HPS_BILLBY_INN').': '.$params['SELLER_COMPANY_INN'];
101 if (!empty($sellerInfoTaxId))
103 }
104 unset($sellerInfoTaxId);
105 $sellerInfoBank = '';
106 $sellerBank = '';
107 $sellerRs = '';
108 if ($params["SELLER_COMPANY_BANK_NAME"])
109 {
110 $sellerBankCity = '';
111 if ($params["SELLER_COMPANY_BANK_CITY"])
112 {
113 $sellerBankCity = $params["SELLER_COMPANY_BANK_CITY"];
114 if (is_array($sellerBankCity))
115 $sellerBankCity = implode(', ', $sellerBankCity);
116 else
117 $sellerBankCity = str_replace(array("\r\n", "\n", "\r"), ', ', strval($sellerBankCity));
118 }
119 $sellerBank = sprintf(
120 "%s %s",
121 $params["SELLER_COMPANY_BANK_NAME"],
122 $sellerBankCity
123 );
124 $sellerRs = $params["SELLER_COMPANY_BANK_ACCOUNT"];
125 }
126 else
127 {
128 $rsPattern = '/\s*\d{10,100}\s*/';
129
130 $sellerBank = trim(preg_replace($rsPattern, ' ', $params["SELLER_COMPANY_BANK_ACCOUNT"]));
131
132 preg_match($rsPattern, $params["SELLER_COMPANY_BANK_ACCOUNT"], $matches);
133 $sellerRs = trim($matches[0]);
134 }
135 if (!empty($sellerRs))
136 {
137 $sellerRsPrefix = Loc::getMessage('SALE_HPS_BILLBY_SELLER_ACC_ABBR');
138 if (!empty($sellerRsPrefix))
139 $sellerRs = $sellerRsPrefix.' '.$sellerRs;
140 unset($sellerRsPrefix);
142 }
143 unset($sellerRs);
144 if (!empty($sellerBank))
145 {
146 if (!empty($sellerInfoBank))
147 $sellerInfoBank .= ', ';
149 }
150 unset($sellerBank);
151 if (!empty($params['SELLER_COMPANY_BANK_BIC']))
152 {
153 if (!empty($sellerInfoBank))
154 $sellerInfoBank .= ', ';
156 Loc::getMessage('SALE_HPS_BILLBY_SELLER_BANK_BIK').' '.$params['SELLER_COMPANY_BANK_BIC'];
157 }
158 if (!empty($sellerInfoBank))
160 unset($sellerInfoBank);
161 $sellerInfoAddr = '';
162 if ($params['SELLER_COMPANY_ADDRESS'])
163 {
164 $sellerAddr = $params['SELLER_COMPANY_ADDRESS'];
165 if (is_array($sellerAddr))
166 $sellerAddr = implode(', ', $sellerAddr);
167 else
168 $sellerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($sellerAddr));
169 if (!empty($sellerAddr))
170 $sellerInfoAddr .= Loc::getMessage('SALE_HPS_BILLBY_ADDR_TITLE').': '.$sellerAddr;
171 }
172 if ($params["SELLER_COMPANY_PHONE"])
173 {
174 if (!empty($sellerInfoAddr))
175 $sellerInfoAddr .= ', ';
176 $phoneTitle = Loc::getMessage('SALE_HPS_BILLBY_PHONE_TITLE');
177 if (!empty($phoneTitle))
178 $sellerInfoAddr .= $phoneTitle.' ';
179 $sellerInfoAddr .= $params["SELLER_COMPANY_PHONE"];
180 }
181 if (!empty($sellerInfoAddr))
183 unset($sellerInfoAddr);
184 // endregion Seller info
185
186 $pdf->SetX($x0);
187 if (!empty($sellerInfoRows))
188 {
189 foreach ($sellerInfoRows as $text)
190 {
192 while ($pdf->GetStringWidth($text))
193 {
194 list($string, $text) = $pdf->splitString($text, $textWidth);
195 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'L');
196 $pdf->Ln();
197 }
198 }
199 }
200 unset($sellerInfoRows);
201 $pdf->Ln();
202 }
203 $pdf->SetY(max($y0 + $logoHeight, $pdf->GetY()));
204}
205if ($params['BILLBY_HEADER'])
206{
207 $dateValue = $params["PAYMENT_DATE_INSERT"];
208 if ($dateValue instanceof \Bitrix\Main\Type\Date || $dateValue instanceof \Bitrix\Main\Type\DateTime)
209 {
210 $dateValue = mb_strtolower(FormatDate('d F Y', $dateValue->getTimestamp()));
211 $yearPostfix = Loc::getMessage('SALE_HPS_BILLBY_YEAR_POSTFIX');
212 if (!empty($yearPostfix))
213 $dateValue .= $yearPostfix;
214 unset($yearPostfix);
215 }
216 else if (is_string($dateValue))
217 {
218 $timeStampValue = MakeTimeStamp($dateValue);
219 if ($timeStampValue !== false)
220 $dateValue = mb_strtolower(FormatDate('d F Y', $timeStampValue));
221 unset($timeStampValue);
222 }
223 $pdf->SetFont($fontFamily, 'B', $fontSize * 1.6);
225 $params['BILLBY_HEADER'].' '.Loc::getMessage('SALE_HPS_BILLBY_SELLER_TITLE', array('#PAYMENT_NUM#' => $params["ACCOUNT_NUMBER"], '#PAYMENT_DATE#' => $dateValue))
226 );
227
228 $billNo_width = $pdf->GetStringWidth($billNo_tmp);
229 $pdf->Cell(0, $lineHeight, $billNo_tmp, 0, 0, 'C');
230 $pdf->Ln();
231}
232$pdf->SetFont($fontFamily, '', $fontSize);
233
234if ($params["BILLBY_ORDER_SUBJECT"])
235{
236 $pdf->Cell($width/2-$billNo_width/2-2, $lineHeight, '');
237 $pdf->MultiCell(0, 15, CSalePdf::prepareToPdf($params["BILLBY_ORDER_SUBJECT"]), 0, 'L');
238}
239
240if ($params["PAYMENT_DATE_PAY_BEFORE"])
241{
242 $pdf->Cell($width/2-$billNo_width/2-2, $lineHeight, '');
244 Loc::getMessage('SALE_HPS_BILLBY_SELLER_DATE_END', array('#PAYMENT_DATE_END#' => ConvertDateTime($params["PAYMENT_DATE_PAY_BEFORE"], FORMAT_DATE) ?: $params["PAYMENT_DATE_PAY_BEFORE"]))), 0, 'L');
245}
246
247$pdf->Ln();
248if ($params['BILLBY_PAYER_SHOW'] == 'Y')
249{
250 // region Buyer info
251 $buyerInfoRows = array();
252 if ($params['BUYER_PERSON_COMPANY_DOGOVOR'])
253 {
254 $buyerInfoRows[] =
255 Loc::getMessage('SALE_HPS_BILLBY_BUYER_DOGOVOR').': '.$params['BUYER_PERSON_COMPANY_DOGOVOR'];
256 $buyerInfoRows[] = '';
257 }
258 $buyerInfoName = Loc::getMessage('SALE_HPS_BILLBY_BUYER_TITLE').':';
259 if ($params["BUYER_PERSON_COMPANY_NAME"])
260 {
261 if (!empty($buyerInfoName))
262 $buyerInfoName .= ' ';
263 $buyerInfoName .= $params["BUYER_PERSON_COMPANY_NAME"];
264 }
265 if (!empty($buyerInfoName))
266 $buyerInfoRows[] = $buyerInfoName;
267 unset($buyerInfoName);
268 $buyerInfoTaxId = '';
269 if ($params['BUYER_PERSON_COMPANY_INN'])
270 {
271 $buyerInfoTaxId .= Loc::getMessage('SALE_HPS_BILLBY_INN').': '.$params['BUYER_PERSON_COMPANY_INN'];
272 if (!empty($buyerInfoTaxId))
273 $buyerInfoRows[] = $buyerInfoTaxId;
274 }
275 unset($buyerInfoTaxId);
276 $buyerInfoBank = '';
277 $buyerBank = '';
278 $buyerRs = '';
279 if ($params["BUYER_PERSON_COMPANY_BANK_NAME"])
280 {
281 $buyerBankCity = '';
282 if ($params["BUYER_PERSON_COMPANY_BANK_CITY"])
283 {
284 $buyerBankCity = $params["BUYER_PERSON_COMPANY_BANK_CITY"];
285 if (is_array($buyerBankCity))
286 $buyerBankCity = implode(', ', $buyerBankCity);
287 else
288 $buyerBankCity = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerBankCity));
289 }
290 $buyerBank = sprintf(
291 "%s %s",
292 $params["BUYER_PERSON_COMPANY_BANK_NAME"],
293 $buyerBankCity
294 );
295 $buyerRs = $params["BUYER_PERSON_COMPANY_BANK_ACCOUNT"];
296 }
297 else
298 {
299 $rsPattern = '/\s*\d{10,100}\s*/';
300
301 $buyerBank = trim(preg_replace($rsPattern, ' ', $params["BUYER_PERSON_COMPANY_BANK_ACCOUNT"]));
302
303 preg_match($rsPattern, $params["BUYER_PERSON_COMPANY_BANK_ACCOUNT"], $matches);
304 $buyerRs = trim($matches[0]);
305 }
306 if (!empty($buyerRs))
307 {
308 $buyerRsPrefix = Loc::getMessage('SALE_HPS_BILLBY_SELLER_ACC_ABBR');
309 if (!empty($buyerRsPrefix))
310 $buyerRs = $buyerRsPrefix.' '.$buyerRs;
311 unset($buyerRsPrefix);
312 $buyerInfoBank .= $buyerRs;
313 }
314 unset($buyerRs);
315 if (!empty($buyerBank))
316 {
317 if (!empty($buyerInfoBank))
318 $buyerInfoBank .= ', ';
319 $buyerInfoBank .= $buyerBank;
320 }
321 unset($buyerBank);
322 if (!empty($params['BUYER_PERSON_COMPANY_BANK_BIC']))
323 {
324 if (!empty($buyerInfoBank))
325 $buyerInfoBank .= ', ';
326 $buyerInfoBank .= Loc::getMessage('SALE_HPS_BILLBY_SELLER_BANK_BIK').' '.$params['BUYER_PERSON_COMPANY_BANK_BIC'];
327 }
328 if (!empty($buyerInfoBank))
329 $buyerInfoRows[] = $buyerInfoBank;
330 unset($buyerInfoBank);
331 $buyerInfoAddr = '';
332 if ($params['BUYER_PERSON_COMPANY_ADDRESS'])
333 {
334 $buyerAddr = $params['BUYER_PERSON_COMPANY_ADDRESS'];
335 if (is_array($buyerAddr))
336 $buyerAddr = implode(', ', $buyerAddr);
337 else
338 $buyerAddr = str_replace(array("\r\n", "\n", "\r"), ', ', strval($buyerAddr));
339 if (!empty($buyerAddr))
340 $buyerInfoAddr .= Loc::getMessage('SALE_HPS_BILLBY_ADDR_TITLE').': '.$buyerAddr;
341 }
342 if ($params["BUYER_PERSON_COMPANY_PHONE"])
343 {
344 if (!empty($buyerInfoAddr))
345 $buyerInfoAddr .= ', ';
346 $phoneTitle = Loc::getMessage('SALE_HPS_BILLBY_PHONE_TITLE');
347 if (!empty($phoneTitle))
348 $buyerInfoAddr .= $phoneTitle.' ';
349 $buyerInfoAddr .= $params["BUYER_PERSON_COMPANY_PHONE"];
350 }
351 if ($params["BUYER_PERSON_COMPANY_FAX"])
352 {
353 if (!empty($buyerInfoAddr))
354 $buyerInfoAddr .= ', ';
355 $phoneTitle = Loc::getMessage('SALE_HPS_BILLBY_FAX_TITLE');
356 if (!empty($phoneTitle))
357 $buyerInfoAddr .= $phoneTitle.' ';
358 $buyerInfoAddr .= $params["BUYER_PERSON_COMPANY_FAX"];
359 }
360 if ($params["BUYER_PERSON_COMPANY_NAME_CONTACT"])
361 {
362 if (!empty($buyerInfoAddr))
363 $buyerInfoAddr .= ', ';
364 $buyerInfoAddr .= $params["BUYER_PERSON_COMPANY_NAME_CONTACT"];
365 }
366 if (!empty($buyerInfoAddr))
367 $buyerInfoRows[] = $buyerInfoAddr;
368 unset($buyerInfoAddr);
369 // endregion Buyer info
370
371 $pdf->SetX($x0);
373 if (!empty($buyerInfoRows))
374 {
375 foreach ($buyerInfoRows as $text)
376 {
377 if (empty($text))
378 {
379 $pdf->Ln();
380 }
381 else
382 {
384 while ($pdf->GetStringWidth($text))
385 {
386 list($string, $text) = $pdf->splitString($text, $textWidth);
387 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'L');
388 $pdf->Ln();
389 }
390 }
391 }
392 }
393 unset($buyerInfoRows);
394}
395$arCurFormat = CCurrencyLang::GetCurrencyFormat($params['CURRENCY']);
396$currency = preg_replace('/(^|[^&])#/', '${1}', $arCurFormat['FORMAT_STRING']);
397 $currency = strip_tags($currency);
398
399// Precision
400$currencyFormat = CCurrencyLang::GetFormatDescription($params['CURRENCY']);
401if ($currencyFormat === false)
402 $currencyFormat = CCurrencyLang::GetDefaultValues();
404if ($currencyPrecision <= 0)
406$salePrecision = (int)Bitrix\Main\Config\Option::get('sale', 'value_precision', 2);
407if ($salePrecision <= 0)
408 $salePrecision = 2;
411
412
413$columnList = array('NUMBER', 'NAME', 'QUANTITY', 'MEASURE', 'PRICE', 'SUM', 'VAT_RATE', 'VAT_SUM', 'TOTAL');
416foreach ($columnList as $column)
417{
418 if ($params['BILLBY_COLUMN_'.$column.'_SHOW'] == 'Y')
419 {
420 $caption = $params['BILLBY_COLUMN_'.$column.'_TITLE'];
421
422 $arCols[$column] = array(
423 'NAME' => CSalePdf::prepareToPdf($caption),
424 'SORT' => $params['BILLBY_COLUMN_'.$column.'_SORT']
425 );
426 }
427}
428if ($params['USER_COLUMNS'])
429{
430 $columnList = array_merge($columnList, array_keys($params['USER_COLUMNS']));
431 foreach ($params['USER_COLUMNS'] as $id => $val)
432 {
433 $arCols[$id] = array(
434 'NAME' => CSalePdf::prepareToPdf($val['NAME']),
435 'SORT' => $val['SORT']
436 );
437 }
438}
439
440uasort($arCols, function ($a, $b) {return ($a['SORT'] < $b['SORT']) ? -1 : 1;});
441$arColumnKeys = array_keys($arCols);
443
445
450if (count($params['BASKET_ITEMS']) > 0)
451{
452 $arCells = array();
453 $arProps = array();
454
455 $n = 0;
456 $sum = 0.00;
457 $totalSum = 0.00;
458 $totalVatSum = 0.00;
459 $totalSumWithVat = 0.00;
460 $vat = 0;
461
462 foreach ($params['BASKET_ITEMS'] as $basketItem)
463 {
464 $productName = $basketItem["NAME"];
465 if ($productName == "OrderDelivery")
466 $productName = Loc::getMessage('SALE_HPS_BILLBY_DELIVERY');
467 else if ($productName == "OrderDiscount")
468 $productName = Loc::getMessage('SALE_HPS_BILLBY_DISCOUNT');
469
470 if ($basketItem['IS_VAT_IN_PRICE'])
471 {
472 $basketItemTotal = doubleval($basketItem['PRICE'] * $basketItem['QUANTITY']);
473
474 if (($basketItem['VAT_RATE'] != 0.0))
475 {
476 $basketItemSum = $basketItemTotal / (1 + doubleval($basketItem['VAT_RATE']));
477 $basketItemVatSum = doubleval($basketItemSum * $basketItem['VAT_RATE']);
478 }
479 else
480 {
481 $basketItemSum = $basketItemTotal;
482 $basketItemVatSum = 0.0;
483 }
484 }
485 else
486 {
487 $basketItemSum = doubleval($basketItem['PRICE'] * $basketItem['QUANTITY']);
488
489 if (($basketItem['VAT_RATE'] != 0.0))
490 {
491 $basketItemTotal = doubleval($basketItemSum * (1 + doubleval($basketItem['VAT_RATE'])));
492 $basketItemVatSum = doubleval($basketItemSum * doubleval($basketItem['VAT_RATE']));
493 }
494 else
495 {
496 $basketItemTotal = $basketItemSum;
497 $basketItemVatSum = 0.0;
498 }
499 }
500
501 $arCells[++$n] = array();
502 foreach ($arCols as $columnId => $col)
503 {
504 $data = null;
505
506 switch ($columnId)
507 {
508 case 'NUMBER':
510 $arCols[$columnId]['IS_DIGIT'] = true;
511 break;
512 case 'NAME':
513 $data = CSalePdf::prepareToPdf($productName);
514 break;
515 case 'QUANTITY':
516 $data = CSalePdf::prepareToPdf(roundEx($basketItem['QUANTITY'], SALE_VALUE_PRECISION));
517 $arCols[$columnId]['IS_DIGIT'] = true;
518 break;
519 case 'MEASURE':
520 $data = CSalePdf::prepareToPdf($basketItem["MEASURE_NAME"] ? $basketItem["MEASURE_NAME"] : Loc::getMessage('SALE_HPS_BILLBY_BASKET_MEASURE_DEFAULT'));
521 $arCols[$columnId]['IS_DIGIT'] = true;
522 break;
523 case 'PRICE':
524 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItem['PRICE'], $basketItem['CURRENCY'], true));
525 $arCols[$columnId]['IS_DIGIT'] = true;
526 break;
527 case 'SUM':
528 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemSum, $basketItem['CURRENCY'], true));
529 $arCols[$columnId]['IS_DIGIT'] = true;
530 break;
531 case 'VAT_RATE':
532 if ($basketItem['VAT_RATE'] == 0.0)
533 $data = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_RATE_NO'));
534 else
535 $data = CSalePdf::prepareToPdf(roundEx($basketItem['VAT_RATE'] * 100, $precision)."%");
536 $arCols[$columnId]['IS_DIGIT'] = true;
537 break;
538 case 'VAT_SUM':
539 if ($basketItem['VAT_RATE'] == 0.0)
540 $data = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_SUM_NO'));
541 else
542 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemVatSum, $basketItem['CURRENCY'], true));
543 $arCols[$columnId]['IS_DIGIT'] = true;
544 break;
545 case 'TOTAL':
546 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemTotal, $basketItem['CURRENCY'], true));
547 $arCols[$columnId]['IS_DIGIT'] = true;
548 break;
549 default:
550 if (preg_match('/[^0-9 ,\.]/', $basketItem[$columnId]) === 0)
551 {
552 if (!array_key_exists('IS_DIGIT', $arCols[$columnId]))
553 $arCols[$columnId]['IS_DIGIT'] = true;
554 }
555 else
556 {
557 $arCols[$columnId]['IS_DIGIT'] = false;
558 }
559 $data = ($basketItem[$columnId]) ? CSalePdf::prepareToPdf($basketItem[$columnId]) : '';
560 }
561 if ($data !== null)
562 $arCells[$n][$columnId] = $data;
563 }
564
565 $arProps[$n] = array();
566 foreach ($basketItem['PROPS'] as $basketPropertyItem)
567 {
568 if ($basketPropertyItem['CODE'] == 'CATALOG.XML_ID' || $basketPropertyItem['CODE'] == 'PRODUCT.XML_ID')
569 continue;
570
571 $arProps[$n][] = $pdf::prepareToPdf(sprintf("%s: %s", $basketPropertyItem["NAME"], $basketPropertyItem["VALUE"]));
572 }
573
574 $sum += roundEx(doubleval($basketItem['PRICE'] * $basketItem['QUANTITY']), $precision);
575 $vat = max($vat, $basketItem['VAT_RATE']);
576 $totalSum += roundEx($basketItemSum, $precision);
577 $totalVatSum += roundEx($basketItemVatSum, $precision);
578 $totalSumWithVat += roundEx($basketItemTotal, $precision);
579 }
580
581 if ($params['DELIVERY_PRICE'] > 0)
582 {
583 $sDeliveryItem = Loc::getMessage('SALE_HPS_BILLBY_DELIVERY');
584 if ($params['DELIVERY_NAME'])
585 $sDeliveryItem .= sprintf(" (%s)", $params['DELIVERY_NAME']);
586
587 $basketItemTotal = $params['DELIVERY_PRICE'];
588
589 if (($vat != 0.0))
590 {
591 $basketItemSum = $basketItemTotal / (1 + doubleval($vat));
592 $basketItemVatSum = doubleval($basketItemSum * $vat);
593 }
594 else
595 {
596 $basketItemSum = $basketItemTotal;
597 $basketItemVatSum = 0.0;
598 }
599
600 $arCells[++$n] = array();
601 foreach ($arCols as $columnId => $col)
602 {
603 $data = null;
604
605 switch ($columnId)
606 {
607 case 'NUMBER':
609 $arCols[$columnId]['IS_DIGIT'] = true;
610 break;
611 case 'NAME':
612 $data = CSalePdf::prepareToPdf($sDeliveryItem);
613 break;
614 case 'QUANTITY':
616 $arCols[$columnId]['IS_DIGIT'] = true;
617 break;
618 case 'MEASURE':
620 $arCols[$columnId]['IS_DIGIT'] = true;
621 break;
622 case 'PRICE':
623 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($params['DELIVERY_PRICE'], $params['CURRENCY'], true));
624 $arCols[$columnId]['IS_DIGIT'] = true;
625 break;
626 case 'SUM':
627 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemSum, $params['CURRENCY'], true));
628 $arCols[$columnId]['IS_DIGIT'] = true;
629 break;
630 case 'VAT_RATE':
631 if ($vat == 0.0)
632 $data = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_RATE_NO'));
633 else
635 $arCols[$columnId]['IS_DIGIT'] = true;
636 break;
637 case 'VAT_SUM':
638 if ($vat == 0.0)
639 $data = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_SUM_NO'));
640 else
641 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemVatSum, $params['CURRENCY'], true));
642 $arCols[$columnId]['IS_DIGIT'] = true;
643 break;
644 case 'TOTAL':
645 $data = CSalePdf::prepareToPdf(SaleFormatCurrency($basketItemTotal, $params['CURRENCY'], true));
646 $arCols[$columnId]['IS_DIGIT'] = true;
647 break;
648 default:
649 $data = '';
650 }
651 if ($data !== null)
652 $arCells[$n][$columnId] = $data;
653 }
654
655 $sum += roundEx(doubleval($params['DELIVERY_PRICE']), $precision);
656 $totalSum += roundEx($basketItemSum, $precision);
657 $totalVatSum += roundEx($basketItemVatSum, $precision);
658 $totalSumWithVat += roundEx($basketItemTotal, $precision);
659 }
660
661 $totalRowIsLast = false;
662 $totalRowIndex = -1;
664 if ($params['BILLBY_TOTAL_SHOW'] == 'Y')
665 {
666 $totalRowValues = array();
667 foreach ($arColumnKeys as $colNum => $colCode)
668 {
669 $skip = false;
670 $value = null;
671 $isDigit = false;
672 switch ($colCode)
673 {
674 case 'SUM':
675 $value = CSalePdf::prepareToPdf(SaleFormatCurrency($totalSum, $params['CURRENCY'], true));
676 $isDigit = true;
677 break;
678 case 'VAT_RATE':
679 $value = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_RATE_X'));
680 $isDigit = true;
681 break;
682 case 'VAT_SUM':
683 if ($totalVatSum == 0.0)
684 $value = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT_SUM_NO'));
685 else
687 $isDigit = true;
688 break;
689 case 'TOTAL':
691 $isDigit = true;
692 break;
693 default:
694 $skip = true;
695 }
696 if (!$skip)
697 $totalRowValues[$colNum] = array('value' => $value, 'isDigit' => $isDigit);
698 }
699 unset($skip, $value, $isDigit);
700 $totalTitleColIndex = (empty($totalRowValues) ? 0 : (int)min(array_keys($totalRowValues))) - 1;
701 if ($totalTitleColIndex >= 0)
702 $totalRowValues[$totalTitleColIndex] = array('value' => CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_SUM')));
703 if (!empty($totalRowValues))
704 {
705 $showTotalRow = true;
706 $arCells[++$n] = array();
707 for ($i = 0; $i < $columnCount; $i++)
708 {
709 if (isset($totalRowValues[$i]))
710 {
711 $arCells[$n][$arColumnKeys[$i]] = $totalRowValues[$i]['value'];
712 if (isset($totalRowValues[$i]['isDigit']))
713 $arCols[$arColumnKeys[$i]]['IS_DIGIT'] = $totalRowValues[$i]['isDigit'];
714 }
715 else
716 {
717 $arCells[$n][$arColumnKeys[$i]] = null;
718 }
719 }
721 }
722 unset($totalRowValues);
723
724 $totalRowIsLast = true;
725 if ($params['TAXES'])
726 {
727 foreach ($params['TAXES'] as $tax)
728 {
729 if (isset($tax['CODE']) && $tax['CODE'] !== 'VAT')
730 {
731 $totalRowIsLast = false;
732 $arCells[++$n] = array();
733 for ($i = 0; $i < $columnCount; $i++)
734 $arCells[$n][$arColumnKeys[$i]] = null;
735
737 "%s%s%s:",
738 ($tax["IS_IN_PRICE"] == "Y") ? Loc::getMessage('SALE_HPS_BILLBY_INCLUDING') : "",
739 $tax["TAX_NAME"],
740 ($vat <= 0 && $tax["IS_PERCENT"] == "Y") ? sprintf(' (%s%%)', roundEx($tax["VALUE"], $precision)) : ""
741 ));
742 $arCells[$n][$arColumnKeys[$columnCount-1]] = CSalePdf::prepareToPdf(SaleFormatCurrency($tax["VALUE_MONEY"], $params['CURRENCY'], true));
743 }
744 }
745 }
746
747 if ($params['SUM_PAID'] > 0)
748 {
749 $totalRowIsLast = false;
750 $arCells[++$n] = array();
751 for ($i = 0; $i < $columnCount; $i++)
752 $arCells[$n][$arColumnKeys[$i]] = null;
753
754 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_PAID'));
756 }
757
758 if ($params['DISCOUNT_PRICE'] > 0)
759 {
760 $totalRowIsLast = false;
761 $arCells[++$n] = array();
762 for ($i = 0; $i < $columnCount; $i++)
763 $arCells[$n][$arColumnKeys[$i]] = null;
764
765 $arCells[$n][$arColumnKeys[$columnCount-2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_DISCOUNT'));
767 }
768
769 if (!$totalRowIsLast)
770 {
771 $arCells[$totalRowIndex][$arColumnKeys[$totalTitleColIndex]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_SUBTOTAL'));
772
773 $arCells[++$n] = array();
774 for ($i = 0; $i < $columnCount; $i++)
775 $arCells[$n][$arColumnKeys[$i]] = null;
776
777 $arCells[$n][$arColumnKeys[$columnCount - 2]] = CSalePdf::prepareToPdf(Loc::getMessage('SALE_HPS_BILLBY_TOTAL_SUM'));
779 }
780 }
781
782 $pdf->SetFont($fontFamily, 'B', $fontSize);
783 $rowsInfo = $pdf->calculateRowsWidth($arCols, $arCells, $totalRowIndex > 0 ? $totalRowIndex : $cntBasketItem, $width, 3);
784 $pdf->SetFont($fontFamily, '', $fontSize);
785 $arRowsWidth = $rowsInfo['ROWS_WIDTH'];
786 $arRowsContentWidth = $rowsInfo['ROWS_CONTENT_WIDTH'];
787}
788$pdf->Ln();
789
790$x0 = $pdf->GetX();
791$y0 = $pdf->GetY();
792
794{
795 $newLine = false;
796 foreach ($arCols as $columnId => $column)
797 {
798 list($string, $arCols[$columnId]['NAME']) = $pdf->splitString($column['NAME'], $arRowsWidth[$columnId]);
799 $pdf->Cell($arRowsWidth[$columnId], $lineHeight, $string, 0, 0, 'C');
800
801 if ($arCols[$columnId]['NAME'])
802 $newLine = true;
803
804 $i = array_search($columnId, $arColumnKeys);
805 ${"x".($i+1)} = $pdf->GetX();
806 }
807
808 $pdf->Ln();
809}
810while($newLine);
811
812$y5 = $pdf->GetY();
813
814$pdf->Line($x0, $y0, ${"x".$columnCount}, $y0);
815for ($i = 0; $i <= $columnCount; $i++)
816{
817 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
818}
819$pdf->Line($x0, $y5, ${'x'.$columnCount}, $y5);
820
822for ($n = 1; $n <= $rowsCnt; $n++)
823{
824 $arRowsWidth_tmp = $arRowsWidth;
825 $arRowsContentWidth_tmp = $arRowsContentWidth;
826 $accumulated = 0;
827 $accumulatedContent = 0;
828 foreach ($arCols as $columnId => $column)
829 {
830 if (is_null($arCells[$n][$columnId]))
831 {
832 $accumulated += $arRowsWidth_tmp[$columnId];
833 $arRowsWidth_tmp[$columnId] = null;
834 $accumulatedContent += $arRowsContentWidth_tmp[$columnId];
835 $arRowsContentWidth_tmp[$columnId] = null;
836 }
837 else
838 {
839 $arRowsWidth_tmp[$columnId] += $accumulated;
840 $arRowsContentWidth_tmp[$columnId] += $accumulatedContent;
841 $accumulated = 0;
842 $accumulatedContent = 0;
843 }
844 }
845
846 $x0 = $pdf->GetX();
847 $y0 = $pdf->GetY();
848
849 $pdf->SetFont($fontFamily, $n === $totalRowIndex ? 'B' : '', $fontSize);
850
851 $l = 0;
852 do
853 {
854 $newLine = false;
855 foreach ($arCols as $columnId => $column)
856 {
857 $string = '';
858 if (!is_null($arCells[$n][$columnId]))
859 list($string, $arCells[$n][$columnId]) = $pdf->splitString($arCells[$n][$columnId], $arRowsContentWidth_tmp[$columnId]);
860
861 $rowWidth = $arRowsWidth_tmp[$columnId];
862
863 if (in_array($columnId, array('QUANTITY', 'MEASURE', 'PRICE', 'SUM', 'VAT_RATE', 'VAT_SUM', 'TOTAL'), true))
864 {
865 if (!is_null($arCells[$n][$columnId]))
866 {
867 $pdf->Cell($rowWidth, $lineHeight, $string, 0, 0, 'R');
868 }
869 }
870 elseif ($columnId == 'NUMBER')
871 {
872 if (!is_null($arCells[$n][$columnId]))
873 $pdf->Cell($rowWidth, $lineHeight, ($l == 0) ? $string : '', 0, 0, 'C');
874 }
875 elseif ($columnId == 'NAME')
876 {
877 if (!is_null($arCells[$n][$columnId]))
878 $pdf->Cell($rowWidth, $lineHeight, $string, 0, 0, ($n > $cntBasketItem) ? 'R' : '');
879 }
880 else
881 {
882 if (!is_null($arCells[$n][$columnId]))
883 {
884 $pdf->Cell($rowWidth, $lineHeight, $string, 0, 0, ($n > $cntBasketItem) ? 'R' : 'L');
885 }
886 }
887
888 if ($l == 0)
889 {
890 $pos = array_search($columnId, $arColumnKeys);
891 ${'x'.($pos+1)} = $pdf->GetX();
892 }
893
894 if ($arCells[$n][$columnId])
895 $newLine = true;
896 }
897
898 $pdf->Ln();
899 $l++;
900 }
901 while($newLine);
902
903 if ($params['BILLBY_COLUMN_NAME_SHOW'] == 'Y')
904 {
905 if (isset($arProps[$n]) && is_array($arProps[$n]))
906 {
907 $pdf->SetFont($fontFamily, '', $fontSize - 2);
908 foreach ($arProps[$n] as $property)
909 {
910 $i = 0;
911 $line = 0;
912 foreach ($arCols as $columnId => $caption)
913 {
914 $i++;
915 if ($i == $columnCount)
916 $line = 1;
917 if ($columnId == 'NAME')
918 $pdf->Cell($arRowsWidth_tmp[$columnId], 12, $property, 0, $line);
919 else
920 $pdf->Cell($arRowsWidth_tmp[$columnId], 12, '', 0, $line);
921 }
922 }
923 }
924 }
925
926 $y5 = $pdf->GetY();
927
928 if ($y0 > $y5)
929 $y0 = $margin['top'];
930
931 $startIndex = ($n > $cntBasketItem) ? (($showTotalRow && $n === $totalRowIndex) ? ($totalTitleColIndex >= 0 ? $totalTitleColIndex + 1 : 0) : $columnCount - 1) : 0;
932 for ($i = $startIndex; $i <= $columnCount; $i++)
933 {
934 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
935 }
936
937 $pdf->Line(${"x$startIndex"}, $y5, ${'x'.$columnCount}, $y5);
938}
939
940if ($params['BILLBY_TOTAL_SHOW'] == 'Y')
941{
942 $pdf->SetFont($fontFamily, 'B', $fontSize);
943
944 $inWords = in_array($params['CURRENCY'], array("RUR", "RUB", "UAH", "KZT", "BYR", "BYN"));
946
947 $pdf->Ln(5);
948 $text = Loc::getMessage('SALE_HPS_BILLBY_TOTAL_VAT').': ';
949 if ($inWords)
951 else
953 unset($totalVatSum);
954 if (!empty($text))
955 {
957 while ($pdf->GetStringWidth($text))
958 {
959 list($string, $text) = $pdf->splitString($text, $textWidth);
960 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'L');
961 $pdf->Ln($lineHeight);
962 }
963 }
964 $pdf->Ln($lineHeight);
965
966 $text = Loc::getMessage('SALE_HPS_BILLBY_TOTAL_SUM_WITH_VAT').': ';
967 if ($inWords)
968 $text .= Number2Word_Rus($totalSumWithVat, "Y", $params['CURRENCY']);
969 else
970 $text .= SaleFormatCurrency($totalSumWithVat, $params['CURRENCY'], false);
971
972 if (!empty($text))
973 {
975 while ($pdf->GetStringWidth($text))
976 {
977 list($string, $text) = $pdf->splitString($text, $textWidth);
978 $pdf->Cell($textWidth, $lineHeight, $string, 0, 0, 'L');
979 $pdf->Ln();
980 }
981 }
982
983 unset($inWords);
984}
985$pdf->Ln();
986$pdf->Ln();
987
988if ($params["BILLBY_COMMENT1"] || $params["BILLBY_COMMENT2"])
989{
990 $pdf->SetFont($fontFamily, '', $fontSize);
991
992 if ($params["BILLBY_COMMENT1"])
993 {
994 $pdf->Write($lineHeight, HTMLToTxt(preg_replace(
995 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
996 CSalePdf::prepareToPdf($params["BILLBY_COMMENT1"])
997 ), '', array(), 0));
998 $pdf->Ln();
999 $pdf->Ln();
1000 }
1001
1002 if ($params["BILLBY_COMMENT2"])
1003 {
1004 $pdf->Write($lineHeight, HTMLToTxt(preg_replace(
1005 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
1006 CSalePdf::prepareToPdf($params["BILLBY_COMMENT2"])
1007 ), '', array(), 0));
1008 $pdf->Ln();
1009 $pdf->Ln();
1010 }
1011}
1012
1013$pdf->Ln();
1014$pdf->Ln();
1015
1016if ($params['BILLBY_SIGN_SHOW'] == 'Y')
1017{
1018 if ($params['BILLBY_PATH_TO_STAMP'])
1019 {
1020 $filePath = $pdf->GetImagePath($params['BILLBY_PATH_TO_STAMP']);
1021
1022 if ($filePath != '' && !$blank && \Bitrix\Main\IO\File::isFileExists($filePath))
1023 {
1024 list($stampHeight, $stampWidth) = $pdf->GetImageSize($params['BILLBY_PATH_TO_STAMP']);
1025 if ($stampHeight && $stampWidth)
1026 {
1027 if ($stampHeight > 120 || $stampWidth > 120)
1028 {
1029 $ratio = 120 / max($stampHeight, $stampWidth);
1030 $stampHeight = $ratio * $stampHeight;
1031 $stampWidth = $ratio * $stampWidth;
1032 }
1033
1034 if ($pdf->GetY() + $stampHeight > $pageHeight)
1035 $pdf->AddPage();
1036
1037 $pdf->Image(
1038 $params['BILLBY_PATH_TO_STAMP'],
1039 $margin['left'] + 40, $pdf->GetY(),
1040 $stampWidth, $stampHeight
1041 );
1042 }
1043 }
1044 }
1045
1046 $x2 = 0;
1047 $signHeight = 0;
1048 $signWidth = 0;
1049 if ($params["SELLER_COMPANY_DIRECTOR_POSITION"])
1050 {
1051 $isDirSign = false;
1052 if (!$blank && $params['SELLER_COMPANY_DIR_SIGN'])
1053 {
1054 list($signHeight, $signWidth) = $pdf->GetImageSize($params['SELLER_COMPANY_DIR_SIGN']);
1055
1056 if ($signHeight && $signWidth)
1057 {
1058 $ratio = min(37.5/$signHeight, 150/$signWidth);
1059 $signHeight = $ratio * $signHeight;
1060 $signWidth = $ratio * $signWidth;
1061
1062 $isDirSign = true;
1063 }
1064 }
1065
1066 $sellerDirPos = CSalePdf::prepareToPdf($params["SELLER_COMPANY_DIRECTOR_POSITION"]);
1067 if ($isDirSign && $pdf->GetStringWidth($sellerDirPos) <= 160)
1068 $pdf->SetY($pdf->GetY() + max($signHeight, $lineHeight * 2) - $lineHeight);
1069
1070 $pdf->SetFont($fontFamily, 'B', $fontSize);
1071 $pdf->MultiCell(150, $lineHeight, $sellerDirPos, 0, 'L');
1072 $pdf->SetFont($fontFamily, '', $fontSize);
1073 $pdf->SetXY($margin['left'] + 150, $pdf->GetY() - $lineHeight);
1074
1075 if ($isDirSign)
1076 {
1077 $pdf->Image(
1078 $params['SELLER_COMPANY_DIR_SIGN'],
1079 $pdf->GetX() + 80 - $signWidth/2, $pdf->GetY() - $signHeight + $lineHeight,
1080 $signWidth, $signHeight
1081 );
1082 }
1083
1084 $x1 = $pdf->GetX();
1085 $pdf->Cell(160, $lineHeight, '');
1086 $x2 = $pdf->GetX();
1087
1088 if ($params["SELLER_COMPANY_DIRECTOR_NAME"])
1089 $pdf->Write($lineHeight, CSalePdf::prepareToPdf('('.$params["SELLER_COMPANY_DIRECTOR_NAME"].')'));
1090 $pdf->Ln();
1091
1092 $y2 = $pdf->GetY();
1093 $pdf->Line($x1, $y2, $x2, $y2);
1094
1095 $pdf->Ln();
1096 }
1097
1098 if ($params["SELLER_COMPANY_ACCOUNTANT_POSITION"])
1099 {
1100 $isAccSign = false;
1101 if (!$blank && $params['SELLER_COMPANY_ACC_SIGN'])
1102 {
1103 list($signHeight, $signWidth) = $pdf->GetImageSize($params['SELLER_COMPANY_ACC_SIGN']);
1104
1105 if ($signHeight && $signWidth)
1106 {
1107 $ratio = min(37.5/$signHeight, 150/$signWidth);
1108 $signHeight = $ratio * $signHeight;
1109 $signWidth = $ratio * $signWidth;
1110
1111 $isAccSign = true;
1112 }
1113 }
1114
1115 $sellerAccPos = CSalePdf::prepareToPdf($params["SELLER_COMPANY_ACCOUNTANT_POSITION"]);
1116 if ($isAccSign && $pdf->GetStringWidth($sellerAccPos) <= 160)
1117 $pdf->SetY($pdf->GetY() + max($signHeight, $lineHeight * 2) - $lineHeight);
1118 $pdf->SetFont($fontFamily, 'B', $fontSize);
1119 $pdf->MultiCell(150, $lineHeight, $sellerAccPos, 0, 'L');
1120 $pdf->SetFont($fontFamily, '', $fontSize);
1121 $pdf->SetXY($margin['left'] + 150, $pdf->GetY() - $lineHeight);
1122
1123 if ($isAccSign)
1124 {
1125 $pdf->Image(
1126 $params['SELLER_COMPANY_ACC_SIGN'],
1127 $pdf->GetX() + 80 - $signWidth/2, $pdf->GetY() - $signHeight + $lineHeight,
1128 $signWidth, $signHeight
1129 );
1130 }
1131
1132 $x1 = $pdf->GetX();
1133 $pdf->Cell(($params["SELLER_COMPANY_DIRECTOR_NAME"]) ? $x2-$x1 : 160, $lineHeight, '');
1134 $x2 = $pdf->GetX();
1135
1136 if ($params["SELLER_COMPANY_ACCOUNTANT_NAME"])
1137 $pdf->Write($lineHeight, CSalePdf::prepareToPdf('('.$params["SELLER_COMPANY_ACCOUNTANT_NAME"].')'));
1138 $pdf->Ln();
1139
1140 $y2 = $pdf->GetY();
1141 $pdf->Line($x1, $y2, $x2, $y2);
1142 }
1143}
1144
1145$dest = 'I';
1146if ($_REQUEST['GET_CONTENT'] == 'Y')
1147 $dest = 'S';
1148else if ($_REQUEST['DOWNLOAD'] == 'Y')
1149 $dest = 'D';
1150
1151$fileName = sprintf(
1152 'Schet No %s ot %s.pdf',
1153 str_replace(
1154 array(
1155 chr(0), chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), chr(7), chr(8), chr(9), chr(10), chr(11),
1156 chr(12), chr(13), chr(14), chr(15), chr(16), chr(17), chr(18), chr(19), chr(20), chr(21), chr(22),
1157 chr(23), chr(24), chr(25), chr(26), chr(27), chr(28), chr(29), chr(30), chr(31),
1158 '"', '*', '/', ':', '<', '>', '?', '\\', '|'
1159 ),
1160 '_',
1161 strval($params["ACCOUNT_NUMBER"])
1162 ),
1163 ConvertDateTime($params['PAYMENT_DATE_INSERT'], 'YYYY-MM-DD')
1164);
1165
1166$trFileName = CUtil::translit($fileName, 'ru', array('max_len' => 1024, 'safe_chars' => '.', 'replace_space' => '-'));
1167
1168return $pdf->Output($trFileName, $dest, $fileName);
1169?>
$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
const FORMAT_DATE
Определения include.php:63
$l
Определения options.php:783
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
$sellerAddr
Определения html.php:558
$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
$sellerInfoTaxId
Определения template.php:93
foreach( $params[ 'BASKET_ITEMS'] as $basketItem) if($params['DELIVERY_PRICE'] > 0) $totalRowIsLast
Определения template.php:621
$precision
Определения template.php:403
$currencyPrecision
Определения template.php:396
$totalSumWithVat
Определения template.php:412
$sellerInfoAddr
Определения template.php:156
$sellerInfoBank
Определения template.php:101
$salePrecision
Определения template.php:399
$totalSum
Определения template.php:410
$totalVatSum
Определения template.php:411
$totalRowIndex
Определения template.php:622
if($params['BILLBY_HEADER_SHOW']=='Y') $sellerInfoRows
Определения template.php:84
$sellerInfoName
Определения template.php:85
if($params["BILLBY_ORDER_SUBJECT"]) if( $params["PAYMENT_DATE_PAY_BEFORE"]) if($params['BILLBY_PAYER_SHOW']=='Y') $currencyFormat
Определения template.php:393
$arCells
Определения template.php:223
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
$y2
Определения pdf.php:144
$billNo_width
Определения pdf.php:202
$billNo_tmp
Определения pdf.php:197
$x2
Определения pdf.php:124
$isAccSign
Определения pdf.php:601
$matches
Определения index.php:22
$trFileName
Определения template_pdf.php:929
$n
Определения update_log.php:107
$arRowsContentWidth
Определения template_pdf.php:447
$defaultLineWidth
Определения template_pdf.php:32
$showTotalRow
Определения template_pdf.php:448
$arRowsWidth
Определения template_pdf.php:446
$taxes
Определения template_pdf.php:444
$lineHeight
Определения template_pdf.php:33
$blank
Определения template_pdf.php:11
$totalTitleColIndex
Определения template_pdf.php:449
$x1
Определения template_pdf.php:419