本文整理汇总了PHP中Vtiger_Util_Helper::getBaseCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Util_Helper::getBaseCurrency方法的具体用法?PHP Vtiger_Util_Helper::getBaseCurrency怎么用?PHP Vtiger_Util_Helper::getBaseCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Util_Helper
的用法示例。
在下文中一共展示了Vtiger_Util_Helper::getBaseCurrency方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process($module, $id, Vtiger_PDF_Model $pdf)
{
$html = '';
$recordId = $id;
$record = Vtiger_Record_Model::getInstanceById($recordId);
$moduleModel = $record->getModule();
if (!$moduleModel->isInventory()) {
return $html;
}
$inventoryField = Vtiger_InventoryField_Model::getInstance($module);
$fields = $inventoryField->getFields(true);
if ($fields[0] != 0) {
$columns = $inventoryField->getColumns();
$inventoryRows = $record->getInventoryData();
$mainParams = $inventoryField->getMainParams($fields[1]);
$countFields0 = count($fields[0]);
$countFields1 = count($fields[1]);
$countFields2 = count($fields[2]);
$baseCurrency = Vtiger_Util_Helper::getBaseCurrency();
}
if (in_array("currency", $columns)) {
if (count($inventoryRows) > 0 && $inventoryRows[0]['currency'] != NULL) {
$currency = $inventoryRows[0]['currency'];
} else {
$currency = $baseCurrency['id'];
}
$currencySymbolRate = Vtiger_Functions::getCurrencySymbolandRate($currency);
}
$html .= '<style>' . '.productTable{color:#000; font-size:10px}' . '.productTable th {text-transform: uppercase;font-weight:normal}' . '.productTable tbody tr:nth-child(odd){background:#eee}' . '.productTable tbody tr td{border-bottom: 1px solid #ddd; padding:5px}' . '.colapseBorder {border-collapse: collapse;}' . '.productTable td, th {padding-left: 5px; padding-right: 5px;}' . '.productTable .summaryContainer{background:#ccc;}' . '</style>';
if (count($fields[0]) != 0) {
$discount = 0;
foreach ($inventoryRows as $key => &$inventoryRow) {
$taxes = $inventoryField->getTaxParam($inventoryRow['taxparam'], $inventoryRow['net'], $taxes);
}
if (in_array('discount', $columns) && in_array('discountmode', $columns)) {
$html .= '<table class="productTable colapseBorder">
<thead>
<tr>
<th class="tBorder noBottomBorder tHeader">
<strong>' . vtranslate('LBL_DISCOUNTS_SUMMARY', $module) . '</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="textAlignRight tBorder">' . CurrencyField::convertToUserFormat($discount, null, true) . ' ' . $currencySymbolRate['symbol'] . '</td>
</tr>
</tbody>
</table>';
}
}
return $html;
}
示例2: checkLimits
public function checkLimits(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$record = $request->get('record');
$currency = $request->get('currency');
$price = $request->get('price');
$limitConfig = $request->get('limitConfig');
$limitFieldName = 'creditlimit';
$balanceFieldName = 'inventorybalance';
$moduleInstance = Vtiger_Module_Model::getInstance('Accounts');
$limitField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance);
$balanceField = Vtiger_Field_Model::getInstance($balanceFieldName, $moduleInstance);
if (!$limitField->isActiveField() || !$balanceField->isActiveField()) {
$response = new Vtiger_Response();
$response->setResult(['status' => true]);
$response->emit();
return;
}
$recordModel = Vtiger_Record_Model::getInstanceById($record, 'Accounts');
$limitID = $recordModel->get($limitFieldName);
$balance = $recordModel->get($balanceFieldName);
$limit = reset(Vtiger_InventoryLimit_UIType::getValues($limitID))['value'];
$baseCurrency = Vtiger_Util_Helper::getBaseCurrency();
$symbol = $baseCurrency['currency_symbol'];
if ($baseCurrency['id'] != $currency) {
$selectedCurrency = Vtiger_Functions::getCurrencySymbolandRate($currency);
$price = floatval($price) * $selectedCurrency['rate'];
$symbol = $selectedCurrency['symbol'];
}
$totalPrice = $price + $balance;
$status = $totalPrice > $limit ? false : true;
if (!$status) {
$viewer = new Vtiger_Viewer();
$viewer->assign('PRICE', $price);
$viewer->assign('BALANCE', $balance);
$viewer->assign('SYMBOL', $symbol);
$viewer->assign('LIMIT', $limit);
$viewer->assign('TOTALS', $totalPrice);
$viewer->assign('LIMIT_CONFIG', $limitConfig);
$html = $viewer->view('InventoryLimitAlert.tpl', $moduleName, true);
}
$response = new Vtiger_Response();
$response->setResult([
'status' => $status,
'html' => $html
]);
$response->emit();
}
示例3: process
public function process(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
$id = $request->get('id');
$type = $request->get('type');
if (empty($id)) {
$recordModel = new Settings_Inventory_Record_Model();
} else {
$recordModel = Settings_Inventory_Record_Model::getInstanceById($id, $type);
}
$viewer->assign('PAGE_LABELS', $this->getPageLabels($request));
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
$viewer->assign('RECORD_MODEL', $recordModel);
$viewer->assign('TYPE', $type);
$viewer->assign('CURRENCY', Vtiger_Util_Helper::getBaseCurrency());
echo $viewer->view('Modal.tpl', $qualifiedModuleName, true);
}
示例4: process
public function process(Vtiger_Request $request)
{
$mode = $request->getMode();
if (!empty($mode)) {
echo $this->invokeExposedMethod($mode, $request);
return;
}
$view = $this->getView();
$recordModel = new Settings_Inventory_Record_Model();
$recordModel->setType($view);
$allData = Settings_Inventory_Record_Model::getDataAll($view);
$qualifiedModuleName = $request->getModule(false);
$viewer = $this->getViewer($request);
$viewer->assign('PAGE_LABELS', $this->getPageLabels($request));
$viewer->assign('RECORD_MODEL', $recordModel);
$viewer->assign('INVENTORY_DATA', $allData);
$viewer->assign('VIEW', $view);
$viewer->assign('CURRENCY', Vtiger_Util_Helper::getBaseCurrency());
$viewer->view('Index.tpl', $qualifiedModuleName);
}
示例5: process
public function process($module, $id, Vtiger_PDF_Model $pdf)
{
$html = '';
$recordId = $id;
$record = Vtiger_Record_Model::getInstanceById($recordId);
$moduleModel = $record->getModule();
if (!$moduleModel->isInventory()) {
return $html;
}
$inventoryField = Vtiger_InventoryField_Model::getInstance($module);
$fields = $inventoryField->getFields(true);
if ($fields[0] != 0) {
$columns = $inventoryField->getColumns();
$inventoryRows = $record->getInventoryData();
$mainParams = $inventoryField->getMainParams($fields[1]);
$countFields0 = count($fields[0]);
$countFields1 = count($fields[1]);
$countFields2 = count($fields[2]);
$baseCurrency = Vtiger_Util_Helper::getBaseCurrency();
}
if (in_array("currency", $columns)) {
if (count($inventoryRows) > 0 && $inventoryRows[0]['currency'] != NULL) {
$currency = $inventoryRows[0]['currency'];
} else {
$currency = $baseCurrency['id'];
}
$currencySymbolRate = Vtiger_Functions::getCurrencySymbolandRate($currency);
}
$html .= '<style>' . '.colapseBorder {border-collapse: collapse;}' . '.tBorder {border: 1px solid grey;}' . '.tHeader {background-color: lightgrey;}' . '.summaryBorder {border-left: 1px solid grey; border-bottom: 1px solid grey; border-right: 1px solid grey;}' . '.pTable td, th {padding-left: 5px; padding-right: 5px;}' . '.noBottomBorder {border-bottom: none;}' . '.noBorder {border: none !important;}' . '</style>';
if (count($fields[0]) != 0) {
$html .= '<table class="pTable colapseBorder">
<thead>
<tr>
<th style="width: 65%;"></th>';
foreach ($fields[0] as $field) {
$html .= '<th colspan="' . $field->get('colspan') . '" class="tBorder noBottomBorder tHeader">
<span>' . vtranslate($field->get('label'), $module) . ':</span> ';
switch ($field->getTemplateName('DetailView', $module)) {
case 'DetailViewBase.tpl':
$html .= $field->getDisplayValue($inventoryRows[0][$field->get('columnname')]);
break;
case 'DetailViewTaxMode.tpl':
case 'DetailViewDiscountMode.tpl':
$html .= vtranslate($field->getDisplayValue($inventoryRows[0][$field->get('columnname')]), $MODULE);
break;
}
$html .= '</th>';
}
$html .= '</tr>
</thead>
</table>';
$fieldsTextAlignRight = ['TotalPrice', 'Tax', 'MarginP', 'Margin', 'Purchase', 'Discount', 'NetPrice', 'GrossPrice', 'UnitPrice', 'Quantity'];
$html .= '<table class="pTable colapseBorder">
<thead>
<tr>';
foreach ($fields[1] as $field) {
if ($field->isVisible($inventoryRows)) {
$html .= '<th colspan="' . $field->get('colspan') . '" class="textAlignCenter tBorder tHeader">' . vtranslate($field->get('label'), $module) . '</th>';
}
}
$html .= '</tr>
</thead>
<tbody>';
// for($i=0; $i<100; $i++) {
foreach ($inventoryRows as $key => &$inventoryRow) {
$rowNo = $key + 1;
$html .= '<tr>';
foreach ($fields[1] as $field) {
if ($field->isVisible($inventoryRows)) {
$itemValue = $inventoryRow[$field->get('columnname')];
$html .= '<td ' . ($field->getName() == 'Name' ? 'width="40%;" ' : '') . ' class="' . (in_array($field->getName(), $fieldsTextAlignRight) ? 'textAlignRight ' : '') . 'tBorder">';
switch ($field->getTemplateName('DetailView', $module)) {
case 'DetailViewName.tpl':
$html .= '<strong>' . $field->getDisplayValue($itemValue) . '</strong>';
if (isset($fields[2]['comment' . $rowNo])) {
$COMMENT_FIELD = $fields[2]['comment' . $rowNo];
$html .= '<br/>' . $COMMENT_FIELD->getDisplayValue($inventoryRow[$COMMENT_FIELD->get('columnname')]);
}
break;
case 'DetailViewBase.tpl':
$html .= $field->getDisplayValue($itemValue);
break;
}
$html .= '</td>';
}
}
$html .= '</tr>';
}
// }
$html .= '</tbody>
<tfoot>
<tr>';
foreach ($fields[1] as $field) {
if ($field->isVisible($inventoryRows)) {
$html .= '<td colspan="' . $field->get('colspan') . '" class="textAlignRight ';
if ($field->isSummary()) {
$html .= 'summaryBorder';
}
$html .= '">';
if ($field->isSummary()) {
//.........这里部分代码省略.........
示例6: content_54e7656f35028
function content_54e7656f35028($_smarty_tpl)
{
if (!is_callable('smarty_modifier_replace')) {
include '/var/www/vhosts/registro.tuagencia24.com/vtigercrm/libraries/Smarty/libs/plugins/modifier.replace.php';
}
?>
<div class="contents-topscroll"><div class="topscroll-div container-fluid"> </div></div><div id="reportDetails" class="container-fluid contents-bottomscroll"><div class="bottomscroll-div"><input type="hidden" id="updatedCount" value="<?php
echo $_smarty_tpl->tpl_vars['NEW_COUNT']->value;
?>
" /><?php
if (!empty($_smarty_tpl->tpl_vars['CALCULATION_FIELDS']->value)) {
?>
<table class=" table-bordered table-condensed marginBottom10px" width="100%"><thead><tr class="blockHeader"><th><?php
echo vtranslate('LBL_FIELD_NAMES', $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</th><th><?php
echo vtranslate('LBL_SUM', $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</th><th><?php
echo vtranslate('LBL_AVG', $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</th><th><?php
echo vtranslate('LBL_MIN', $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</th><th><?php
echo vtranslate('LBL_MAX', $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</th></tr></thead><?php
$_smarty_tpl->tpl_vars['ESCAPE_CHAR'] = new Smarty_variable(array('_SUM', '_AVG', '_MIN', '_MAX'), null, 0);
$_smarty_tpl->tpl_vars['CALCULATION_FIELD'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['CALCULATION_FIELD']->_loop = false;
$_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
$_from = $_smarty_tpl->tpl_vars['CALCULATION_FIELDS']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars['CALCULATION_FIELD']->key => $_smarty_tpl->tpl_vars['CALCULATION_FIELD']->value) {
$_smarty_tpl->tpl_vars['CALCULATION_FIELD']->_loop = true;
$_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['CALCULATION_FIELD']->key;
?>
<tr><?php
$_smarty_tpl->tpl_vars['CALCULATION_FIELD_KEYS'] = new Smarty_variable(array_keys($_smarty_tpl->tpl_vars['CALCULATION_FIELD']->value), null, 0);
$_smarty_tpl->tpl_vars['CALCULATION_FIELD_KEYS'] = new Smarty_variable(smarty_modifier_replace($_smarty_tpl->tpl_vars['CALCULATION_FIELD_KEYS']->value, $_smarty_tpl->tpl_vars['ESCAPE_CHAR']->value, ''), null, 0);
$_smarty_tpl->tpl_vars['FIELD_IMPLODE'] = new Smarty_variable(explode('_', $_smarty_tpl->tpl_vars['CALCULATION_FIELD_KEYS']->value['0']), null, 0);
$_smarty_tpl->tpl_vars['MODULE_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_IMPLODE']->value['0'], null, 0);
$_smarty_tpl->tpl_vars['FIELD_LABEL'] = new Smarty_variable(implode(" ", $_smarty_tpl->tpl_vars['FIELD_IMPLODE']->value), null, 0);
$_smarty_tpl->tpl_vars['FIELD_LABEL'] = new Smarty_variable(smarty_modifier_replace($_smarty_tpl->tpl_vars['FIELD_LABEL']->value, $_smarty_tpl->tpl_vars['MODULE_NAME']->value, ''), null, 0);
?>
<td><?php
echo vtranslate($_smarty_tpl->tpl_vars['MODULE_NAME']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
?>
<?php
echo vtranslate($_smarty_tpl->tpl_vars['FIELD_LABEL']->value, $_smarty_tpl->tpl_vars['MODULE']->value);
?>
</td><?php
$_smarty_tpl->tpl_vars['CALCULATION_VALUE'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['CALCULATION_VALUE']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['CALCULATION_FIELD']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars['CALCULATION_VALUE']->key => $_smarty_tpl->tpl_vars['CALCULATION_VALUE']->value) {
$_smarty_tpl->tpl_vars['CALCULATION_VALUE']->_loop = true;
?>
<td width="15%"><?php
echo $_smarty_tpl->tpl_vars['CALCULATION_VALUE']->value;
?>
</td><?php
}
?>
</tr><?php
}
?>
</table><?php
if ($_smarty_tpl->tpl_vars['PRIMARY_MODULE']->value == 'Invoice' || $_smarty_tpl->tpl_vars['PRIMARY_MODULE']->value == 'Quotes' || $_smarty_tpl->tpl_vars['PRIMARY_MODULE']->value == 'SalesOrder' || $_smarty_tpl->tpl_vars['PRIMARY_MODULE']->value == 'PurchaseOrder') {
$_smarty_tpl->tpl_vars['BASE_CURRENCY_INFO'] = new Smarty_variable(Vtiger_Util_Helper::getBaseCurrency(), null, 0);
?>
<div class="alert alert-info"><?php
echo vtranslate('LBL_NOTE', 'Vtiger');
?>
: <?php
echo vtranslate('LBL_CALCULATION_CONVERSION_MESSAGE', 'Reports');
?>
- <?php
echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_INFO']->value['currency_name'];
?>
(<?php
echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_INFO']->value['currency_code'];
?>
)</div><?php
}
}
if ($_smarty_tpl->tpl_vars['DATA']->value != '') {
$_smarty_tpl->tpl_vars['HEADERS'] = new Smarty_variable($_smarty_tpl->tpl_vars['DATA']->value[0], null, 0);
?>
<table class="table table-bordered table-striped"><thead><tr class="blockHeader"><?php
$_smarty_tpl->tpl_vars['HEADER'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['HEADER']->_loop = false;
$_smarty_tpl->tpl_vars['NAME'] = new Smarty_Variable();
$_from = $_smarty_tpl->tpl_vars['HEADERS']->value;
//.........这里部分代码省略.........
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:101,代码来源:f5add539ea8affddd5bef607c777f8efbb7a49da.file.ReportContents.tpl.php