Skip to content

Commit

Permalink
Merge pull request #335 from fasrc/development
Browse files Browse the repository at this point in the history
Clear out ProductUsageProcessing when recalculating billing records
  • Loading branch information
aaronk committed Aug 29, 2024
2 parents 9f319b2 + 65ac36d commit d78b8f2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion coldfront/plugins/ifx/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def generate_billing_records_for_organization(self, year, month, organization, r
'''
successes = []
errors = []

if organization.org_tree == 'Harvard':
projects = [po.project for po in organization.projectorganization_set.all()]
if not projects:
Expand Down
1 change: 1 addition & 0 deletions coldfront/plugins/ifx/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def calculate_billing_month(request, year, month):
try:
if recalculate:
ifxbilling_models.BillingRecord.objects.filter(year=year, month=month).delete()
ifxbilling_models.ProductUsageProcessing.objects.filter(product_usage__year=year, product_usage__month=month).delete()
calculator = NewColdfrontBillingCalculator()
calculator.calculate_billing_month(year, month, recalculate=recalculate)
return Response('OK', status=status.HTTP_200_OK)
Expand Down
2 changes: 1 addition & 1 deletion ifxbilling

0 comments on commit d78b8f2

Please sign in to comment.