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