yuan
2026-08-29 f34a379fc9a4908d39fac8b9688280e38bfaffbb
src/utils/summarizeTable.js
@@ -40,14 +40,22 @@
  });
  return sums;
};
// 不含税总价计算
const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
// 不含税总价计算,decimals 为保留小数位数(销售/采购相关页面传 6)
const calculateTaxExclusiveTotalPrice = (
  taxInclusiveTotalPrice,
  taxRate,
  decimals = 2
) => {
  const taxRateDecimal = taxRate / 100;
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(decimals);
};
// 含税总价计算
const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
  return (taxInclusiveUnitPrice * quantity).toFixed(2);
// 含税总价计算,decimals 为保留小数位数(销售/采购相关页面传 6)
const calculateTaxIncludeTotalPrice = (
  taxInclusiveUnitPrice,
  quantity,
  decimals = 2
) => {
  return (taxInclusiveUnitPrice * quantity).toFixed(decimals);
};
// 导出函数供其他文件使用
export {