|
|
@ -148,9 +148,9 @@ class TrialView(models.TransientModel): |
|
|
|
wheres.append(where_clause.strip()) |
|
|
|
filters = " AND ".join(wheres) |
|
|
|
if data['target_move'] == 'posted': |
|
|
|
filters += " AND account_move_line__move_id.state = 'posted'" |
|
|
|
filters += " AND account_move_line.parent_state = 'posted'" |
|
|
|
else: |
|
|
|
filters += " AND account_move_line__move_id.state in ('draft','posted')" |
|
|
|
filters += " AND account_move_line.parent_state in ('draft','posted')" |
|
|
|
if data.get('date_from'): |
|
|
|
filters += " AND account_move_line.date >= '%s'" % data.get('date_from') |
|
|
|
if data.get('date_to'): |
|
|
@ -158,7 +158,7 @@ class TrialView(models.TransientModel): |
|
|
|
|
|
|
|
if data['journals']: |
|
|
|
filters += ' AND jrnl.id IN %s' % str(tuple(data['journals'].ids) + tuple([0])) |
|
|
|
tables += 'JOIN account_journal jrnl ON (account_move_line.journal_id=jrnl.id)' |
|
|
|
tables += ' JOIN account_journal jrnl ON (account_move_line.journal_id=jrnl.id)' |
|
|
|
# compute the balance, debit and credit for the provided accounts |
|
|
|
request = ( |
|
|
|
"SELECT account_id AS id, SUM(debit) AS debit, SUM(credit) AS credit, (SUM(debit) - SUM(credit)) AS balance" + \ |
|
|
@ -207,9 +207,9 @@ class TrialView(models.TransientModel): |
|
|
|
wheres.append(where_clause.strip()) |
|
|
|
filters = " AND ".join(wheres) |
|
|
|
if data['target_move'] == 'posted': |
|
|
|
filters += " AND account_move_line__move_id.state = 'posted'" |
|
|
|
filters += " AND account_move_line.parent_state = 'posted'" |
|
|
|
else: |
|
|
|
filters += " AND account_move_line__move_id.state in ('draft','posted')" |
|
|
|
filters += " AND account_move_line.parent_state in ('draft','posted')" |
|
|
|
if data.get('date_from'): |
|
|
|
filters += " AND account_move_line.date < '%s'" % data.get('date_from') |
|
|
|
|
|
|
|