Skip to content

Commit

Permalink
quarter period modified
Browse files Browse the repository at this point in the history
  • Loading branch information
collinskipkorir committed Nov 11, 2024
1 parent e523cd6 commit 54568d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mis_builder/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _compute_dates(self):
date_from = date_from + relativedelta(months=record.offset * 3)
date_to = (
date_from
+ relativedelta(months=(record.duration * 3) - 1)
+ relativedelta(months=(record.duration * 3) + 1)
+ relativedelta(day=31)
)
record.date_from = fields.Date.to_string(date_from)
Expand Down
10 changes: 6 additions & 4 deletions mis_builder/views/mis_report_instance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,18 @@
</group>
<group name="relative" invisible="mode != 'relative'" colspan="4">
<group>
<field name="type" required="mode == 'relative'" />
<field name="type" required="mode == 'relative'" />
<field name="date_from" attrs="{'invisible': [('type', '!=', 'date_range')]}"/>
<field name="date_to" attrs="{'invisible': [('type', '!=', 'date_range')]}"/>
<field name="is_ytd" />
<field
name="date_range_type_id"
invisible="type != 'date_range'"
required="type == 'date_range' and mode == 'relative'"
/>
<field name="offset" string="Offset (Quarters)" attrs="{'invisible': [('type', '!=', 'q')]}"/>
<field name="duration" string="Duration (Quarters)" attrs="{'invisible': [('type', '!=', 'q')]}"/>
</group>
<field name="offset" />
<field name="duration"/>
<group>
<group>
<field name="date_from" />
<field name="date_to" />
Expand Down

0 comments on commit 54568d4

Please sign in to comment.