OXID eShop CE  4.9.7
 All Classes Files Functions Variables Pages
invoicepdfarticlesummary.php
Go to the documentation of this file.
1 <?php
2 
7 {
8 
14  protected $_oData = null;
15 
21  protected $_oPdf = null;
22 
29  public function __construct($oData, $oPdf)
30  {
31  $this->_oData = $oData;
32  $this->_oPdf = $oPdf;
33  }
34 
40  protected function _setTotalCostsWithoutDiscount(&$iStartPos)
41  {
42  $oLang = oxRegistry::getLang();
43 
44  // products netto price
45  $this->line(15, $iStartPos + 1, 195, $iStartPos + 1);
46  $sNetSum = $oLang->formatCurrency($this->_oData->oxorder__oxtotalnetsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
47  $this->text(45, $iStartPos + 4, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICENETTO'));
48  $this->text(195 - $this->_oPdf->getStringWidth($sNetSum), $iStartPos + 4, $sNetSum);
49 
50  // #345 - product VAT info
51  $iCtr = 0;
52  foreach ($this->_oData->getVats() as $iVat => $dVatPrice) {
53  $iStartPos += 4 * $iCtr;
54  $sVATSum = $oLang->formatCurrency($dVatPrice, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
55  $this->text(45, $iStartPos + 8, $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $iVat . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM'));
56  $this->text(195 - $this->_oPdf->getStringWidth($sVATSum), $iStartPos + 8, $sVATSum);
57  $iCtr++;
58  }
59 
60  // products brutto price
61  $sBrutPrice = $oLang->formatCurrency($this->_oData->oxorder__oxtotalbrutsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
62  $this->text(45, $iStartPos + 12, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICEBRUTTO'));
63  $this->text(195 - $this->_oPdf->getStringWidth($sBrutPrice), $iStartPos + 12, $sBrutPrice);
64  $iStartPos++;
65 
66  // line separator
67  $this->line(45, $iStartPos + 13, 195, $iStartPos + 13);
68  $iStartPos += 5;
69  }
70 
76  protected function _setTotalCostsWithDiscount(&$iStartPos)
77  {
78  $oLang = oxRegistry::getLang();
79 
80  // line separator
81  $this->line(15, $iStartPos + 1, 195, $iStartPos + 1);
82 
83  if ($this->_oData->isNettoMode()) {
84 
85  // products netto price
86  $sNetSum = $oLang->formatCurrency($this->_oData->oxorder__oxtotalnetsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
87  $this->text(45, $iStartPos + 4, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICENETTO'));
88  $this->text(195 - $this->_oPdf->getStringWidth($sNetSum), $iStartPos + 4, $sNetSum);
89 
90  // discount
91  $dDiscountVal = $this->_oData->oxorder__oxdiscount->value;
92  if ($dDiscountVal > 0) {
93  $dDiscountVal *= -1;
94  }
95  $sDiscount = $oLang->formatCurrency($dDiscountVal, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
96  $this->text(45, $iStartPos + 8, $this->_oData->translate('ORDER_OVERVIEW_PDF_DISCOUNT'));
97  $this->text(195 - $this->_oPdf->getStringWidth($sDiscount), $iStartPos + 8, $sDiscount);
98  $iStartPos++;
99 
100  // line separator
101  $this->line(45, $iStartPos + 8, 195, $iStartPos + 8);
102 
103  $iCtr = 0;
104  foreach ($this->_oData->getVats() as $iVat => $dVatPrice) {
105  $iStartPos += 4 * $iCtr;
106  $sVATSum = $oLang->formatCurrency($dVatPrice, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
107  $this->text(45, $iStartPos + 12, $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $iVat . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM'));
108  $this->text(195 - $this->_oPdf->getStringWidth($sVATSum), $iStartPos + 12, $sVATSum);
109  $iCtr++;
110  }
111  $iStartPos += 4;
112 
113  // products brutto price
114  $sBrutPrice = $oLang->formatCurrency($this->_oData->oxorder__oxtotalbrutsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
115  $this->text(45, $iStartPos + 12, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICEBRUTTO'));
116  $this->text(195 - $this->_oPdf->getStringWidth($sBrutPrice), $iStartPos + 12, $sBrutPrice);
117  $iStartPos += 4;
118 
119  } else {
120  // products brutto price
121  $sBrutPrice = $oLang->formatCurrency($this->_oData->oxorder__oxtotalbrutsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
122  $this->text(45, $iStartPos + 4, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICEBRUTTO'));
123  $this->text(195 - $this->_oPdf->getStringWidth($sBrutPrice), $iStartPos + 4, $sBrutPrice);
124 
125  // line separator
126  $this->line(45, $iStartPos + 5, 195, $iStartPos + 5);
127 
128  // discount
129  $dDiscountVal = $this->_oData->oxorder__oxdiscount->value;
130  if ($dDiscountVal > 0) {
131  $dDiscountVal *= -1;
132  }
133  $sDiscount = $oLang->formatCurrency($dDiscountVal, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
134  $this->text(45, $iStartPos + 8, $this->_oData->translate('ORDER_OVERVIEW_PDF_DISCOUNT'));
135  $this->text(195 - $this->_oPdf->getStringWidth($sDiscount), $iStartPos + 8, $sDiscount);
136  $iStartPos++;
137 
138  // line separator
139  $this->line(45, $iStartPos + 8, 195, $iStartPos + 8);
140  $iStartPos += 4;
141 
142  // products netto price
143  $sNetSum = $oLang->formatCurrency($this->_oData->oxorder__oxtotalnetsum->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
144  $this->text(45, $iStartPos + 8, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLPRICENETTO'));
145  $this->text(195 - $this->_oPdf->getStringWidth($sNetSum), $iStartPos + 8, $sNetSum);
146 
147  // #345 - product VAT info
148  $iCtr = 0;
149  foreach ($this->_oData->getVats() as $iVat => $dVatPrice) {
150  $iStartPos += 4 * $iCtr;
151  $sVATSum = $oLang->formatCurrency($dVatPrice, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
152  $this->text(45, $iStartPos + 12, $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $iVat . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM'));
153  $this->text(195 - $this->_oPdf->getStringWidth($sVATSum), $iStartPos + 12, $sVATSum);
154  $iCtr++;
155  }
156  $iStartPos += 4;
157  }
158  }
159 
165  protected function _setVoucherInfo(&$iStartPos)
166  {
167  $dVoucher = 0;
168  if ($this->_oData->oxorder__oxvoucherdiscount->value) {
169  $dDiscountVal = $this->_oData->oxorder__oxvoucherdiscount->value;
170  if ($dDiscountVal > 0) {
171  $dDiscountVal *= -1;
172  }
173  $sPayCost = oxRegistry::getLang()->formatCurrency($dDiscountVal, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
174  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_VOUCHER'));
175  $this->text(195 - $this->_oPdf->getStringWidth($sPayCost), $iStartPos, $sPayCost);
176  $iStartPos += 4;
177  }
178 
179  $iStartPos++;
180  }
181 
187  protected function _setDeliveryInfo(&$iStartPos)
188  {
189  $sAddString = '';
190  $oLang = oxRegistry::getLang();
191  $oConfig = oxRegistry::getConfig();
192 
193  if ($oConfig->getConfigParam('blShowVATForDelivery')) {
194  // delivery netto
195  $sDelCostNetto = $oLang->formatCurrency($this->_oData->getOrderDeliveryPrice()->getNettoPrice(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
196  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_SHIPCOST') . ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_NETTO'));
197  $this->text(195 - $this->_oPdf->getStringWidth($sDelCostNetto), $iStartPos, $sDelCostNetto);
198  $iStartPos += 4;
199 
200  if ($oConfig->getConfigParam('sAdditionalServVATCalcMethod') != 'proportional') {
201  $sVatValueText = $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $this->_oData->oxorder__oxdelvat->value . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM');
202  } else {
203  $sVatValueText = $this->_oData->translate('TOTAL_PLUS_PROPORTIONAL_VAT');
204  }
205 
206  // delivery VAT
207  $sDelCostVAT = $oLang->formatCurrency($this->_oData->getOrderDeliveryPrice()->getVATValue(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
208  $this->text(45, $iStartPos, $sVatValueText);
209  $this->text(195 - $this->_oPdf->getStringWidth($sDelCostVAT), $iStartPos, $sDelCostVAT);
210  //$iStartPos += 4;
211 
212  $sAddString = ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_BRUTTO');
213  } else {
214  // if canceled order, reset value
215  if ($this->_oData->oxorder__oxstorno->value) {
216  $this->_oData->oxorder__oxdelcost->setValue(0);
217  }
218 
219  $sDelCost = $oLang->formatCurrency($this->_oData->oxorder__oxdelcost->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
220  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_SHIPCOST') . $sAddString);
221  $this->text(195 - $this->_oPdf->getStringWidth($sDelCost), $iStartPos, $sDelCost);
222  }
223  }
224 
230  protected function _setWrappingInfo(&$iStartPos)
231  {
232  if ($this->_oData->oxorder__oxwrapcost->value || $this->_oData->oxorder__oxgiftcardcost->value) {
233  $oLang = oxRegistry::getLang();
234  $oConfig = oxRegistry::getConfig();
235 
236  //displaying wrapping VAT info
237  if ($oConfig->getConfigParam('blShowVATForWrapping')) {
238 
239  if ($this->_oData->oxorder__oxwrapcost->value) {
240  // wrapping netto
241  $iStartPos += 4;
242  $sWrapCostNetto = $oLang->formatCurrency($this->_oData->getOrderWrappingPrice()->getNettoPrice(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
243  $this->text(45, $iStartPos, $this->_oData->translate('WRAPPING_COSTS') . ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_NETTO'));
244  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCostNetto), $iStartPos, $sWrapCostNetto);
245  //$iStartPos++;
246 
247  //wrapping VAT
248  $iStartPos += 4;
249  $sWrapCostVAT = $oLang->formatCurrency($this->_oData->getOrderWrappingPrice()->getVATValue(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
250  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT'));
251  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCostVAT), $iStartPos, $sWrapCostVAT);
252  // $iStartPos++;
253  }
254 
255  if ($this->_oData->oxorder__oxgiftcardcost->value) {
256  // wrapping netto
257  $iStartPos += 4;
258  $sWrapCostNetto = $oLang->formatCurrency($this->_oData->getOrderGiftCardPrice()->getNettoPrice(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
259  $this->text(45, $iStartPos, $this->_oData->translate('GIFTCARD_COSTS') . ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_NETTO'));
260  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCostNetto), $iStartPos, $sWrapCostNetto);
261  //$iStartPos++;
262 
263  //wrapping VAT
264  $iStartPos += 4;
265  $sWrapCostVAT = $oLang->formatCurrency($this->_oData->getOrderGiftCardPrice()->getVATValue(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
266 
267  if ($oConfig->getConfigParam('sAdditionalServVATCalcMethod') != 'proportional') {
268  $sVatValueText = $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $this->_oData->oxorder__oxgiftcardvat->value . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM');
269  } else {
270  $sVatValueText = $this->_oData->translate('TOTAL_PLUS_PROPORTIONAL_VAT');
271  }
272 
273  $this->text(45, $iStartPos, $sVatValueText);
274  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCostVAT), $iStartPos, $sWrapCostVAT);
275  $iStartPos++;
276  }
277 
278  } else {
279  $sAddString = ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_BRUTTO');
280 
281  if ($this->_oData->oxorder__oxwrapcost->value) {
282  $iStartPos += 4;
283  // wrapping cost
284  $sWrapCost = $oLang->formatCurrency($this->_oData->oxorder__oxwrapcost->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
285  $this->text(45, $iStartPos, $this->_oData->translate('WRAPPING_COSTS' /*'ORDER_OVERVIEW_PDF_WRAPPING'*/) . $sAddString);
286  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCost), $iStartPos, $sWrapCost);
287  $iStartPos++;
288  }
289 
290  if ($this->_oData->oxorder__oxgiftcardcost->value) {
291  $iStartPos += 4;
292  // gift card cost
293  $sWrapCost = $oLang->formatCurrency($this->_oData->oxorder__oxgiftcardcost->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
294  $this->text(45, $iStartPos, $this->_oData->translate('GIFTCARD_COSTS') . $sAddString);
295  $this->text(195 - $this->_oPdf->getStringWidth($sWrapCost), $iStartPos, $sWrapCost);
296  $iStartPos++;
297  }
298  }
299  }
300  }
301 
307  protected function _setPaymentInfo(&$iStartPos)
308  {
309  $oLang = oxRegistry::getLang();
310  $oConfig = oxRegistry::getConfig();
311 
312  if ($this->_oData->oxorder__oxstorno->value) {
313  $this->_oData->oxorder__oxpaycost->setValue(0);
314  }
315 
316  if ($oConfig->getConfigParam('blShowVATForDelivery')) {
317  if ($this->_oData->oxorder__oxpayvat->value) {
318  // payment netto
319  $iStartPos += 4;
320  $sPayCostNetto = $oLang->formatCurrency($this->_oData->getOrderPaymentPrice()->getNettoPrice(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
321  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_PAYMENTIMPACT') . ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_NETTO'));
322  $this->text(195 - $this->_oPdf->getStringWidth($sPayCostNetto), $iStartPos, $sPayCostNetto);
323 
324  if ($oConfig->getConfigParam('sAdditionalServVATCalcMethod') != 'proportional') {
325  $sVatValueText = $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $this->_oData->oxorder__oxpayvat->value . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM');
326  } else {
327  $sVatValueText = $this->_oData->translate('TOTAL_PLUS_PROPORTIONAL_VAT');
328  }
329 
330  // payment VAT
331  $iStartPos += 4;
332  $sPayCostVAT = $oLang->formatCurrency($this->_oData->getOrderPaymentPrice()->getVATValue(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
333  $this->text(45, $iStartPos, $sVatValueText);
334  $this->text(195 - $this->_oPdf->getStringWidth($sPayCostVAT), $iStartPos, $sPayCostVAT);
335 
336  }
337 
338  // if canceled order, reset value
339 
340  } else {
341 
342  // payment costs
343  if ($this->_oData->oxorder__oxpaycost->value) {
344  $iStartPos += 4;
345  $sPayCost = $oLang->formatCurrency($this->_oData->oxorder__oxpaycost->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
346  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_PAYMENTIMPACT'));
347  $this->text(195 - $this->_oPdf->getStringWidth($sPayCost), $iStartPos, $sPayCost);
348  }
349 
350  $iStartPos++;
351  }
352  }
353 
359  protected function _setTsProtection(&$iStartPos)
360  {
361  $oLang = oxRegistry::getLang();
362  $oConfig = oxRegistry::getConfig();
363  if ($this->_oData->oxorder__oxtsprotectcosts->value && $oConfig->getConfigParam('blShowVATForPayCharge')) {
364 
365  // payment netto
366  $iStartPos += 4;
367  $sPayCostNetto = $oLang->formatCurrency($this->_oData->getOrderTsProtectionPrice()->getNettoPrice(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
368  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_TSPROTECTION') . ' ' . $this->_oData->translate('ORDER_OVERVIEW_PDF_NETTO'));
369  $this->text(195 - $this->_oPdf->getStringWidth($sPayCostNetto), $iStartPos, $sPayCostNetto);
370 
371  // payment VAT
372  $iStartPos += 4;
373  $sPayCostVAT = $oLang->formatCurrency($this->_oData->getOrderTsProtectionPrice()->getVATValue(), $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
374  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_ZZGLVAT') . $oConfig->getConfigParam('dDefaultVAT') . $this->_oData->translate('ORDER_OVERVIEW_PDF_PERCENTSUM'));
375  $this->text(195 - $this->_oPdf->getStringWidth($sPayCostVAT), $iStartPos, $sPayCostVAT);
376 
377  $iStartPos++;
378 
379  } elseif ($this->_oData->oxorder__oxtsprotectcosts->value) {
380 
381  $iStartPos += 4;
382  $sPayCost = $oLang->formatCurrency($this->_oData->oxorder__oxtsprotectcosts->value, $this->_oData->getCurrency()) . ' ' . $this->_oData->getCurrency()->name;
383  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_TSPROTECTION'));
384  $this->text(195 - $this->_oPdf->getStringWidth($sPayCost), $iStartPos, $sPayCost);
385 
386  $iStartPos++;
387  }
388  }
389 
395  protected function _setGrandTotalPriceInfo(&$iStartPos)
396  {
397  $this->font($this->getFont(), 'B', 10);
398 
399  // total order sum
400  $sTotalOrderSum = $this->_oData->getFormattedTotalOrderSum() . ' ' . $this->_oData->getCurrency()->name;
401  $this->text(45, $iStartPos, $this->_oData->translate('ORDER_OVERVIEW_PDF_ALLSUM'));
402  $this->text(195 - $this->_oPdf->getStringWidth($sTotalOrderSum), $iStartPos, $sTotalOrderSum);
403  $iStartPos += 2;
404 
405  if ($this->_oData->oxorder__oxdelvat->value || $this->_oData->oxorder__oxwrapvat->value || $this->_oData->oxorder__oxpayvat->value) {
406  $iStartPos += 2;
407  }
408  }
409 
415  protected function _setPaymentMethodInfo(&$iStartPos)
416  {
417  $oPayment = oxNew('oxpayment');
418  $oPayment->loadInLang($this->_oData->getSelectedLang(), $this->_oData->oxorder__oxpaymenttype->value);
419 
420  $text = $this->_oData->translate('ORDER_OVERVIEW_PDF_SELPAYMENT') . $oPayment->oxpayments__oxdesc->value;
421  $this->font($this->getFont(), '', 10);
422  $this->text(15, $iStartPos + 4, $text);
423  $iStartPos += 4;
424  }
425 
431  protected function _setPayUntilInfo(&$iStartPos)
432  {
433  $text = $this->_oData->translate('ORDER_OVERVIEW_PDF_PAYUPTO') . date('d.m.Y', strtotime('+' . $this->_oData->getPaymentTerm() . ' day', strtotime($this->_oData->oxorder__oxbilldate->value)));
434  $this->font($this->getFont(), '', 10);
435  $this->text(15, $iStartPos + 4, $text);
436  $iStartPos += 4;
437  }
438 
446  public function generate($iStartPos)
447  {
448 
449  $this->font($this->getFont(), '', 10);
450  $siteH = $iStartPos;
451 
452  // #1147 discount for vat must be displayed
453  if (!$this->_oData->oxorder__oxdiscount->value) {
454  $this->_setTotalCostsWithoutDiscount($siteH);
455  } else {
456  $this->_setTotalCostsWithDiscount($siteH);
457  }
458 
459  $siteH += 12;
460 
461  // voucher info
462  $this->_setVoucherInfo($siteH);
463 
464  // additional line separator
465  if ($this->_oData->oxorder__oxdiscount->value || $this->_oData->oxorder__oxvoucherdiscount->value) {
466  $this->line(45, $siteH - 3, 195, $siteH - 3);
467  }
468 
469  // delivery info
470  $this->_setDeliveryInfo($siteH);
471 
472  // payment info
473  $this->_setPaymentInfo($siteH);
474 
475  // wrapping info
476  $this->_setWrappingInfo($siteH);
477 
478  // TS protection info
479  $this->_setTsProtection($siteH);
480 
481  // separating line
482  $this->line(15, $siteH, 195, $siteH);
483  $siteH += 4;
484 
485  // total order sum
486  $this->_setGrandTotalPriceInfo($siteH);
487 
488  // separating line
489  $this->line(15, $siteH, 195, $siteH);
490  $siteH += 4;
491 
492  // payment method
493  $this->_setPaymentMethodInfo($siteH);
494 
495  // pay until ...
496  $this->_setPayUntilInfo($siteH);
497 
498  return $siteH - $iStartPos;
499  }
500 }