-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix CCP -ve Tax Amount #659
Conversation
WalkthroughThe recent changes improve the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
apps/quickbooks_online/utils.py (1)
964-964
: Inconsistent application of absolute value logic for TaxAmount.The logic to ensure
TaxAmount
is positive usingabs()
is applied in some parts of the codebase but not consistently across all instances.
- File:
apps/quickbooks_online/utils.py
- Line: 964:
line[0][credit_card_purchase_lineitems[0].detail_type]['TaxAmount'] = abs(line[0][credit_card_purchase_lineitems[0].detail_type]['TaxAmount'])
- Other instances in the same file do not use
abs()
.Please review and ensure consistent application of this logic to prevent potential discrepancies in financial calculations.
Analysis chain
Ensure TaxAmount is always positive.
The change to set
TaxAmount
to its absolute value when theAmount
is negative is a good fix. This ensures consistency in tax calculations.Verify that this logic is applied consistently across all relevant parts of the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the logic of setting TaxAmount to absolute value is applied consistently across the codebase. # Test: Search for instances where TaxAmount is set. Expect: Consistent application of absolute value logic. rg --type python $'TaxAmount'Length of output: 59
Script:
#!/bin/bash # Description: Verify that the logic of setting TaxAmount to absolute value is applied consistently across the codebase. # Test: Search for instances where TaxAmount is set. Expect: Consistent application of absolute value logic. rg --type py $'TaxAmount'Length of output: 6944
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/quickbooks_online/utils.py (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/quickbooks_online/utils.py
apps/quickbooks_online/utils.py
Outdated
line[0]['Amount'] = abs(line[0]['Amount']) | ||
line[0][credit_card_purchase_lineitems[0].detail_type]['TaxAmount'] = abs(tax_amount) if tax_amount else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterate and set all lines to +ve
|
1 similar comment
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/quickbooks_online/utils.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/quickbooks_online/utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/quickbooks_online/utils.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/quickbooks_online/utils.py
Summary by CodeRabbit
New Features
Bug Fixes
TaxAmount
field.