-
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.
feature #179 [CreditMemo] Rework credit memo (GSadee)
This PR was merged into the 1.0-dev branch. Discussion ---------- ![image](https://user-images.githubusercontent.com/6140884/73335650-49ca8180-4270-11ea-8d50-79749456f915.png) <img width="1408" alt="Zrzut ekranu 2020-01-25 o 20 20 49" src="https://user-images.githubusercontent.com/6140884/73159645-3fc94700-40e7-11ea-895f-57a5374b4cd2.png"> Commits ------- 76445f2 [Behat][CreditMemo] Update scenarios for generating credit memos a34b8ad [Behat][CreditMemo] Scenarios fixes after PR review ad5c265 [CreditMemo] Change credit memo units to be resource line items e6c7706 [CreditMemo] Add notes to UPGRADE file 981220d [Behat][CreditMemo] Fixes f62c77d [CreditMemo] Fixes for reworking credit memos after PR review
- Loading branch information
Showing
50 changed files
with
1,227 additions
and
775 deletions.
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
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 |
---|---|---|
|
@@ -7,62 +7,19 @@ Feature: Having credit memo generated | |
Background: | ||
Given the store operates on a single green channel in "United States" | ||
And channel "United States" billing data is "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles", "United States" with "1100110011" tax ID | ||
And default tax zone is "US" | ||
And the store has "US VAT" tax rate of 10% for "Clothes" within the "US" zone | ||
And the store has a product "Mr. Meeseeks T-Shirt" priced at "$10.00" | ||
And it belongs to "Clothes" tax category | ||
And the store has a product "PHP T-Shirt" priced at "$10.00" | ||
And the store has "Galaxy Post" shipping method with "$10.00" fee | ||
And the store allows paying with "Space money" | ||
And there is a promotion "Anatomy Park Promotion" | ||
And this promotion gives "$1.00" off on every product with minimum price at "$5.00" | ||
And there is a customer "[email protected]" that placed an order "#00000022" | ||
And the customer bought 2 "Mr. Meeseeks T-Shirt" products | ||
And the customer bought 2 "PHP T-Shirt" products | ||
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 there is a customer "[email protected]" that placed an order "#00000023" | ||
And the customer bought 2 "Mr. Meeseeks T-Shirt" products | ||
And the customer "Morty Smith" addressed it to "Main St.", "90100" "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 "#00000023" is already paid | ||
And I am logged in as an administrator | ||
And the order "#00000022" is already paid | ||
And I am logged in as an administrator | ||
|
||
@ui @application | ||
Scenario: Having credit memo generated after refund process | ||
When I want to refund some units of order "#00000022" | ||
And I decide to refund 1st "Mr. Meeseeks T-Shirt" product with "Space money" payment | ||
And I decide to refund 1st "PHP T-Shirt" product with "Space money" payment | ||
Then I should be notified that selected order units have been successfully refunded | ||
And I should have 1 credit memo generated for order "#00000022" | ||
|
||
@ui @application | ||
Scenario: Seeing the details of generated credit memo | ||
Given all units from the order "#00000022" are refunded with "Space money" payment | ||
And I browse the details of the only credit memo generated for order "#00000022" | ||
And it should have sequential number generated from current date | ||
Then this credit memo should contain 2 "Mr. Meeseeks T-Shirt" products with "$0.90" tax applied | ||
And it should be issued in "United States" channel | ||
And it should be issued from "Rick Sanchez", "Seaside Fwy", "90802" "Los Angeles" in the "United States" | ||
And it should be issued to "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles" in the "United States" with "1100110011" tax ID | ||
And its subtotal should be "$18.00" | ||
And it should have a tax item "US VAT (10%)" with amount "$1.80" | ||
And its total should be "$19.80" | ||
|
||
@ui @application | ||
Scenario: Seeing the details of generated credit memo with partial price | ||
Given 1st "Mr. Meeseeks T-Shirt" product from order "#00000022" has already "$5.50" refunded with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000022" | ||
And it should have sequential number generated from current date | ||
Then this credit memo should contain 1 "Mr. Meeseeks T-Shirt" product with "$0.50" tax applied | ||
And it should be issued in "United States" channel | ||
And its subtotal should be "$5.00" | ||
And it should have a tax item "US VAT (10%)" with amount "$0.50" | ||
And its total should be "$5.50" | ||
|
||
@ui @application | ||
Scenario: Seeing the details of generated credit memo with partial shipment price | ||
Given shipment from order "#00000023" has already "$4.50" refunded with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000023" | ||
And it should have sequential number generated from current date | ||
Then this credit memo should contain 1 "Galaxy Post" shipment with "$4.50" total | ||
And it should be issued in "United States" channel | ||
And its total should be "$4.50" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@refunds | ||
Feature: Viewing details of a credit memo | ||
In order to be aware of what order units have been refunded | ||
As an Administrator | ||
I want to be able to view details of a credit memo | ||
|
||
Background: | ||
Given the store operates on a single green channel in "United States" | ||
And channel "United States" billing data is "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles", "United States" with "1100110011" tax ID | ||
And default tax zone is "US" | ||
And the store has "US VAT" tax rate of 10% for "Clothes" within the "US" zone | ||
And the store has included in price "VAT" tax rate of 20% for "Mugs" within the "US" zone | ||
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 it belongs to "Clothes" tax category | ||
And the store has a product "Symfony Mug" priced at "$21.00" | ||
And it belongs to "Mugs" tax category | ||
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 @application | ||
Scenario: Viewing details of a credit memo issued for a full refund | ||
Given all units from the order "#00000022" are refunded with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000022" | ||
Then it should have sequential number generated from current date | ||
And it should be issued in "United States" channel | ||
And it should be issued to "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles" in the "United States" with "1100110011" tax ID | ||
And it should be issued from "Rick Sanchez", "Seaside Fwy", "90802" "Los Angeles" in the "United States" | ||
And it should contain 1 "PHP T-Shirt" product with "10.00" net value, "1.00" tax amount and "11.00" gross value in "USD" currency | ||
And it should contain 1 "Symfony Mug" product with "17.50" net value, "3.50" tax amount and "21.00" gross value in "USD" currency | ||
And it should contain a tax item "10%" with amount "1.00" in "USD" currency | ||
And it should contain a tax item "20%" with amount "3.50" in "USD" currency | ||
And its total should be "32.00" in "USD" currency | ||
|
||
@ui @application | ||
Scenario: Viewing details of a credit memo issued for a partial refund | ||
Given the 1st "PHP T-Shirt" product from order "#00000022" has a refund of "$5.50" with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000022" | ||
Then it should have sequential number generated from current date | ||
And it should be issued in "United States" channel | ||
And it should contain 1 "PHP T-Shirt" product with "5.00" net value, "0.50" tax amount and "5.50" gross value in "USD" currency | ||
And it should contain a tax item "10%" with amount "0.50" in "USD" currency | ||
And its total should be "5.50" in "USD" currency | ||
|
||
@ui @application | ||
Scenario: Viewing details of a credit memo issued for a partial shipping cost refund | ||
Given the "#00000022" order's shipping cost already has a refund of "$4.50" with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000022" | ||
Then it should have sequential number generated from current date | ||
And it should contain 1 "Galaxy Post" shipment with "4.50" gross value in "USD" currency | ||
And it should be issued in "United States" channel | ||
And its total should be "4.50" in "USD" currency |
36 changes: 36 additions & 0 deletions
36
features/viewing_details_of_credit_memo_with_promotion_applied.feature
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,36 @@ | ||
@refunds | ||
Feature: Viewing details of a credit memo for order with a promotion applied | ||
In order to be aware of what order units have been refunded | ||
As an Administrator | ||
I want to be able to view details of a credit memo | ||
|
||
Background: | ||
Given the store operates on a single green channel in "United States" | ||
And channel "United States" billing data is "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles", "United States" with "1100110011" tax ID | ||
And default tax zone is "US" | ||
And the store has "US VAT" tax rate of 10% for "Clothes" within the "US" zone | ||
And the store has a product "PHP T-Shirt" priced at "$10.00" | ||
And it belongs to "Clothes" tax category | ||
And the store has "Galaxy Post" shipping method with "$10.00" fee | ||
And the store allows paying with "Space money" | ||
And there is a promotion "Anatomy Park Promotion" | ||
And this promotion gives "$3.99" discount to every order with quantity at least 4 | ||
And there is a customer "[email protected]" that placed an order "#00000022" | ||
And the customer bought 4 "PHP T-Shirt" products | ||
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 @application | ||
Scenario: Viewing details of a credit memo issued for an order with a promotion applied | ||
Given all units from the order "#00000022" are refunded with "Space money" payment | ||
When I browse the details of the only credit memo generated for order "#00000022" | ||
Then it should have sequential number generated from current date | ||
And it should be issued in "United States" channel | ||
And it should be issued to "Haas & Milan", "Pacific Coast Hwy", "90003" "Los Angeles" in the "United States" with "1100110011" tax ID | ||
And it should be issued from "Rick Sanchez", "Seaside Fwy", "90802" "Los Angeles" in the "United States" | ||
And it should contain 3 "PHP T-Shirt" products with "27.00" net value, "2.70" tax amount and "29.70" gross value in "USD" currency | ||
And it should contain 1 "PHP T-Shirt" product with "9.01" net value, "0.90" tax amount and "9.91" gross value in "USD" currency | ||
And it should contain a tax item "10%" with amount "3.60" in "USD" currency | ||
And its total should be "39.61" in "USD" currency |
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20200125182414 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('CREATE TABLE sylius_refund_credit_memo_line_items (credit_memo_id VARCHAR(255) NOT NULL, line_item_id INT NOT NULL, INDEX IDX_1453B90E8E574316 (credit_memo_id), UNIQUE INDEX UNIQ_1453B90EA7CBD339 (line_item_id), PRIMARY KEY(credit_memo_id, line_item_id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('CREATE TABLE sylius_refund_line_item (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, quantity INT NOT NULL, unit_net_price INT NOT NULL, unit_gross_price INT NOT NULL, net_value INT NOT NULL, gross_value INT NOT NULL, tax_amount INT NOT NULL, tax_rate VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('ALTER TABLE sylius_refund_credit_memo_line_items ADD CONSTRAINT FK_1453B90E8E574316 FOREIGN KEY (credit_memo_id) REFERENCES sylius_refund_credit_memo (id)'); | ||
$this->addSql('ALTER TABLE sylius_refund_credit_memo_line_items ADD CONSTRAINT FK_1453B90EA7CBD339 FOREIGN KEY (line_item_id) REFERENCES sylius_refund_line_item (id)'); | ||
$this->addSql('ALTER TABLE sylius_refund_credit_memo DROP units'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('ALTER TABLE sylius_refund_credit_memo_line_items DROP FOREIGN KEY FK_1453B90EA7CBD339'); | ||
$this->addSql('DROP TABLE sylius_refund_credit_memo_line_items'); | ||
$this->addSql('DROP TABLE sylius_refund_line_item'); | ||
$this->addSql('ALTER TABLE sylius_refund_credit_memo ADD units LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:json)\''); | ||
} | ||
} |
Oops, something went wrong.