-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
受注編集の画面で、金額にエラーがあると、課税区分のカッコ内が表示されなくなる 不具合の修正 #5761
Merged
+87
−21
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
57a8331
Fix issues/5753
maianhtu010596 187aa6e
Merge remote-tracking branch 'upstream/4.2' into issues/5753
shinya 6eacc4a
Merge remote-tracking branch 'upstream/4.2' into issues/5753
shinya 54ea12e
OrderHelperに処理を移動
shinya c346f0f
TaxProcessorも共通化
shinya 4f54e2b
テストの追加
shinya 02eea0b
テストをDataProviderを使う形式へ変更
shinya f18e9a0
間違い部分を修正
shinya d5af7f9
phpstan指摘事項を反映
shinya ceb90dd
削除したfunctionを互換性維持のため復帰
shinya 8b33dcf
処理の移譲を反映と誤記を修正
shinya 99b20b4
deprecatedの追加
shinya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
use Eccube\Service\PurchaseFlow\ItemHolderPreprocessor; | ||
use Eccube\Service\PurchaseFlow\PurchaseContext; | ||
use Eccube\Service\TaxRuleService; | ||
use Eccube\Service\OrderHelper; | ||
|
||
class TaxProcessor implements ItemHolderPreprocessor | ||
{ | ||
|
@@ -41,6 +42,11 @@ class TaxProcessor implements ItemHolderPreprocessor | |
*/ | ||
protected $taxRuleService; | ||
|
||
/** | ||
* @var OrderHelper | ||
*/ | ||
protected $orderHelper; | ||
|
||
/** | ||
* TaxProcessor constructor. | ||
* | ||
|
@@ -50,11 +56,13 @@ class TaxProcessor implements ItemHolderPreprocessor | |
public function __construct( | ||
EntityManagerInterface $entityManager, | ||
TaxRuleRepository $taxRuleRepository, | ||
TaxRuleService $taxRuleService | ||
TaxRuleService $taxRuleService, | ||
OrderHelper $orderHelper | ||
) { | ||
$this->entityManager = $entityManager; | ||
$this->taxRuleRepository = $taxRuleRepository; | ||
$this->taxRuleService = $taxRuleService; | ||
$this->orderHelper = $orderHelper; | ||
} | ||
|
||
/** | ||
|
@@ -77,7 +85,7 @@ public function process(ItemHolderInterface $itemHolder, PurchaseContext $contex | |
$item->setTaxType($this->getTaxType($OrderItemType)); | ||
} | ||
if (!$item->getTaxDisplayType()) { | ||
$item->setTaxDisplayType($this->getTaxDisplayType($OrderItemType)); | ||
$item->setTaxDisplayType($this->orderHelper->getTaxDisplayType($OrderItemType)); | ||
} | ||
|
||
// 税区分: 非課税, 不課税 | ||
|
@@ -152,28 +160,12 @@ protected function getTaxType($OrderItemType) | |
* - ポイント値引き: 税込 | ||
* | ||
* @param $OrderItemType | ||
* @deprecated OrderHelper::getTaxDisplayTypeを使用してください | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deprecatedのアノテーションを追加お願いします。
|
||
* @return TaxType | ||
* @return TaxDisplayType | ||
*/ | ||
protected function getTaxDisplayType($OrderItemType) | ||
kiy0taka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
if ($OrderItemType instanceof OrderItemType) { | ||
$OrderItemType = $OrderItemType->getId(); | ||
} | ||
|
||
switch ($OrderItemType) { | ||
case OrderItemType::PRODUCT: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::EXCLUDED); | ||
case OrderItemType::DELIVERY_FEE: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::INCLUDED); | ||
case OrderItemType::DISCOUNT: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::EXCLUDED); | ||
case OrderItemType::CHARGE: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::INCLUDED); | ||
case OrderItemType::POINT: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::INCLUDED); | ||
default: | ||
return $this->entityManager->find(TaxDisplayType::class, TaxDisplayType::EXCLUDED); | ||
} | ||
return $this->orderHelper->getTaxDisplayType($OrderItemType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shinya
phpstanの指摘修正お願いします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
メンバ変数の宣言が漏れている、という指摘であってますでしょうか?
そちら反映いたしました(認識違いあればおっしゃってください。)