Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Implement and Fix Tax Calculation in Invoices #8541

Open
anuj-ever opened this issue Nov 12, 2024 · 0 comments
Open

[Enhancement] Implement and Fix Tax Calculation in Invoices #8541

anuj-ever opened this issue Nov 12, 2024 · 0 comments
Labels
type: enhancement ✨ New feature or request

Comments

@anuj-ever
Copy link

anuj-ever commented Nov 12, 2024

Issue:

The tax calculation appears to be either not implemented or incorrectly presented, as it is not accounted for in the invoice amount. The issue needs to be addressed to ensure accurate tax calculation and presentation on invoices.

Expected Condition:

  • Implement the tax calculation for invoices if not already in place.
  • Ensure both Tax 1 and Tax 2 are correctly calculated and reflected in the invoice amount.
  • Tax 2 can be calculated in either of the following ways based on the
    1. Tax 2 is calculated on the amount including Tax 1.
    2. Tax 2 is applied on the taxable amount only.
  • Display a field for the user to select tax 2 calculation.
  • Tax calculation should support both percentage-based and flat amount configurations.
  • Display the tax amounts clearly on the invoice.

Flow:

Determine and implement the correct formula for both percentage-based and flat tax calculations:

Tax 1 (Percentage-Based): Tax 1 Amount= Taxable Amount × Tax 1 Rate

Tax 2 (Percentage-Based on Taxable Amount): Tax 2 Amount = Taxable Amount × Tax 2 Rate
Tax 2 (Percentage-Based on Taxable Amount + Tax 1): Tax 2 Amount = (Taxable Amount + Tax 1 Amount) × Tax 2 Rate

Flat Tax: Use the provided flat amount directly.

  • Update the invoice generation process to include the calculated tax amounts.
  • Ensure the invoice total reflects the sum of the Taxable Amount and the calculated taxes.
  • Validate and test the calculations and presentation for various scenarios (e.g., different tax rates, flat amounts, combinations of percentage and flat taxes).
  • Update calculations to reflect the changes made.

Sample Tax Calculation:

Scenario 1: Tax 1 is Percentage-Based and Tax 2 is Flat

Taxable Amount: ₹1,000
Tax 1 Rate: 5%
Tax 2 (Flat): ₹50

Calculate Tax 1:
Tax 1 Amount = ₹1,000 × 0.05 = ₹50

Flat Tax (Tax 2):
Flat Tax Amount = ₹50

Total Tax Amount:
Total Tax Amount = Tax 1 Amount + Flat Tax Amount
Total Tax Amount = ₹50 + ₹50 = ₹100

Total Invoice Amount:
Total Invoice Amount = Taxable Amount + Total Tax Amount
Total Invoice Amount = ₹1,000 + ₹100 = ₹1,100

Scenario 2: Both Taxes are Flat
Taxable Amount: ₹1,000

Tax 1 (Flat): ₹30
Tax 2 (Flat): ₹50

Flat Tax (Tax 1):
Flat Tax Amount = ₹30

Flat Tax (Tax 2):
Flat Tax Amount = ₹50

Total Tax Amount:
Total Tax Amount = Tax 1 Amount + Tax 2 Amount
Total Tax Amount = ₹30 + ₹50 = ₹80

Total Invoice Amount:
Total Invoice Amount = Taxable Amount + Total Tax Amount
Total Invoice Amount = ₹1,000 + ₹80 = ₹1,080

Scenario 3: Both Taxes are Percentage-Based (Tax 2 on Taxable Amount + Tax 1)

Taxable Amount: ₹1,000
Tax 1 Rate: 5%
Tax 2 Rate: 10%

Calculate Tax 1:
Tax 1 Amount = ₹1,000 × 0.05 = ₹50

Calculate Tax 2:
Tax 2 Amount = (₹1,000 + ₹50) × 0.10 = ₹1,050 × 0.10 = ₹105

Total Tax Amount:
Total Tax Amount = Tax 1 Amount + Tax 2 Amount
Total Tax Amount = ₹50 + ₹105 = ₹155

Total Invoice Amount:
Total Invoice Amount = Taxable Amount + Total Tax Amount
Total Invoice Amount = ₹1,000 + ₹155 = ₹1,155

Scenario 4: Both Taxes are Percentage-Based (Tax 2 on Taxable Amount only)

Taxable Amount: ₹1,000
Tax 1 Rate: 5%
Tax 2 Rate: 10%

Calculate Tax 1:
Tax 1 Amount = ₹1,000 × 0.05 = ₹50

Calculate Tax 2:
Tax 2 Amount = ₹1,000 × 0.10 = ₹100

Total Tax Amount:
Total Tax Amount = Tax 1 Amount + Tax 2 Amount
Total Tax Amount = ₹50 + ₹100 = ₹150

Total Invoice Amount:
Total Invoice Amount = Taxable Amount + Total Tax Amount
Total Invoice Amount = ₹1,000 + ₹150 = ₹1,150

Acceptance Criteria:

  • Tax calculations (both percentage-based and flat) are correctly implemented and displayed on the invoice.
  • Invoices show the correct total amount including the calculated taxes.
@anuj-ever anuj-ever changed the title Implement and Fix Tax Calculation in Invoices [Enhancement] Implement and Fix Tax Calculation in Invoices Dec 6, 2024
@anuj-ever anuj-ever added the type: enhancement ✨ New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant