classyllama / ClassyLlama_AvaTax

This extension has been deprecated in favor of https://github.com/avadev/Avalara-AvaTax-for-Magento2
Open Software License 3.0
23 stars 15 forks source link

Inconsistent grand total on shipping API #236

Closed kassner closed 5 years ago

kassner commented 5 years ago

Related to #184

Preconditions

  1. Avatax 1.5.1;
  2. Magento Commerce 2.2.7;

Steps to reproduce

  1. POST to the REST API endpoint /V1/guest-carts/:quoteId/shipping-information to trigger the shipping calculation;

Expected result

Consistent values between the totals.grand_total and the Grand Total item under total_segments; Consistent values between the totals.grand_total and the totals.base_grand_total if both currencies are the same;

Actual result

{
    "totals": {
        "grand_total": 110,
        "base_grand_total": 119.5,
        ...
        "total_segments": [
            {
                "code": "grand_total",
                "title": "Grand Total",
                "value": 119.5,
                "area": "footer"
            },
            ...
        }
        ...
}

Complete response:

{
    "payment_methods": [],
    "totals": {
        "grand_total": 110,
        "base_grand_total": 119.5,
        "subtotal": 100,
        "base_subtotal": 100,
        "discount_amount": 0,
        "base_discount_amount": 0,
        "subtotal_with_discount": 100,
        "base_subtotal_with_discount": 100,
        "shipping_amount": 10,
        "base_shipping_amount": 10,
        "shipping_discount_amount": 0,
        "base_shipping_discount_amount": 0,
        "tax_amount": 9.5,
        "base_tax_amount": 9.5,
        "weee_tax_applied_amount": null,
        "shipping_tax_amount": 0,
        "base_shipping_tax_amount": 0,
        "subtotal_incl_tax": 109.5,
        "shipping_incl_tax": 10,
        "base_shipping_incl_tax": 10,
        "base_currency_code": "USD",
        "quote_currency_code": "USD",
        "items_qty": 2,
        "items": [
            {
                "item_id": 3,
                "price": 50,
                "base_price": 50,
                "qty": 2,
                "row_total": 100,
                "base_row_total": 100,
                "row_total_with_discount": 0,
                "tax_amount": 9.5,
                "base_tax_amount": 9.5,
                "tax_percent": 9.5,
                "discount_amount": 0,
                "base_discount_amount": 0,
                "discount_percent": 0,
                "price_incl_tax": 54.75,
                "base_price_incl_tax": 54.75,
                "row_total_incl_tax": 109.5,
                "base_row_total_incl_tax": 109.5,
                "options": "[]",
                "weee_tax_applied_amount": null,
                "weee_tax_applied": null,
                "name": "xxx"
            }
        ],
        "total_segments": [
            {
                "code": "subtotal",
                "title": "Subtotal",
                "value": 100
            },
            {
                "code": "giftwrapping",
                "title": "Gift Wrapping",
                "value": null,
                "extension_attributes": {
                    "gw_item_ids": [],
                    "gw_price": "0.0000",
                    "gw_base_price": "0.0000",
                    "gw_items_price": "0.0000",
                    "gw_items_base_price": "0.0000",
                    "gw_card_price": "0.0000",
                    "gw_card_base_price": "0.0000"
                }
            },
            {
                "code": "shipping",
                "title": "Shipping & Handling (Flat Rate - Fixed)",
                "value": 10
            },
            {
                "code": "tax",
                "title": "Tax",
                "value": 9.5,
                "extension_attributes": {
                    "tax_grandtotal_details": [
                        {
                            "rates": [
                                {
                                    "extension_attributes": {
                                        "tax": 6
                                    },
                                    "percent": "6",
                                    "title": "CA STATE TAX"
                                },
                                {
                                    "extension_attributes": {
                                        "tax": 0.25
                                    },
                                    "percent": "0.25",
                                    "title": "CA COUNTY TAX"
                                },
                                {
                                    "extension_attributes": {
                                        "tax": 1
                                    },
                                    "percent": "1",
                                    "title": "CA SPECIAL TAX"
                                },
                                {
                                    "extension_attributes": {
                                        "tax": 2.25
                                    },
                                    "percent": "2.25",
                                    "title": "CA SPECIAL TAX"
                                }
                            ],
                            "amount": 9.5,
                            "group_id": 1
                        }
                    ]
                }
            },
            {
                "code": "grand_total",
                "title": "Grand Total",
                "value": 119.5,
                "area": "footer"
            },
            {
                "code": "customerbalance",
                "title": "Store Credit",
                "value": 0
            },
            {
                "code": "reward",
                "title": "0 Reward points",
                "value": 0
            }
        ],
        "extension_attributes": {
            "reward_points_balance": 0,
            "reward_currency_amount": 0,
            "base_reward_currency_amount": 0
        }
    }
}
erikhansen commented 5 years ago

Avalara has shifted how they are handling support for this extension and are no longer providing support via Github issues. If you are still experiencing this issue, please contact support@avalara.com

Sorry for the delay in replying to this issue.