diff --git a/CHANGELOG b/CHANGELOG index 6e6bdaec03..70f942b966 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Print general journal from moves * Add reconciliation sequence to configuration * Add report for income statement and balance sheet * Allow filtering general ledger by journal diff --git a/__init__.py b/__init__.py index 55c3d751f3..fe74ff82c5 100644 --- a/__init__.py +++ b/__init__.py @@ -60,7 +60,6 @@ def register(): move.ReconcileShow, move.CancelMovesDefault, move.GroupLinesStart, - move.PrintGeneralJournalStart, tax.TaxGroup, tax.TaxCodeTemplate, tax.TaxCode, @@ -101,7 +100,6 @@ def register(): move.Reconcile, move.CancelMoves, move.GroupLines, - move.PrintGeneralJournal, move_template.CreateMove, tax.OpenChartTaxCode, tax.OpenTaxCode, diff --git a/doc/design/journal.rst b/doc/design/journal.rst index d71a9627d9..aacf63aa9d 100644 --- a/doc/design/journal.rst +++ b/doc/design/journal.rst @@ -22,25 +22,6 @@ This limits where the journal can be used. .. |Financial --> Configuration --> Journals --> Journals| replace:: :menuselection:`Financial --> Configuration --> Journals --> Journals` __ https://demo.tryton.org/model/account.journal -Reports -------- - -.. _report-account.move.general_journal: - -General Journal -^^^^^^^^^^^^^^^ - -In Tryton the general journal lists all of the -`Account Moves ` that happened between the selected start -and end dates. -It also includes details such as the accounts, debits and credits involved. - -.. seealso:: - - The general journal can be printed by using the main menu item: - - :menuselection:`Financial --> Reporting --> Print General Journal` - Wizards ------- diff --git a/doc/design/move.rst b/doc/design/move.rst index c3e5d76bfa..c519e1cf4c 100644 --- a/doc/design/move.rst +++ b/doc/design/move.rst @@ -31,6 +31,18 @@ Only account moves whose line's debits and credits are balanced can be posted. .. |Financial --> Entries --> Account Moves| replace:: :menuselection:`Financial --> Entries --> Account Moves` __ https://demo.tryton.org/model/account.move +Reports +------- + +.. _report-account.move.general_journal: + +General Journal +^^^^^^^^^^^^^^^ + +In Tryton the general journal lists all of the selected `Account Moves +`. +It also includes details such as the accounts, debits and credits involved. + Wizards ------- diff --git a/general_journal.fodt b/general_journal.fodt index 999c6adbbc..9109183bab 100644 --- a/general_journal.fodt +++ b/general_journal.fodt @@ -1,24 +1,24 @@ - - LibreOffice/5.4.5.1$Linux_X86_64 LibreOffice_project/40m0$Build-12012-11-14T22:45:371P0D + + LibreOffice/6.4.7.2$Linux_X86_64 LibreOffice_project/40$Build-22012-11-14T22:45:371P0D 0 0 - 54700 - 26672 + 25640 + 23021 true false view2 - 16499 - 9366 + 13259 + 10862 0 0 - 54698 - 26670 + 25638 + 23019 0 0 false @@ -29,90 +29,102 @@ - false - true - true - true - 0 - true - true - - false - false - false - false - false - false - false - false - false - false - false - false - false - true - false - true - true - false - false - false - false - - false - false - false - true - false - false - - false - false - false - false - true - 1458629 false - true - false - false - true - true - false - true - 0 - false - true - high-resolution - false - false - false - true - true - true - - true - false - false - true - false - false - false - - false - false - 991389 - false - 1 - true - false - false - 0 - false - false - - false + + + false + false + 0 + false + false + 1 + false + false + false + false + true + false + false + true + true + false + false + false + false + false + false + high-resolution + false + 0 + false + true + false + false + false + + false + true + + false + false + false + + false + true + false + true + false + false + 2105963 + false + false + true + false + + false + 991389 + false + true + true + false + true + false + false + true + false + false + false + false + false + false + false + false + false + true + true + true + false + false + false + false + true + false + false + false + false + + true + true + true + 0 + true + true + true + true + true + true + false @@ -131,15 +143,15 @@ - - + + - - + + @@ -151,18 +163,18 @@ - + - + - + @@ -180,11 +192,19 @@ + + + + + + + + - - + + @@ -195,8 +215,8 @@ - - + + @@ -205,21 +225,21 @@ - + - - + + - - + + @@ -231,136 +251,154 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + - - + + - - + + + + - - - - - + + - - + + - - + + - - + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + - - + + + + + + + + + + + @@ -374,32 +412,54 @@ - + + + + + - + + + + + + + + + - + + + + + + + + + + + - + - - + + - + - + @@ -408,7 +468,7 @@ - + Company: <company.rec_name> @@ -425,7 +485,7 @@ - + User: <user.rec_name> @@ -445,28 +505,27 @@ + - General Journal - From Date: <format_date(from_date, user.language)> - To Date: <format_date(to_date, user.language)> + General Journal <for each="move in records"> - - - - + + - - - Journal Entry: <move.number><move.description> + + + Journal Entry:<move.number> - - Date: <format_date(move.date, user.language)> + + Date: <format_date(move.date, user.language)> - - Origin: <getattr(move.origin, 'rec_name', '')> + + <if test="move.origin"> + Origin:<getattr(move.origin, 'rec_name', '')> + </if> - + <if test="move.state == 'posted'"> Posted <move.post_number><format_date(move.post_date, user.language)> </if> @@ -476,49 +535,60 @@ - - - Account - - - Description + + + <move.description> - - Debit + + + + + + + Account - - Credit + + + + Debit + + + Credit - - - <for each="line in move.lines"> + + + <for each="line in move.lines"> - - - <(line.account.code and (line.account.code + ' ') or '') + line.account.name> - - - <line.description> + + + <line.account.rec_name> + <if test="line.party"> + <'[%s] %s' % (line.party.code, line.party.name)> + </if> + <if test="line.description"> + <line.description> + </if> - - <format_currency(line.debit, user.language, company.currency)> + + + <format_currency(line.debit, user.language, company.currency)> - - <format_currency(line.credit, user.language, company.currency)> + + <format_currency(line.credit, user.language, company.currency)> - - - </for> + + + </for> diff --git a/move.py b/move.py index 7723e87a52..2bc18061e6 100644 --- a/move.py +++ b/move.py @@ -2063,81 +2063,14 @@ class GroupLinesStart(ModelView): description = fields.Char("Description") -class PrintGeneralJournalStart(ModelView): - 'Print General Journal' - __name__ = 'account.move.print_general_journal.start' - from_date = fields.Date('From Date', required=True) - to_date = fields.Date('To Date', required=True) - company = fields.Many2One('company.company', 'Company', required=True) - posted = fields.Boolean('Posted Move', help="Only include posted moves.") - - @staticmethod - def default_from_date(): - Date = Pool().get('ir.date') - return datetime.date(Date.today().year, 1, 1) - - @staticmethod - def default_to_date(): - Date = Pool().get('ir.date') - return Date.today() - - @staticmethod - def default_company(): - return Transaction().context.get('company') - - @staticmethod - def default_posted(): - return False - - -class PrintGeneralJournal(Wizard): - 'Print General Journal' - __name__ = 'account.move.print_general_journal' - start = StateView('account.move.print_general_journal.start', - 'account.print_general_journal_start_view_form', [ - Button('Cancel', 'end', 'tryton-cancel'), - Button('Print', 'print_', 'tryton-print', default=True), - ]) - print_ = StateReport('account.move.general_journal') - - def do_print_(self, action): - data = { - 'company': self.start.company.id, - 'from_date': self.start.from_date, - 'to_date': self.start.to_date, - 'posted': self.start.posted, - } - return action, data - - class GeneralJournal(Report): __name__ = 'account.move.general_journal' - @classmethod - def _get_records(cls, ids, model, data): - Move = Pool().get('account.move') - - clause = [ - ('date', '>=', data['from_date']), - ('date', '<=', data['to_date']), - ('period.fiscalyear.company', '=', data['company']), - ] - if data['posted']: - clause.append(('state', '=', 'posted')) - return Move.search(clause, - order=[('date', 'ASC'), ('id', 'ASC')]) - @classmethod def get_context(cls, records, header, data): + pool = Pool() + Company = pool.get('company.company') + context = Transaction().context report_context = super().get_context(records, header, data) - - Company = Pool().get('company.company') - - company = Company(data['company']) - - report_context['company'] = company - report_context['digits'] = company.currency.digits - report_context['from_date'] = data['from_date'] - report_context['to_date'] = data['to_date'] - + report_context['company'] = Company(context['company']) return report_context diff --git a/move.xml b/move.xml index 43c1dc58de..0c33eecd61 100644 --- a/move.xml +++ b/move.xml @@ -403,29 +403,18 @@ this repository contains the full copyright notices and license terms. --> move_line_group_start_form - - account.move.print_general_journal.start - form - print_general_journal_start_form - - - - Print General Journal - account.move.print_general_journal - - - General Journal account.move account.move.general_journal account/general_journal.fodt + + form_print + account.move,-1 + + + Grouped Account Move account.move diff --git a/tests/scenario_reports.rst b/tests/scenario_reports.rst index 16e30bcc7b..133e2bc894 100644 --- a/tests/scenario_reports.rst +++ b/tests/scenario_reports.rst @@ -200,8 +200,8 @@ Print some reports:: >>> aged_balance = Report('account.aged_balance', context=context) >>> _ = aged_balance.execute(aged_balances) - >>> print_general_journal = Wizard('account.move.print_general_journal') - >>> print_general_journal.execute('print_') + >>> general_journal = Report('account.move.general_journal') + >>> _ = general_journal.execute(Move.find([])) >>> with config.set_context( ... start_date=period.start_date, diff --git a/view/print_general_journal_start_form.xml b/view/print_general_journal_start_form.xml deleted file mode 100644 index bb17be4c95..0000000000 --- a/view/print_general_journal_start_form.xml +++ /dev/null @@ -1,13 +0,0 @@ - - -
-