13 include_once
'./Services/Payment/classes/class.ilPaymentShoppingCart.php';
14 include_once
'./Services/Payment/classes/class.ilShopShoppingCartGUI.php';
15 include_once
'./Services/Payment/classes/class.ilPaymentCoupons.php';
16 include_once
'./Services/Payment/classes/class.ilShopVatsList.php';
17 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
18 include_once
'./Services/Payment/classes/class.ilShopUtils.php';
19 include_once
'./Services/Payment/classes/class.ilInvoiceNumberPlaceholdersPropertyGUI.php';
20 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
42 $this->ilias = $ilias;
49 $this->session_var = $this->pmethod_obj->getPmTitle();
57 if (!is_array(
$_SESSION[$this->session_var][
'personal_data']))
61 if (strpos(
'_' . $this->user_obj->getStreet(),
' ') > 0)
63 $houseNo = substr($this->user_obj->getStreet(), strrpos($this->user_obj->getStreet(),
' ')+1);
64 $street = substr($this->user_obj->getStreet(), 0, strlen($this->user_obj->getStreet())-(strlen($houseNo)+1));
78 $_SESSION[
$this->session_var][
'personal_data'][
'language'] = $this->user_obj->getLanguage();
81 if (!is_array(
$_SESSION[
'coupons'][$this->session_var]))
88 $this->lng->loadLanguageModule(
'payment');
90 $ilTabs->clearTargets();
91 $ilTabs->clearSubTabs();
103 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
105 $this->tpl->setVariable(
'HEADER',$this->lng->txt(
'pay_bmf_your_order'));
106 $this->tpl->touchBlock(
'stop_floating');
111 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
114 $oForm->setFormAction($this->ctrl->getFormAction($this,
'getPersonalData'));
115 $oForm->setTitle($this->lng->txt(
'pay_bmf_personal_data'));
118 $oFirstname->
setValue($this->user_obj->getFirstname());
119 $oForm->addItem($oFirstname);
122 $oLastname->
setValue($this->user_obj->getLastname());
123 $oForm->addItem($oLastname);
125 $oStreet =
new ilTextInputGUI($this->lng->txt(
'street'),
'street');
129 $oForm->addItem($oStreet);
131 $oHouseNumber =
new ilTextInputGUI($this->lng->txt(
'pay_bmf_house_number'),
'house_number');
132 $oHouseNumber->
setValue($this->error !=
'' && isset(
$_POST[
'house_number'])
135 $oForm->addItem($oHouseNumber);
137 $oPoBox =
new ilTextInputGUI($this->lng->txt(
'pay_bmf_or').
' '.$this->lng->txt(
'pay_bmf_po_box'),
'po_box');
141 $oForm->addItem($oPoBox);
143 $oZipCode =
new ilTextInputGUI($this->lng->txt(
'zipcode'),
'zipcode');
144 if($this->user_obj->getZipCode() && !isset(
$_POST[
'zipcode']))
145 $oZipCode->
setValue($this->user_obj->getZipCode());
147 $oZipCode->setValue($this->error !=
'' && isset(
$_POST[
'zipcode'])
150 $oForm->addItem($oZipCode);
153 if($this->user_obj->getCity()&& !isset(
$_POST[
'city']))
154 $oCity->
setValue($this->user_obj->getCity());
156 $oCity->setValue($this->error !=
'' && isset(
$_POST[
'city'])
159 $oForm->addItem($oCity);
164 if($this->user_obj->getSelectedCountry()&& !isset(
$_POST[
'country']))
165 $oCountry->setValue($this->user_obj->getSelectedCountry());
167 $oCountry->setValue($this->error !=
'' && isset(
$_POST[
'country']) ?
$_POST[
'country']
168 :
$_SESSION[$this->session_var][
'personal_data'][
'country']);
169 $oForm->addItem($oCountry);
172 $oEmail->
setValue($this->user_obj->getEmail());
173 $oForm->addItem($oEmail);
175 $oForm->addcommandButton(
'getPersonalData',ucfirst($this->lng->txt(
'next')));
177 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
184 if (
$_SESSION[$this->session_var][
'personal_data'][
'firstname'] ==
'' ||
185 $_SESSION[$this->session_var][
'personal_data'][
'lastname'] ==
'' ||
186 $_POST[
'zipcode'] ==
'' ||
188 $_POST[
'country'] ==
'' ||
189 $_SESSION[$this->session_var][
'personal_data'][
'email'] ==
'')
192 $this->error = $this->lng->txt(
'pay_bmf_personal_data_not_valid');
198 if ((
$_POST[
'street'] ==
'' &&
$_POST[
'house_number'] ==
'' &&
$_POST[
'po_box'] ==
'') ||
199 ((
$_POST[
'street'] !=
'' ||
$_POST[
'house_number'] !=
'') &&
$_POST[
'po_box'] !=
'') ||
200 (
$_POST[
'street'] !=
'' &&
$_POST[
'house_number'] ==
'') ||
201 (
$_POST[
'street'] ==
'' &&
$_POST[
'house_number'] !=
''))
203 $this->error = $this->lng->txt(
'pay_bmf_street_or_pobox');
230 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
232 $this->tpl->setVariable(
'HEADER',$this->lng->txt(
'pay_bmf_your_order'));
233 $this->tpl->touchBlock(
'stop_floating');
238 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_bill_confirm.html',
'Services/Payment');
242 $this->tpl->setVariable(
'BILL_CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
246 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_usr'));
247 $this->tpl->touchBlock(
'stop_floating');
248 $this->tpl->setVariable(
'TXT_CLOSE_WINDOW',$this->lng->txt(
'close_window'));
251 $this->tpl->setVariable(
'TXT_TERMS_CONDITIONS',$this->lng->txt(
'pay_bmf_terms_conditions'));
252 $this->tpl->setVariable(
'TXT_TERMS_CONDITIONS_READ',$this->lng->txt(
'pay_bmf_terms_conditions_read'));
253 $this->tpl->setVariable(
'TXT_TERMS_CONDITIONS_SHOW',$this->lng->txt(
'pay_bmf_terms_conditions_show'));
254 $this->tpl->setVariable(
'LINK_TERMS_CONDITIONS',
'./payment.php?view=conditions');
255 $this->tpl->setVariable(
'TXT_PASSWORD',$this->lng->txt(
'password'));
256 $this->tpl->setVariable(
'TXT_CONFIRM_ORDER',$this->lng->txt(
'pay_confirm_order'));
258 $this->tpl->setVariable(
'INPUT_VALUE',$this->lng->txt(
'pay_send_order'));
259 $this->tpl->setVariable(
'CANCEL',$this->lng->txt(
'cancel'));
260 if ($this->error !=
'' &&
261 isset(
$_POST[
'terms_conditions']))
263 $this->tpl->setVariable(
'TERMS_CONDITIONS_' . strtoupper(
$_POST[
'terms_conditions']),
' checked') ;
265 if ($this->error !=
'' &&
266 isset(
$_POST[
'password']))
272 $this->tpl->addBlockfile(
'BUTTONS',
'buttons',
'tpl.buttons.html');
273 $this->tpl->setCurrentBlock(
'btn_cell');
274 $this->tpl->setVariable(
'BTN_LINK', $this->ctrl->getLinkTarget($this,
'showPersonalData'));
275 $this->tpl->setVariable(
'BTN_TXT', $this->lng->txt(
'pay_bmf_back'));
276 $this->tpl->parseCurrentBlock(
'btn_cell');
287 $cmd = $this->ctrl->getCmd();
289 switch ($this->ctrl->getNextClass($this))
292 if(!
$cmd = $this->ctrl->getCmd())
294 $cmd =
'showPersonalData';
303 global $ilUser, $ilObjDataCache;
305 $sc = $this->psc_obj->getShoppingCart($this->pm_id);
307 # $this->psc_obj->clearCouponItemsSession();
309 if (is_array($sc) && count($sc) > 0)
311 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
314 for ($i = 0; $i < count($sc); $i++)
316 if (!empty(
$_SESSION[
'coupons'][$this->session_var]))
318 $sc[$i][
'math_price'] = (float) $sc[$i][
'price'];
320 $tmp_pobject =
new ilPaymentObject($this->user_obj, $sc[$i][
'pobject_id']);
322 foreach (
$_SESSION[
'coupons'][$this->session_var] as $key => $coupon)
324 $this->coupon_obj->setId($coupon[
'pc_pk']);
325 $this->coupon_obj->setCurrentCoupon($coupon);
327 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
338 $coupon_discount_items = $this->psc_obj->calcDiscountPrices(
$_SESSION[
'coupons'][$this->session_var]);
341 for ($i = 0; $i < count($sc); $i++)
346 $price = $sc[$i][
'price'];
349 if (array_key_exists($sc[$i][
'pobject_id'], $coupon_discount_items))
351 $bonus = $coupon_discount_items[$sc[$i][
'pobject_id']][
'math_price'] - $coupon_discount_items[$sc[$i][
'pobject_id']][
'discount_price'];
353 $discount = round($bonus, 2)* (-1);
354 else $discount = round($bonus, 2);
358 $book_obj->setTransaction($transaction);
359 $book_obj->setPobjectId($sc[$i][
'pobject_id']);
360 $book_obj->setCustomerId($this->user_obj->getId());
361 $book_obj->setVendorId($pobjectData[
'vendor_id']);
362 $book_obj->setPayMethod($pobjectData[
'pay_method']);
363 $book_obj->setOrderDate(time());
364 $book_obj->setDuration($sc[$i][
'duration']);
365 $book_obj->setUnlimitedDuration($sc[i][
'unlimited_duration']);
366 $book_obj->setPrice($sc[$i][
'price_string']);
368 $book_obj->setDiscount($discount);
369 $book_obj->setPayed(1);
370 $book_obj->setAccess(1);
372 $book_obj->setVoucher(
'');
373 $book_obj->setTransactionExtern(
'');
375 $book_obj->setVatRate($sc[$i][
'vat_rate']);
376 $book_obj->setVatUnit($sc[$i][
'vat_unit']);
377 $book_obj->setObjectTitle(strip_tags($sc[$i][
'object_title']));
378 $book_obj->setAccessExtension($sc[$i][
'extension']);
382 $book_obj->setVoucher($external_data[
'voucher']);
383 $book_obj->setTransactionExtern($external_data[
'transaction_extern']);
384 $book_obj->setStreet($external_data[
'street'],
'');
385 $book_obj->setZipcode($external_data[
'zipcode']);
386 $book_obj->setCity($external_data[
'city']);
387 $book_obj->setCountry($external_data[
'country']);
390 if(isset(
$_SESSION[$this->session_var][
'personal_data']))
392 $book_obj->setStreet(
$_SESSION[$this->session_var][
'personal_data'][
'street'],
$_SESSION[$this->session_var][
'personal_data'][
'house_number']);
393 $book_obj->setPoBox(
$_SESSION[$this->session_var][
'personal_data'][
'po_box']);
394 $book_obj->setZipcode(
$_SESSION[$this->session_var][
'personal_data'][
'zipcode']);
395 $book_obj->setCity(
$_SESSION[$this->session_var][
'personal_data'][
'city']);
396 $book_obj->setCountry(
$_SESSION[$this->session_var][
'personal_data'][
'country']);
400 $book_obj->setStreet($this->user_obj->getStreet(),
'');
401 $book_obj->setPoBox($this->user_obj->getPoBox());
402 $book_obj->setZipcode($this->user_obj->getZipCode());
403 $book_obj->setCity($this->user_obj->getCity());
404 $book_obj->setCountry($this->user_obj->getCountry());
407 $booking_id = $book_obj->add();
415 if($obj_type ==
'crs')
420 if (!empty(
$_SESSION[
'coupons'][$this->session_var]) && $booking_id)
422 foreach (
$_SESSION[
'coupons'][$this->session_var] as $coupon)
424 $this->coupon_obj->setId($coupon[
'pc_pk']);
425 $this->coupon_obj->setCurrentCoupon($coupon);
427 if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
429 $this->coupon_obj->addCouponForBookingId($booking_id);
434 $obj_id = $ilObjDataCache->lookupObjId($pobjectData[
'ref_id']);
435 $obj_type = $ilObjDataCache->lookupType($obj_id);
436 $obj_title = $ilObjDataCache->lookupTitle($obj_id);
439 # ilObjUser::_addDesktopItem($this->user_obj->getId(), $pobjectData['ref_id'], $obj_type);
441 $bookings[
'list'][] = array(
442 'pobject_id' => $sc[$i][
'pobject_id'],
444 'title' =>
'['.$obj_id.
']: ' . $obj_title,
445 'duration' => $sc[$i][
'duration'],
446 'vat_rate' => $sc[$i][
'vat_rate'],
447 'vat_unit' => $sc[$i][
'vat_unit'],
448 'price_string' => $sc[$i][
'price_string'],
449 'price' => $sc[$i][
'price'],
450 'discount'=> $discount,
451 'access_startdate' => $book_obj->getAccessStartdate(),
452 'access_enddate' => $book_obj->getAccessEnddate()
455 $total += $sc[$i][
'price'];
456 $total_vat += $sc[$i][
'vat_unit'];
457 $total_discount += $discount;
459 if ($sc[$i][
'psc_id']) $this->psc_obj->delete($sc[$i][
'psc_id']);
462 if (!empty(
$_SESSION[
'coupons'][$this->session_var]))
464 foreach (
$_SESSION[
'coupons'][$this->session_var] as $coupon)
466 $this->coupon_obj->setId($coupon[
'pc_pk']);
467 $this->coupon_obj->setCurrentCoupon($coupon);
468 $this->coupon_obj->addTracking();
473 $bookings[
'total'] =
$total;
474 $bookings[
'total_vat'] = $total_vat;
475 $bookings[
'total_discount'] = $total_discount;
476 $bookings[
'transaction'] = $transaction;
477 $bookings[
'street'] = $book_obj->getStreet();
478 $bookings[
'zipcode'] = $book_obj->getZipCode();
479 $bookings[
'city'] = $book_obj->getCity();
480 $bookings[
'country'] = $book_obj->getCountry();
481 $bookings[
'transaction_extern'] = $book_obj->getTransactionExtern();
490 include_once
'./classes/class.ilTemplate.php';
491 include_once
'./Services/Utilities/classes/class.ilUtil.php';
492 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
493 include_once
'./Services/Payment/classes/class.ilPaymentShoppingCart.php';
494 include_once
'Services/Mail/classes/class.ilMimeMail.php';
498 $currency = $genSet->get(
'currency_unit');
500 $tpl =
new ilTemplate(
'tpl.pay_bill.html',
true,
true,
'Services/Payment');
503 if($tpl->placeholderExists(
'HTTP_PATH'))
506 $tpl->setVariable(
'HTTP_PATH', $http_path);
510 $tpl->setVariable(
'TXT_CREDIT', utf8_decode($this->lng->txt(
'credit')));
511 $tpl->setVariable(
'TXT_DAY_OF_SERVICE_PROVISION',$this->lng->txt(
'day_of_service_provision'));
512 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
514 $tpl->setVariable(
'TXT_EXTERNAL_BILL_NO', str_replace(
'%s',$str_paymethod,utf8_decode($this->lng->txt(
'external_bill_no'))));
515 $tpl->setVariable(
'EXTERNAL_BILL_NO', $bookings[
'transaction_extern']);
516 $tpl->setVariable(
'TXT_POSITION',$this->lng->txt(
'position'));
517 $tpl->setVariable(
'TXT_AMOUNT',$this->lng->txt(
'amount'));
518 $tpl->setVariable(
'TXT_UNIT_PRICE', utf8_decode($this->lng->txt(
'unit_price')));
520 $tpl->setVariable(
'VENDOR_ADDRESS', nl2br(utf8_decode($genSet->get(
'address'))));
521 $tpl->setVariable(
'VENDOR_ADD_INFO', nl2br(utf8_decode($genSet->get(
'add_info'))));
522 $tpl->setVariable(
'VENDOR_BANK_DATA', nl2br(utf8_decode($genSet->get(
'bank_data'))));
523 $tpl->setVariable(
'TXT_BANK_DATA', utf8_decode($this->lng->txt(
'pay_bank_data')));
526 $tpl->setVariable(
'CUSTOMER_FIRSTNAME', utf8_decode($this->user_obj->getFirstname()));
527 $tpl->setVariable(
'CUSTOMER_LASTNAME', utf8_decode($this->user_obj->getLastname()));
528 if($bookings[
'po_box']==
'')
530 $tpl->setVariable(
'CUSTOMER_STREET',utf8_decode($bookings[
'street']));
534 $tpl->setVariable(
'CUSTOMER_STREET', utf8_decode($bookings[
'po_box']));
536 $tpl->setVariable(
'CUSTOMER_ZIPCODE', utf8_decode($bookings[
'zipcode']));
537 $tpl->setVariable(
'CUSTOMER_CITY', utf8_decode($bookings[
'city']));
538 $tpl->setVariable(
'CUSTOMER_COUNTRY', utf8_decode($bookings[
'country']));
540 $tpl->setVariable(
'BILL_NO', $bookings[
'transaction']);
541 $tpl->setVariable(
'DATE', date(
'd.m.Y'));
543 $tpl->setVariable(
'TXT_BILL', utf8_decode($this->lng->txt(
'pays_bill')));
544 $tpl->setVariable(
'TXT_BILL_NO', utf8_decode($this->lng->txt(
'pay_bill_no')));
545 $tpl->setVariable(
'TXT_DATE', utf8_decode($this->lng->txt(
'date')));
547 $tpl->setVariable(
'TXT_ARTICLE', utf8_decode($this->lng->txt(
'pay_article')));
548 $tpl->setVariable(
'TXT_VAT_RATE', utf8_decode($this->lng->txt(
'vat_rate')));
549 $tpl->setVariable(
'TXT_VAT_UNIT', utf8_decode($this->lng->txt(
'vat_unit')));
550 $tpl->setVariable(
'TXT_PRICE', utf8_decode($this->lng->txt(
'price_a')));
552 for ($i = 0; $i < count($bookings[
'list']); $i++)
554 $tmp_pobject =
new ilPaymentObject($this->user_obj, $bookings[
'list'][$i][
'pobject_id']);
556 $assigned_coupons =
'';
557 if (!empty(
$_SESSION[
'coupons'][$this->session_var]))
559 foreach (
$_SESSION[
'coupons'][$this->session_var] as $coupon)
561 $this->coupon_obj->setId($coupon[
'pc_pk']);
562 $this->coupon_obj->setCurrentCoupon($coupon);
564 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
566 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
'pcc_code'];
571 $tpl->setCurrentBlock(
'loop');
572 $tpl->setVariable(
'LOOP_POSITION', $i+1);
573 $tpl->setVariable(
'LOOP_AMOUNT',
'1');
574 $tpl->setVariable(
'LOOP_TXT_PERIOD_OF_SERVICE_PROVISION', utf8_decode($this->lng->txt(
'period_of_service_provision')));
576 $tpl->setVariable(
'LOOP_OBJ_TYPE', utf8_decode($this->lng->txt($bookings[
'list'][$i][
'type'])));
577 $tpl->setVariable(
'LOOP_TITLE',$tmp = utf8_decode($bookings[
'list'][$i][
'title']));
578 $tpl->setVariable(
'LOOP_COUPON', utf8_decode( $assigned_coupons));
579 $tpl->setVariable(
'LOOP_TXT_ENTITLED_RETRIEVE', utf8_decode($this->lng->txt(
'pay_entitled_retrieve')));
581 if( $bookings[
'list'][$i][
'duration'] == 0)
583 $tpl->setVariable(
'LOOP_DURATION', utf8_decode($this->lng->txt(
'unlimited_duration')));
590 $tpl->setVariable(
'LOOP_DURATION',
591 $access_startdate.
' - '.$access_enddate.
' / '.
592 $bookings[
'list'][$i][
'duration'] .
' ' . utf8_decode($this->lng->txt(
'paya_months')));
594 #$currency = $bookings['list'][$i]['currency_unit'];
595 $tpl->setVariable(
'LOOP_VAT_RATE', number_format($bookings[
'list'][$i][
'vat_rate'], 2,
',',
'.').
' %');
596 $tpl->setVariable(
'LOOP_VAT_UNIT', number_format($bookings[
'list'][$i][
'vat_unit'], 2,
',',
'.').
' '.$currency);
597 $tpl->setVariable(
'LOOP_PRICE', number_format($bookings[
'list'][$i][
'price'], 2,
',',
'.').
' '.$currency);
598 $tpl->setVariable(
'LOOP_UNIT_PRICE',number_format($bookings[
'list'][$i][
'price'], 2,
',',
'.').
' '.$currency);
599 $tpl->parseCurrentBlock(
'loop');
602 $bookings[
'total'] += (float)$bookings[$i][
'price'];
603 $bookings[
'total_vat']+= (float)$bookings[$i][
'vat_unit'];
604 #$bookings['total_discount'] +=(float) $bookings[$i]['discount'];
607 $sub_total_amount = $bookings[
'total'];
610 $bookings[
'total'] += $bookings[
'total_discount'];
611 if($bookings[
'total_discount'] < 0)
613 $tpl->setCurrentBlock(
'cloop');
615 $tpl->setVariable(
'TXT_SUBTOTAL_AMOUNT', utf8_decode($this->lng->txt(
'pay_bmf_subtotal_amount')));
616 $tpl->setVariable(
'SUBTOTAL_AMOUNT', number_format($sub_total_amount, 2,
',',
'.') .
' ' . $currency);
618 $tpl->setVariable(
'TXT_COUPON', utf8_decode($this->lng->txt(
'paya_coupons_coupon')));
619 $tpl->setVariable(
'BONUS', number_format($bookings[
'total_discount'], 2,
',',
'.') .
' ' . $currency);
620 $tpl->parseCurrentBlock();
623 if ($bookings[
'total'] < 0)
625 $bookings[
'total'] = 0.00;
628 $total_net_price = $sub_total_amount-$bookings[
'total_vat'];
630 $tpl->setVariable(
'TXT_TOTAL_NETPRICE', utf8_decode($this->lng->txt(
'total_netprice')));
631 $tpl->setVariable(
'TOTAL_NETPRICE', number_format($total_net_price, 2,
',',
'.') .
' ' . $currency);
633 $tpl->setVariable(
'TXT_TOTAL_AMOUNT', utf8_decode($this->lng->txt(
'pay_bmf_total_amount')));
634 $tpl->setVariable(
'TOTAL_AMOUNT', number_format($bookings[
'total'], 2,
',',
'.') .
' ' . $currency);
635 if ($bookings[
'total_vat'] > 0)
637 $tpl->setVariable(
'TOTAL_VAT',number_format( $bookings[
'total_vat'], 2,
',',
'.') .
' ' .$currency);
638 $tpl->setVariable(
'TXT_TOTAL_VAT', utf8_decode($this->lng->txt(
'plus_vat')));
641 $tpl->setVariable(
'TXT_PAYMENT_TYPE', utf8_decode($this->lng->txt(
'pay_payed_bill')));
643 if (!@file_exists($genSet->get(
'pdf_path')))
650 if (@file_exists($genSet->get(
'pdf_path')))
655 if (@file_exists($genSet->get(
'pdf_path') .
'/' .
$file_name .
'.pdf') &&
656 $this->user_obj->getEmail() !=
'' &&
657 $this->ilias->getSetting(
'admin_email') !=
'')
660 $m->
From( $this->ilias->getSetting(
'admin_email') );
661 $m->To( $this->user_obj->getEmail() );
662 $m->Subject( $this->lng->txt(
'pay_message_subject') );
665 $message = $this->lng->txt(
'pay_message_hello') .
' ' . $this->user_obj->getFirstname() .
' ' . $this->user_obj->getLastname() .
",\n\n";
666 $message .= $this->lng->txt(
'pay_message_thanks') .
"\n\n";
667 $message .= $this->lng->txt(
'pay_message_attachment') .
"\n\n";
668 $message .= $this->lng->txt(
'pay_message_regards') .
"\n\n";
669 $message .= strip_tags($genSet->get(
'address'));
672 $billing_text = $genSet->getMailBillingText();
677 if($genSet->getMailUsePlaceholders() == 1)
679 include_once
'./Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
683 $m->Body( $message );
684 $m->Attach( $genSet->get(
'pdf_path') .
'/' .
$file_name .
'.pdf',
'application/pdf' ) ;
688 @unlink($genSet->get(
'pdf_path') .
'/' .
$file_name .
'.html');
689 @unlink($genSet->get(
'pdf_path') .
'/' .
$file_name .
'.pdf');
691 unset($current_booking_id);
693 unset(
$_SESSION[
'coupons'][$this->session_var]);
698 include_once
'./Services/Payment/classes/class.ilPaymentShoppingCart.php';
702 return $sc_obj->emptyShoppingCart();
713 $this->tpl->addBlockFile(
'CONTENT',
'content',
'tpl.payb_content.html');
721 $this->tpl->addBlockFile(
'STATUSLINE',
'statusline',
'tpl.statusline.html');
722 # $this->__buildLocator();
727 $this->tpl->addBlockFile(
'LOCATOR',
'locator',
'tpl.locator.html');
728 $this->tpl->setVariable(
'TXT_LOCATOR',$this->lng->txt(
'locator'));
730 $this->tpl->setCurrentBlock(
'locator_item');
731 $this->tpl->setVariable(
'ITEM', $this->lng->txt(
'personal_desktop'));
732 $this->tpl->setVariable(
'LINK_ITEM',
'../ilias.php?baseClass=ilPersonalDesktopGUI');
733 $this->tpl->parseCurrentBlock();
735 $this->tpl->setCurrentBlock(
'locator_item');
736 $this->tpl->setVariable(
'PREFIX',
'> ');
737 $this->tpl->setVariable(
'ITEM',
'Payment');
738 $this->tpl->setVariable(
'LINK_ITEM',
'./payment.php');
739 $this->tpl->parseCurrentBlock();
759 $lng->loadLanguageModule(
'meta');
761 $cntcodes = array (
'DE',
'ES',
'FR',
'GB',
'AT',
'CH',
'AF',
'AL',
'DZ',
'AS',
'AD',
'AO',
762 'AI',
'AQ',
'AG',
'AR',
'AM',
'AW',
'AU',
'AT',
'AZ',
'BS',
'BH',
'BD',
'BB',
'BY',
763 'BE',
'BZ',
'BJ',
'BM',
'BT',
'BO',
'BA',
'BW',
'BV',
'BR',
'IO',
'BN',
'BG',
'BF',
764 'BI',
'KH',
'CM',
'CA',
'CV',
'KY',
'CF',
'TD',
'CL',
'CN',
'CX',
'CC',
'CO',
'KM',
765 'CG',
'CK',
'CR',
'CI',
'HR',
'CU',
'CY',
'CZ',
'DK',
'DJ',
'DM',
'DO',
'TP',
'EC',
766 'EG',
'SV',
'GQ',
'ER',
'EE',
'ET',
'FK',
'FO',
'FJ',
'FI',
'FR',
'FX',
'GF',
'PF',
767 'TF',
'GA',
'GM',
'GE',
'DE',
'GH',
'GI',
'GR',
'GL',
'GD',
'GP',
'GU',
'GT',
'GN',
768 'GW',
'GY',
'HT',
'HM',
'HN',
'HU',
'IS',
'IN',
'ID',
'IR',
'IQ',
'IE',
'IL',
'IT',
769 'JM',
'JP',
'JO',
'KZ',
'KE',
'KI',
'KP',
'KR',
'KW',
'KG',
'LA',
'LV',
'LB',
'LS',
770 'LR',
'LY',
'LI',
'LT',
'LU',
'MO',
'MK',
'MG',
'MW',
'MY',
'MV',
'ML',
'MT',
'MH',
771 'MQ',
'MR',
'MU',
'YT',
'MX',
'FM',
'MD',
'MC',
'MN',
'MS',
'MA',
'MZ',
'MM',
'NA',
772 'NR',
'NP',
'NL',
'AN',
'NC',
'NZ',
'NI',
'NE',
'NG',
'NU',
'NF',
'MP',
'NO',
'OM',
773 'PK',
'PW',
'PA',
'PG',
'PY',
'PE',
'PH',
'PN',
'PL',
'PT',
'PR',
'QA',
'RE',
'RO',
774 'RU',
'RW',
'KN',
'LC',
'VC',
'WS',
'SM',
'ST',
'SA',
'CH',
'SN',
'SC',
'SL',
'SG',
775 'SK',
'SI',
'SB',
'SO',
'ZA',
'GS',
'ES',
'LK',
'SH',
'PM',
'SD',
'SR',
'SJ',
'SZ',
776 'SE',
'SY',
'TW',
'TJ',
'TZ',
'TH',
'TG',
'TK',
'TO',
'TT',
'TN',
'TR',
'TM',
'TC',
777 'TV',
'UG',
'UA',
'AE',
'GB',
'UY',
'US',
'UM',
'UZ',
'VU',
'VA',
'VE',
'VN',
'VG',
778 'VI',
'WF',
'EH',
'YE',
'ZR',
'ZM',
'ZW');
780 foreach($cntcodes as $cntcode)
782 $cntrs[$cntcode] = $lng->txt(
'meta_c_'.$cntcode);
791 foreach($countries as $code => $text)
804 return $countries[$value];
811 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
817 foreach($items as $item)
819 $tmp_pobject =&
new ilPaymentObject($this->user_obj,$item[
'pobject_id']);
824 $f_result[$counter][
"object_title"] = $tmp_obj->getTitle();
828 $f_result[$counter][
"object_title"] = $this->lng->txt(
'object_not_found');
833 $price = (float) $price_arr[
'price'];
834 $f_result[$counter][
'price'] = $price * 1.0;
850 for ($i = 0; $i < count(
$result); $i++)
852 $amount +=
$result[$i][
'price'];
861 if (
$_POST[
'terms_conditions'] != 1)
863 $this->error = $this->lng->txt(
'pay_bmf_check_terms_conditions');
868 if (
$_POST[
'password'] ==
'' ||
869 md5(
$_POST[
'password']) != $this->user_obj->getPasswd())
871 $this->error = $this->lng->txt(
'pay_bmf_password_not_valid');
885 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
891 if(!count($items = $this->psc_obj->getEntries($this->pm_id)))
897 foreach($items as $item)
899 $tmp_pobject =
new ilPaymentObject($this->user_obj,$item[
'pobject_id']);
905 $assigned_coupons =
'';
906 if (!empty(
$_SESSION[
'coupons'][$this->session_var]))
908 foreach (
$_SESSION[
'coupons'][$this->session_var] as $key => $coupon)
910 $this->coupon_obj->setId($coupon[
'pc_pk']);
911 $this->coupon_obj->setCurrentCoupon($coupon);
913 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
915 $assigned_coupons .=
'<br />' . $this->lng->txt(
'paya_coupons_coupon') .
': ' . $coupon[
'pcc_code'];
919 $f_result[$counter][
'item'] =
'';
922 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
926 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
928 if ($assigned_coupons !=
'') $f_result[$counter][count($f_result[$counter]) - 1] .= $assigned_coupons;
930 if($price_arr[
'duration'] == 0)
932 $f_result[$counter][
'duration'] = $this->lng->txt(
'unlimited_duration');
936 $f_result[$counter][
'duration'] = $price_arr[
'duration'] .
' ' . $this->lng->txt(
'paya_months');
939 $oVAT =
new ilShopVats((
int)$tmp_pobject->getVatId());
942 $float_price = $price_arr[
'price'];
945 $f_result[$counter][
'vat_unit'] = $tmp_pobject->getVat($float_price,
'GUI').
' '.$genSet->get(
'currency_unit');
946 $this->totalVat = $this->totalVat + $tmp_pobject->getVat($float_price);
948 $f_result[$counter][
'price'] = number_format($float_price, 2,
',',
'.') .
' '.$genSet->get(
'currency_unit');
961 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
964 include_once
'./Services/Payment/classes/class.ilShoppingCartTableGUI.php';
967 $tbl->setId(
'tbl_id_'.$this->session_var);
968 $tbl->setTitle($this->lng->txt(
'paya_shopping_cart'));
973 $tbl->setRowTemplate(
"tpl.shop_shoppingcart_row.html",
"Services/Payment");
974 $tbl->addColumn(
'',
'item',
'1%');
975 $tbl->addColumn($this->lng->txt(
'title'),
'title',
'30%');
976 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'30%');
977 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'15%');
978 $tbl->addColumn($this->lng->txt(
'vat_unit'),
'vat_unit',
'15%');
979 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'10%');
980 $tbl->disable(
'sort');
982 #$tbl->setPrefix("table". $a_pay_method['pm_title']."_");
986 $totalAmount = $sc_obj->getTotalAmount();
988 if (!empty(
$_SESSION[
'coupons'][$this->session_var]))
990 if (count($items = $sc_obj->getEntries($this->pm_id)))
992 $tbl->setTotalData(
'TXT_SUB_TOTAL', $this->lng->txt(
'pay_bmf_subtotal_amount') .
": ");
993 $tbl->setTotalData(
'VAL_SUB_TOTAL', number_format($totalAmount[$this->pm_id], 2,
',',
'.') .
" " . $genSet->get(
'currency_unit'));
994 #$tbl->setTotalData('VAL_SUB_TOTAL',ilPaymentPrices::_formatPriceToString($totalAmount[$a_pay_method['pm_id']], (int)$this->default_currency['currency_id'] ));
996 $totalAmount[$current_coupon_bonus] = 0;
997 foreach (
$_SESSION[
'coupons'][$this->session_var] as $coupon)
999 $this->coupon_obj->setId($coupon[
'pc_pk']);
1000 $this->coupon_obj->setCurrentCoupon($coupon);
1002 $total_object_price = 0.0;
1003 $current_coupon_bonus = 0.0;
1005 foreach ($items as $item)
1007 $tmp_pobject =
new ilPaymentObject($this->user_obj, $item[
'pobject_id']);
1009 if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
1012 $price = (float) $price_data[
'price'];
1014 $total_object_price += $price;
1016 unset($tmp_pobject);
1018 $current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
1019 $totalAmount[$current_coupon_bonus] += $current_coupon_bonus * (-1);
1021 $tbl->setTotalData(
'TXT_COUPON_BONUS', $this->lng->txt(
'paya_coupons_coupon') .
": ");# . $coupon[
'pcc_code'] .
": ");
1022 $tbl->setTotalData(
'VAL_COUPON_BONUS', number_format($totalAmount[$current_coupon_bonus], 2,
',',
'.') .
" " . $genSet->get(
'currency_unit'));
1025 if ($totalAmount[$this->pm_id] < 0)
1028 $this->totalVat = 0;
1035 $tbl->setTotalData(
'TXT_TOTAL_AMOUNT', $this->lng->txt(
'pay_bmf_total_amount').
": ");
1036 $tbl->setTotalData(
'VAL_TOTAL_AMOUNT', number_format($this->totalAmount[$this->pm_id] , 2,
',',
'.') .
" " . $genSet->get(
'currency_unit')); #.$item[
'currency']);
1038 if ($this->totalVat > 0)
1040 $tbl->setTotalData(
'TXT_TOTAL_VAT', $this->lng->txt(
'pay_bmf_vat_included') .
": ");
1041 $tbl->setTotalData(
'VAL_TOTAL_VAT', number_format($this->totalVat , 2,
',',
'.') .
" " . $genSet->get(
'currency_unit'));
1044 $tbl->setData($a_result_set);
1045 $this->tpl->setVariable(
'ITEMS_TABLE',$tbl->getCartHTML());