ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopUtils Class Reference

Class ilShopUtils. More...

+ Collaboration diagram for ilShopUtils:

Static Public Member Functions

static _formatVAT ($a_vat)
 Formats a vat rate for gui output.
static _formatFloat ($a_float, $a_num_decimals=2)
 Formats a float value for gui output.
static _checkVATRate ($a_vat_rate)
 Checks if the passed vat rate is valid.
static _sendNotificationToVATAdministration ($oPaymentObject)
 Sends a notification message to all users responsible for vat assignment.

Detailed Description

Class ilShopUtils.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 33 of file class.ilShopUtils.php.

Member Function Documentation

static ilShopUtils::_checkVATRate (   $a_vat_rate)
static

Checks if the passed vat rate is valid.

public

Parameters
string$a_vat
Returns
bool

Definition at line 73 of file class.ilShopUtils.php.

Referenced by ilObjPaymentSettingsGUI\saveVatObject(), and ilObjPaymentSettingsGUI\updateVatObject().

{
$reg = '/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/';
return preg_match($reg, $a_vat_rate);
}

+ Here is the caller graph for this function:

static ilShopUtils::_formatFloat (   $a_float,
  $a_num_decimals = 2 
)
static

Formats a float value for gui output.

public

Parameters
float$a_vat
Returns
string

Definition at line 58 of file class.ilShopUtils.php.

References $lng.

Referenced by ilPurchasePaypal\__sendBill(), ilPurchaseBMFGUI\__sendBill(), ilPurchaseBillGUI\__showItemsTable(), ilPurchaseBMFGUI\__showItemsTable(), ilPaymentObject\getVat(), and ilShopShoppingCartGUI\showItemsTable().

{
global $lng;
return number_format((float)$a_float, $a_num_decimals, $lng->txt('lang_sep_decimal'), $lng->txt('lang_sep_thousand'));
}

+ Here is the caller graph for this function:

static ilShopUtils::_formatVAT (   $a_vat)
static

Formats a vat rate for gui output.

public

Parameters
float$a_vat
Returns
string

Definition at line 43 of file class.ilShopUtils.php.

Referenced by ilPurchasePaypal\__sendBill(), ilPurchaseBMFGUI\__sendBill(), ilPurchaseBillGUI\__showShoppingCart(), ilPurchaseBMFGUI\__showShoppingCart(), ilPaymentObjectGUI\editDetails(), ilObjPaymentSettingsGUI\editObjectObject(), ilObjPaymentSettingsGUI\objectsObject(), ilPaymentShoppingCartGUI\showItems(), ilShopShoppingCartGUI\showItems(), ilPaymentObjectGUI\showObjects(), and ilObjPaymentSettingsGUI\vatsObject().

{
return ((float)$a_vat != floor((float)$a_vat) ?
self::_formatFloat((float)$a_vat) :
(int)$a_vat).' %';
}

+ Here is the caller graph for this function:

static ilShopUtils::_sendNotificationToVATAdministration (   $oPaymentObject)
static

Sends a notification message to all users responsible for vat assignment.

public

Parameters
ilPaymentObject$oPaymentObject

Definition at line 86 of file class.ilShopUtils.php.

References $ilSetting, $lng, $login, $success, ilObjUser\_lookupId(), and ilObjectFactory\getInstanceByRefId().

{
global $ilSetting, $lng, $ilClientIniFile;
$payment_vat_admins = $ilSetting->get('payment_vat_admins');
$users = explode(',', $payment_vat_admins);
$subject = $lng->txt('payment_vat_assignment_notification_subject');
$tmp_obj = ilObjectFactory::getInstanceByRefId($oPaymentObject->getRefId());
$message = sprintf($lng->txt('payment_vat_assignment_notification_body'), $tmp_obj->getTitle())."\n\n";
$message .= "------------------------------------------------------------\n";
$message .= sprintf($lng->txt('payment_vat_assignment_notification_intro'),
$ilClientIniFile->readVariable('client', 'name'),
ILIAS_HTTP_PATH.'/?client_id='.CLIENT_ID);
include_once 'Services/Mail/classes/class.ilMail.php';
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
foreach((array)$users as $login)
{
if(strlen(trim($login)) &&
(int)ilObjUser::_lookupId(trim($login)))
{
$success = $mail_obj->sendMail(trim($login), '', '',
$subject, $message,
array(),array("system"));
}
}
}

+ Here is the call graph for this function:


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