Skip to content

Commit cbfaceb

Browse files
committed
Merge branch 'develop' into MAGETWO-31191
2 parents c8854d9 + ae383b5 commit cbfaceb

File tree

357 files changed

+4142
-1342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+4142
-1342
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ atlassian*
3232
/pub/media/theme/*
3333
/pub/media/theme_customization/*
3434
!/pub/media/theme_customization/.htaccess
35+
/pub/media/wysiwyg/*
36+
!/pub/media/wysiwyg/.htaccess
3537
/pub/media/tmp/*
3638
!/pub/media/tmp/.htaccess
3739
/pub/static/*

COPYING.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
22

33
http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
4-
Please see <insert file name of the OSL license> for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy.
4+
Please see LICENSE.txt for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy.
55

6-
Subject to Licensees payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
6+
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
77
Please see <insert file name of the MEE license> for the full text of the MEE License or visit http://magento.com/legal/terms/enterprise.

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ protected function calculateDynamicBundleAmount($basePriceValue, $bundleProduct,
314314

315315
/** @var Store $store */
316316
$store = $bundleProduct->getStore();
317-
$roundingMethod = $this->taxHelper->getCalculationAgorithm($store);
317+
$roundingMethod = $this->taxHelper->getCalculationAlgorithm($store);
318318
foreach ($amountList as $amountInfo) {
319319
/** @var \Magento\Framework\Pricing\Amount\AmountInterface $itemAmount */
320320
$itemAmount = $amountInfo['amount'];

app/code/Magento/Catalog/Model/Product.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,10 @@ public function afterSave()
777777
*/
778778
public function setQty($qty)
779779
{
780-
$this->setData('qty', $qty);
781-
$this->reloadPriceInfo();
780+
if ($this->getData('qty') != $qty) {
781+
$this->setData('qty', $qty);
782+
$this->reloadPriceInfo();
783+
}
782784
return $this;
783785
}
784786

app/code/Magento/Directory/Model/PriceCurrency.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,12 @@ public function convert($amount, $scope = null, $currency = null)
5858
}
5959

6060
/**
61-
* Convert and round price value for specified store or passed currency
62-
*
63-
* @param float $amount
64-
* @param null|string|bool|int|\Magento\Store\Model\Store $store
65-
* @param Currency|string|null $currency
66-
* @param int $precision
67-
* @return float
61+
* {@inheritdoc}
6862
*/
69-
public function convertAndRound($amount, $store = null, $currency = null, $precision = self::DEFAULT_PRECISION)
63+
public function convertAndRound($amount, $scope = null, $currency = null, $precision = self::DEFAULT_PRECISION)
7064
{
71-
$currentCurrency = $this->getCurrency($store, $currency);
72-
$convertedValue = $this->getStore($store)->getBaseCurrency()->convert($amount, $currentCurrency);
65+
$currentCurrency = $this->getCurrency($scope, $currency);
66+
$convertedValue = $this->getStore($scope)->getBaseCurrency()->convert($amount, $currentCurrency);
7367
return round($convertedValue, $precision);
7468
}
7569

app/code/Magento/Sales/Model/Order/Invoice/Total/Subtotal.php

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,15 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice)
3737

3838
$allowedSubtotal = $order->getSubtotal() - $order->getSubtotalInvoiced();
3939
$baseAllowedSubtotal = $order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced();
40-
$allowedSubtotalInclTax = $allowedSubtotal +
41-
$order->getHiddenTaxAmount() +
42-
$order->getTaxAmount() -
43-
$order->getTaxInvoiced() -
44-
$order->getHiddenTaxInvoiced();
45-
$baseAllowedSubtotalInclTax = $baseAllowedSubtotal +
46-
$order->getBaseHiddenTaxAmount() +
47-
$order->getBaseTaxAmount() -
48-
$order->getBaseTaxInvoiced() -
49-
$order->getBaseHiddenTaxInvoiced();
50-
51-
/**
52-
* Check if shipping tax calculation is included to current invoice.
53-
*/
54-
$includeShippingTax = true;
55-
foreach ($invoice->getOrder()->getInvoiceCollection() as $previousInvoice) {
56-
if ($previousInvoice->getShippingAmount() && !$previousInvoice->isCanceled()) {
57-
$includeShippingTax = false;
58-
break;
59-
}
60-
}
61-
62-
if ($includeShippingTax) {
63-
$allowedSubtotalInclTax -= $order->getShippingTaxAmount();
64-
$baseAllowedSubtotalInclTax -= $order->getBaseShippingTaxAmount();
65-
} else {
66-
$allowedSubtotalInclTax += $order->getShippingHiddenTaxAmount();
67-
$baseAllowedSubtotalInclTax += $order->getBaseShippingHiddenTaxAmount();
68-
}
40+
//Note: The $subtotalInclTax and $baseSubtotalInclTax are not adjusted from those provide by the line items
41+
//because the "InclTax" is displayed before any tax adjustments based on discounts, shipping, etc.
6942

