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

fix: Round invoice money using decimal #7284

Merged
merged 2 commits into from
Sep 24, 2020

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Sep 24, 2020

@@ -30,6 +31,10 @@ def get_new_id():
return get_new_identifier(EventInvoice, length=8)


def round_money(money):
return Decimal(money).quantize(Decimal('0.01'), rounding=ROUND_UP)

Choose a reason for hiding this comment

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

Black would make changes.

@auto-label auto-label bot added fix labels Sep 24, 2020
@codecov
Copy link

codecov bot commented Sep 24, 2020

Codecov Report

Merging #7284 into development will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #7284   +/-   ##
============================================
  Coverage        63.92%   63.93%           
============================================
  Files              259      259           
  Lines            13030    13033    +3     
============================================
+ Hits              8329     8332    +3     
  Misses            4701     4701           
Impacted Files Coverage Δ
app/models/event_invoice.py 93.68% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79e7a6a...d5b440e. Read the comment docs.

@iamareebjamal iamareebjamal merged commit 29189f8 into fossasia:development Sep 24, 2020
@iamareebjamal iamareebjamal deleted the rounding branch September 24, 2020 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invoice should always show two digits for cent
2 participants