本文整理汇总了PHP中Currency::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::retrieve方法的具体用法?PHP Currency::retrieve怎么用?PHP Currency::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Currency
的用法示例。
在下文中一共展示了Currency::retrieve方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
global $current_user, $sugar_config;
SugarTestHelper::setUp('current_user', array(true));
$current_user->setPreference('dec_sep', ',');
$current_user->setPreference('num_grp_sep', '.');
$current_user->setPreference('default_currency_significant_digits', 3);
SugarTestHelper::setUp('app_list_strings');
SugarTestHelper::setUp('beanFiles');
SugarTestHelper::setUp('beanList');
parent::setUp();
$this->lm = new LayoutManager();
$this->lm->setAttribute('reporter', new stdClass());
$this->currency_51568 = new Currency();
$this->currency_51568->symbol = 'TT';
$this->currency_51568->conversion_rate = 0.5;
$this->currency_51568->save(false);
$this->currency_system = new Currency();
$this->currency_system->retrieve(-99);
$this->backupSymbol = $this->currency_system->symbol;
$this->currency_system->symbol = '¥';
$this->currency_system->save(false);
$sugar_config['default_currency_symbol'] = '¥';
get_number_seperators(true);
}
示例2: get_currency
function get_currency()
{
global $current_user, $global_currency_obj;
if (empty($global_currency_obj)) {
$global_currency_obj = new Currency();
// $global_currency_symbol = '$';
if ($current_user->getPreference('currency')) {
$global_currency_obj->retrieve($current_user->getPreference('currency'));
} else {
$global_currency_obj->retrieve('-99');
}
}
return $global_currency_obj;
}
示例3: display
public function display()
{
$currency_symbol = $GLOBALS['sugar_config']['default_currency_symbol'];
if ($GLOBALS['current_user']->getPreference('currency')) {
require_once 'modules/Currencies/Currency.php';
$currency = new Currency();
$currency->retrieve($GLOBALS['current_user']->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$this->chartDefName = $this->which_chart[0];
//$chartDef = $this->chartDefs[$this->chartDefName];
$chartDef = array('type' => 'code', 'id' => 'Chart_invoices_by_month', 'label' => 'Invoices by Month', 'chartUnits' => 'Invoice Size in $1K', 'chartType' => 'stacked group by chart', 'groupBy' => array('m', 'state_in_chart'), 'base_url' => array('module' => 'reg_invoices', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search'), 'url_params' => array('state', 'date_closed'));
require_once 'include/SugarCharts/SugarChartFactory.php';
// Special chart config for RegInvoices
$sugarChart = SugarChartFactory::getInstance('Jit', 'RegInvoices');
$sugarChart->setProperties('', translate('LBL_FACT_SIZE', 'reg_invoices') . ' ' . $currency_symbol . '1' . translate('LBL_OPP_THOUSANDS', 'Charts'), $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->is_currency = true;
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
$sugarChart->getData($this->constructQuery());
$this->sortData($sugarChart->data_set);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />';
}
示例4: populateCurrency
function populateCurrency()
{
global $mod_strings;
require_once 'modules/Currencies/Currency.php';
$currency = new Currency();
$currText = '';
if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
$currency->retrieve($this->bean->currency_id);
if ($currency->deleted != 1) {
$currText = $currency->iso4217 . ' ' . $currency->symbol;
} else {
$currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
}
} else {
$currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
}
$javascript = "<script language='javascript'>\n";
$javascript .= "var CurrencyText = new Array(); \n";
$javascript .= "CurrencyText['-99'] = '" . $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol() . "';\n";
$sql = "SELECT id, iso4217, symbol FROM currencies";
$res = $this->bean->db->query($sql);
while ($row = $this->bean->db->fetchByAssoc($res)) {
$javascript .= "CurrencyText['" . $row['id'] . "'] = '" . $row['iso4217'] . ' ' . $row['symbol'] . "';\n";
}
$javascript .= "</script>";
echo $javascript;
$this->ss->assign('CURRENCY', "<div id =curr_symbol>{$currText}</div>");
$mod_strings['LBL_LIST_PRICE'] .= " (" . $currText . ")";
$mod_strings['LBL_UNIT_PRICE'] .= " (" . $currText . ")";
$mod_strings['LBL_VAT_AMT'] .= " (" . $currText . ")";
$mod_strings['LBL_TOTAL_PRICE'] .= " (" . $currText . ")";
$mod_strings['LBL_SERVICE_PRICE'] .= " (" . $currText . ")";
}
示例5: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $current_user, $sugar_config;
require "modules/Charts/chartdefs.php";
$chartDef = $chartDefs['lead_source_by_outcome'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->is_currency = true;
$currency_symbol = $sugar_config['default_currency_symbol'];
if ($current_user->getPreference('currency')) {
$currency = new Currency();
$currency->retrieve($current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts');
$sugarChart->setProperties('', $subtitle, $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
if (count($this->lsbo_ids) > 0) {
$sugarChart->url_params['assigned_user_id'] = array_values($this->lsbo_ids);
}
$sugarChart->getData($this->constuctQuery());
$sugarChart->data_set = $sugarChart->sortData($sugarChart->data_set, 'lead_source', true, 'sales_stage', true, true);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
示例6: display
function display()
{
global $app_list_strings;
$this->ss->assign('APP_LIST', $app_list_strings);
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'set_target') {
require_once 'modules/Campaigns/utils.php';
//call function to create campaign logs
$mess = track_campaign_prospects($this->bean);
$confirm_msg = "var ajax_C_LOG_Status = new SUGAR.ajaxStatusClass(); \n window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",1000); \n window.setTimeout('ajax_C_LOG_Status.hideStatus()', 1500); \n window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",2000); \n window.setTimeout('ajax_C_LOG_Status.hideStatus()', 5000); ";
$this->ss->assign("MSG_SCRIPT", $confirm_msg);
}
if ($this->bean->campaign_type == 'Email' || $this->bean->campaign_type == 'NewsLetter') {
$this->ss->assign("ADD_BUTTON_STATE", "submit");
$this->ss->assign("TARGET_BUTTON_STATE", "hidden");
} else {
$this->ss->assign("ADD_BUTTON_STATE", "hidden");
$this->ss->assign("DISABLE_LINK", "display:none");
$this->ss->assign("TARGET_BUTTON_STATE", "submit");
}
$currency = new Currency();
if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
$currency->retrieve($this->bean->currency_id);
if ($currency->deleted != 1) {
$this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
} else {
$this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
} else {
$this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
parent::display();
//We want to display subset of available, panels, so we will call subpanel
//object directly instead of using sugarview.
$GLOBALS['focus'] = $this->bean;
require_once 'include/SubPanel/SubPanelTiles.php';
$subpanel = new SubPanelTiles($this->bean, $this->module);
//get available list of subpanels
$alltabs = $subpanel->subpanel_definitions->get_available_tabs();
if (!empty($alltabs)) {
//iterate through list, and filter out all but 3 subpanels
foreach ($alltabs as $key => $name) {
if ($name != 'prospectlists' && $name != 'emailmarketing' && $name != 'tracked_urls') {
//exclude subpanels that are not prospectlists, emailmarketing, or tracked urls
$subpanel->subpanel_definitions->exclude_tab($name);
}
}
//only show email marketing subpanel for email/newsletter campaigns
if ($this->bean->campaign_type != 'Email' && $this->bean->campaign_type != 'NewsLetter') {
//exclude emailmarketing subpanel if not on an email or newsletter campaign
$subpanel->subpanel_definitions->exclude_tab('emailmarketing');
// Bug #49893 - 20120120 - Captivea (ybi) - Remove trackers subpanels if not on an email/newsletter campaign (useless subpannl)
$subpanel->subpanel_definitions->exclude_tab('tracked_urls');
}
}
//show filtered subpanel list
echo $subpanel->display();
}
示例7: perform_save
function perform_save(&$focus)
{
//US DOLLAR
if (isset($focus->amount) && !number_empty($focus->amount)) {
$currency = new Currency();
$currency->retrieve($focus->currency_id);
$focus->amount_usdollar = $currency->convertToDollar($focus->amount);
}
}
示例8: perform_save
function perform_save(&$focus)
{
require_once 'modules/Currencies/Currency.php';
//US DOLLAR
if (isset($focus->price) && !number_empty($focus->price)) {
$currency = new Currency();
$currency->retrieve($focus->currency_id);
$focus->price_usdollar = $currency->convertToDollar(unformat_number($focus->price));
}
}
示例9: Currency
/**
* Overriding display of value of currency because of currencies are not stored in app_list_strings
*
* @param array $layout_def
* @return string for display
*/
public function &displayListPlain($layout_def)
{
static $currencies;
$value = $this->_get_list_value($layout_def);
if (empty($currencies[$value])) {
$currency = new Currency();
$currency->retrieve($value);
$currencies[$value] = $currency->symbol . ' ' . $currency->iso4217;
}
return $currencies[$value];
}
示例10: updateAmountByID
function updateAmountByID($id, $curID, $price)
{
global $db, $currencies;
if (isset($id) && !empty($id)) {
$currency = new Currency();
$currency->retrieve($curID);
$dollars = $currency->convertToDollar($price);
$query = "update opportunities set price='{$price}', currency_id='{$curID}', price_usdollar='{$dollars}' where id='{$id}';";
$db->query($query);
}
}
示例11: save
function save($check_notify = FALSE)
{
//"amount_usdollar" is really amount_basecurrency. We need to save a copy of the amount in the base currency.
if (isset($this->amount) && !number_empty($this->amount)) {
if (!number_empty($this->currency_id)) {
$currency = new Currency();
$currency->retrieve($this->currency_id);
$this->amount_usdollar = $currency->convertToDollar($this->amount);
} else {
$this->amount_usdollar = $this->amount;
}
}
return parent::save($check_notify);
}
示例12: populateCurrency
function populateCurrency()
{
require_once 'modules/Currencies/Currency.php';
$currency = new Currency();
if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
$currency->retrieve($focus->currency_id);
if ($currency->deleted != 1) {
$this->currSymbol = $currency->symbol;
} else {
$this->currSymbol = $currency->getDefaultCurrencySymbol();
}
} else {
$this->currSymbol = $currency->getDefaultCurrencySymbol();
}
}
示例13: perform_aos_save
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with this program; if not, see http://www.gnu.org/licenses
* or write to the Free Software Foundation,Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Salesagility Ltd <info@salesagility.com>
*/
function perform_aos_save($focus)
{
//US DOLLAR
foreach ($focus->field_defs as $field) {
if (isset($focus->field_defs[$field['name'] . '_usdollar'])) {
$fieldName = $field['name'] . '_usdollar';
$focus->{$fieldName} = '';
if (!number_empty($focus->field_defs[$field['name']])) {
$currency = new Currency();
$currency->retrieve($focus->currency_id);
$focus->{$fieldName} = $currency->convertToDollar($focus->{$field}['name']);
}
}
}
}
示例14: display
function display()
{
$currency = new Currency();
if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
$currency->retrieve($this->bean->currency_id);
if ($currency->deleted != 1) {
$this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
} else {
$this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
} else {
$this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
parent::display();
}
示例15: perform_aos_save
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with this program; if not, see http://www.gnu.org/licenses
* or write to the Free Software Foundation,Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Salesagility Ltd <info@salesagility.com>
*/
function perform_aos_save($focus)
{
foreach ($focus->field_defs as $field) {
$fieldName = $field['name'];
$fieldNameDollar = $field['name'] . '_usdollar';
if (isset($focus->field_defs[$fieldNameDollar])) {
$focus->{$fieldNameDollar} = '';
if (!number_empty($focus->field_defs[$field['name']])) {
$currency = new Currency();
$currency->retrieve($focus->currency_id);
$focus->{$fieldNameDollar} = $currency->convertToDollar(unformat_number($fieldName));
}
}
}
}