-
-
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 #264 Taxes displayed properly on credit memo (AdamKasp, GSadee)
This PR was merged into the 1.0-dev branch. Discussion ---------- Show Page: ![Screenshot 2021-03-13 at 11 59 36](https://user-images.githubusercontent.com/29897151/111027939-9e3cac00-83f3-11eb-80e0-6c1c014f6828.png) PDF: ![Screenshot 2021-03-13 at 12 00 58](https://user-images.githubusercontent.com/29897151/111027966-cfb57780-83f3-11eb-9328-9667ffc10bbe.png) TODO: - [x] implement behat context - [x] fix row with shipment tax value - [x] add subsums for net values and tax value - [x] refactor PDF view Commits ------- c547939 Behats scenarios e7f9af0 refactor tax rate provider 3f75385 refactor shipment line converter 757def6 Impletement behats c6415d4 Refactor taxRateProvider 0db1f05 extract logic to new provider - taxRateAmountProvider f1499ab refactor credit memo show page c0d818b update creditMemo pdf file f068570 minor CS fixes af6d25e Minor fixes in tax rate providers c418470 Remove unnecessary tax rate amount provider service 5167435 Refactor shipment line items converter 0d82b19 Add scenarios for viewing details of credit memo with included and excluded taxes a63ae1e Fix scenario for viewing detaild of credit memo with promotion applied
- Loading branch information
Showing
23 changed files
with
397 additions
and
124 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@refunds | ||
Feature: Viewing details of a credit memo | ||
Feature: Viewing details of a credit memo with taxes excluded from price | ||
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 | ||
|
@@ -9,12 +9,14 @@ Feature: Viewing details of a credit memo | |
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 has "VAT" tax rate of 20% for "Mugs" within the "US" zone | ||
And the store has "SHIPPING_VAT" tax rate of 15% for "Shipments" within the "US" zone | ||
And the store has "Galaxy Post" shipping method with "$10.00" fee within the "US" zone | ||
And shipping method "Galaxy Post" belongs to "Shipments" tax category | ||
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 the store has a product "Symfony Mug" priced at "$20.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" | ||
|
@@ -25,17 +27,21 @@ Feature: Viewing details of a credit memo | |
|
||
@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 | ||
Given all units and shipment 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 1 "Symfony Mug" product with "20.00" net value, "4.00" tax amount and "24.00" gross value in "USD" currency | ||
And it should contain 1 "Galaxy Post" shipment with "10.00" net value, "1.50" tax amount and "11.50" 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 | ||
And it should contain a tax item "15%" with amount "1.50" in "USD" currency | ||
And it should contain a tax item "20%" with amount "4.00" in "USD" currency | ||
And its total should be "46.50" in "USD" currency | ||
And its net total should be "40.00" | ||
And its tax total should be "6.50" | ||
|
||
@ui @application | ||
Scenario: Viewing details of a credit memo issued for a partial refund | ||
|
@@ -46,12 +52,16 @@ Feature: Viewing details of a credit memo | |
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 | ||
And its net total should be "5.00" | ||
And its tax total should be "0.50" | ||
|
||
@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 | ||
Given the "#00000022" order's shipping cost already has a refund of "$5.75" 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 contain 1 "Galaxy Post" shipment with "5.00" net value, "0.75" tax amount and "5.75" gross value in "USD" currency | ||
And it should be issued in "United States" channel | ||
And its total should be "4.50" in "USD" currency | ||
And its total should be "5.75" in "USD" currency | ||
And its net total should be "5.00" | ||
And its tax total should be "0.75" |
67 changes: 67 additions & 0 deletions
67
features/viewing_details_of_credit_memo_with_included_taxes.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,67 @@ | ||
@refunds | ||
Feature: Viewing details of a credit memo with taxes included in price | ||
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 included in price "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 included in price "SHIPPING_VAT" tax rate of 15% for "Shipments" within the "US" zone | ||
And the store has "Galaxy Post" shipping method with "$11.50" fee within the "US" zone | ||
And shipping method "Galaxy Post" belongs to "Shipments" tax category | ||
And the store allows paying with "Space money" | ||
And the store has a product "PHP T-Shirt" priced at "$11.00" | ||
And it belongs to "Clothes" tax category | ||
And the store has a product "Symfony Mug" priced at "$24.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 and shipment 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 "20.00" net value, "4.00" tax amount and "24.00" gross value in "USD" currency | ||
And it should contain 1 "Galaxy Post" shipment with "10.00" net value, "1.50" tax amount and "11.50" 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 "15%" with amount "1.50" in "USD" currency | ||
And it should contain a tax item "20%" with amount "4.00" in "USD" currency | ||
And its total should be "46.50" in "USD" currency | ||
And its net total should be "40.00" | ||
And its tax total should be "6.50" | ||
|
||
@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 | ||
And its net total should be "5.00" | ||
And its tax total should be "0.50" | ||
|
||
@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 "$5.75" 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 "5.00" net value, "0.75" tax amount and "5.75" gross value in "USD" currency | ||
And it should be issued in "United States" channel | ||
And its total should be "5.75" in "USD" currency | ||
And its net total should be "5.00" | ||
And its tax total should be "0.75" |
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 |
---|---|---|
|
@@ -11,11 +11,15 @@ Feature: Viewing details of a credit memo for order with a promotion applied | |
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 has included in price "SHIPPING_VAT" tax rate of 15% for "Shipments" within the "US" zone | ||
And the store has "Galaxy Post" shipping method with "$11.50" fee within the "US" zone | ||
And shipping method "Galaxy Post" belongs to "Shipments" tax category | ||
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 there is a promotion "Cheaper shipments" | ||
And it gives "50%" discount on shipping to every order | ||
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 | ||
|
@@ -24,13 +28,15 @@ Feature: Viewing details of a credit memo for order with a promotion applied | |
|
||
@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 | ||
Given all units and shipment 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 1 "Galaxy Post" shipment with "5.00" net value, "0.75" tax amount and "5.75" 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 | ||
And it should contain a tax item "15%" with amount "0.75" in "USD" currency | ||
And its total should be "45.36" 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
Oops, something went wrong.