ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserDefinedInvoiceNumber Class Reference
+ Collaboration diagram for ilUserDefinedInvoiceNumber:

Public Member Functions

 setUDInvoiceNumberActive ($a_ud_invoice_number)
 
 getUDInvoiceNumberActive ()
 
 setInvoiceNumberText ($a_invoice_number_text)
 
 getInvoiceNumberText ()
 
 setIncStartValue ($a_inc_start_value)
 
 getIncStartValue ()
 
 setIncCurrentValue ($a_inc_current_value)
 
 getIncCurrentValue ()
 
 setIncResetPeriod ($a_inc_reset_period)
 
 getIncResetPeriod ()
 
 setIncLastReset ($a_timestamp)
 
 getIncLastReset ()
 
 __construct ()
 
 read ()
 
 update ()
 
 cronCheck ()
 

Static Public Member Functions

static _nextIncCurrentValue ()
 
static _setIncCurrentValue ($a_value)
 
static _getIncCurrentValue ()
 
static _getResetPeriod ()
 
static _isUDInvoiceNumberActive ()
 

Data Fields

 $pSettings
 
 $ud_invoice_number = 0
 
 $invoice_number_text = null
 
 $inc_start_value = 0
 
 $inc_current_value = 0
 
 $inc_reset_period = 0
 
 $last_reset = 0
 

Private Member Functions

 __updateCron ()
 

Detailed Description

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

Definition at line 15 of file class.ilUserDefinedInvoiceNumber.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserDefinedInvoiceNumber::__construct ( )

Definition at line 93 of file class.ilUserDefinedInvoiceNumber.php.

References ilPaymentSettings\_getInstance(), and read().

94  {
95  $this->pSettings = ilPaymentSettings::_getInstance();
96  $this->read();
97  }
+ Here is the call graph for this function:

Member Function Documentation

◆ __updateCron()

ilUserDefinedInvoiceNumber::__updateCron ( )
private

Definition at line 207 of file class.ilUserDefinedInvoiceNumber.php.

References getIncCurrentValue(), and getIncLastReset().

Referenced by cronCheck().

