Skip to content

Commit

Permalink
remove unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
prv-proton authored and Your Name committed Aug 30, 2023
1 parent 504f726 commit cb0fd15
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions backend/api/services/OrganizationService.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def get_pending_transfers_value(organization):
Q(is_rescinded=False) &
(Q(trade_effective_date__gte=datetime.datetime.now()) | Q(trade_effective_date__isnull=True)))
).aggregate(total_credits=Sum('number_of_credits'))

if pending_trades['total_credits'] is not None:
pending_transfers_value = pending_trades['total_credits']

Expand Down Expand Up @@ -58,7 +57,6 @@ def get_pending_deductions(
"Deleted"
])
).filter(id=group_id).first()

if compliance_report and compliance_report.summary:
if compliance_report.supplements_id and \
compliance_report.supplements_id > 0:
Expand Down Expand Up @@ -112,7 +110,6 @@ def get_pending_deductions(
# if report.status.director_status_id == 'Accepted' and \
# ignore_pending_supplemental:
# deductions -= report.summary.credits_offset

if deductions < 0:
deductions = 0

Expand All @@ -126,7 +123,6 @@ def get_max_credit_offset(organization, compliance_year, exclude_reserved=False)
compliance_period_effective_date = datetime.date(
int(compliance_year), 1, 1
)

credits = CreditTrade.objects.filter(
(Q(status__status="Approved") &
Q(type__the_type="Sell") &
Expand All @@ -151,7 +147,6 @@ def get_max_credit_offset(organization, compliance_year, exclude_reserved=False)
Q(is_rescinded=False) &
Q(compliance_period__effective_date__lte=compliance_period_effective_date))
).aggregate(total=Sum('number_of_credits'))

debits = CreditTrade.objects.filter(
(Q(status__status="Approved") &
Q(type__the_type="Sell") &
Expand All @@ -169,7 +164,6 @@ def get_max_credit_offset(organization, compliance_year, exclude_reserved=False)
Q(is_rescinded=False) &
Q(compliance_period__effective_date__lte=compliance_period_effective_date))
).aggregate(total=Sum('number_of_credits'))

total_in_compliance_period = 0
if credits and credits.get('total') is not None:
total_in_compliance_period = credits.get('total')
Expand All @@ -184,10 +178,8 @@ def get_max_credit_offset(organization, compliance_year, exclude_reserved=False)
validated_credits = organization.organization_balance.get(
'validated_credits', 0
)

total_balance = validated_credits - pending_deductions
total_available_credits = min(total_in_compliance_period, total_balance)

if total_available_credits < 0:
total_available_credits = 0

Expand Down

0 comments on commit cb0fd15

Please sign in to comment.