-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmove.py
27 lines (22 loc) · 867 Bytes
/
move.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This file is part of the account_report_ar module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
from decimal import Decimal
from trytond.pool import PoolMeta
class GeneralJournal(metaclass=PoolMeta):
__name__ = 'account.move.general_journal'
@classmethod
def get_context(cls, records, header, data):
report_context = super().get_context(records, header, data)
report_context['get_total_move'] = cls.get_total_move
return report_context
@classmethod
def get_total_move(self, lines, type):
amount = Decimal('0')
if type == 'debit':
for line in lines:
amount += line.debit
elif type == 'credit':
for line in lines:
amount += line.credit
return amount