Payment Method Add'tl Fee & Tax Calcs Incorrect

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 anno tempo fa
Working with:
   - no-source nopCommerce 4.50.1
   - NOP Templates Venture theme
   - restaurant ordering

Website conditions:
   - All food items are taxable at 5%
   - There is a dropdown list Checkout Attribute to add a tip with non-taxable Price Adjustments
   - A 3% Payment Method Additional Fee (Processing Fee) is charged on the total, also taxable at 5%
   - Site uses one-page Checkout

EXPECTED BEHAVIOR
Expected Tax and Processing Fees under Checkout Payment Method and Confirm Order sections are as follows;

Let:
OT = Order Total (taxable)
T  = Tip (non-taxable)
ST = Sub-Total
TX = Tax
p  = Tax Rate
PF = Processing Fee
q  = Processing Fee rate

Then:
(1)  TX = p x (OT + PF)
(2)  PF = q x (OT + T + TX)

Substituting (2) in (1) and solving for TX gives:
(3)  TX = p[(1+q)OT + qT]
(4)  PF = q(ST + TX)

ACTUAL BEHAVIOR
- Amount on Checkout | Payment Method is incorrect
- Amount under Checkout | Confirm Order differs from Payment Method section and is closer but sometimes incorrect

STEPS TO REPRODUCE
  - Added one item to Cart at 12.49
  - Went to Cart page
  - Added a 2.00 tip
  - Sub-total of 14.49

Per formulas above, tax should be 0.65 and processing fee should be 0.45:
With the numbers from the example:
   TX = 5% x [(1+3%) x 12.49 + 3% x 2.00] = 0.65
   PF = 3% x (14.49 + 0.65) = 0.45

  - Agreed with the Terms of Service
  - Clicked Checkout button, going to Bill Address section
  - Clicked Continue button in Billing Address section, going to Payment Method section

CHECKOUT/PAYMENT METHOD shows:
Order Total: 12.49
Tip: 2.00
Sub-Total: 14.49
3% Processing Fee: 0.45
Tax: 0.62 ***** INCORRECT - corresponds to tax without the 3% Processing Fee
Total: 15.56

  - Added a credit card
  - Clicked Continue button on Payment Information section, going to Confirm Order section

CHECKOUT/CONFIRM ORDER shows:
3% Processing Fee: 0.45
Tax: 0.64 ***** INCORRECT
Total: 15.58

Notes:
   - Might relate to: https://github.com/nopSolutions/nopCommerce/issues/4936
1 anno tempo fa
What payment method do you use?
1 anno tempo fa
Authorize.Net
1 anno tempo fa
I cannot reproduce the problem with the mentioned steps. I see the correct tax (0.65) and payment fee (0.45).
What are your Tax Settings? And also what is the value of "shoppingcartsettings.roundpricesduringcalculation" setting? Try to set it to "false".
1 anno tempo fa
Tax Settings under Admin | Configuration | Tax Providers:
    Friendly name:Manual (Fixed or By Country/State/Zip)
    System name: Tax.FixedOrByCountryStateZip
    Configuration:
        Fixed Rate: 5

shoppingcartsettings.roundpricesduringcalculation:
    - Was set at True
    - Setting to False causes incorrect calculations on Shopping Cart page
      - Example: Sub-Total: 11.65; Tax: 0.50; Total: 12.14 (should be 12.15)
1 anno tempo fa
I mean tax settings under Admin → Configuration → Settings → Tax settings.

On my installation calculations are correct with disabled rounding. Anyway, even if there are minor discrepancies during the checkout, it's only in the display (see comment), and should be accurate in the order, check the order details in the admin.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.