diff --git a/account.py b/account.py index 62ccecc823..acbd67c0e5 100644 --- a/account.py +++ b/account.py @@ -299,7 +299,8 @@ class FrFEC(Wizard): format_number(line.debit or 0), format_number(line.credit or 0), reconciliation.rec_name if reconciliation else '', - format_date(reconciliation.create_date) if reconciliation else '', + format_date(reconciliation.create_date.date()) + if reconciliation else '', format_date(line.move.post_date), format_number(line.amount_second_currency) if line.amount_second_currency else '', diff --git a/tests/FEC.csv b/tests/FEC.csv index 2751512871..a22cba1698 100644 --- a/tests/FEC.csv +++ b/tests/FEC.csv @@ -3,3 +3,7 @@ OUV Balance Initiale 0 20180101 4111 Clients - Ventes de biens ou de prestations OUV Balance Initiale 0 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 5,00 20180101 REV Revenue 1 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 10,00 20180101 REV Revenue 1 20180101 4111 Clients - Ventes de biens ou de prestations de services 2 Party - 20180101 - 10,00 0,00 20180101 +REV Revenue 2 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 42,00 20180101 +REV Revenue 2 20180101 4111 Clients - Ventes de biens ou de prestations de services 2 Party - 20180101 - 42,00 0,00 1 {current_date} 20180101 +CASH Cash 3 20180101 5311 Caisse en monnaie nationale - 20180101 - 42,00 0,00 20180101 +CASH Cash 3 20180101 4111 Clients - Ventes de biens ou de prestations de services 2 Party - 20180101 - 0,00 42,00 1 {current_date} 20180101 diff --git a/tests/scenario_fec.rst b/tests/scenario_fec.rst index 46f5af3d91..d33c003b83 100644 --- a/tests/scenario_fec.rst +++ b/tests/scenario_fec.rst @@ -110,6 +110,49 @@ With an empty line:: ... }, config.context) >>> move.click('post') +With reconciliation:: + + >>> move = Move() + >>> move.period = period + >>> move.journal = journal_revenue + >>> move.date = period.start_date + >>> line = move.lines.new() + >>> line.account = revenue + >>> line.credit = Decimal(42) + >>> line = move.lines.new() + >>> line.account = receivable + >>> line.debit = Decimal(42) + >>> line.party = party + >>> move.save() + >>> reconcile1, = [l for l in move.lines if l.account == receivable] + >>> Move.write([move.id], { + ... 'post_date': period.start_date, + ... 'post_number': '2', + ... }, config.context) + >>> move.click('post') + >>> move = Move() + >>> move.period = period + >>> move.journal = journal_cash + >>> move.date = period.start_date + >>> line = move.lines.new() + >>> line.account = cash + >>> line.debit = Decimal(42) + >>> line = move.lines.new() + >>> line.account = receivable + >>> line.credit = Decimal(42) + >>> line.party = party + >>> move.save() + >>> Move.write([move.id], { + ... 'post_date': period.start_date, + ... 'post_number': '3', + ... }, config.context) + >>> move.click('post') + >>> reconcile2, = [l for l in move.lines if l.account == receivable] + >>> reconcile_lines = Wizard('account.move.reconcile_lines', + ... [reconcile1, reconcile2]) + >>> reconcile_lines.state == 'end' + True + Balance non-deferral:: >>> Sequence = Model.get('ir.sequence') @@ -152,7 +195,12 @@ Generate FEC:: >>> FEC.form.filename >>> file = os.path.join(os.path.dirname(__file__), 'FEC.csv') >>> with io.open(file, mode='rb') as fp: - ... FEC.form.file.decode('utf-8') == fp.read().decode('utf-8') + ... template = fp.read().decode('utf-8') + >>> current_date = datetime.date.today().strftime('%Y%m%d') + >>> template = template.format( + ... current_date=current_date, + ... ) + >>> FEC.form.file.decode('utf-8') == template True Generate FEC for previous fiscal year::