-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #240 [BUG] Credit memos and refund payment appears in different o…
…rder (clem21) This PR was merged into the 1.0-dev branch. Discussion ---------- Fixes #231 Commits ------- 1f96d2e Create CreditMemo repository to find order by Id and order them correctly 5160572 Add behat scenario 87eb341 Add return type to CreditMemoRepositoryInterface cf32dc9 Fix typo 8666f26 Fix typo c3a01cd applied Grzegorz's comments e8f4d0f Create new behat feature file
- Loading branch information
Showing
9 changed files
with
101 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@refunds | ||
Feature: Seeing credit memos in admin order view | ||
In order to see every credit memos related to one order | ||
As an Administrator | ||
I want to be able to see credit memos in admin order view | ||
|
||
Background: | ||
Given the store operates on a single green channel in "United States" | ||
And the store has "Galaxy Post" shipping method with "$10.00" fee | ||
And the store allows paying with "Space money" | ||
And the store has a product "PHP T-Shirt" priced at "$10.00" | ||
And the store has a product "Symfony Mug" priced at "$21.00" | ||
And there is a customer "[email protected]" that placed an order "#00000022" | ||
And the customer bought a "PHP T-Shirt" and a "Symfony Mug" | ||
And the customer "Rick Sanchez" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States" with identical billing address | ||
And the customer chose "Galaxy Post" shipping method with "Space money" payment | ||
And the order "#00000022" is already paid | ||
And I am logged in as an administrator | ||
|
||
|
||
@ui | ||
Scenario: Having all credit memos listed on the order page in ascending order | ||
Given the "#00000022" order's shipping cost already has a refund of "$4.50" with "Space money" payment | ||
And the 1st "PHP T-Shirt" product from order "#00000022" has a refund of "$5.50" with "Space money" payment | ||
When I view the summary of the order "#00000022" | ||
Then I should see the credit memo with "$4.50" total as 1st in the list | ||
And I should see the credit memo with "$5.50" total as 2nd in the list |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\RefundPlugin\Doctrine\ORM; | ||
|
||
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; | ||
use Sylius\RefundPlugin\Repository\CreditMemoRepositoryInterface; | ||
|
||
class CreditMemoRepository extends EntityRepository implements CreditMemoRepositoryInterface | ||
{ | ||
public function findByOrderId(string $orderId): array | ||
{ | ||
return $this->createQueryBuilder('o') | ||
->andWhere('o.order = :orderId') | ||
->addOrderBy('o.issuedAt', 'ASC') | ||
->setParameter('orderId', $orderId) | ||
->getQuery() | ||
->getResult() | ||
; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\RefundPlugin\Repository; | ||
|
||
use Sylius\Component\Resource\Repository\RepositoryInterface; | ||
|
||
interface CreditMemoRepositoryInterface extends RepositoryInterface | ||
{ | ||
public function findByOrderId(string $orderId): array; | ||
} |
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
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