Merge pull request #9442 from jibees/8904-display-fees-name-instead-of-type-on-invoices

Display fees name instead of type on invoices
This commit is contained in:
Maikel
2022-10-10 13:15:01 +11:00
committed by GitHub
8 changed files with 24 additions and 45 deletions

View File

@@ -215,7 +215,8 @@ describe '
it "displays GST for enterprise fees" do
pending "ii) for legend see picture on PR #9495"
# enterprise fee of $20.00
expect(page).to have_content "Admin & Handling 1 $20.00 $120.00"
expect(page).to have_content "Whole order - #{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} 1 $20.00 (included) $120.00"
end
it "displays the taxes correctly" do
@@ -225,7 +226,8 @@ describe '
expect(page).to have_content "#{Spree::Product.second.name} 3 $250.08 $1,500.45"
expect(page).to have_content "(1g)" # display as
# Enterprise fee
expect(page).to have_content "Admin & Handling 1 $120.00"
expect(page).to have_content "Whole order - #{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} 1 $15.65 (included) $120.00"
# Shipping
expect(page).to have_content "Shipping 1 $9.14 (included) $100.55"
# Order Totals
@@ -257,7 +259,8 @@ describe '
expect(page).to have_content "(1g)" # display as
expect(page).to have_content "3 $500.15 $1,500.45 20.0%"
# Enterprise fee
expect(page).to have_content "Admin & Handling $120.00"
expect(page).to have_content "#{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} $120.00"
# Shipping
expect(page).to have_content "Shipping $100.55 10.0%"
# Tax totals
@@ -357,14 +360,16 @@ describe '
it "displays GST for enterprise fees" do
pending "v) for legend see picture on PR #9495"
# enterprise fee of $24.00
expect(page).to have_content "Admin & Handling 1 $20.00 $120.00"
expect(page).to have_content "Whole order - #{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} 1 $20.00 $120.00"
end
it "displays the taxes correctly" do
# header
expect(page).to have_content "Item Qty GST Price"
# Enterprise fee
expect(page).to have_content "Admin & Handling 1 $120.00"
expect(page).to have_content "Whole order - #{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} 1 $18.00 $120.00"
# Shipping
expect(page).to have_content "Shipping 1 $10.06 $100.55"
# Order Totals
@@ -395,7 +400,8 @@ describe '
expect(page).to have_content "(1g)" # display as
expect(page).to have_content "3 $500.15 $1,500.45 20.0%"
# Enterprise fee
expect(page).to have_content "Admin & Handling $120.00"
expect(page).to have_content "#{enterprise_fee.name} fee by coordinator " \
"#{user1.enterprises.first.name} $120.00"
# Shipping
expect(page).to have_content "Shipping $100.55 10.0%"
# Tax totals

View File

@@ -106,14 +106,14 @@ describe "full-page cart", js: true do
visit main_app.cart_path
end
it "shows admin and handlings row" do
it "shows enterprise fees row row" do
expect(page).to have_selector('#cart-detail')
expect(page).to have_content('Admin & Handling')
expect(page).to have_content("Whole order - #{handling_fee.name} fee by distributor #{order_cycle.coordinator.name}")
expect(page).to have_selector '.cart-item-price',
text: with_currency(0.86)
expect(page).to have_selector '.order-total.item-total',
text: with_currency(2.58)
expect(page).to have_selector '.order-total.distribution-total',
expect(page).to have_selector '.order-adjustment .total',
text: with_currency(1.00)
expect(page).to have_selector '.order-total.grand-total', text: with_currency(3.58) # price * 3 + 1
end