diff --git a/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php b/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php index 2e230c870bef..420176d1d9fa 100644 --- a/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php +++ b/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php @@ -1,7 +1,21 @@ isPurchaseOrderQuote($subject) && !$subject->getIsVirtual()) { - return $subject; + if (!$this->isPurchaseOrderQuote($subject) || $subject->getIsVirtual()) { + return $proceed(); + } + + if ($subject->getIsActive() && $subject->getTotalsCollectedFlag()) { + $items = $subject->getItems(); + if (is_array($items) && (float)$items[0]->getData('tax_amount') > 0) { + $subject->setTotalsCollectedFlag(false); + return $proceed(); + } } - return $proceed(); + + return $subject; } /**