Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Aconcagua
hr_payroll_base_config
Commits
3755f559
Commit
3755f559
authored
Dec 17, 2021
by
Santiago Apel
💬
Browse files
Merge branch 'rule_total_max_sub' into '12.0-stage'
[FIX] rule_total_max_sub See merge request
!31
parents
252097d9
92cee57a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
models/hr_payslip.py
models/hr_payslip.py
+17
-1
No files found.
models/hr_payslip.py
View file @
3755f559
...
...
@@ -187,6 +187,22 @@ class Payslips(BrowsableObject):
)
return
result
def
get_rule_dates_sub
(
self
,
months_back
,
date_to
=
False
):
today
=
fields
.
Date
.
today
()
date_to
=
date_to
or
self
.
date_to
or
today
date_to_obj
=
fields
.
Date
.
from_string
(
date_to
)
date_from_obj
=
date_to_obj
-
relativedelta
(
months
=
months_back
)
date_from
=
"{}-{:02}-01"
.
format
(
date_from_obj
.
year
,
date_from_obj
.
month
)
if
months_back
==
0
:
date_to
=
date_to
else
:
date_to
=
fields
.
Date
.
to_string
(
date_to_obj
-
timedelta
(
days
=
date_to_obj
.
day
)
)
return
date_from
,
date_to
def
rule_total_max_sub
(
self
,
rule_code
,
rule_code_sub
,
months_back
,
date_to
=
False
,
*
args
,
**
kwargs
):
...
...
@@ -215,7 +231,7 @@ class Payslips(BrowsableObject):
"""
date_from
,
date_to
=
self
.
get_rule_dates
(
months_back
,
date_to
)
date_from
,
date_to
=
self
.
get_rule_dates
_sub
(
months_back
,
date_to
)
query_arguments
=
(
rule_code
,
rule_code_sub
,
self
.
employee_id
.
id
or
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment