• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getTaxPercentage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getTaxPercentage函数的典型用法代码示例。如果您正苦于以下问题:PHP getTaxPercentage函数的具体用法?PHP getTaxPercentage怎么用?PHP getTaxPercentage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getTaxPercentage函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getAllTaxes

    $tax_details = getAllTaxes('available');
}
for ($i = 0; $i < count($tax_details); $i++) {
    $tax_details[$i]['check_name'] = $tax_details[$i]['taxname'] . '_check';
    $tax_details[$i]['check_value'] = 0;
}
//For Edit and Duplicate we have to retrieve the product associated taxes and show them
if ($retrieve_taxes) {
    for ($i = 0; $i < count($tax_details); $i++) {
        $tax_value = getProductTaxPercentage($tax_details[$i]['taxname'], $productid);
        $tax_details[$i]['percentage'] = $tax_value;
        $tax_details[$i]['check_value'] = 1;
        //if the tax is not associated with the product then we should get the default value and unchecked
        if ($tax_value == '') {
            $tax_details[$i]['check_value'] = 0;
            $tax_details[$i]['percentage'] = getTaxPercentage($tax_details[$i]['taxname']);
        }
    }
}
$smarty->assign("TAX_DETAILS", $tax_details);
//Tax handling - ends
$unit_price = $focus->column_fields['unit_price'];
$price_details = getPriceDetailsForProduct($productid, $unit_price, 'available', $currentModule);
$smarty->assign("PRICE_DETAILS", $price_details);
$base_currency = 'curname' . $product_base_currency;
$smarty->assign("BASE_CURRENCY", $base_currency);
if (isset($focus->id) && $_REQUEST['isDuplicate'] != 'true') {
    $is_parent = $focus->isparent_check();
} else {
    $is_parent = 0;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:31,代码来源:EditView.php


示例2: getProductTaxPercentage

/**	function to get the product's taxpercentage
 *	@param string $type       - tax type (VAT or Sales or Service)
 *	@param id  $productid     - productid to which we want the tax percentage
 *	@param id  $default       - if 'default' then first look for product's tax percentage and product's tax is empty then it will return the default configured tax percentage, else it will return the product's tax (not look for default value)
 *	return int $taxpercentage - taxpercentage corresponding to the Tax type from vtiger_inventorytaxinfo vtiger_table
 */
function getProductTaxPercentage($type, $productid, $default = '')
{
    global $adb, $log;
    $log->debug("Entering into getProductTaxPercentage({$type},{$productid}) function.");
    list($void1, $void2, $taxpercentage) = cbEventHandler::do_filter('corebos.filter.TaxCalculation.getProductTaxPercentage', array($type, $productid, ''));
    if ($taxpercentage == '') {
        $res = $adb->pquery("SELECT taxpercentage\n\t\t\tFROM vtiger_inventorytaxinfo\n\t\t\tINNER JOIN vtiger_producttaxrel\n\t\t\t\tON vtiger_inventorytaxinfo.taxid = vtiger_producttaxrel.taxid\n\t\t\tWHERE vtiger_producttaxrel.productid = ?\n\t\t\tAND vtiger_inventorytaxinfo.taxname = ?", array($productid, $type));
        if ($res and $adb->num_rows($res) > 0) {
            $taxpercentage = $adb->query_result($res, 0, 'taxpercentage');
        }
    }
    //This is to retrieve the default configured value if the taxpercentage related to product is empty
    if ($taxpercentage == '' && $default == 'default') {
        $taxpercentage = getTaxPercentage($type);
    }
    $log->debug("Exiting from getProductTaxPercentage({$productid},{$type}) function. return value={$taxpercentage}");
    return $taxpercentage;
}
开发者ID:jaimeaga84,项目名称:corebos,代码行数:24,代码来源:InventoryUtils.php


示例3: insertTaxInformation

 /**	function to save the service tax information in vtiger_servicetaxrel table
  *	@param string $tablename - vtiger_tablename to save the service tax relationship (servicetaxrel)
  *	@param string $module	 - current module name
  *	$return void
  */
 function insertTaxInformation($tablename, $module)
 {
     global $adb, $log;
     $log->debug("Entering into insertTaxInformation({$tablename}, {$module}) method ...");
     $tax_details = getAllTaxes();
     $tax_per = '';
     //Save the Product - tax relationship if corresponding tax check box is enabled
     //Delete the existing tax if any
     if ($this->mode == 'edit') {
         for ($i = 0; $i < count($tax_details); $i++) {
             $taxid = getTaxId($tax_details[$i]['taxname']);
             $sql = "delete from vtiger_producttaxrel where productid=? and taxid=?";
             $adb->pquery($sql, array($this->id, $taxid));
         }
     }
     for ($i = 0; $i < count($tax_details); $i++) {
         $tax_name = $tax_details[$i]['taxname'];
         $tax_checkname = $tax_details[$i]['taxname'] . "_check";
         if ($_REQUEST[$tax_checkname] == 'on' || $_REQUEST[$tax_checkname] == 1) {
             $taxid = getTaxId($tax_name);
             $tax_per = $_REQUEST[$tax_name];
             if ($tax_per == '') {
                 $log->debug("Tax selected but value not given so default value will be saved.");
                 $tax_per = getTaxPercentage($tax_name);
             }
             $log->debug("Going to save the Product - {$tax_name} tax relationship");
             $query = "insert into vtiger_producttaxrel values(?,?,?)";
             $adb->pquery($query, array($this->id, $taxid, $tax_per));
         }
     }
     $log->debug("Exiting from insertTaxInformation({$tablename}, {$module}) method ...");
 }
开发者ID:mslokhat,项目名称:corebos,代码行数:37,代码来源:Services.php


示例4: getProductTaxPercentage

/** 	function to get the product's taxpercentage
 * 	@param string $type       - tax type (VAT or Sales or Service)
 * 	@param id  $productid     - productid to which we want the tax percentage
 * 	@param id  $default       - if 'default' then first look for product's tax percentage and product's tax is empty then it will return the default configured tax percentage, else it will return the product's tax (not look for default value)
 * 	return int $taxpercentage - taxpercentage corresponding to the Tax type from vtiger_inventorytaxinfo vtiger_table
 */
function getProductTaxPercentage($type, $productid, $default = '')
{
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $current_user = vglobal('current_user');
    $log->debug("Entering into getProductTaxPercentage({$type},{$productid}) function.");
    $taxpercentage = '';
    $res = $adb->pquery("SELECT taxpercentage\n\t\t\tFROM vtiger_inventorytaxinfo\n\t\t\tINNER JOIN vtiger_producttaxrel\n\t\t\t\tON vtiger_inventorytaxinfo.taxid = vtiger_producttaxrel.taxid\n\t\t\tWHERE vtiger_producttaxrel.productid = ?\n\t\t\tAND vtiger_inventorytaxinfo.taxname = ?", array($productid, $type));
    $taxpercentage = $adb->query_result($res, 0, 'taxpercentage');
    //This is to retrive the default configured value if the taxpercentage related to product is empty
    if ($taxpercentage == '' && $default == 'default') {
        $taxpercentage = getTaxPercentage($type);
    }
    $log->debug("Exiting from getProductTaxPercentage({$productid},{$type}) function. return value={$taxpercentage}");
    if ($current_user->truncate_trailing_zeros == true) {
        return decimalFormat($taxpercentage);
    } else {
        return $taxpercentage;
    }
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:26,代码来源:InventoryUtils.php


示例5: getProductTaxPercentage

/**	function to get the product's taxpercentage
 *	@param string $type       - tax type (VAT or Sales or Service)
 *	@param id  $productid     - productid to which we want the tax percentage
 *	@param id  $default       - if 'default' then first look for product's tax percentage and product's tax is empty then it will return the default configured tax percentage, else it will return the product's tax (not look for default value)
 *	return int $taxpercentage - taxpercentage corresponding to the Tax type from vtiger_inventorytaxinfo vtiger_table
 */
function getProductTaxPercentage($type, $productid, $default = '')
{
    global $adb, $log;
    $log->debug("Entering into getProductTaxPercentage({$type},{$productid}) function.");
    $taxpercentage = '';
    $res = $adb->pquery("SELECT taxpercentage\n\t\t\tFROM vtiger_inventorytaxinfo\n\t\t\tINNER JOIN vtiger_producttaxrel\n\t\t\t\tON vtiger_inventorytaxinfo.taxid = vtiger_producttaxrel.taxid\n\t\t\tWHERE vtiger_producttaxrel.productid = ?\n\t\t\tAND vtiger_inventorytaxinfo.taxname = ?", array($productid, $type));
    $taxpercentage = $adb->query_result($res, 0, 'taxpercentage');
    //This is to retrive the default configured value if the taxpercentage related to product is empty
    if ($taxpercentage == '' && $default == 'default') {
        $taxpercentage = getTaxPercentage($type);
    }
    $log->debug("Exiting from getProductTaxPercentage({$productid},{$type}) function. return value={$taxpercentage}");
    return $taxpercentage;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:20,代码来源:InventoryUtils.php


示例6: getTaxClassDetails

 /**
  * Function to get Tax Class Details for this record(Product)
  * @return <Array> List of Taxes
  */
 public function getTaxClassDetails()
 {
     $taxClassDetails = $this->get('taxClassDetails');
     if (!empty($taxClassDetails)) {
         return $taxClassDetails;
     }
     $record = $this->getId();
     if (empty($record)) {
         return $this->getAllTaxes();
     }
     $taxClassDetails = getTaxDetailsForProduct($record, 'available_associated');
     $noOfTaxes = count($taxClassDetails);
     for ($i = 0; $i < $noOfTaxes; $i++) {
         $taxValue = getProductTaxPercentage($taxClassDetails[$i]['taxname'], $this->getId());
         $taxClassDetails[$i]['percentage'] = $taxValue;
         $taxClassDetails[$i]['check_name'] = $taxClassDetails[$i]['taxname'] . '_check';
         $taxClassDetails[$i]['check_value'] = 1;
         //if the tax is not associated with the product then we should get the default value and unchecked
         if ($taxValue == '') {
             $taxClassDetails[$i]['check_value'] = 0;
             $taxClassDetails[$i]['percentage'] = getTaxPercentage($taxClassDetails[$i]['taxname']);
         }
     }
     $this->set('taxClassDetails', $taxClassDetails);
     return $taxClassDetails;
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:30,代码来源:Record.php



注:本文中的getTaxPercentage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getTempFolder函数代码示例发布时间:2022-05-15
下一篇:
PHP getTaxDetailsForProduct函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap