Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_cotisation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hervé Silvant - CGScop
cgscop_cotisation
Commits
1182e545
Commit
1182e545
authored
1 month ago
by
Hervé Silvant - CGScop
Browse files
Options
Downloads
Patches
Plain Diff
Ajout des cotisations PACA dans la vue synthétique des cotisations
parent
27d9914f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__manifest__.py
+1
-0
1 addition, 0 deletions
__manifest__.py
report/scop_contribution_report.py
+57
-0
57 additions, 0 deletions
report/scop_contribution_report.py
with
58 additions
and
0 deletions
__manifest__.py
+
1
−
0
View file @
1182e545
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
"
cgscop_account
"
,
"
cgscop_account
"
,
"
cgscop_liasse_fiscale
"
,
"
cgscop_liasse_fiscale
"
,
"
cgscop_partner
"
,
"
cgscop_partner
"
,
"
cgscop_cotisation_paca
"
,
"
lefilament_sales
"
,
"
lefilament_sales
"
,
],
],
"
data
"
:
[
"
data
"
:
[
...
...
This diff is collapsed.
Click to expand it.
report/scop_contribution_report.py
+
57
−
0
View file @
1182e545
...
@@ -50,6 +50,61 @@ class ScopContributionReport(models.Model):
...
@@ -50,6 +50,61 @@ class ScopContributionReport(models.Model):
],
],
}
}
# ------------------------------------------------------
# Sub Query PACA
# ------------------------------------------------------
def
_select_paca
(
self
):
type_coti_ur
=
self
.
env
.
ref
(
"
cgscop_partner.riga_14399
"
).
id
select_str
=
"""
SELECT
'
odoo
'
as source,
CAST(i.annee AS VARCHAR),
%d AS type_contribution_id,
i.partner_id,
SUM(i.mt_coti) AS amount_called,
SUM(i.mt_paid) AS amount_paid,
SUM(i.mt_coti - i.mt_paid) AS amount_due
"""
%
(
type_coti_ur
,
)
return
select_str
def
_from_paca
(
self
):
from_str
=
"""
FROM
scop_cotisation_paca i
"""
return
from_str
def
_where_paca
(
self
):
where_str
=
"""
WHERE
i.partner_id IS NOT NULL
"""
return
where_str
def
_groupby_paca
(
self
):
groupby_str
=
"""
GROUP BY
i.annee,
i.partner_id
"""
return
groupby_str
def
_query_paca
(
self
):
query
=
"
(%s %s %s %s)
"
%
(
self
.
_select_paca
(),
self
.
_from_paca
(),
self
.
_where_paca
(),
self
.
_groupby_paca
(),
)
return
query
def
_subquerypaca
(
self
):
return
self
.
_query_paca
()
# ------------------------------------------------------
# ------------------------------------------------------
# Sub Query
# Sub Query
# ------------------------------------------------------
# ------------------------------------------------------
...
@@ -137,6 +192,8 @@ class ScopContributionReport(models.Model):
...
@@ -137,6 +192,8 @@ class ScopContributionReport(models.Model):
query
=
(
query
=
(
self
.
_select
()
self
.
_select
()
+
self
.
_subquery
()
+
self
.
_subquery
()
+
"
UNION ALL
"
+
self
.
_subquerypaca
()
+
"
) c
"
+
"
) c
"
+
self
.
_query_groupby
()
+
self
.
_query_groupby
()
+
self
.
_query_order
()
+
self
.
_query_order
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment