Skip to content

Commit

Permalink
Add v1.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mhnkhalifa committed Nov 9, 2023
1 parent 3346687 commit 25d9cb8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
13 changes: 8 additions & 5 deletions Sales/Helper/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ public function getMiraklOrderTaxDetails($miraklOrder, $excludeStatuses = [Order
* Will return Mirakl order tax details like that:
* <code>
* [
* 'tax_code_1' => 13.78,
* 'tax_code_2' => 2.95,
* 'tax_code_3' => 0.19,
* 'tax_code_1' => ['amount' => 13.78, 'rate' => 10],
* 'tax_code_2' => ['amount' => 2.95, 'rate' => 5.5],
* 'tax_code_3' => ['amount' => 0.19, 'rate' => 8.9],
* ]
* </code>
*
Expand All @@ -218,9 +218,12 @@ public function getMiraklOrderTaxDetailsComputed($miraklOrder)
foreach ($orderLineTaxes as $taxDetails) {
foreach ($taxDetails as $code => $tax) {
if (!isset($result[$code])) {
$result[$code] = 0;
$result[$code] = [
'amount' => 0,
'rate' => $tax['rate'] ?? 0,
];
}
$result[$code] += $tax['amount'];
$result[$code]['amount'] += $tax['amount'];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sales/Helper/Order/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ public function priceIncludesTax($store = null)
{
return $this->magentoTaxHelper->priceIncludesTax($store);
}
}
}
10 changes: 5 additions & 5 deletions Sales/Model/Create/OrderTaxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ public function create(Order $order, ShopOrder $miraklOrder)
$orderTaxItemResource = $this->orderTaxItemResourceFactory->create();

// Save order taxes by code
foreach ($computedTaxes as $code => $amount) {
foreach ($computedTaxes as $code => $computedTax) {
$data = [
'order_id' => $order->getId(),
'code' => $code,
'title' => $code,
'hidden' => 0,
'percent' => 0,
'percent' => $computedTax['rate'],
'priority' => 0,
'position' => 0,
'process' => 0,
'amount' => $amount,
'base_amount' => $amount,
'base_real_amount' => $amount,
'amount' => $computedTax['amount'],
'base_amount' => $computedTax['amount'],
'base_real_amount' => $computedTax['amount'],
];

/** @var OrderTax $orderTax */
Expand Down
2 changes: 1 addition & 1 deletion Sales/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mirakl/connector-magento2-seller-sales",
"description": "This is the official Mirakl extension for sellers using Magento 2.",
"type": "magento2-module",
"version": "1.4.12",
"version": "1.4.13",
"license": "proprietary",
"require": {
"mirakl/connector-magento2-seller-core": "~1.2"
Expand Down
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": "mirakl/magento2-seller-connector",
"description": "This is the official Mirakl extension for sellers using Magento 2.",
"type": "magento2-component",
"version": "1.7.8",
"version": "1.7.9",
"license": "proprietary",
"require": {
"mirakl/sdk-php-shop": "^1.15"
Expand Down

0 comments on commit 25d9cb8

Please sign in to comment.