Use reconciliation date as date instead of datetime

issue8843
review282451002
This commit is contained in:
Sebastien Marie
2020-03-16 21:43:17 +01:00
parent 7cef08d7d3
commit b04c2a3ec8
3 changed files with 55 additions and 2 deletions
+2 -1
View File
@@ -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 '',
+4
View File
@@ -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
1 JournalCode JournalLib EcritureNum EcritureDate CompteNum CompteLib CompAuxNum CompAuxLib PieceRef PieceDate EcritureLib Debit Credit EcritureLet DateLet ValidDate Montantdevise Idevise
3 OUV Balance Initiale 0 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 5,00 20180101
4 REV Revenue 1 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 10,00 20180101
5 REV Revenue 1 20180101 4111 Clients - Ventes de biens ou de prestations de services 2 Party - 20180101 - 10,00 0,00 20180101
6 REV Revenue 2 20180101 7011 Produits finis (ou groupe) A - 20180101 - 0,00 42,00 20180101
7 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
8 CASH Cash 3 20180101 5311 Caisse en monnaie nationale - 20180101 - 42,00 0,00 20180101
9 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
+49 -1
View File
@@ -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::