12 include_once
'Services/Form/classes/class.ilFormPropertyGUI.php';
26 $subtpl =
new ilTemplate(
"tpl.invoice_number_placeholders.html",
false,
false,
"Services/Payment");
28 $subtpl->setVariable(
'TXT_USE_PLACEHOLDERS', $lng->txt(
'placeholders'));
29 $subtpl->setVariable(
'TXT_PLACEHOLDERS_ADVICE', $lng->txt(
'inv_number_placeholder_advice'));
31 $subtpl->setVariable(
'TXT_CURRENT_TIMESTAMP', $lng->txt(
'current_timestamp'));
32 $subtpl->setVariable(
'TXT_INSTALLATION_ID', $lng->txt(
'inst_id'));
33 $subtpl->setVariable(
'TXT_USER_ID', $lng->txt(
'user_id'));
34 $subtpl->setVariable(
'TXT_DAY', $lng->txt(
'day'));
35 $subtpl->setVariable(
'TXT_MONTH', $lng->txt(
'month'));
36 $subtpl->setVariable(
'TXT_YEAR', $lng->txt(
'year'));
37 $subtpl->setVariable(
'TXT_INCREMENTAL_NUMBER', $lng->txt(
'incremental_number'));
39 $a_tpl->setCurrentBlock(
"prop_generic");
40 $a_tpl->setVariable(
"PROP_GENERIC", $subtpl->get());
41 $a_tpl->parseCurrentBlock();
56 $a_user_id = $ilUser->getId();
59 $inst_id = $ilSetting->get(
'inst_id');
62 include_once
'./Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php';
65 if($invObj->getUDInvoiceNumberActive() == 1)
69 $invoice_number = $invObj->getInvoiceNumberText();
71 $invoice_number = str_replace(
'[CURRENT_TIMESTAMP]', $cur_time, $invoice_number);
72 $invoice_number = str_replace(
'[INSTALLATION_ID]', $inst_id, $invoice_number);
73 $invoice_number = str_replace(
'[USER_ID]', $a_user_id, $invoice_number);
74 $invoice_number = str_replace(
'[DAY]', date(
'd', $cur_time), $invoice_number);
75 $invoice_number = str_replace(
'[MONTH]', date(
'm', $cur_time), $invoice_number);
76 $invoice_number = str_replace(
'[YEAR]', date(
'Y', $cur_time), $invoice_number);
77 $invoice_number = str_replace(
'[INCREMENTAL_NUMBER]', $next_number, $invoice_number);
81 $inst_id_time = $inst_id.
'_'.$a_user_id.
'_'.substr((
string) $cur_time,-3);
82 $invoice_number = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
85 return $invoice_number;