Skip to content

Commit

Permalink
Tracking pull request to merge release-1.30.0.1 to master (#917)
Browse files Browse the repository at this point in the history
Emergency fix for the to_date (#918)
  • Loading branch information
kuanfandevops authored Oct 18, 2021
1 parent 4c5b908 commit 8c4dbcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions backend/api/viewsets/model_year_report_compliance_obligation.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,17 @@ def details(self, request, *args, **kwargs):

if report_year == 2020:
from_date = date(2018, 1, 2,)
to_date = date(report_year + 1, 9, 30,)
to_date = date(report_year + 1, 10, 1,)
else:
from_date = date(report_year, 10, 1,)
to_date = date(report_year + 1, 9, 30,)
to_date = date(report_year + 1, 10, 1,)

content = []

transfers_in = CreditTransaction.objects.filter(
credit_to=organization,
transaction_type__transaction_type='Credit Transfer',
transaction_timestamp__lte=to_date,
transaction_timestamp__lt=to_date,
transaction_timestamp__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -245,7 +245,7 @@ def details(self, request, *args, **kwargs):
transfers_out = CreditTransaction.objects.filter(
debit_from=organization,
transaction_type__transaction_type='Credit Transfer',
transaction_timestamp__lte=to_date,
transaction_timestamp__lt=to_date,
transaction_timestamp__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -258,7 +258,7 @@ def details(self, request, *args, **kwargs):
initative_agreements = CreditTransaction.objects.filter(
credit_to=organization,
credit_agreement_credit_transaction__credit_agreement__transaction_type=CreditAgreementTransactionTypes.INITIATIVE_AGREEMENT,
credit_agreement_credit_transaction__credit_agreement__effective_date__lte=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__lt=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -270,7 +270,7 @@ def details(self, request, *args, **kwargs):
purchase_agreements = CreditTransaction.objects.filter(
credit_to=organization,
credit_agreement_credit_transaction__credit_agreement__transaction_type=CreditAgreementTransactionTypes.PURCHASE_AGREEMENT,
credit_agreement_credit_transaction__credit_agreement__effective_date__lte=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__lt=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -282,7 +282,7 @@ def details(self, request, *args, **kwargs):
administrative_credit_alloction = CreditTransaction.objects.filter(
credit_to=organization,
credit_agreement_credit_transaction__credit_agreement__transaction_type=CreditAgreementTransactionTypes.ADMINISTRATIVE_CREDIT_ALLOCATION,
credit_agreement_credit_transaction__credit_agreement__effective_date__lte=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__lt=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -294,7 +294,7 @@ def details(self, request, *args, **kwargs):
administrative_credit_reduction = CreditTransaction.objects.filter(
debit_from=organization,
credit_agreement_credit_transaction__credit_agreement__transaction_type=CreditAgreementTransactionTypes.ADMINISTRATIVE_CREDIT_REDUCTION,
credit_agreement_credit_transaction__credit_agreement__effective_date__lte=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__lt=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -306,7 +306,7 @@ def details(self, request, *args, **kwargs):
automatic_administrative_penalty = CreditTransaction.objects.filter(
credit_to=organization,
credit_agreement_credit_transaction__credit_agreement__transaction_type=CreditAgreementTransactionTypes.AUTOMATIC_ADMINISTRATIVE_PENALTY,
credit_agreement_credit_transaction__credit_agreement__effective_date__lte=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__lt=to_date,
credit_agreement_credit_transaction__credit_agreement__effective_date__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand All @@ -318,7 +318,7 @@ def details(self, request, *args, **kwargs):
credits_issued_sales = CreditTransaction.objects.filter(
credit_to=organization,
transaction_type__transaction_type='Validation',
transaction_timestamp__lte=to_date,
transaction_timestamp__lt=to_date,
transaction_timestamp__gte=from_date,
).values(
'credit_class_id', 'model_year_id'
Expand Down Expand Up @@ -364,7 +364,7 @@ def details(self, request, *args, **kwargs):
pending_sales_submissions = SalesSubmission.objects.filter(
organization=organization,
validation_status__in=['SUBMITTED', 'RECOMMEND_APPROVAL', 'RECOMMEND_REJECTION', 'CHECKED'],
submission_date__lte=to_date,
submission_date__lt=to_date,
submission_date__gte=from_date,
)

Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zeva-frontend",
"version": "1.30.0",
"version": "1.30.0-1",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
Expand Down

0 comments on commit 8c4dbcd

Please sign in to comment.