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

PHP getAllTaxes函数代码示例

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

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



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

示例1: insertTaxInformation

 /**	function to save the product tax information in vtiger_producttaxrel table
  *	@param string $tablename - vtiger_tablename to save the product tax relationship (producttaxrel)
  *	@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:gitter-badger,项目名称:openshift-salesplatform,代码行数:37,代码来源:Products.php


示例2: __construct

 function __construct($fieldname = '')
 {
     InventoryLineField::$ILFieldsLabel = array('item name' => InventoryLineField::$ILFieldsName['productid'], 'quantity' => InventoryLineField::$ILFieldsName['quantity'], 'list price' => InventoryLineField::$ILFieldsName['listprice'], 'item comment' => InventoryLineField::$ILFieldsName['comment'], 'item discount amount' => InventoryLineField::$ILFieldsName['discount_amount'], 'item discount percent' => InventoryLineField::$ILFieldsName['discount_percent']);
     $taxes = getAllTaxes('all');
     foreach ($taxes as $key => $tax) {
         $fieldlabel = strtolower($tax['taxlabel']);
         InventoryLineField::$ILFieldsLabel[$fieldlabel] = array('uitype' => 7, 'fieldtype' => 'double', 'fieldname' => $tax['taxname'], 'columnname' => $tax['taxname'], 'fieldlabel' => $tax['taxlabel'], 'tablename' => 'vtiger_inventoryproductrel', 'typeofdata' => 'N~O', 'mandatory' => 'false');
         InventoryLineField::$ILFieldsName[$tax['taxname']] = InventoryLineField::$ILFieldsLabel[$fieldlabel];
     }
     $this->fieldname = $fieldname;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:11,代码来源:InventoryLineField.php


示例3: getShippingTaxes

 function getShippingTaxes()
 {
     $shippingTaxDetails = $this->get('shippingTaxDetails');
     if ($shippingTaxDetails) {
         return $shippingTaxDetails;
     }
     $record = $this->getId();
     if ($record) {
         $relatedProducts = getAssociatedProducts($this->getModuleName(), $this->getEntity());
         $shippingTaxDetails = $relatedProducts[1]['final_details']['sh_taxes'];
     } else {
         $shippingTaxDetails = getAllTaxes('available', 'sh', 'edit', $this->getId());
     }
     $this->set('shippingTaxDetails', $shippingTaxDetails);
     return $shippingTaxDetails;
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:16,代码来源:Record.php


示例4: getProductTaxes

 function getProductTaxes()
 {
     $taxDetails = $this->get('taxDetails');
     if ($taxDetails) {
         return $taxDetails;
     }
     $record = $this->getId();
     if ($record) {
         $relatedProducts = getAssociatedProducts($this->getModuleName(), $this->getEntity());
         $taxDetails = $relatedProducts[1]['final_details']['taxes'];
     } else {
         $taxDetails = getAllTaxes('available', '', $this->getEntity()->mode, $this->getId());
     }
     $this->set('taxDetails', $taxDetails);
     return $taxDetails;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:16,代码来源:Record.php


示例5: initTax

 private function initTax($element, $parent)
 {
     if (!empty($element['parent_id'])) {
         $this->taxType = $parent['hdnTaxType'];
     }
     $productId = vtws_getIdComponents($element['productid']);
     $productId = $productId[1];
     if (strcasecmp($parent['hdnTaxType'], $this->Individual) === 0) {
         $found = false;
         $meta = $this->getMeta();
         $moduleFields = $meta->getModuleFields();
         $productTaxList = $this->getProductTaxList($productId);
         if (count($productTaxList) > 0) {
             foreach ($moduleFields as $fieldName => $field) {
                 if (preg_match('/tax\\d+/', $fieldName) != 0) {
                     if (!empty($element[$fieldName])) {
                         $found = true;
                         if (is_array($productTaxList[$fieldName])) {
                             $this->taxList[$fieldName] = array('label' => $field->getFieldLabelKey(), 'percentage' => $element[$fieldName]);
                         }
                     }
                 }
             }
         } elseif ($found == false) {
             array_merge($this->taxList, $productTaxList);
         }
     } else {
         $meta = $this->getMeta();
         $moduleFields = $meta->getModuleFields();
         $availableTaxes = getAllTaxes('available');
         $found = false;
         foreach ($moduleFields as $fieldName => $field) {
             if (preg_match('/tax\\d+/', $fieldName) != 0) {
                 $found = true;
                 if (!empty($element[$fieldName])) {
                     $this->taxList[$fieldName] = array('label' => $field->getFieldLabelKey(), 'percentage' => $element[$fieldName]);
                 }
             }
         }
         if (!$found) {
             foreach ($availableTaxes as $taxInfo) {
                 $this->taxList[$taxInfo['taxname']] = array('label' => $field->getFieldLabelKey(), 'percentage' => $taxInfo['percentage']);
             }
         }
     }
     $this->taxList;
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:47,代码来源:VtigerLineItemOperation.php


示例6: getProductTaxes

 public static function getProductTaxes()
 {
     vimport('~~/include/utils/InventoryUtils.php');
     $taxes = getAllTaxes();
     $recordList = array();
     foreach ($taxes as $taxInfo) {
         $taxRecord = new self();
         $taxRecord->setData($taxInfo)->setType(self::PRODUCT_AND_SERVICE_TAX);
         $recordList[] = $taxRecord;
     }
     return $recordList;
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:12,代码来源:TaxRecord.php


示例7: beforeGetTaskform

 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->getWorkflow()->getSettings();
     $new_module = $new_module["module_name"];
     if (!empty($new_module) && $new_module != -1) {
         $viewer->assign("new_module", $new_module);
     }
     $sql = "SELECT\r\n                    vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.description,\r\n                    vtiger_products.*,\r\n                    vtiger_productcf.*\r\n                FROM vtiger_products\r\n                    INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid\r\n                    INNER JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid\r\n                    LEFT JOIN vtiger_vendor ON vtiger_vendor.vendorid = vtiger_products.vendor_id\r\n                    LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\r\n                    LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\r\n                WHERE\r\n                    vtiger_products.productid > 0 AND\r\n                    vtiger_crmentity.deleted = 0 and\r\n                    vtiger_products.discontinued <> 0 AND\r\n                    (vtiger_products.productid NOT IN (\r\n                        SELECT crmid FROM vtiger_seproductsrel WHERE vtiger_products.productid > 0 AND setype='Products'\r\n                        )\r\n                    )";
     $result = $adb->query($sql);
     $products = array();
     $taxes = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $products[$row["productid"]] = $row;
         $taxes[$row["productid"]] = getTaxDetailsForProduct($row["productid"], 'all');
         if (empty($taxes[$row["productid"]])) {
             $taxes[$row["productid"]] = array("a" => "b");
         }
     }
     $viewer->assign("taxlist", $taxes);
     $viewer->assign("productlist", $products);
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:34,代码来源:WfTaskReverseInventory.php


示例8: getDetailAssociatedProducts


//.........这里部分代码省略.........
    $output .= '</table>';
    //$netTotal should be equal to $focus->column_fields['hdnSubTotal']
    $netTotal = $focus->column_fields['hdnSubTotal'];
    $netTotalformated = number_format($netTotal, $decimal_precision, $decimals_separator, $thousands_separator);
    //Display the total, adjustment, S&H details
    $output .= '<table width="100%" border="0" cellspacing="0" cellpadding="5" class="crmTable">';
    $output .= '<tr>';
    $output .= '<td width="88%" class="crmTableRow small" align="right"><b>' . $app_strings['LBL_NET_TOTAL'] . '</td>';
    $output .= '<td width="12%" class="crmTableRow small" align="right"><b>' . $netTotalformated . '</b></td>';
    $output .= '</tr>';
    //Decide discount
    $finalDiscount = '0.00';
    $final_discount_info = '0';
    //if($focus->column_fields['hdnDiscountPercent'] != '') - previously (before changing to prepared statement) the selected option (either percent or amount) will have value and the other remains empty. So we can find the non selected item by empty check. But now with prepared statement, the non selected option stored as 0
    if ($focus->column_fields['hdnDiscountPercent'] != '0') {
        $finalDiscount = $netTotal * $focus->column_fields['hdnDiscountPercent'] / 100;
        $finalDiscountformated = number_format($finalDiscount, $decimal_precision, $decimals_separator, $thousands_separator);
        $final_discount_info = $focus->column_fields['hdnDiscountPercent'] . " % " . $app_strings['of_string'] . " {$netTotalformated} = {$finalDiscountformated}";
    } elseif ($focus->column_fields['hdnDiscountAmount'] != '0') {
        $finalDiscount = $focus->column_fields['hdnDiscountAmount'];
        $finalDiscountformated = number_format($finalDiscount, $decimal_precision, $decimals_separator, $thousands_separator);
        $final_discount_info = $finalDiscount;
    }
    //Alert the Final Discount amount even it is zero
    $final_discount_info = $app_strings['LBL_FINAL_DISCOUNT_AMOUNT'] . " = {$final_discount_info}";
    $final_discount_info = 'onclick="alert(\'' . $final_discount_info . '\');"';
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">(-)&nbsp;<b><a href="javascript:;" ' . $final_discount_info . '>' . $app_strings['LBL_DISCOUNT'] . '</a></b></td>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">' . $finalDiscountformated . '</td>';
    $output .= '</tr>';
    if ($taxtype == 'group') {
        $taxtotal = '0.00';
        $final_totalAfterDiscount = $netTotal - $finalDiscount;
        $final_totalAfterDiscountformated = number_format($final_totalAfterDiscount, $decimal_precision, $decimals_separator, $thousands_separator);
        $tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . " = {$final_totalAfterDiscountformated} \\n";
        //First we should get all available taxes and then retrieve the corresponding tax values
        $tax_details = getAllTaxes('available', '', 'edit', $focus->id);
        //if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table
        for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
            $tax_name = $tax_details[$tax_count]['taxname'];
            $tax_label = $tax_details[$tax_count]['taxlabel'];
            $tax_value = $adb->query_result($result, 0, $tax_name);
            if ($tax_value == '' || $tax_value == 'NULL') {
                $tax_value = '0.00';
            }
            $taxamount = ($netTotal - $finalDiscount) * $tax_value / 100;
            $taxamountformated = number_format($taxamount, $decimal_precision, $decimals_separator, $thousands_separator);
            $taxtotal = $taxtotal + $taxamount;
            $taxtotalformated = number_format($taxtotal, $decimal_precision, $decimals_separator, $thousands_separator);
            $tax_info_message .= "{$tax_label} : {$tax_value} % = {$taxamountformated} \\n";
        }
        $tax_info_message .= "\\n " . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . " = {$taxtotalformated}";
        $output .= '<tr>';
        $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $tax_info_message . '\');">' . $app_strings['LBL_TAX'] . '</a></b></td>';
        $output .= '<td align="right" class="crmTableRow small">' . $taxtotalformated . '</td>';
        $output .= '</tr>';
    }
    $shAmount = $focus->column_fields['hdnS_H_Amount'] != '' ? $focus->column_fields['hdnS_H_Amount'] : '0.00';
    $shAmountformated = number_format($shAmount, $decimal_precision, $decimals_separator, $thousands_separator);
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b>' . $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . $shAmountformated . '</td>';
    $output .= '</tr>';
    //calculate S&H tax
    $shtaxtotal = '0.00';
    //First we should get all available taxes and then retrieve the corresponding tax values
    $shtax_details = getAllTaxes('available', 'sh', 'edit', $focus->id);
    //if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table
    $shtax_info_message = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGE'] . " = {$shAmountformated} \\n";
    for ($shtax_count = 0; $shtax_count < count($shtax_details); $shtax_count++) {
        $shtax_name = $shtax_details[$shtax_count]['taxname'];
        $shtax_label = $shtax_details[$shtax_count]['taxlabel'];
        $shtax_percent = getInventorySHTaxPercent($focus->id, $shtax_name);
        $shtaxamount = $shAmount * $shtax_percent / 100;
        $shtaxamountformated = number_format($shtaxamount, $decimal_precision, $decimals_separator, $thousands_separator);
        $shtaxtotal = $shtaxtotal + $shtaxamount;
        $shtaxtotalformated = number_format($shtaxtotal, $decimal_precision, $decimals_separator, $thousands_separator);
        $shtax_info_message .= "{$shtax_label} : {$shtax_percent} % = {$shtaxamountformated} \\n";
    }
    $shtax_info_message .= "\\n " . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . " = {$shtaxtotalformated}";
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $shtax_info_message . '\')">' . $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'] . '</a></b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . $shtaxtotalformated . '</td>';
    $output .= '</tr>';
    $adjustment = $focus->column_fields['txtAdjustment'] != '' ? $focus->column_fields['txtAdjustment'] : '0.00';
    $adjustmentformated = number_format($adjustment, $decimal_precision, $decimals_separator, $thousands_separator);
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">&nbsp;<b>' . $app_strings['LBL_ADJUSTMENT'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . $adjustmentformated . '</td>';
    $output .= '</tr>';
    $grandTotal = $focus->column_fields['hdnGrandTotal'] != '' ? $focus->column_fields['hdnGrandTotal'] : '0.00';
    $grandTotalformated = number_format($grandTotal, $decimal_precision, $decimals_separator, $thousands_separator);
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop"><b>' . $app_strings['LBL_GRAND_TOTAL'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">' . $grandTotalformated . '</td>';
    $output .= '</tr>';
    $output .= '</table>';
    $log->debug("Exiting getDetailAssociatedProducts method ...");
    return $output;
}
开发者ID:joomlacorner,项目名称:vtigerthai,代码行数:101,代码来源:DetailViewUtils.php


示例9: changeDeleted

    } else {
        changeDeleted($_REQUEST['taxname'], 0);
    }
    $getlist = true;
} elseif (($_REQUEST['sh_disable'] == 'true' || $_REQUEST['sh_enable'] == 'true') && $_REQUEST['sh_taxname'] != '') {
    if ($_REQUEST['sh_disable'] == 'true') {
        changeDeleted($_REQUEST['sh_taxname'], 1, 'sh');
    } else {
        changeDeleted($_REQUEST['sh_taxname'], 0, 'sh');
    }
    $getlist = true;
}
//after done save or enable/disable or added new tax the list will be retrieved again from db
if ($getlist) {
    $tax_details = getAllTaxes();
    $sh_tax_details = getAllTaxes('all', 'sh');
}
$smarty->assign("TAX_COUNT", count($tax_details));
$smarty->assign("SH_TAX_COUNT", count($sh_tax_details));
if (count($tax_details) == 0) {
    $smarty->assign("TAX_COUNT", 0);
}
if (count($sh_tax_details) == 0) {
    $smarty->assign("SH_TAX_COUNT", 0);
}
$smarty->assign("TAX_VALUES", $tax_details);
$smarty->assign("SH_TAX_VALUES", $sh_tax_details);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:TaxConfig.php


示例10: getTranslatedString

    $mod_seq_no = $adb->query_result($mod_seq_string, 0, 'cur_id');
    if ($adb->num_rows($mod_seq_string) == 0 || $focus->checkModuleSeqNumber($focus->table_name, $mod_seq_field['column'], $mod_seq_prefix . $mod_seq_no)) {
        echo '<br><font color="#FF0000"><b>' . getTranslatedString('LBL_DUPLICATE') . ' ' . getTranslatedString($mod_seq_field['label']) . ' - ' . getTranslatedString('LBL_CLICK') . ' <a href="index.php?module=Settings&action=CustomModEntityNo&parenttab=Settings&selmodule=' . $currentModule . '">' . getTranslatedString('LBL_HERE') . '</a> ' . getTranslatedString('LBL_TO_CONFIGURE') . ' ' . getTranslatedString($mod_seq_field['label']) . '</b></font>';
    } else {
        $smarty->assign("MOD_SEQ_ID", $autostr);
    }
} else {
    $smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]);
}
//if create PO, get all available product taxes and shipping & Handling taxes
if ($focus->mode != 'edit') {
    $tax_details = getAllTaxes('available');
    $sh_tax_details = getAllTaxes('available', 'sh');
} else {
    $tax_details = getAllTaxes('available', '', $focus->mode, $focus->id);
    $sh_tax_details = getAllTaxes('available', 'sh', 'edit', $focus->id);
}
$smarty->assign('GROUP_TAXES', $tax_details);
$smarty->assign('SH_TAXES', $sh_tax_details);
$smarty->assign("CURRENCIES_LIST", getAllCurrencies());
if ($focus->mode == 'edit') {
    $inventory_cur_info = getInventoryCurrencyInfo('PurchaseOrder', $focus->id);
    $smarty->assign("INV_CURRENCY_ID", $inventory_cur_info['currency_id']);
} else {
    $smarty->assign("INV_CURRENCY_ID", $currencyid);
}
$smarty->assign('CREATEMODE', vtlib_purify($_REQUEST['createmode']));
// Gather the help information associated with fields
$smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule));
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($currentModule);
$smarty->assign("PICKIST_DEPENDENCY_DATASOURCE", Zend_Json::encode($picklistDependencyDatasource));
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:EditView.php


示例11: save

 public function save()
 {
     ${"GLOBALS"}["ducixeik"] = "additionalProductFields";
     ${${"GLOBALS"}["wtrcwdueuts"]} = PearDatabase::getInstance();
     ${${"GLOBALS"}["ducixeik"]} = $this->getAdditionalProductFields();
     ${"GLOBALS"}["molcrpc"] = "manualUpdateFields";
     ${"GLOBALS"}["gbmhcqh"] = "tmp";
     ${"GLOBALS"}["ewjsruuy"] = "fieldName";
     ${${"GLOBALS"}["molcrpc"]} = array();
     foreach (${${"GLOBALS"}["vptmrj"]} as ${${"GLOBALS"}["ewjsruuy"]} => ${${"GLOBALS"}["gbmhcqh"]}) {
         if (${${"GLOBALS"}["ykppheofobwk"]}["implemented"] == false) {
             $jpmxewcq = "relData";
             ${"GLOBALS"}["fkfnvsuaox"] = "manualUpdateFields";
             ${${"GLOBALS"}["fkfnvsuaox"]}[] = ${${"GLOBALS"}["thpgoyrlu"]};
             ${$jpmxewcq} = $this->_getProductRelData();
         }
     }
     require_once "modules/Emails/mail.php";
     if (!empty($this->_id) && $this->_changed == true) {
         $this->_changedProducts = $this->_changed;
         if ($this->_listitems === null) {
             $this->_loadProducts();
         }
     }
     parent::save();
     $this->prepareTransfer();
     if (!empty($this->_currencyID)) {
         ${${"GLOBALS"}["xkutivbm"]} = $this->_currencyID;
     } else {
         $ogqhrcro = "currency_id";
         ${$ogqhrcro} = false;
     }
     $this->clearData();
     if ($this->_changedProducts === true) {
         ${"GLOBALS"}["tgkrfb"] = "shipping_handling_charge";
         ${"GLOBALS"}["negltbro"] = "field";
         ${${"GLOBALS"}["amsupsflnmf"]} = $this->get("hdnTaxType");
         ${"GLOBALS"}["hxnewftfdqn"] = "i";
         ${"GLOBALS"}["etqhqirsnh"] = "taxtype";
         $agoclef = "adjustment";
         ${$agoclef} = 0;
         ${${"GLOBALS"}["tgkrfb"]} = 0;
         $qwpblm = "i";
         ${"GLOBALS"}["krxwtxw"] = "fields";
         ${${"GLOBALS"}["whqnrjvsw"]} = getAllTaxes();
         $nxxrnbh = "intObject";
         $mdwcbjhvim = "availTaxes";
         $vaqwwrr = "value";
         $_REQUEST["totalProductCount"] = count($this->_listitems);
         $_REQUEST["taxtype"] = ${${"GLOBALS"}["etqhqirsnh"]};
         $_REQUEST["subtotal"] = 0;
         ${${"GLOBALS"}["pponynktout"]} = $this->getProductFields();
         foreach (${${"GLOBALS"}["krxwtxw"]} as ${${"GLOBALS"}["negltbro"]} => ${$vaqwwrr}) {
             $_REQUEST[${${"GLOBALS"}["mlsoidilfq"]}] = ${${"GLOBALS"}["cqlhrtj"]};
         }
         for (${${"GLOBALS"}["hxnewftfdqn"]} = 1; ${${"GLOBALS"}["jsntgvnqkf"]} <= count($this->_listitems); ${${"GLOBALS"}["jsntgvnqkf"]}++) {
             ${"GLOBALS"}["zepdlqparq"] = "i";
             $_REQUEST["subtotal"] += ${${"GLOBALS"}["pponynktout"]}["productTotal" . ${${"GLOBALS"}["zepdlqparq"]}];
         }
         $klivirms = "intObject";
         $cnavotvg = "globalTaxValue";
         ${"GLOBALS"}["ouawiowlgku"] = "shipTaxValue";
         $_REQUEST["discount_percentage_final"] = $this->get("hdnDiscountPercent");
         $_REQUEST["discount_percentage_final"] = floatval($_REQUEST["discount_percentage_final"]);
         $_REQUEST["discount_amount_final"] = $this->get("hdnDiscountAmount");
         $_REQUEST["discount_amount_final"] = floatval($_REQUEST["discount_amount_final"]);
         $_REQUEST["discount_type_final"] = !empty($_REQUEST["discount_percentage_final"]) ? "percentage" : "amount";
         $_REQUEST["total"] = $_REQUEST["subtotal"];
         if ($_REQUEST["discount_type_final"] == "amount") {
             $_REQUEST["total"] -= $_REQUEST["discount_amount_final"];
         } elseif ($_REQUEST["discount_type_final"] == "percentage") {
             $_REQUEST["total"] -= $_REQUEST["total"] * ($_REQUEST["discount_percentage_final"] / 100);
         }
         ${$cnavotvg} = 0;
         if (${${"GLOBALS"}["amsupsflnmf"]} == "group") {
             ${"GLOBALS"}["yirabwmnwgyp"] = "globalTaxValue";
             $oplkjyxi = "availTaxes";
             foreach (${$oplkjyxi} as ${${"GLOBALS"}["wfuwxbmiwytq"]}) {
                 $psuluqnb = "request_tax_name";
                 $enefpgduf = "tax";
                 ${"GLOBALS"}["wxlvsgkcw"] = "request_tax_name";
                 ${${"GLOBALS"}["hvjpdk"]} = ${$enefpgduf}["taxname"];
                 ${${"GLOBALS"}["wxlvsgkcw"]} = ${${"GLOBALS"}["hvjpdk"]} . "_group_percentage";
                 $lifliipv = "request_tax_name";
                 $_REQUEST[${${"GLOBALS"}["hwivgkl"]}] = isset($this->_groupTax[${${"GLOBALS"}["hwivgkl"]}]) ? $this->_groupTax[${$psuluqnb}] : 0;
                 $bltbxkcxbjyp = "tmpTaxValue";
                 ${${"GLOBALS"}["fvbuscvwjf"]} = $_REQUEST["total"] * ($_REQUEST[${$lifliipv}] / 100);
                 ${${"GLOBALS"}["zjswudci"]} += ${$bltbxkcxbjyp};
             }
             $_REQUEST["total"] += ${${"GLOBALS"}["yirabwmnwgyp"]};
         }
         $_REQUEST["shipping_handling_charge"] = $this->_shippingCost;
         ${${"GLOBALS"}["cxnjuagap"]} = 0;
         $bbluqvmmcrl = "tax";
         foreach (${$mdwcbjhvim} as ${$bbluqvmmcrl}) {
             $rbwcrso = "request_tax_name";
             ${"GLOBALS"}["woxvppdlct"] = "tmpTaxValue";
             $xeqhidsvg = "shipTaxValue";
             ${"GLOBALS"}["rihoezbjibn"] = "tax_name";
             ${${"GLOBALS"}["rihoezbjibn"]} = ${${"GLOBALS"}["wfuwxbmiwytq"]}["taxname"];
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:VTInventoryEntity.php


示例12: createpdffile


//.........这里部分代码省略.........
        } else {
            $price_discount = "0.00";
        }
    }
    //Adjustment
    $price_adjustment = $final_details["adjustment"];
    $price_adjustment_formated = number_format($price_adjustment, $decimal_precision, $decimals_separator, $thousands_separator);
    //Grand Total
    $price_total = $final_details["grandTotal"];
    $price_total_formated = number_format($price_total, $decimal_precision, $decimals_separator, $thousands_separator);
    //To calculate the group tax amount
    if ($final_details['taxtype'] == 'group') {
        $group_tax_total = $final_details['tax_totalamount'];
        $price_salestax = $group_tax_total;
        $price_salestax_formated = number_format($price_salestax, $decimal_precision, $decimals_separator, $thousands_separator);
        $group_total_tax_percent = '0.00';
        $group_tax_details = $final_details['taxes'];
        for ($i = 0; $i < count($group_tax_details); $i++) {
            $group_total_tax_percent = $group_total_tax_percent + $group_tax_details[$i]['percentage'];
        }
    }
    //S&H amount
    $sh_amount = $final_details['shipping_handling_charge'];
    $price_shipping_formated = number_format($sh_amount, $decimal_precision, $decimals_separator, $thousands_separator);
    //S&H taxes
    $sh_tax_details = $final_details['sh_taxes'];
    $sh_tax_percent = '0.00';
    for ($i = 0; $i < count($sh_tax_details); $i++) {
        $sh_tax_percent = $sh_tax_percent + $sh_tax_details[$i]['percentage'];
    }
    $sh_tax_amount = $final_details['shtax_totalamount'];
    $price_shipping_tax = number_format($sh_tax_amount, $decimal_precision, $decimals_separator, $thousands_separator);
    //to calculate the individuel tax amounts included we should get all available taxes and then retrieve the corresponding tax values
    $tax_details = getAllTaxes('available');
    $numer_of_tax_types = count($tax_details);
    for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
        $taxtype_listings[taxname . $tax_count] = $tax_details[$tax_count]['taxname'];
        $taxtype_listings[percentage . $tax_count] = $tax_details[$tax_count]['percentage'];
        $taxtype_listings[value . $tax_count] = '0';
    }
    //This is to get all prodcut details as row basis
    for ($i = 1, $j = $i - 1; $i <= $num_products; $i++, $j++) {
        $product_code[$i] = $associated_products[$i]['hdnProductcode' . $i];
        $product_name[$i] = decode_html($associated_products[$i]['productName' . $i]);
        $prod_description[$i] = decode_html($associated_products[$i]['productDescription' . $i]);
        $qty[$i] = $associated_products[$i]['qty' . $i];
        $qty_formated[$i] = number_format($associated_products[$i]['qty' . $i], $decimal_precision, $decimals_separator, $thousands_separator);
        $comment[$i] = decode_html($associated_products[$i]['comment' . $i]);
        $unit_price[$i] = number_format($associated_products[$i]['unitPrice' . $i], $decimal_precision, $decimals_separator, $thousands_separator);
        $list_price[$i] = number_format($associated_products[$i]['listPrice' . $i], $decimal_precision, $decimals_separator, $thousands_separator);
        $list_pricet[$i] = $associated_products[$i]['listPrice' . $i];
        $discount_total[$i] = $associated_products[$i]['discountTotal' . $i];
        $discount_totalformated[$i] = number_format($associated_products[$i]['discountTotal' . $i], $decimal_precision, $decimals_separator, $thousands_separator);
        //added by crm-now
        $usageunit[$i] = $associated_products[$i]['usageunit' . $i];
        //look whether the entry already exists, if the translated string is available then the translated string other wise original string will be returned
        $usageunit[$i] = getTranslatedString($usageunit[$i], 'Products');
        $taxable_total = $qty[$i] * $list_pricet[$i] - $discount_total[$i];
        $producttotal = $taxable_total;
        $total_taxes = '0.00';
        if ($focus->column_fields["hdnTaxType"] == "individual") {
            $total_tax_percent = '0.00';
            //This loop is to get all tax percentage and then calculate the total of all taxes
            for ($tax_count = 0; $tax_count < count($associated_products[$i]['taxes']); $tax_count++) {
                $tax_percent = $associated_products[$i]['taxes'][$tax_count]['percentage'];
                $total_tax_percent = $total_tax_percent + $tax_percent;
开发者ID:joomlacorner,项目名称:vtigerthai,代码行数:67,代码来源:pdfcreator.php


示例13: parse_calendardate

}
if (isset($cust_fld)) {
    $smarty->assign("CUSTOMFIELD", $cust_fld);
}
$smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
//Tax handling (get the available taxes only) - starts
if ($focus->mode == 'edit') {
    $retrieve_taxes = true;
    $productid = $focus->id;
    $tax_details = getTaxDetailsForProduct($productid, 'available_associated');
} elseif ($_REQUEST['isDuplicate'] == 'true') {
    $retrieve_taxes = true;
    $productid = $_REQUEST['record'];
    $tax_details = getTaxDetailsForProduct($productid, 'available_associated');
} else {
    $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']);
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:31,代码来源:EditView.php


示例14: beforeGetTaskform

 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->get("new_module");
     if (!empty($_POST["task"]["new_module_setter"])) {
         $new_module = $_POST["task"]["new_module_setter"];
         #            $viewer->assign("module_name", $_POST["task"]["new_module_setter"]);
         $mandatoryFields = VtUtils::getMandatoryFields(getTabId($_POST["task"]["new_module_setter"]));
         $startFields = array();
         $counter = 1;
         foreach ($mandatoryFields as $field) {
             if ('productid' != $field['fieldname']) {
                 $startFields["" . $counter] = array("field" => $field["fieldname"], "mode" => "value", "value" => "", "fixed" => true);
                 $counter++;
             }
         }
         $startFields["" . $counter++] = array("field" => "currency_id", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnTaxType", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnS_H_Amount", "mode" => "value", "value" => "", "fixed" => true);
         $this->set("setter", $startFields);
         $this->set("global", array());
     }
     if (!empty($new_module) && $new_module != -1) {
         $field = new StdClass();
         $field->name = "hdnS_H_Amount";
         $field->label = getTranslatedString("Shipping & Handling Charges", $_POST["task"]["new_module_setter"]);
         $additionalFields = array($field);
         $viewer->assign("new_module", $new_module);
     }
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:42,代码来源:WfTaskCreateInventory.php


示例15: getValue


//.........这里部分代码省略.........
                            // For ToDo creation the underlying form is not named as EditView
                            $form = !empty($_REQUEST['form']) ? $_REQUEST['form'] : '';
                            if (!empty($form)) {
                                $form = htmlspecialchars($form, ENT_QUOTES, $default_charset);
                            }
                            $value = '<a href="javascript:window.close();" onclick=\'set_return_contact_address("' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '", "' . popup_decode_html($cntct_focus->column_fields['mailingstreet']) . '", "' . popup_decode_html($cntct_focus->column_fields['otherstreet']) . '", "' . popup_decode_html($cntct_focus->column_fields['mailingcity']) . '", "' . popup_decode_html($cntct_focus->column_fields['othercity']) . '", "' . popup_decode_html($cntct_focus->column_fields['mailingstate']) . '", "' . popup_decode_html($cntct_focus->column_fields['otherstate']) . '", "' . popup_decode_html($cntct_focus->column_fields['mailingzip']) . '", "' . popup_decode_html($cntct_focus->column_fields['otherzip']) . '", "' . popup_decode_html($cntct_focus->column_fields['mailingcountry']) . '", "' . popup_decode_html($cntct_focus->column_fields['othercountry']) . '","' . popup_decode_html($cntct_focus->column_fields['mailingpobox']) . '", "' . popup_decode_html($cntct_focus->column_fields['otherpobox']) . '","' . $form . '");\'>' . $temp_val . '</a>';
                        } else {
                            if ($popuptype == 'toDospecific') {
                                $value = '<a href="javascript:window.close();" onclick=\'set_return_toDospecific("' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\'>' . $temp_val . '</a>';
                            } else {
                                $value = '<a href="javascript:window.close();" onclick=\'set_return_specific("' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\'>' . $temp_val . '</a>';
                            }
                        }
                    } elseif ($popuptype == "detailview") {
                        if ($colname == "lastname" && ($module == 'Contacts' || $module == 'Leads')) {
                            $temp_val = getFullNameFromQResult($list_result, $list_result_count, $module);
                        }
                        $slashes_temp_val = popup_from_html($temp_val);
                        $slashes_temp_val = htmlspecialchars($slashes_temp_val, ENT_QUOTES, $default_charset);
                        $focus->record_id = $_REQUEST['recordid'];
                        if ($_REQUEST['return_module'] == "Calendar") {
                            $value = '<a href="javascript:window.close();" id="calendarCont' . $entity_id . '" LANGUAGE=javascript onclick=\'add_data_to_relatedlist_incal("' . $entity_id . '","' . decode_html($slashes_temp_val) . '");\'>' . $temp_val . '</a>';
                        } else {
                            $value = '<a href="javascript:window.close();" onclick=\'add_data_to_relatedlist("' . $entity_id . '","' . $focus->record_id . '","' . $module . '");\'>' . $temp_val . '</a>';
                        }
                    } elseif ($popuptype == "formname_specific") {
                        $slashes_temp_val = popup_from_html($temp_val);
                        $slashes_temp_val = htmlspecialchars($slashes_temp_val, ENT_QUOTES, $default_charset);
                        $value = '<a href="javascript:window.close();" onclick=\'set_return_formname_specific("' . $_REQUEST['form'] . '", "' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\'>' . $temp_val . '</a>';
                    } elseif ($popuptype == "inventory_prod") {
                        $row_id = $_REQUEST['curr_row'];
                        //To get all the tax types and values and pass it to product details
                        $tax_str = '';
                        $tax_details = getAllTaxes();
                        for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
                            $tax_str .= $tax_details[$tax_count]['taxname'] . '=' . $tax_details[$tax_count]['percentage'] . ',';
                        }
                        $tax_str = trim($tax_str, ',');
                        $rate = $user_info['conv_rate'];
                        if (getFieldVisibilityPermission('Products', $current_user->id, 'unit_price') == '0') {
                            $unitprice = $adb->query_result($list_result, $list_result_count, 'unit_price');
                           

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getAllUsers函数代码示例发布时间:2022-05-15
下一篇:
PHP getAllSettings函数代码示例发布时间: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