本文整理汇总了PHP中oledrion_utils::getAmountWithVat方法的典型用法代码示例。如果您正苦于以下问题:PHP oledrion_utils::getAmountWithVat方法的具体用法?PHP oledrion_utils::getAmountWithVat怎么用?PHP oledrion_utils::getAmountWithVat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oledrion_utils
的用法示例。
在下文中一共展示了oledrion_utils::getAmountWithVat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XoopsTpl
$optionName = oledrion_utils::getName($attributeValue);
$optionPrice = $attribute->getOptionPriceFromValue($optionName);
$productPrice += $optionPrice;
}
} else {
$optionPrice = $attribute->getOptionPriceFromValue(oledrion_utils::getName($attributeValues));
$productPrice += $optionPrice;
}
}
}
// Mise en template
include_once XOOPS_ROOT_PATH . '/class/template.php';
$template = new XoopsTpl();
$vat = null;
$vat = $handlers->h_oledrion_vat->get($vat_id);
$productPriceTTC = oledrion_utils::getAmountWithVat($productPrice, $vat_id);
$oledrion_Currency = oledrion_Currency::getInstance();
$templateProduct = $product->toArray();
$templateProduct['product_final_price_ht_formated_long'] = $oledrion_Currency->amountForDisplay($productPrice, 'l');
$templateProduct['product_final_price_ttc_formated_long'] = $oledrion_Currency->amountForDisplay($productPriceTTC, 'l');
if (is_object($vat)) {
$templateProduct['product_vat_rate'] = $vat->toArray();
}
$templateProduct['product_vat_amount_formated_long'] = $oledrion_Currency->amountForDisplay($productPriceTTC - $productPrice, 'l');
$template->assign('product', $templateProduct);
$return = $template->fetch('db:oledrion_product_price.tpl');
}
break;
// ajax search
// ajax search
case 'search':
示例2: getTTC
/**
* Retourne le montant TTC du prix normal du produit
*
* @return floatval
*/
public function getTTC()
{
return oledrion_utils::getAmountWithVat($this->getVar('product_price', 'e'), $this->getVar('product_vat_id'));
}
示例3: getAttributeOptions
/**
* Retourne une liste combinée des options de l'attribut
*
* @param string $format Format dans lequel renvoyer les données
* @param boolean $withFormatedPrices Faut il retourner les prix formatés ?
* @param object $product Le produit de travail
* @return array
* @since 2.3.2009.03.11
*/
function getAttributeOptions($format = 's', $withFormatedPrices = false, oledrion_products $product = null)
{
$ret = array();
$counter = 0;
if (!is_null($product)) {
$vat_id = $product->getVar('product_vat_id');
}
$names = $this->getOption('attribute_names', $format);
$values = $this->getOption('attribute_values', $format);
if (oledrion_utils::getModuleOption('use_price')) {
$prices = $this->getOption('attribute_prices', $format);
}
if (oledrion_utils::getModuleOption('attributes_stocks')) {
$stocks = $this->getOption('attribute_stocks', $format);
}
if ($withFormatedPrices) {
$oledrion_Currency = oledrion_Currency::getInstance();
}
if (count($names) > 0) {
foreach ($names as $key => $name) {
$price = $stock = 0;
if (oledrion_utils::getModuleOption('use_price')) {
$price = $prices[$key];
if ($withFormatedPrices) {
$priceFormated = $oledrion_Currency->amountForDisplay($price);
$priceTtc = oledrion_utils::getAmountWithVat($price, $vat_id);
$priceTtcFormated = $oledrion_Currency->amountForDisplay($priceTtc);
$vat = $priceTtc - $price;
$vatFormated = $oledrion_Currency->amountForDisplay($vat);
}
}
if (oledrion_utils::getModuleOption('attributes_stocks')) {
$stock = $stocks[$key];
}
if (!$withFormatedPrices) {
$ret[] = array('name' => $name, 'value' => $values[$key], 'price' => $price, 'stock' => $stock);
} else {
$ret[] = array('name' => $name, 'value' => $values[$key], 'price' => $price, 'priceFormated' => $priceFormated, 'priceTTC' => $priceTtc, 'priceTTCFormated' => $priceTtcFormated, 'vat' => $vat, 'vatFormated' => $vatFormated, 'counter' => $counter, 'stock' => $stock);
}
$counter++;
}
}
return $ret;
}
示例4: renderForInvoice
/**
* Retourne les informations formatées de l'attribut pour affichage dans la facture
*
* @param oledrion_products $product Le produit concerné par l'attribut
* @return array
* @since 2.3.2009.03.23
*/
function renderForInvoice(oledrion_products $product, $format = 's')
{
$names = $prices = $ret = array();
$names = $this->getOption('ca_attribute_names', $format);
if (oledrion_utils::getModuleOption('use_price')) {
$prices = $this->getOption('ca_attribute_prices', $format);
}
$oledrion_Currency = oledrion_Currency::getInstance();
$counter = 0;
foreach ($names as $name) {
$price = 0;
if (oledrion_utils::getModuleOption('use_price')) {
if (isset($prices[$counter])) {
$price = oledrion_utils::getAmountWithVat(floatval($prices[$counter]), $product->getVar('product_vat_id'));
$price = $oledrion_Currency->amountForDisplay($price);
}
}
$ret[] = array('ca_attribute_name' => $name, 'ca_attribute_price_formated' => $price);
$counter++;
}
return $ret;
}