Skip to content

Fix tax calculation logic and update discount calculation method#6

Open
henryhabib wants to merge 1 commit into
masterfrom
hh-fix-logic-finance
Open

Fix tax calculation logic and update discount calculation method#6
henryhabib wants to merge 1 commit into
masterfrom
hh-fix-logic-finance

Conversation

@henryhabib
Copy link
Copy Markdown
Owner

This pull request updates the tax calculation and discount logic in the app.py file to improve accuracy and better reflect business requirements.

Tax calculation changes:

  • Adjusted the lowest tax bracket threshold in calculate_tax: The threshold for the lowest tax rate was changed from 10000 to 5000, so incomes up to 5000 are now taxed at 10%.

Discount calculation changes:

  • Revised the discount calculation in calculate_discount: Instead of a direct percentage calculation, the discount is now applied iteratively, reducing the price by 1% for each percentage point in the discount rate.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modifies tax and discount calculation logic in a Flask-based personal finance tracker application. The changes aim to adjust tax brackets and implement a new iterative discount calculation method. However, the implementation contains critical bugs that need to be addressed before merging.

Key Changes:

  • Modified the lowest tax bracket threshold from $10,000 to $5,000 in the calculate_tax function
  • Replaced the direct percentage-based discount calculation with an iterative approach in calculate_discount
  • Maintained the existing type annotation error in calculate_tax function signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants