ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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

ilUserDefinedInvoiceNumber::__construct ( )

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

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

{
$this->pSettings = ilPaymentSettings::_getInstance();
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilUserDefinedInvoiceNumber::__updateCron ( )
private

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

References getIncCurrentValue(), and getIncLastReset().

Referenced by cronCheck().

{
$this->pSettings->set('inc_current_value',$this->getIncCurrentValue(),'invoice_number');
$this->pSettings->set('inc_last_reset',$this->getIncLastReset(), 'invoice_number');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilUserDefinedInvoiceNumber::_getIncCurrentValue ( )
static

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

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilObjPaymentSettingsGUI\InvoiceNumberObject().

{
return $pSettings->get('inc_current_value');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilUserDefinedInvoiceNumber::_getResetPeriod ( )
static

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

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilObjSystemFolderGUI\initCronJobsForm().

{
return $pSettings->get('inc_reset_period');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilUserDefinedInvoiceNumber::_isUDInvoiceNumberActive ( )
static

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

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilObjSystemFolderGUI\initCronJobsForm(), and ilCronCheck\initTasks().

{
if(!IS_PAYMENT_ENABLED) return false;
if($pSettings->get('ud_invoice_number') == 1)
return true;
else
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilUserDefinedInvoiceNumber::_nextIncCurrentValue ( )
static

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

References $pSettings, and ilPaymentSettings\_getInstance().

Referenced by ilInvoiceNumberPlaceholdersPropertyGUI\_generateInvoiceNumber().

{
$cur_id = $pSettings->get('inc_current_value');
$next_id = ++$cur_id;
$pSettings->set('inc_current_value', $next_id, 'invoice_number');
return $next_id;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References $pSettings, and ilPaymentSettings\_getInstance().

{
$pSettings->set('inc_current_value', $a_value, 'invoice_number');
}

+ Here is the call graph for this function:

ilUserDefinedInvoiceNumber::cronCheck ( )

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

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

{
$last_month = date('n', $last_reset);
$last_year = date('Y', $last_reset);
$now = time();
$now_month = date('n', $now);
$now_year = date('Y', $now);
$reset_type = $this->getIncResetPeriod();
switch($reset_type)
{
case '1': #yearly
if($last_year < $now_year)
{
$reset = true;
}
break;
case '2': #monthly
if(($last_month < $now_month) || ($last_month > $now_month && $last_year < $now_year) )
{
$reset = true;
}
break;
default:
$reset = false;
break;
}
if($reset == true)
{
$this->setIncLastReset(mktime(0, 0, 0, $now_month, 1, $now_year));
$this->__updateCron();
}
}

+ Here is the call graph for this function:

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:

ilUserDefinedInvoiceNumber::getIncLastReset ( )

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

Referenced by __updateCron(), and cronCheck().

{
return $this->inc_last_reset;
}

+ Here is the caller graph for this function:

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:

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:

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:

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:

ilUserDefinedInvoiceNumber::read ( )

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

Referenced by __construct().

{
$settings = $this->pSettings->getValuesByScope('invoice_number');
$this->ud_invoice_number = $settings['ud_invoice_number'];
$this->invoice_number_text = $settings['invoice_number_text'];
$this->inc_start_value = $settings['inc_start_value'];
$this->inc_current_value = $settings['inc_current_value'];
$this->inc_reset_period = $settings['inc_reset_period'];
$this->inc_last_reset = $settings['inc_last_reset'];
}

+ Here is the caller graph for this function:

ilUserDefinedInvoiceNumber::setIncCurrentValue (   $a_inc_current_value)

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

Referenced by cronCheck().

{
$this->inc_current_value = $a_inc_current_value;
}

+ Here is the caller graph for this function:

ilUserDefinedInvoiceNumber::setIncLastReset (   $a_timestamp)

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

Referenced by cronCheck().

{
$this->inc_last_reset = $a_timestamp;
}

+ Here is the caller graph for this function:

ilUserDefinedInvoiceNumber::setIncResetPeriod (   $a_inc_reset_period)

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

{
$this->inc_reset_period = $a_inc_reset_period;
}
ilUserDefinedInvoiceNumber::setIncStartValue (   $a_inc_start_value)

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

{
$this->inc_start_value = $a_inc_start_value;
}
ilUserDefinedInvoiceNumber::setInvoiceNumberText (   $a_invoice_number_text)

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

{
$this->invoice_number_text = $a_invoice_number_text;
}
ilUserDefinedInvoiceNumber::setUDInvoiceNumberActive (   $a_ud_invoice_number)

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

{
$this->ud_invoice_number = $a_ud_invoice_number;
}
ilUserDefinedInvoiceNumber::update ( )

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

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

{
$this->pSettings->set('ud_invoice_number', $this->getUDInvoiceNumberActive(),'invoice_number');
$this->pSettings->set('invoice_number_text', $this->getInvoiceNumberText(),'invoice_number');
$this->pSettings->set('inc_start_value', $this->getIncStartValue(),'invoice_number');
$this->pSettings->set('inc_reset_period', $this->getIncResetPeriod(),'invoice_number');
}

+ Here is the call graph for this function:

Field Documentation

ilUserDefinedInvoiceNumber::$inc_current_value = 0

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

Referenced by getIncCurrentValue().

ilUserDefinedInvoiceNumber::$inc_reset_period = 0

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

Referenced by getIncResetPeriod().

ilUserDefinedInvoiceNumber::$inc_start_value = 0

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

Referenced by getIncStartValue().

ilUserDefinedInvoiceNumber::$invoice_number_text = null

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

Referenced by getInvoiceNumberText().

ilUserDefinedInvoiceNumber::$last_reset = 0

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

Referenced by cronCheck().

ilUserDefinedInvoiceNumber::$pSettings
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: