Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Aug 19, 2019
1 parent a9b35ea commit 20d57e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/class/SC_Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ public static function setIncTaxToProducts(&$arrProducts)
*/
public static function setIncTaxToProduct(&$arrProduct, $rules = [])
{
// XXX 同一商品で規格ごとに税率も価格も異なり、税抜と税込で最小値、最大値の規格が変わるというケースは正確な処理ができない.
// このようなケースは希だと思われるため、実運用で発生する場合は以下のパッチを推奨
// https://github.com/EC-CUBE/eccube-2_13/issues/99#issuecomment-518100061
$arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_min'], $arrProduct['product_id'], SC_Product_Ex::findProductClassIdByRule('price01', $rules, 'min')) : null;
$arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_max'], $arrProduct['product_id'], SC_Product_Ex::findProductClassIdByRule('price01', $rules, 'max')) : null;
$arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_min'], $arrProduct['product_id'], SC_Product_Ex::findProductClassIdByRule('price02', $rules, 'min')) : null;
Expand Down
7 changes: 7 additions & 0 deletions tests/class/SC_Product/SC_Product_setIncTaxToProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public function findProductClassIdByRuleProvider()
3 => ['price01' => null, 'tax_rate' => 8, 'product_class_id' => 3],
],
'min', 0],
// see https://github.com/EC-CUBE/eccube-2_13/pull/298#issuecomment-522072546
// ['price02',
// [
// 1 => ['price02' => 1000, 'tax_rate' => 10, 'product_class_id' => 1],
// 2 => ['price02' => 1010, 'tax_rate' => 8, 'product_class_id' => 2],
// ],
// 'min', 1],
];
}

Expand Down

0 comments on commit 20d57e0

Please sign in to comment.