208  {
209  $this->pSettings->set('inc_current_value',$this->getIncCurrentValue(),'invoice_number');
210  $this->pSettings->set('inc_last_reset',$this->getIncLastReset(), 'invoice_number');
211  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIncCurrentValue()

static ilUserDefinedInvoiceNumber::_getIncCurrentValue ( )
static

Definition at line 139 of file class.ilUserDefinedInvoiceNumber.php.

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilObjPaymentSettingsGUI\InvoiceNumberObject().

140  {
142  return $pSettings->get('inc_current_value');
143 
144  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getResetPeriod()

static ilUserDefinedInvoiceNumber::_getResetPeriod ( )
static

Definition at line 145 of file class.ilUserDefinedInvoiceNumber.php.

References $pSettings, and ilPaymentSettings\_getInstance().

146  {
148  return $pSettings->get('inc_reset_period');
149  }
+ Here is the call graph for this function:

◆ _isUDInvoiceNumberActive()

static ilUserDefinedInvoiceNumber::_isUDInvoiceNumberActive ( )
static

Definition at line 155 of file class.ilUserDefinedInvoiceNumber.php.

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilPaymentCronNotification\run().

156  {
158 
159  if(!IS_PAYMENT_ENABLED) return false;
160 
161  if($pSettings->get('ud_invoice_number') == 1)
162  return true;
163  else
164  return false;
165  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _nextIncCurrentValue()

static ilUserDefinedInvoiceNumber::_nextIncCurrentValue ( )
static

Definition at line 119 of file class.ilUserDefinedInvoiceNumber.php.

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilInvoiceNumberPlaceholdersPropertyGUI\_generateInvoiceNumber().

120  {
122  $cur_id = $pSettings->get('inc_current_value');
123  $next_id = ++$cur_id;
124 
125  $pSettings->set('inc_current_value', $next_id, 'invoice_number');
126 
127  return $next_id;
128 
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _setIncCurrentValue()

static ilUserDefinedInvoiceNumber::_setIncCurrentValue (   $a_value)
static
Parameters
integer$a_value

Definition at line 133 of file class.ilUserDefinedInvoiceNumber.php.

References $pSettings, and ilPaymentSettings\_getInstance().

134  {
136  $pSettings->set('inc_current_value', $a_value, 'invoice_number');
137  }
+ Here is the call graph for this function:

◆ cronCheck()

ilUserDefinedInvoiceNumber::cronCheck ( )

Definition at line 168 of file class.ilUserDefinedInvoiceNumber.php.

References $last_reset, __updateCron(), getIncLastReset(), getIncResetPeriod(), getIncStartValue(), setIncCurrentValue(), and setIncLastReset().

169  {
170  $last_reset = $this->getIncLastReset();
171  $last_month = date('n', $last_reset);
172  $last_year = date('Y', $last_reset);
173 
174  $now = time();
175  $now_month = date('n', $now);
176  $now_year = date('Y', $now);
177 
178  $reset_type = $this->getIncResetPeriod();
179 
180  switch($reset_type)
181  {
182  case '1': #yearly
183  if($last_year < $now_year)
184  {
185  $reset = true;
186  }
187  break;
188  case '2': #monthly
189  if(($last_month < $now_month) || ($last_month > $now_month && $last_year < $now_year) )
190  {
191  $reset = true;
192  }
193  break;
194  default:
195  $reset = false;
196  break;
197  }
198 
199  if($reset == true)
200  {
201  $this->setIncCurrentValue($this->getIncStartValue());
202  $this->setIncLastReset(mktime(0, 0, 0, $now_month, 1, $now_year));
203  $this->__updateCron();
204  }
205  }
+ Here is the call graph for this function:

◆ getIncCurrentValue()

ilUserDefinedInvoiceNumber::getIncCurrentValue ( )

Definition at line 63 of file class.ilUserDefinedInvoiceNumber.php.

References $inc_current_value.

Referenced by __updateCron().

+ Here is the caller graph for this function:

◆ getIncLastReset()

ilUserDefinedInvoiceNumber::getIncLastReset ( )

Definition at line 88 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by __updateCron(), and cronCheck().

89  {
90  return $this->inc_last_reset;
91  }
+ Here is the caller graph for this function:

◆ getIncResetPeriod()

ilUserDefinedInvoiceNumber::getIncResetPeriod ( )

Definition at line 75 of file class.ilUserDefinedInvoiceNumber.php.

References $inc_reset_period.

Referenced by cronCheck(), and update().

+ Here is the caller graph for this function:

◆ getIncStartValue()

ilUserDefinedInvoiceNumber::getIncStartValue ( )

Definition at line 54 of file class.ilUserDefinedInvoiceNumber.php.

References $inc_start_value.

Referenced by cronCheck(), and update().

+ Here is the caller graph for this function:

◆ getInvoiceNumberText()

ilUserDefinedInvoiceNumber::getInvoiceNumberText ( )

Definition at line 45 of file class.ilUserDefinedInvoiceNumber.php.

References $invoice_number_text.

Referenced by update().

+ Here is the caller graph for this function:

◆ getUDInvoiceNumberActive()

ilUserDefinedInvoiceNumber::getUDInvoiceNumberActive ( )

Definition at line 36 of file class.ilUserDefinedInvoiceNumber.php.

References $ud_invoice_number.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilUserDefinedInvoiceNumber::read ( )

Definition at line 99 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by __construct().

100  {
101  $settings = $this->pSettings->getValuesByScope('invoice_number');
102  $this->ud_invoice_number = $settings['ud_invoice_number'];
103  $this->invoice_number_text = $settings['invoice_number_text'];
104  $this->inc_start_value = $settings['inc_start_value'];
105  $this->inc_current_value = $settings['inc_current_value'];
106  $this->inc_reset_period = $settings['inc_reset_period'];
107  $this->inc_last_reset = $settings['inc_last_reset'];
108  }
+ Here is the caller graph for this function:

◆ setIncCurrentValue()

ilUserDefinedInvoiceNumber::setIncCurrentValue (   $a_inc_current_value)

Definition at line 59 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by cronCheck().

60  {
61  $this->inc_current_value = $a_inc_current_value;
62  }
+ Here is the caller graph for this function:

◆ setIncLastReset()

ilUserDefinedInvoiceNumber::setIncLastReset (   $a_timestamp)

Definition at line 83 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by cronCheck().

84  {
85  $this->inc_last_reset = $a_timestamp;
86  }
+ Here is the caller graph for this function:

◆ setIncResetPeriod()

ilUserDefinedInvoiceNumber::setIncResetPeriod (   $a_inc_reset_period)

Definition at line 71 of file class.ilUserDefinedInvoiceNumber.php.

72  {
73  $this->inc_reset_period = $a_inc_reset_period;
74  }

◆ setIncStartValue()

ilUserDefinedInvoiceNumber::setIncStartValue (   $a_inc_start_value)

Definition at line 50 of file class.ilUserDefinedInvoiceNumber.php.

51  {
52  $this->inc_start_value = $a_inc_start_value;
53  }

◆ setInvoiceNumberText()

ilUserDefinedInvoiceNumber::setInvoiceNumberText (   $a_invoice_number_text)

Definition at line 41 of file class.ilUserDefinedInvoiceNumber.php.

42  {
43  $this->invoice_number_text = $a_invoice_number_text;
44  }

◆ setUDInvoiceNumberActive()

ilUserDefinedInvoiceNumber::setUDInvoiceNumberActive (   $a_ud_invoice_number)

Definition at line 32 of file class.ilUserDefinedInvoiceNumber.php.

33  {
34  $this->ud_invoice_number = $a_ud_invoice_number;
35  }

◆ update()

ilUserDefinedInvoiceNumber::update ( )

Definition at line 110 of file class.ilUserDefinedInvoiceNumber.php.

References getIncResetPeriod(), getIncStartValue(), getInvoiceNumberText(), and getUDInvoiceNumberActive().

111  {
112  $this->pSettings->set('ud_invoice_number', $this->getUDInvoiceNumberActive(),'invoice_number');
113  $this->pSettings->set('invoice_number_text', $this->getInvoiceNumberText(),'invoice_number');
114  $this->pSettings->set('inc_start_value', $this->getIncStartValue(),'invoice_number');
115  $this->pSettings->set('inc_reset_period', $this->getIncResetPeriod(),'invoice_number');
116  }
+ Here is the call graph for this function:

Field Documentation

◆ $inc_current_value

ilUserDefinedInvoiceNumber::$inc_current_value = 0

Definition at line 22 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by getIncCurrentValue().

◆ $inc_reset_period

ilUserDefinedInvoiceNumber::$inc_reset_period = 0

Definition at line 23 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by getIncResetPeriod().

◆ $inc_start_value

ilUserDefinedInvoiceNumber::$inc_start_value = 0

Definition at line 21 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by getIncStartValue().

◆ $invoice_number_text

ilUserDefinedInvoiceNumber::$invoice_number_text = null

Definition at line 20 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by getInvoiceNumberText().

◆ $last_reset

ilUserDefinedInvoiceNumber::$last_reset = 0

Definition at line 24 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by cronCheck().

◆ $pSettings

ilUserDefinedInvoiceNumber::$pSettings

◆ $ud_invoice_number

ilUserDefinedInvoiceNumber::$ud_invoice_number = 0

Definition at line 19 of file class.ilUserDefinedInvoiceNumber.php.

Referenced by getUDInvoiceNumberActive().


The documentation for this class was generated from the following file: