Skip to content

Commit

Permalink
6.14.2 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Sep 30, 2021
1 parent f3fbbbd commit dd62ddd
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 24 deletions.
10 changes: 9 additions & 1 deletion app/code/community/Ess/M2ePro/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
* 6.14.1 (r16362) (14/07/2021)
* 6.14.2 (30/09/2021)

[eBay] [Fixed] eBay order was not refunded as per Magento credit memo creation [#1220]
[eBay] [Fixed] Magento Order was not created. Reason: Warning: A non-numeric value encountered [#2594]
[Amazon] [Fixed] Different Grand Totals in Amazon and Magento orders for Grouped Products listed as Set [#1218]
[Amazon] [Fixed] Internal Server Error(s) [Marketplace ID is not valid. It differs from the current.] occurs when trying to update the MWS token [#1215]
[Amazon] [Improved] Self-upload of Amazon invoices without receiving and checking the results of the GetFeedSubmissionResult command [#2939]

* 6.14.1 (r16362) (14/07/2021)

[Common] [Improved] Display shipping service in the beginning of the line in Magento Orders [M1-1354]
[Ebay] [Fixed] Magento Order was not created. Reason: Notice: Undefined index: delivery_date [M1-1361]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ class Ess_M2ePro_Model_Amazon_Connector_Account_Update_EntityRequester

public function getRequestData()
{
return $this->_params;
/** @var $marketplaceObject Ess_M2ePro_Model_Marketplace */
$marketplaceObject = Mage::helper('M2ePro/Component_Amazon')->getCachedObject(
'Marketplace', $this->_params['marketplace_id']
);

return array(
'merchant_id' => $this->_params['merchant_id'],
'token' => $this->_params['token'],
'marketplace_id' => $marketplaceObject->getNativeId(),
);
}

protected function getCommand()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ class Ess_M2ePro_Model_Cron_Task_Amazon_Order_SendInvoice
extends Ess_M2ePro_Model_Cron_Task_Abstract
{
const NICK = 'amazon/order/send_invoice';
const ORDER_CHANGES_PER_ACCOUNT = 100;

/** ~4-10 seconds on call, ~5-10 invoices per minute, 50 requests in 10 minutes */
const LIMIT_ORDER_CHANGES = 50;

/** @var int $_interval (in seconds) */
protected $_interval = 600;

protected $_maxOrderChangesPerTask = 0;

//####################################

Expand Down Expand Up @@ -56,6 +63,10 @@ protected function performActions()
foreach ($permittedAccounts as $account) {
/** @var Ess_M2ePro_Model_Account $account */

if ($this->_maxOrderChangesPerTask === self::LIMIT_ORDER_CHANGES) {
break;
}

$this->getOperationHistory()->addText('Starting account "' . $account->getTitle() . '"');

$this->getOperationHistory()->addTimePoint(
Expand Down Expand Up @@ -399,9 +410,11 @@ protected function getRelatedChanges(Ess_M2ePro_Model_Account $account)
array()
);
$changesCollection->addFieldToFilter('pl.id', array('null' => true));
$changesCollection->getSelect()->limit(self::ORDER_CHANGES_PER_ACCOUNT);
$changesCollection->getSelect()->limit(self::LIMIT_ORDER_CHANGES);
$changesCollection->getSelect()->group(array('order_id'));

$this->_maxOrderChangesPerTask += $changesCollection->count();

return $changesCollection->getItems();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function processAccount(Ess_M2ePro_Model_Account $account)
);
$dispatcherObject->process($connectorObj);

$cancelResponseData = $connectorObj->getRequestData();
$cancelResponseData = $connectorObj->getResponseData();

if (!$cancelResponseData['result'] && $cancelResponseData['cancelId'] === null) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @copyright M2E LTD
* @license Commercial use is forbidden
*/
use Ess_M2ePro_Model_Order_Change as Change;

class Ess_M2ePro_Model_Cron_Task_Ebay_Order_Update extends Ess_M2ePro_Model_Cron_Task_Abstract
{
Expand Down Expand Up @@ -101,6 +102,8 @@ protected function getRelatedChanges(Ess_M2ePro_Model_Account $account)
$changesCollection = Mage::getModel('M2ePro/Order_Change')->getCollection();
$changesCollection->addAccountFilter($account->getId());
$changesCollection->addProcessingAttemptDateFilter();
$changesCollection->addFieldToFilter('action', ['in' => [Change::ACTION_UPDATE_SHIPPING,
Change::ACTION_UPDATE_PAYMENT]]);
$changesCollection->setPageSize(self::MAX_UPDATES_PER_TIME);
$changesCollection->getSelect()->group(array('order_id'));

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Model/Ebay/Order/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ protected function hasUpdatedCancellationStatus()
$oldStatus = $this->_order->getChildObject()->getData('cancellation_status');
$newStatus = $this->getData('cancellation_status');

if ($newStatus == 0 && ($oldStatus != $newStatus)) {
if ($newStatus == 1 && ($oldStatus != $newStatus)) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Model/Ebay/Order/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ protected function getShippingPrice()
{
if ($this->_order->isUseGlobalShippingProgram()) {
$globalShippingDetails = $this->_order->getGlobalShippingDetails();
$price = $globalShippingDetails['service_details']['price'];
$price = (float)$globalShippingDetails['service_details']['price'];
} else {
$price = $this->_order->getShippingPrice();
}
Expand Down
5 changes: 1 addition & 4 deletions app/code/community/Ess/M2ePro/Model/Magento/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,18 @@ protected function initializeQuoteItems()
// ---------------------------------------

foreach ($products as $associatedProduct) {

$item->setQty($associatedProduct->getQty() * $item->getOriginalQty());

$productPriceInSetPercent = ($associatedProduct->getPrice() / $totalPrice) * 100;
$productPriceInItem = (($item->getOriginalPrice() * $productPriceInSetPercent) / 100);
$item->setPrice($productPriceInItem / $associatedProduct->getQty());

$associatedProduct->setTaxClassId($product->getTaxClassId());

$quoteItemBuilder->init($this->_quote, $item);

$this->initializeQuoteItem(
$item,
$quoteItemBuilder,
$associatedProduct,
$quoteItemBuilder->setTaxClassIntoProduct($associatedProduct),
$quoteItemBuilder->getRequest()
);
}
Expand Down
21 changes: 11 additions & 10 deletions app/code/community/Ess/M2ePro/Model/Magento/Quote/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ public function getProduct()
}

// tax class id should be set before price calculation
$this->_product->setTaxClassId($this->getProductTaxClassId());

return $this->_product;
return $this->setTaxClassIntoProduct($this->_product);
}

// ---------------------------------------
Expand All @@ -78,7 +76,10 @@ protected function getAssociatedGroupedProduct()

//########################################

protected function getProductTaxClassId()
/**
* @return Mage_Catalog_Model_Product
*/
public function setTaxClassIntoProduct(Mage_Catalog_Model_Product $product)
{
$proxyOrder = $this->_proxyItem->getProxyOrder();
$itemTaxRate = $this->_proxyItem->getTaxRate();
Expand All @@ -93,14 +94,14 @@ protected function getProductTaxClassId()
|| ($proxyOrder->isTaxModeMagento() && !$hasRatesForCountry && !$calculationBasedOnOrigin)
|| ($proxyOrder->isTaxModeMixed() && $itemTaxRate <= 0 && $isOrderHasTax)
) {
return Ess_M2ePro_Model_Magento_Product::TAX_CLASS_ID_NONE;
return $product->setTaxClassId(Ess_M2ePro_Model_Magento_Product::TAX_CLASS_ID_NONE);
}

if ($proxyOrder->isTaxModeMagento()
|| $itemTaxRate <= 0
|| $itemTaxRate == $this->getProductTaxRate()
|| $itemTaxRate == $this->getProductTaxRate($product->getTaxClassId())
) {
return $this->getProduct()->getTaxClassId();
return $product;
}

// Create tax rule according to channel tax rate
Expand All @@ -117,10 +118,10 @@ protected function getProductTaxClassId()
$productTaxClasses = $taxRule->getProductTaxClasses();
// ---------------------------------------

return array_shift($productTaxClasses);
return $product->setTaxClassId(array_shift($productTaxClasses));
}

protected function getProductTaxRate()
protected function getProductTaxRate($productTaxClassId)
{
/** @var $taxCalculator Mage_Tax_Model_Calculation */
$taxCalculator = Mage::getSingleton('tax/calculation');
Expand All @@ -131,7 +132,7 @@ protected function getProductTaxRate()
$this->_quote->getCustomerTaxClassId(),
$this->_quote->getStore()
);
$request->setProductClassId($this->getProduct()->getTaxClassId());
$request->setProductClassId($productTaxClassId);

return $taxCalculator->getRate($request);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "m2epro/magento1-extension",
"description": "M2E Pro is a Magento trusted (TM), award-winning extension, which allows merchants of all sizes to fully integrate Magento based system(s) into eBay/Amazon/Walmart platforms.",
"type": "magento-module",
"version": "6.14.1",
"version": "6.14.2",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://www.m2epro.com/",
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Ess_M2ePro>
<version>6.14.1</version>
<version>6.14.2</version>
</Ess_M2ePro>
</modules>
<default>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* @author M2E Pro Developers Team
* @copyright M2E LTD
* @license Commercial use is forbidden
*/

class Ess_M2ePro_Sql_Upgrade_v6_14_1__v6_14_2_Config extends Ess_M2ePro_Model_Upgrade_Feature_AbstractConfig
{
//########################################

public function getFeaturesList()
{
return array();
}

//########################################
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "m2epro/magento1-extension",
"description": "M2E Pro is a Magento trusted (TM), award-winning extension, which allows merchants of all sizes to fully integrate Magento based system(s) into eBay/Amazon/Walmart platforms.",
"type": "magento-module",
"version": "6.14.1",
"version": "6.14.2",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://www.m2epro.com/",
Expand Down

0 comments on commit dd62ddd

Please sign in to comment.