1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
pdf.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><?
2$ORDER_ID = IntVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"]);
3if (!is_array($arOrder))
4 $arOrder = CSaleOrder::GetByID($ORDER_ID);
5
7 die();
8
9$pdf = new CSalePdf('P', 'pt', 'A4');
10
12{
13 $pdf->SetBackground(
15 CSalePaySystemAction::GetParamValue('BACKGROUND_STYLE')
16 );
17}
18
19$pageWidth = $pdf->GetPageWidth();
20$pageHeight = $pdf->GetPageHeight();
21
22$pdf->AddFont('Font', '', 'pt_sans-regular.ttf', true);
23$pdf->AddFont('Font', 'B', 'pt_sans-bold.ttf', true);
24
25$fontFamily = 'Font';
26$fontSize = 10.5;
27
29 'top' => intval(CSalePaySystemAction::GetParamValue('MARGIN_TOP') ?: 15) * 72/25.4,
30 'right' => intval(CSalePaySystemAction::GetParamValue('MARGIN_RIGHT') ?: 15) * 72/25.4,
31 'bottom' => intval(CSalePaySystemAction::GetParamValue('MARGIN_BOTTOM') ?: 15) * 72/25.4,
32 'left' => intval(CSalePaySystemAction::GetParamValue('MARGIN_LEFT') ?: 20) * 72/25.4
33);
34
35$width = $pageWidth - $margin['left'] - $margin['right'];
36
37$pdf->SetDisplayMode(100, 'continuous');
38$pdf->SetMargins($margin['left'], $margin['top'], $margin['right']);
39$pdf->SetAutoPageBreak(true, $margin['bottom']);
40
41$pdf->AddPage();
42
43$pdf->SetFont($fontFamily, 'B', $fontSize*3);
44
45$y0 = $pdf->GetY();
48
49if (CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'))
50{
51 list($imageHeight, $imageWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'));
52
53 $logoHeight = $imageHeight + 5;
54 $logoWidth = $imageWidth + 5;
55
56 $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO'), $pdf->GetX(), $pdf->GetY());
57}
58
59$pdf->Ln(15);
60
61$pdf->SetX($pdf->GetX() + $logoWidth);
63$pdf->Ln();
64$pdf->Ln();
65$pdf->Ln();
66$pdf->SetY(max($y0 + $logoHeight, $pdf->GetY()));
67
68$pdf->Ln();
69
70
71$pdf->SetFont($fontFamily, 'B', $fontSize-2);
72
74if (CSalePaySystemAction::GetParamValue("SELLER_ADDRESS"))
75{
76 $seller .= ' – ';
78 $seller .= ' ';
79}
80
82$pdf->Cell($pdf->GetStringWidth($seller), 10, $seller, 'B');
83
84$pdf->Ln();
85$pdf->Ln();
86$pdf->Ln();
87
88$pdf->SetFont($fontFamily, 'B', $fontSize);
89
91{
93 $pdf->Ln();
94
95 if (CSalePaySystemAction::GetParamValue("BUYER_ADDRESS"))
97 $pdf->Ln();
98}
99
100$pdf->Ln();
101$pdf->Ln();
102$pdf->Ln();
103$pdf->Ln();
104$pdf->Ln();
105
106$pdf->SetFont($fontFamily, 'B', $fontSize*2);
107$pdf->Write(15, CSalePdf::prepareToPdf('Rechnung'));
108
109$pdf->Ln();
110$pdf->Ln();
111$pdf->Ln();
112
113
114
115$pdf->SetFont($fontFamily, 'B', $fontSize);
116
117$pdf->Cell(0.35*$width, 15, CSalePdf::prepareToPdf(sprintf(
118 'Rechnung Nr. %s',
119 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ACCOUNT_NUMBER"]
120)));
121
122$pdf->Cell(0.35*$width, 15, CSalePdf::prepareToPdf(sprintf(
123 'Kunden-Nr.: %s',
124 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["USER_ID"]
125)));
126
127$pdf->Cell(0, 15, CSalePdf::prepareToPdf(sprintf(
128 'Datum: %s',
130)), 0, 0, 'R');
131$pdf->Ln();
132
133$pdf->SetFont($fontFamily, 'B', $fontSize-2);
134$pdf->Write(15, CSalePdf::prepareToPdf('Bitte bei Zahlungen und Schriftverkehr angeben!'));
135
136$pdf->Ln();
137$pdf->Ln();
138
139
140$pdf->SetFont($fontFamily, '', $fontSize);
141
142// Список товаров
144 array("NAME" => "ASC"),
145 array("ORDER_ID" => $ORDER_ID)
146);
147if ($arBasket = $dbBasket->Fetch())
148{
149 $arColsCaption = array(
150 1 => CSalePdf::prepareToPdf('Pos.'),
151 CSalePdf::prepareToPdf('Leistung'),
152 CSalePdf::prepareToPdf('Anzahl'),
153 CSalePdf::prepareToPdf('Einheit'),
154 CSalePdf::prepareToPdf('Einzelpreis'),
155 CSalePdf::prepareToPdf('MwSt.'),
156 CSalePdf::prepareToPdf('Gesamtpreis')
157 );
158 $arCells = array();
159 $arProps = array();
160 $arRowsWidth = array(1 => 0, 0, 0, 0, 0, 0, 0);
161
162 for ($i = 1; $i <= 7; $i++)
163 $arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arColsCaption[$i]));
164
165 $n = 0;
166 $sum = 0.00;
167 $vat = 0;
168 $vats = array();
169 do
170 {
171 // props in busket product
172 $arProdProps = array();
173 $dbBasketProps = CSaleBasket::GetPropsList(
174 array("SORT" => "ASC", "ID" => "DESC"),
175 array(
176 "BASKET_ID" => $arBasket["ID"],
177 "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")
178 ),
179 false,
180 false,
181 array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT")
182 );
183 while ($arBasketProps = $dbBasketProps->GetNext())
184 {
185 if (!empty($arBasketProps) && $arBasketProps["VALUE"] != "")
186 $arProdProps[] = $arBasketProps;
187 }
188 $arBasket["PROPS"] = $arProdProps;
189
190 // @TODO: replace with real vatless price
191 $arBasket["VATLESS_PRICE"] = roundEx($arBasket["PRICE"] / (1 + $arBasket["VAT_RATE"]), SALE_VALUE_PRECISION);
192
193 $arCells[++$n] = array(
195 CSalePdf::prepareToPdf($arBasket["NAME"]),
196 CSalePdf::prepareToPdf(roundEx($arBasket["QUANTITY"], SALE_VALUE_PRECISION)),
198 CSalePdf::prepareToPdf(SaleFormatCurrency($arBasket["VATLESS_PRICE"], $arBasket["CURRENCY"], true)),
199 CSalePdf::prepareToPdf(roundEx($arBasket["VAT_RATE"]*100, SALE_VALUE_PRECISION)."%"),
201 $arBasket["VATLESS_PRICE"] * $arBasket["QUANTITY"],
202 $arBasket["CURRENCY"],
203 true
204 ))
205 );
206
207 $arProps[$n] = array();
208 foreach ($arBasket["PROPS"] as $vv)
209 $arProps[$n][] = CSalePdf::prepareToPdf(sprintf("%s: %s", $vv["NAME"], $vv["VALUE"]));
210
211 for ($i = 1; $i <= 7; $i++)
212 $arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arCells[$n][$i]));
213
214 $sum += doubleval($arBasket["VATLESS_PRICE"] * $arBasket["QUANTITY"]);
215 $vat = max($vat, $arBasket["VAT_RATE"]);
216 if ($arBasket["VAT_RATE"] > 0)
217 {
218 if (!isset($vats[$arBasket["VAT_RATE"]]))
219 $vats[$arBasket["VAT_RATE"]] = 0;
220 $vats[$arBasket["VAT_RATE"]] += ($arBasket["PRICE"] - $arBasket["VATLESS_PRICE"]) * $arBasket["QUANTITY"];
221 }
222 }
223 while ($arBasket = $dbBasket->Fetch());
224
225 if (DoubleVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE_DELIVERY"]) > 0)
226 {
227 $arDelivery_tmp = CSaleDelivery::GetByID($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DELIVERY_ID"]);
228
229 $sDeliveryItem = "Schifffahrt";
230 if (strlen($arDelivery_tmp["NAME"]) > 0)
231 $sDeliveryItem .= sprintf(" (%s)", $arDelivery_tmp["NAME"]);
232 $arCells[++$n] = array(
234 CSalePdf::prepareToPdf($sDeliveryItem),
238 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE_DELIVERY"] / (1 + $vat),
239 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
240 true
241 )),
244 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE_DELIVERY"] / (1 + $vat),
245 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
246 true
247 ))
248 );
249
250 for ($i = 1; $i <= 7; $i++)
251 $arRowsWidth[$i] = max($arRowsWidth[$i], $pdf->GetStringWidth($arCells[$n][$i]));
252
253 $sum += roundEx(
254 doubleval($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE_DELIVERY"] / (1 + $vat)),
256 );
257
258 if ($vat > 0)
259 $vats[$vat] += roundEx(
260 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE_DELIVERY"] * $vat / (1 + $vat),
262 );
263 }
264
265 $items = $n;
266
267 if ($sum < $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE"])
268 {
269 $arCells[++$n] = array(
270 1 => null,
271 null,
272 null,
273 null,
274 null,
275 CSalePdf::prepareToPdf("Nettobetrag:"),
276 CSalePdf::prepareToPdf(SaleFormatCurrency($sum, $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"], true))
277 );
278
279 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
280 }
281
282 if (!empty($vats))
283 {
284 // @TODO: remove on real vatless price implemented
285 $delta = intval(roundEx(
286 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["PRICE"] - $sum - array_sum($vats),
288 ) * pow(10, SALE_VALUE_PRECISION));
289 if ($delta)
290 {
291 $vatRates = array_keys($vats);
292 rsort($vatRates);
293
294 while (abs($delta) > 0)
295 {
296 foreach ($vatRates as $vatRate)
297 {
298 $vats[$vatRate] += abs($delta)/$delta / pow(10, SALE_VALUE_PRECISION);
299 $delta -= abs($delta)/$delta;
300
301 if ($delta == 0)
302 break 2;
303 }
304 }
305 }
306
307 foreach ($vats as $vatRate => $vatSum)
308 {
309 $arCells[++$n] = array(
310 1 => null,
311 null,
312 null,
313 null,
314 null,
316 "zzgl. %s%% MwSt:",
317 roundEx($vatRate * 100, SALE_VALUE_PRECISION)
318 )),
320 $vatSum,
321 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
322 true
323 ))
324 );
325
326 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
327 }
328 }
329 else
330 {
331 $dbTaxList = CSaleOrderTax::GetList(
332 array("APPLY_ORDER" => "ASC"),
333 array("ORDER_ID" => $ORDER_ID)
334 );
335
336 while ($arTaxList = $dbTaxList->Fetch())
337 {
338 $arCells[++$n] = array(
339 1 => null,
340 null,
341 null,
342 null,
343 null,
345 "%s%s%s:",
346 ($arTaxList["IS_IN_PRICE"] == "Y") ? "inkl." : "zzgl.",
347 sprintf(' %s%% ', roundEx($arTaxList["VALUE"], SALE_VALUE_PRECISION)),
348 $arTaxList["TAX_NAME"]
349 )),
351 $arTaxList["VALUE_MONEY"],
352 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
353 true
354 ))
355 );
356
357 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
358 }
359 }
360
361 if (DoubleVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SUM_PAID"]) > 0)
362 {
363 $arCells[++$n] = array(
364 1 => null,
365 null,
366 null,
367 null,
368 null,
369 CSalePdf::prepareToPdf("Payment made:"),
371 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SUM_PAID"],
372 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
373 true
374 ))
375 );
376
377 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
378 }
379
380 if (DoubleVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DISCOUNT_VALUE"]) > 0)
381 {
382 $arCells[++$n] = array(
383 1 => null,
384 null,
385 null,
386 null,
387 null,
388 CSalePdf::prepareToPdf("Rabatt:"),
390 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DISCOUNT_VALUE"],
391 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
392 true
393 ))
394 );
395
396 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
397 }
398
399 $arCells[++$n] = array(
400 1 => null,
401 null,
402 null,
403 null,
404 null,
405 CSalePdf::prepareToPdf("Gesamtbetrag:"),
407 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"],
408 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"],
409 true
410 ))
411 );
412
413 $arRowsWidth[7] = max($arRowsWidth[7], $pdf->GetStringWidth($arCells[$n][7]));
414
415 for ($i = 1; $i <= 7; $i++)
416 $arRowsWidth[$i] += 10;
417 if ($vat <= 0)
418 $arRowsWidth[6] = 0;
419 $arRowsWidth[2] = $width - (array_sum($arRowsWidth)-$arRowsWidth[2]);
420}
421$pdf->Ln();
422
423$x0 = $pdf->GetX();
424$y0 = $pdf->GetY();
425
426for ($i = 1; $i <= 7; $i++)
427{
428 if ($vat > 0 || $i != 6)
429 $pdf->Cell($arRowsWidth[$i], 20, $arColsCaption[$i], 0, 0, 'C');
430 ${"x$i"} = $pdf->GetX();
431}
432
433$pdf->Ln();
434
435$y5 = $pdf->GetY();
436
437$pdf->Line($x0, $y0, $x7, $y0);
438for ($i = 0; $i <= 7; $i++)
439{
440 if ($vat > 0 || $i != 6)
441 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
442}
443$pdf->Line($x0, $y5, $x7, $y5);
444
446for ($n = 1; $n <= $rowsCnt; $n++)
447{
448 $arRowsWidth_tmp = $arRowsWidth;
449 $accumulated = 0;
450 for ($j = 1; $j <= 7; $j++)
451 {
452 if (is_null($arCells[$n][$j]))
453 {
454 $accumulated += $arRowsWidth_tmp[$j];
455 $arRowsWidth_tmp[$j] = null;
456 }
457 else
458 {
459 $arRowsWidth_tmp[$j] += $accumulated;
460 $accumulated = 0;
461 }
462 }
463
464 $x0 = $pdf->GetX();
465 $y0 = $pdf->GetY();
466
467 $pdf->SetFont($fontFamily, '', $fontSize);
468
469 if (!is_null($arCells[$n][2]))
470 {
471 $text = $arCells[$n][2];
472 $cellWidth = $arRowsWidth_tmp[2];
473 }
474 else
475 {
476 $text = $arCells[$n][6];
477 $cellWidth = $arRowsWidth_tmp[6];
478 }
479
480 for ($l = 0; $pdf->GetStringWidth($text) > 0; $l++)
481 {
482 $pos = ($pdf->GetStringWidth($text) > $cellWidth)
483 ? strrpos(substr($text, 0, strlen($text)*$cellWidth/$pdf->GetStringWidth($text)), ' ')
484 : strlen($text);
485 if (!$pos)
486 $pos = strlen($text);
487
488 if (!is_null($arCells[$n][1]))
489 $pdf->Cell($arRowsWidth_tmp[1], 15, ($l == 0) ? $arCells[$n][1] : '', 0, 0, 'C');
490 if ($l == 0)
491 $x1 = $pdf->GetX();
492
493 if (!is_null($arCells[$n][2]))
494 $pdf->Cell($arRowsWidth_tmp[2], 15, substr($text, 0, $pos));
495 if ($l == 0)
496 $x2 = $pdf->GetX();
497
498 if (!is_null($arCells[$n][3]))
499 $pdf->Cell($arRowsWidth_tmp[3], 15, ($l == 0) ? $arCells[$n][3] : '', 0, 0, 'R');
500 if ($l == 0)
501 $x3 = $pdf->GetX();
502
503 if (!is_null($arCells[$n][4]))
504 $pdf->Cell($arRowsWidth_tmp[4], 15, ($l == 0) ? $arCells[$n][4] : '', 0, 0, 'R');
505 if ($l == 0)
506 $x4 = $pdf->GetX();
507
508 if (!is_null($arCells[$n][5]))
509 $pdf->Cell($arRowsWidth_tmp[5], 15, ($l == 0) ? $arCells[$n][5] : '', 0, 0, 'R');
510 if ($l == 0)
511 $x5 = $pdf->GetX();
512
513 if (!is_null($arCells[$n][6])) {
514 if (is_null($arCells[$n][2]))
515 $pdf->Cell($arRowsWidth_tmp[6], 15, substr($text, 0, $pos), 0, 0, 'R');
516 else if ($vat > 0)
517 $pdf->Cell($arRowsWidth_tmp[6], 15, ($l == 0) ? $arCells[$n][6] : '', 0, 0, 'R');
518 }
519 if ($l == 0)
520 $x6 = $pdf->GetX();
521
522 if (!is_null($arCells[$n][7]))
523 $pdf->Cell($arRowsWidth_tmp[7], 15, ($l == 0) ? $arCells[$n][7] : '', 0, 0, 'R');
524 if ($l == 0)
525 $x7 = $pdf->GetX();
526
527 $pdf->Ln();
528
529 $text = trim(substr($text, $pos));
530 }
531
532 if (isset($arProps[$n]) && is_array($arProps[$n]))
533 {
534 $pdf->SetFont($fontFamily, '', $fontSize-2);
535 foreach ($arProps[$n] as $property)
536 {
537 $pdf->Cell($arRowsWidth_tmp[1], 12, '');
538 $pdf->Cell($arRowsWidth_tmp[2], 12, $property);
539 $pdf->Cell($arRowsWidth_tmp[3], 12, '');
540 $pdf->Cell($arRowsWidth_tmp[4], 12, '');
541 $pdf->Cell($arRowsWidth_tmp[5], 12, '');
542 if ($vat > 0)
543 $pdf->Cell($arRowsWidth_tmp[6], 12, '');
544 $pdf->Cell($arRowsWidth_tmp[7], 12, '', 0, 1);
545 }
546 }
547
548 $y5 = $pdf->GetY();
549
550 if ($y0 > $y5)
551 $y0 = $margin['top'];
552 for ($i = (is_null($arCells[$n][1])) ? 6 : 0; $i <= 7; $i++)
553 {
554 if ($vat > 0 || $i != 5)
555 $pdf->Line(${"x$i"}, $y0, ${"x$i"}, $y5);
556 }
557
558 $pdf->Line((!is_null($arCells[$n][1])) ? $x0 : $x6, $y5, $x7, $y5);
559}
560$pdf->Ln();
561$pdf->Ln();
562$pdf->Ln();
563
564
565$pdf->SetFont($fontFamily, 'B', $fontSize);
566
568{
569 $pdf->SetFont($fontFamily, '', $fontSize);
570
572 {
573 $pdf->Write(15, HTMLToTxt(preg_replace(
574 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
576 ), '', array(), 0));
577 $pdf->Ln();
578 $pdf->Ln();
579 }
580
582 {
583 $pdf->Write(15, HTMLToTxt(preg_replace(
584 array('#</div>\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'),
586 ), '', array(), 0));
587 $pdf->Ln();
588 $pdf->Ln();
589 }
590}
591
592$pdf->Ln();
593
594if (CSalePaySystemAction::GetParamValue('PATH_TO_STAMP'))
595 $pdf->Image(CSalePaySystemAction::GetParamValue('PATH_TO_STAMP'), $margin['left']+40, $pdf->GetY());
596
597
599{
600 $isDirSign = false;
601 if (CSalePaySystemAction::GetParamValue('SELLER_DIR_SIGN'))
602 {
603 list($signHeight, $signWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('SELLER_DIR_SIGN'));
604
605 if ($signHeight && $signWidth)
606 {
607 $ratio = min(37.5/$signHeight, 150/$signWidth);
608 $signHeight = $ratio * $signHeight;
609 $signWidth = $ratio * $signWidth;
610
611 $isDirSign = true;
612 }
613 }
614
615 if ($isDirSign)
616 $pdf->SetY($pdf->GetY() + $signHeight - 15);
617 $pdf->Write(15, CSalePdf::prepareToPdf('Geschдftsfьhrer '));
618
619 if ($isDirSign)
620 {
621 $pdf->Image(
622 CSalePaySystemAction::GetParamValue('SELLER_DIR_SIGN'),
623 $pdf->GetX() + 80 - $signWidth/2, $pdf->GetY() - $signHeight + 15,
624 $signWidth, $signHeight
625 );
626 }
627
628 $x1 = $pdf->GetX();
629 $pdf->Cell(160, 15, '');
630 $x2 = $pdf->GetX();
631
632 if (CSalePaySystemAction::GetParamValue("SELLER_DIR"))
633 $pdf->Write(15, CSalePdf::prepareToPdf('('.CSalePaySystemAction::GetParamValue("SELLER_DIR").')'));
634 $pdf->Ln();
635
636 $y2 = $pdf->GetY();
637 $pdf->Line($x1+5, $y2, $x2, $y2);
638
639 $pdf->Ln();
640}
641
643{
644 $isAccSign = false;
645 if (CSalePaySystemAction::GetParamValue('SELLER_ACC_SIGN'))
646 {
647 list($signHeight, $signWidth) = $pdf->GetImageSize(CSalePaySystemAction::GetParamValue('SELLER_ACC_SIGN'));
648
649 if ($signHeight && $signWidth)
650 {
651 $ratio = min(37.5/$signHeight, 150/$signWidth);
652 $signHeight = $ratio * $signHeight;
653 $signWidth = $ratio * $signWidth;
654
655 $isAccSign = true;
656 }
657 }
658
659 if ($isAccSign)
660 $pdf->SetY($pdf->GetY() + $signHeight - 15);
661 $pdf->Write(15, CSalePdf::prepareToPdf('Buchhalter '));
662
663 if ($isAccSign)
664 {
665 $pdf->Image(
666 CSalePaySystemAction::GetParamValue('SELLER_ACC_SIGN'),
667 $pdf->GetX() + 80 - $signWidth/2, $pdf->GetY() - $signHeight + 15,
668 $signWidth, $signHeight
669 );
670 }
671
672 $x1 = $pdf->GetX();
673 $pdf->Cell((CSalePaySystemAction::GetParamValue("SELLER_DIR")) ? $x2-$x1 : 160, 15, '');
674 $x2 = $pdf->GetX();
675
676 if (CSalePaySystemAction::GetParamValue("SELLER_ACC"))
677 $pdf->Write(15, CSalePdf::prepareToPdf('('.CSalePaySystemAction::GetParamValue("SELLER_ACC").')'));
678 $pdf->Ln();
679
680 $y2 = $pdf->GetY();
681 $pdf->Line($x1+5, $y2, $x2, $y2);
682}
683
684$pdf->Ln();
685$pdf->Ln();
686$pdf->Ln();
687
688
689$pdf->SetFont($fontFamily, '', $fontSize-2);
690
693
695
696if ($sellerName)
698if ($sellerAddr)
700
701if (!empty($sellerData))
702{
703 $pdf->Cell(0, 15, CSalePdf::prepareToPdf(join(' – ', $sellerData)), 0, 0, 'C');
704 $pdf->Ln();
705}
706
707
710
712
713if ($sellerPhone)
714 $sellerData[] = sprintf('Telefon: %s', $sellerPhone);
715if ($sellerEmail)
716 $sellerData[] = sprintf('Mail: %s', $sellerEmail);
717
718if (!empty($sellerData))
719{
720 $pdf->Cell(0, 15, CSalePdf::prepareToPdf(join(' – ', $sellerData)), 0, 0, 'C');
721 $pdf->Ln();
722}
723
724
730
732
733if ($bankAccNo)
734 $bankData[] = sprintf('Konto Nr.: %s', $bankAccNo);
735if ($bankBlz)
736 $bankData[] = sprintf('BLZ: %s', $bankBlz);
737if ($bankIban)
738 $bankData[] = sprintf('IBAN: %s', $bankIban);
739if ($bankSwift)
740 $bankData[] = sprintf('BIC/SWIFT: %s', $bankSwift);
741if ($bank)
742 $bankData[] = $bank;
743
744if (!empty($bankData))
745{
746 $pdf->Cell(0, 15, CSalePdf::prepareToPdf(join(' – ', $bankData)), 0, 0, 'C');
747 $pdf->Ln();
748}
749
750
755
757
758if ($sellerEuInn)
759 $sellerData[] = sprintf('USt-IdNr.: %s', $sellerEuInn);
760if ($sellerInn)
761 $sellerData[] = sprintf('Steuernummer: %s', $sellerInn);
762if ($sellerReg)
764if ($sellerDir)
766
767if (!empty($sellerData))
768{
769 $pdf->Cell(0, 15, CSalePdf::prepareToPdf(join(' – ', $sellerData)), 0, 0, 'C');
770 $pdf->Ln();
771}
772
773
774$dest = 'I';
775if ($_REQUEST['GET_CONTENT'] == 'Y')
776 $dest = 'S';
777else if ($_REQUEST['DOWNLOAD'] == 'Y')
778 $dest = 'D';
779
780return $pdf->Output(
781 sprintf(
782 'Rechnung Nr. %s (Datum %s).pdf',
783 $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ACCOUNT_NUMBER"],
784 ConvertDateTime($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"], 'YYYY-MM-DD')
785 ), $dest
786);
$sum
Определения checkout.php:6
static GetByID($ID)
Определения delivery.php:249
static GetParamValue($key, $defaultValue=null)
Определения pay_system_action.php:76
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения basket.php:33
static GetPropsList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения basket.php:317
static GetList($arOrder=array("TAX_NAME"=> "ASC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения order_tax.php:7
Определения pdf.php:312
static isPdfAvailable()
Определения pdf.php:316
static prepareToPdf($string)
Определения pdf.php:324
</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
ConvertDateTime($datetime, $to_format=false, $from_site=false, $bSearchInSitesOnly=false)
Определения tools.php:724
roundEx($value, $prec=0)
Определения tools.php:4635
HTMLToTxt($str, $strSiteUrl="", $aDelete=[], $maxlen=70)
Определения tools.php:2587
$delta
Определения prolog_main_admin.php:363
die
Определения quickway.php:367
$text
Определения template_pdf.php:79
for( $i=0, $max=count( $arBasketIDs);$i< $max;$i++) if($arOrder['DELIVERY_VAT_RATE'] > 0) if(is_array( $arBasketOrder) &&!empty( $arBasketOrder)) if(floatval($arOrder["DISCOUNT_VALUE"]) > 0) $arTaxList
Определения factura.php:640
$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
$bankData
Определения html.php:597
$ORDER_ID
Определения html.php:2
$pageWidth
Определения html.php:24
if( $arBasket=$dbBasket->Fetch()) if($vat > 0) $rowsCnt
Определения html.php:430
$sellerAddr
Определения html.php:558
$width
Определения html.php:68
$sellerInn
Определения html.php:618
$bankSwift
Определения html.php:594
if(CSalePaySystemAction::GetParamValue("DATE_PAY_BEFORE", false)) $dbBasket
Определения html.php:162
$sellerDir
Определения html.php:620
if(!empty($sellerData)) $bankAccNo
Определения html.php:591
if(!empty($bankData)) $sellerEuInn
Определения html.php:617
$bank
Определения html.php:595
$bankBlz
Определения html.php:592
if(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
Определения html.php:61
$pageHeight
Определения html.php:25
$sellerData
Определения html.php:560
$bankIban
Определения html.php:593
for($n=1; $n<=$rowsCnt; $n++) if(CSalePaySystemAction::GetParamValue("COMMENT1", false)||CSalePaySystemAction::GetParamValue("COMMENT2", false)) if(! $blank) if(CSalePaySystemAction::GetParamValue("SELLER_DIR_POS", false)) if(CSalePaySystemAction::GetParamValue("SELLER_ACC_POS", false)) $sellerName
Определения html.php:557
$sellerEmail
Определения html.php:575
$sellerReg
Определения html.php:619
if(!empty($sellerData)) $sellerPhone
Определения html.php:574
$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
$fontFamily
Определения pdf.php:29
$x0
Определения pdf.php:452
$seller
Определения pdf.php:78
$y0
Определения pdf.php:47
$vat
Определения template.php:273
$arCells
Определения template.php:223
$items
Определения template.php:224
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
Определения include.php:142
const SALE_VALUE_PRECISION
Определения include.php:46
$x4
Определения pdf.php:128
$y2
Определения pdf.php:144
$x2
Определения pdf.php:124
$x3
Определения pdf.php:126
$isAccSign
Определения pdf.php:601
$GLOBALS['_____370096793']
Определения update_client.php:1
$n
Определения update_log.php:107
$arRowsWidth
Определения template_pdf.php:446
$vatRates
Определения yandex_detail.php:156
$x1
Определения template_pdf.php:419