Skip to content

Commit

Permalink
Merge pull request #33 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
olimpiurob authored Feb 16, 2022
2 parents a65b406 + 640dc86 commit b853d24
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Products/Reportek/EnvelopeCustomDataflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""

import datetime
import json
import logging
import re
Expand Down Expand Up @@ -1553,6 +1554,20 @@ def get_previous_deliveries(self):

return envs

def get_updated_report_id(self, old_rep_id, offset=None, rep_year=None):
""" Return an up to date report id, from an old report where offset is
current year +- offset or using the provided rep_year
Designed to work with copyFromPreviousDelivery script
"""
if not rep_year:
rep_year = datetime.datetime.now().year
if offset:
rep_year = rep_year + int(offset)
rep_year = str(rep_year)
rep_id = re.sub(r'(?:19|20)\d{2}', rep_year, old_rep_id)

return rep_id


# Initialize the class in order the security assertions be taken into account
InitializeClass(EnvelopeCustomDataflows)
2 changes: 1 addition & 1 deletion Products/Reportek/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.15
4.2
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

4.2 - (2022-02-16)
---------------------------
* Change: Develop
[olimpiurob]

4.15 - (2022-02-15)
---------------------------
* Change: Refs #145482; Changed required permission to View on get_previous_del… [olimpiurob]
Expand Down

0 comments on commit b853d24

Please sign in to comment.