Skip to content

Commit

Permalink
Display only posted entries (OCA#648)
Browse files Browse the repository at this point in the history
* Add files via upload

Display only posted entries

* Update activity_statement.py

* Update report_statement_common.py
  • Loading branch information
LGodoo authored and MiquelRForgeFlow committed Feb 4, 2020
1 parent 9aa3531 commit d2906a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions partner_statement/report/activity_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _initial_balance_sql_q1(self, partners, date_start, account_type):
JOIN account_move m ON (l.move_id = m.id)
WHERE l.partner_id IN %(partners)s AND at.type = %(account_type)s
AND l.date < %(date_start)s AND not l.blocked
AND m.state IN ('posted')
GROUP BY l.partner_id, l.currency_id, l.amount_currency,
l.company_id
""", locals()), "utf-8")
Expand Down Expand Up @@ -90,6 +91,7 @@ def _display_lines_sql_q1(self, partners, date_start, date_end,
AND at.type = %(account_type)s
AND %(date_start)s <= l.date
AND l.date <= %(date_end)s
AND m.state IN ('posted')
GROUP BY l.partner_id, m.name, l.date, l.date_maturity,
CASE WHEN (aj.type IN ('sale', 'purchase'))
THEN l.name
Expand Down
2 changes: 1 addition & 1 deletion partner_statement/report/outstanding_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _display_lines_sql_q1(self, partners, date_end, account_type):
(pc.id IS NOT NULL AND
pc.max_date <= %(date_end)s) OR
(pd.id IS NULL AND pc.id IS NULL)
) AND l.date <= %(date_end)s
) AND l.date <= %(date_end)s AND m.state IN ('posted')
GROUP BY l.partner_id, m.name, l.date, l.date_maturity, l.name,
l.ref, l.blocked, l.currency_id,
l.balance, l.amount_currency, l.company_id
Expand Down
1 change: 1 addition & 0 deletions partner_statement/report/report_statement_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _show_buckets_sql_q1(self, partners, date_end, account_type):
pc.max_date <= %(date_end)s) OR
(pd.id IS NULL AND pc.id IS NULL)
) AND l.date <= %(date_end)s AND not l.blocked
AND m.state IN ('posted')
GROUP BY l.partner_id, l.currency_id, l.date, l.date_maturity,
l.amount_currency, l.balance, l.move_id,
l.company_id, l.id
Expand Down

0 comments on commit d2906a6

Please sign in to comment.