7043
if ($invoice->isLast()) {
7144
$subtotal = $allowedSubtotal;
7245
$baseSubtotal = $baseAllowedSubtotal;
73-
$subtotalInclTax = $allowedSubtotalInclTax;
74-
$baseSubtotalInclTax = $baseAllowedSubtotalInclTax;
7546
} else {
7647
$subtotal = min($allowedSubtotal, $subtotal);
7748
$baseSubtotal = min($baseAllowedSubtotal, $baseSubtotal);
78-
$subtotalInclTax = min($allowedSubtotalInclTax, $subtotalInclTax);
79-
$baseSubtotalInclTax = min($baseAllowedSubtotalInclTax, $baseSubtotalInclTax);
8049
}
8150

8251
$invoice->setSubtotal($subtotal);

app/code/Magento/Tax/Helper/Data.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ public function getCalculationSequence($store = null)
629629
* @param null|string|bool|int|Store $store
630630
* @return string
631631
*/
632-
public function getCalculationAgorithm($store = null)
632+
public function getCalculationAlgorithm($store = null)
633633
{
634634
return $this->_config->getAlgorithm($store);
635635
}
@@ -797,23 +797,6 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface
797797

798798
$orderTaxDetails = $this->orderTaxManagement->getOrderTaxDetails($order->getId());
799799

800-
// Apply any taxes for shipping
801-
$shippingTaxAmount = $salesItem->getShippingTaxAmount();
802-
$originalShippingTaxAmount = $order->getShippingTaxAmount();
803-
if ($shippingTaxAmount && $originalShippingTaxAmount &&
804-
$shippingTaxAmount != 0 && floatval($originalShippingTaxAmount)
805-
) {
806-
//An invoice or credit memo can have a different qty than its order
807-
$shippingRatio = $shippingTaxAmount / $originalShippingTaxAmount;
808-
$itemTaxDetails = $orderTaxDetails->getItems();
809-
foreach ($itemTaxDetails as $itemTaxDetail) {
810-
//Aggregate taxable items associated with shipping
811-
if ($itemTaxDetail->getType() == \Magento\Quote\Model\Quote\Address::TYPE_SHIPPING) {
812-
$taxClassAmount = $this->_aggregateTaxes($taxClassAmount, $itemTaxDetail, $shippingRatio);
813-
}
814-
}
815-
}
816-
817800
// Apply any taxes for the items
818801
/** @var $item \Magento\Sales\Model\Order\Invoice\Item|\Magento\Sales\Model\Order\Creditmemo\Item */
819802
foreach ($salesItem->getItems() as $item) {
@@ -845,6 +828,23 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface
845828
}
846829
}
847830

831+
// Apply any taxes for shipping
832+
$shippingTaxAmount = $salesItem->getShippingTaxAmount();
833+
$originalShippingTaxAmount = $order->getShippingTaxAmount();
834+
if ($shippingTaxAmount && $originalShippingTaxAmount &&
835+
$shippingTaxAmount != 0 && floatval($originalShippingTaxAmount)
836+
) {
837+
//An invoice or credit memo can have a different qty than its order
838+
$shippingRatio = $shippingTaxAmount / $originalShippingTaxAmount;
839+
$itemTaxDetails = $orderTaxDetails->getItems();
840+
foreach ($itemTaxDetails as $itemTaxDetail) {
841+
//Aggregate taxable items associated with shipping
842+
if ($itemTaxDetail->getType() == \Magento\Quote\Model\Quote\Address::TYPE_SHIPPING) {
843+
$taxClassAmount = $this->_aggregateTaxes($taxClassAmount, $itemTaxDetail, $shippingRatio);
844+
}
845+
}
846+
}
847+
848848
return $taxClassAmount;
849849
}
850850
}

app/code/Magento/Tax/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function getNeedUseShippingExcludeTax()
270270
}
271271

272272
/**
273-
* Get defined tax calculation agorithm
273+
* Get defined tax calculation algorithm
274274
*
275275
* @param null|string|bool|int|Store $store
276276
* @return string

app/code/Magento/Tax/Model/Observer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public function updateProductOptions(\Magento\Framework\Event\Observer $observer
300300
return $this;
301301
}
302302

303-
$algorithm = $this->_taxData->getCalculationAgorithm();
303+
$algorithm = $this->_taxData->getCalculationAlgorithm();
304304
$options['calculationAlgorithm'] = $algorithm;
305305
// prepare correct template for options render
306306
if ($this->_taxData->displayBothPrices()) {

app/code/Magento/Theme/Block/Html/Topmenu.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function getHtml($outermostClass = '', $childrenWrapClass = '', $limit =
6262
'page_block_html_topmenu_gethtml_after',
6363
['menu' => $this->_menu, 'transportObject' => $transportObject]
6464
);
65+
$html = $transportObject->getHtml();
6566

6667
return $html;
6768
}

0 commit comments

Comments
 (0)