diff --git a/analytic_account.fods b/analytic_account.fods index 61c3244..1ca5f61 100644 --- a/analytic_account.fods +++ b/analytic_account.fods @@ -14,7 +14,7 @@ 0 - 14 + 5 0 0 0 @@ -69,7 +69,7 @@ true true true - owH+/0dlbmVyaWMgUHJpbnRlcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU0dFTlBSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAMAxAAAAAAAAAAIAFZUAAAkbQAASm9iRGF0YSAxCnByaW50ZXI9R2VuZXJpYyBQcmludGVyCm9yaWVudGF0aW9uPVBvcnRyYWl0CmNvcGllcz0xCmNvbGxhdGU9ZmFsc2UKbWFyZ2luZGFqdXN0bWVudD0wLDAsMCwwCmNvbG9yZGVwdGg9MjQKcHNsZXZlbD0wCnBkZmRldmljZT0xCmNvbG9yZGV2aWNlPTAKUFBEQ29udGV4RGF0YQpEdXBsZXg6Tm9uZQBQYWdlU2l6ZTpMZXR0ZXIAABIAQ09NUEFUX0RVUExFWF9NT0RFDwBEdXBsZXhNb2RlOjpPZmY= + owH+/0dlbmVyaWMgUHJpbnRlcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU0dFTlBSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAMAxAAAAAAAAAAIAFZUAAAkbQAASm9iRGF0YSAxCnByaW50ZXI9R2VuZXJpYyBQcmludGVyCm9yaWVudGF0aW9uPVBvcnRyYWl0CmNvcGllcz0xCmNvbGxhdGU9ZmFsc2UKbWFyZ2luZGFqdXN0bWVudD0wLDAsMCwwCmNvbG9yZGVwdGg9MjQKcHNsZXZlbD0wCnBkZmRldmljZT0xCmNvbG9yZGV2aWNlPTAKUFBEQ29udGV4RGF0YQpQYWdlU2l6ZTpMZXR0ZXIARHVwbGV4Ok5vbmUAABIAQ09NUEFUX0RVUExFWF9NT0RFDwBEdXBsZXhNb2RlOjpPZmY= 1000 0 false @@ -126,8 +126,8 @@ - - + + @@ -297,7 +297,7 @@ - + @@ -412,266 +412,285 @@ / - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - + + - - + + - + + + + + + + - + - - - - + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - - + - + - + - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + + + + + + + - + - - - - - - - + + + + - - - - - - - + @@ -679,71 +698,385 @@ - - - - - - + - + - + - - - - - - - + + + + + + - + - + - - - - + + + + - - - - + + + + - - + + - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -785,7 +1118,7 @@ ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 @@ -799,524 +1132,524 @@ - - - - - + + + + + - + - + PLAN DE CUENTAS ANALÍTICAS - - - + + + - + - - company.rec_name + + company.rec_name - - + + - + - - NIT company.party.identifiers and company.party.identifiers[0].code + + NIT company.party.identifiers and company.party.identifiers[0].code - - + + - + - - + + FECHA INICIAL: - format_date(start_date, company.party.lang) + format_date(start_date, company.party.lang) - + FECHA FINAL: - format_date(end_date, company.party.lang) + format_date(end_date, company.party.lang) - + - - - - + + + + - if test="account_move" + if test="account_move" - - - + + + - + COD. - + CUENTA/TERCERO - + DÉBITO - + CRÉDITO - + SALDO - NÚMEROASIENTO + NÚMEROASIENTO - FECHAASIENTO + FECHAASIENTO - + - /if + /if - - - - - - + + + + + + - if test="account_move == False" + if test="account_move == False" - - - - - - + + + + + + - + COD. - + CUENTA - + DÉBITO - + CRÉDITO - + SALDO - - - + + + - /if + /if - - - - - - + + + + + + - root[0].code + root[0].code - root[0].name + root[0].name - + $0,00 - total + total - - - - - + + + + + - for each='analytic_account, accounts in record.items()' + for each='analytic_account, accounts in record.items()' - - - + + + - if test="accounts[analytic_account][3] > 0 or accounts[analytic_account][3] < 0 or without_balance" + if test="accounts[analytic_account][3] > 0 or accounts[analytic_account][3] < 0 or without_balance" - - - + + + - analytic_account + analytic_account - accounts[analytic_account][0].name + accounts[analytic_account][0].name - accounts[analytic_account][1] + accounts[analytic_account][1] - accounts[analytic_account][2] + accounts[analytic_account][2] - -accounts[analytic_account][3] + -accounts[analytic_account][3] - + - /if + /if - - - - + + + + - for each='account in accounts.values()' + for each='account in accounts.values()' - - - + + + - if test="(account[3] > 0 or account[3] < 0 or without_balance) and account[0].parent.parent" + if test="(account[3] > 0 or account[3] < 0 or without_balance) and account[0].parent.parent" - - - + + + - account[0].code + account[0].code - account[0].name + account[0].name - account[1] + account[1] - account[2] + account[2] - -account[3] + -account[3] - + - + - /if + /if - - - + + + - + - if test="account[0].type == 'normal' and len(account) == 5 and detailed" + if test="account[0].type == 'normal' and len(account) == 5 and detailed" - - - - - - - - + + + + + + + + - for each='key, line in account[4].items()' + for each='key, line in account[4].items()' - - - - - - - + + + + + + + - key + key - line[0] + line[0] - line[1] + line[1] - -line[2] + -line[2] - - - - - - + + + + + + - if test="len(line[3]) > 0 and account_move" + if test="len(line[3]) > 0 and account_move" - - - - - - - - - + + + + + + + + + - for each='move in line[3]' + for each='move in line[3]' - - - - - - - + + + + + + + - - if test="move.party" + + if test="move.party" - - - - - - + + + + + + - move.party.identifiers[0].code + move.party.identifiers[0].code - move.party.name + move.party.name - move.debit + move.debit - -move.credit + -move.credit - move.debit-move.credit + move.debit-move.credit - move.move.number + move.move.number - move.date + move.date - - - + + + - - /if + + /if - - - - - - + + + + + + - - if test="move.party == None" + + if test="move.party == None" - - - - - - + + + + + + - - move.debit + + move.debit - -move.credit + -move.credit - move.debit-move.credit + move.debit-move.credit - move.move.number + move.move.number - move.date + move.date - - - + + + - - /if + + /if - - - - - - + + + + + + - /for + /for - - - - - - - + + + + + + + - /if + /if - - - - - - - + + + + + + + - /for + /for - - - - - - - + + + + + + + - /if + /if - - - - - - - + + + + + + + - /for + /for - - - + + + - /for + /for - - - + + + - - - + + + - - Impresión: format_date(datetime.date.today(), company.party.lang) + + Impresión: format_date(datetime.date.today(), company.party.lang) - - + + - - - + + + - + REPRESENTANTE LEGAL - - + + CONTADOR - - - + + + - - - - - + + + + + - - - + + + - - - + + + - - + + @@ -1324,7 +1657,7 @@ - + diff --git a/analytic_account_report.py b/analytic_account_report.py index 0044058..5ce885e 100644 --- a/analytic_account_report.py +++ b/analytic_account_report.py @@ -72,7 +72,7 @@ def compute_report(data): move_line ] record[1] += a_l.debit - record[2] += a_l.credit + record[2] += a_l.credit * -(1) record[3] += a_l.debit - a_l.credit total += a_l.debit - a_l.credit def is_parent(parent, account, debit, credit): diff --git a/income_statement_colgaap_report.fods b/income_statement_colgaap_report.fods index 7be3aa1..a35ff94 100644 --- a/income_statement_colgaap_report.fods +++ b/income_statement_colgaap_report.fods @@ -1,20 +1,20 @@ - 2012-09-27T06:56:34P0D1LibreOffice/7.1.1.2$Linux_X86_64 LibreOffice_project/10$Build-2 + 2012-09-27T06:56:34P0D1LibreOffice/7.1.1.2$Linux_X86_64 LibreOffice_project/10$Build-2 0 0 - 18915 - 33274 + 24860 + 42955 view1 - 3 - 10 + 0 + 0 0 0 0 @@ -32,7 +32,7 @@ 0 - 14 + 0 0 0 0 @@ -41,7 +41,7 @@ 0 0 0 - 3 + 0 0 160 120 @@ -49,7 +49,7 @@ false - Detallado + Consolidado 1609 0 160 @@ -242,7 +242,7 @@ - +  % @@ -346,65 +346,74 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - - - - + - + - + - + - + - + - + - - - @@ -473,709 +482,920 @@ - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - - - - - + - + - + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - - - - - - - - - - - + + + - + - + - - - - + + + - + - + - - - - - - + - - + + - - - - + + + + - - + + - - + + - - - - - - - + + - - + + - - + + - - + + - - - - - - - - + + + - - - - - - - + + - - + + - + - + + + + + + - + - + + + + - + - + - - + + - + - - + + + + + + + - + - - - - + + + + - - - - - - - - - - - - + + - - - + + + + - - - + + + + - - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - + - - - - + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + + - - + + - + + - - + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -1191,6 +1411,18 @@ + + + + + + + + + + + + @@ -1198,8 +1430,8 @@ ??? - - Página 1 + + Página 1de 99 @@ -1209,7 +1441,7 @@ ???(???) - 00/00/0000, 00:00:00 + 00/00/0000, 00:00:00 @@ -1230,845 +1462,116 @@ - - - - - - - - - - - + + + + + + + + + + + + - - - ESTADO DE RESULTADOS CON CENTROS DE COSTOS + + ESTADO DE RESULTADOS CON CUENTAS ANALITICAS - - - - + + + + + - - + + - - AL end_date and format_date(end_date, company.party.lang) + + company.rec_name - - - - + + + + + + - - company.rec_name + + NIT company.party.identifiers and company.party.identifiers[0].code - - - - + + + + - - - - - - NIT company.party.identifiers and company.party.identifiers[0].code - - - - - - - - + + - - + Dirección: - - Teléfono: - - + + PERIODO INICIAL: - start_period.name + start_period.name - - + + + - - company.party.address_get().full_address + company.party.address_get().full_address - company.party.get_mechanism('phone') - - - PERIODO FINAL: - - end_period.name - - - - - - - - - - - - - - - - - - COD. - - - CUENTA - - CUENTASCONTABLES - - - CUENTAS ANALÍTICAS - - - % EJECUTADO - - NÚMEROASIENTO - - FECHAASIENTO - - - - - - - - - for each='key, account in records_full.items()' - - - - - - - - - - choose test="" - - - - - - - - - - when test="len(account[0]) == 1 and account[2] != 0" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - account[4]/account[2] - - - - - - - - /when - - - - - - - - - - when test="len(account[0]) == 1 and without_balance" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - - 0,00 % - - - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 2 and len(account[0]) < 4 and account[2] != 0" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - account[4]/account[2] - - - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 2 and len(account[0]) < 4 and without_balance" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - - 0,00 % - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 4 and len(account[0]) < 6 and account[2] != 0" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - account[4]/account[2] - - - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 4 and len(account[0]) < 6 and without_balance" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - - 0,00 % - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 6 and len(account[0]) < 8 and account[2] != 0" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - account[4]/account[2] - - - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 6 and without_balance" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - - 0,00 % - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 8 and account[2] != 0 and detailed" - - - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - account[4]/account[2] - - - - - - /when - - - - - - - - - - when test="len(account[0]) >= 8 and without_balance and detailed" - - - - - - - - - - account[0] - - account[1] - - account[2] - - account[4] - - - 0.00% - - - - - - /when - - - - - - - - - - if test="len(account[3]) > 0 and analytic_lines" - - - - - - - - - - - for each='analytic_line in account[3]' - - - - - - - - - - - if test="account[2] == 0" - - - - - - - - - - - analytic_line.account.code - - analytic_line.move_line.account.name - - analytic_line.account.debit - - analytic_line.account.credit - - - 0,00 % - - analytic_line.move_line.move.number - - analytic_line.move_line.move.date - - - - - /if - - - - - - - - - - if test="account[2] > 0 or account[2] < 0" - - - - - - - - - - - analytic_line.account.code - - analytic_line.move_line.account.name - - analytic_line.debit - - analytic_line.credit - - (analytic_line.debit-analytic_line.credit)/account[2] - - analytic_line.move_line.move.number - - analytic_line.move_line.move.date - - - - - /if - - - - - - - - - - /for - - - - - - - - - - - /if - - - - - - - - - - - /choose - - - - - - - - - - /for - - - - - - - - - - - - - UTILIDAD DEL EJERCICIO - - - global_result - - - - - - - Impresión: format_date(datetime.date.today(), company.party.lang) - - - - - - - - - - - - - - - - - - - - - - REPRESENTANTE LEGAL - - - - CONTADOR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ESTADO DE RESULTADOS CON CUENTAS ANALITICAS - - - - - - - - - - - AL end_date and format_date(end_date, company.party.lang) - - - - - - - - - company.rec_name - - - - - - - - - - - NIT company.party.identifiers and company.party.identifiers[0].code - - - - - - - - - - - - Dirección: - - - Teléfono: - - - PERIODO INICIAL: - - start_period.name - - - - - - - company.party.address_get().full_address - - company.party.get_mechanism('phone') - - + PERIODO FINAL: - end_period.name + end_period.name - + - - + + + + + if test="analytic_lines" + + + + + + + + + + + + + + + + + + + + TERCEROS + + + + + - - - - - - - - - + COD. - + CUENTA CUENTASCONTABLES @@ -2076,529 +1579,1806 @@ CUENTAS ANALÍTICAS - - % EJECUTADO + + % NÚMEROASIENTO - FECHAASIENTO + FECHAASIENTO - - - - - + + IDENTIFICACIÓN + + + NOMBRES + + + + - - root[0].code + + /if - root[0].name - - global_result - - analytic_balance - - analytic_balance/global_result - - - + + + + + + + + - - for each='id, accounts in records.items()' + + if test="analytic_lines == False" - - - - - + + + + + + + + + + - - accounts['code'] + + + COD. - id + + CUENTA - global_result + CUENTASCONTABLES - accounts['balance'] + + CUENTAS ANALÍTICAS - accounts['balance']/global_result + + % - - + NÚMEROASIENTO + + FECHAASIENTO + + + + + - - for each='key, account in accounts.items()' + + /if - - - - - + + + + + + + + - - if test="key != 'balance' and key != 'code' " + + for each='key, account in records_full.items()' - - - - - + + + + + + - - choose test="" + + choose test="" - - - - - + + + + + + - - when test="len(account[0].code) == 1 and account[0].balance != 0" + + when test="len(account[0]) == 1 and account[2] != 0" - - - - - + + + + + + - - account[0].code + + account[0] - account[0].name + account[1] - account[0].balance + account[2] - account[2] + account[4] - account[2]/account[0].balance - - - - - - - - /when - - - - - - - - - when test="len(account[0].code) >= 2 and len(account[0].code) < 4 and account[0].balance != 0" - - - - - - - - - account[0].code - - account[0].name - - account[0].balance - - account[2] - - account[2]/account[0].balance - - - - - - - - - /when - - - - - - - - - when test="len(account[0].code) >= 4 and len(account[0].code) < 6 and account[0].balance != 0" - - - - - - - - - account[0].code - - account[0].name - - account[0].balance - - account[2] - - account[2]/account[0].balance - - - - - - - - - /when - - - - - - - - - when test="len(account[0].code) >= 6 and len(account[0].code) < 8 and account[0].balance != 0" - - - - - - - - - account[0].code - - account[0].name - - account[0].balance - - account[2] - - account[2]/account[0].balance - - - - - - - - - /when - - - - - - - - - when test="len(account[0].code) >= 8 and account[0].balance != 0 and detailed" + account[4]/account[2] - - - + + + + + + /when + + + + + + + + + + when test="(len(account[0]) == 1) and (account[4] != 0 and account[2] == 0 or without_balance)" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + + 0,00 % + + + + + + + + /when + + + + + + + + + + when test="len(account[0]) >= 2 and len(account[0]) < 4 and account[2] != 0" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + account[4]/account[2] + + + + + + + + + /when + + + + + + + + + + when test="(len(account[0]) >= 2 and len(account[0]) < 4) and (account[4] != 0 and account[2] == 0 or without_balance)" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + + 0,00 % + + + + + + /when + + + + + + + + + + when test="len(account[0]) >= 4 and len(account[0]) < 6 and account[2] != 0" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + account[4]/account[2] + + + + + + + + + /when + + + + + + + + + + when test="(len(account[0]) >= 4 and len(account[0]) < 6) and (account[4] != 0 and account[2] == 0 or without_balance)" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + + 0,00 % + + + + + + /when + + + + + + + + + + when test="len(account[0]) >= 6 and len(account[0]) < 8 and account[2] != 0" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + account[4]/account[2] + + + + + + + + + /when + + + + + + + + + + when test="(len(account[0]) >= 6 and len(account[0]) < 8) and (account[4] != 0 and account[2] == 0 or without_balance)" + + + + + + + + + + account[0] + + account[1] + + account[2] + + account[4] + + + 0,00 % + + + + + + /when + + + + + + + + + + when test="len(account[0]) >= 8 and account[2] != 0 and detailed" + + + + + + - + - - account[0].code + + account[0] - account[0].name + account[1] - account[0].balance + account[2] - account[2] + account[4] - account[2]/account[0].balance + account[4]/account[2] - - + + - - /when + + /when - - - - - + + + + + + - - if test="len(account[1]) > 0 and analytic_lines" + + when test="(len(account[0]) >= 8 and detailed) and (account[4] != 0 and account[2] == 0 or without_balance)" - - - - - + + + + + + - - for each='analytic_line in account[1]' + + account[0] - - - - - - + account[1] + + account[2] + + account[4] + + + 0.00% + + + - - if test="account[2] == 0" + + /when - - - - - - + + + + + + - - analytic_line.account.code + + if test="len(account[3]) > 0 and analytic_lines" - analytic_line.move_line.account.name + + + + + + + + + + + + + for each='analytic_line in account[3]' - analytic_line.debit + + + + + + + + + + + + + + if test="account[2] == 0 and analytic_line.move_line.party" - analytic_line.credit + + + + + + + + + + + + + + analytic_line.account.code - + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + 0,00% - analytic_line.move_line.move.number + analytic_line.move_line.move.number - analytic_line.move_line.move.date + format_date(analytic_line.move_line.move.date, company.party.lang) - + analytic_line.move_line.party.identifiers[0].code + + analytic_line.move_line.party.name + + + + - - /if + + /if - - - - - + + + + + + + + + - - if test="account[2] > 0 or account[2] < 0" + + if test="(account[2] > 0 or account[2] < 0) and analytic_line.move_line.party" - - - - - - + + + + + + + + + + + - - analytic_line.account.code + + analytic_line.account.code - analytic_line.move_line.account.name + analytic_line.move_line.account.name - analytic_line.debit + analytic_line.debit - analytic_line.credit + analytic_line.credit - (analytic_line.debit-analytic_line.credit)/account[2] + (analytic_line.debit-analytic_line.credit)/account[2] - analytic_line.move_line.move.number + analytic_line.move_line.move.number - analytic_line.move_line.move.date + format_date(analytic_line.move_line.move.date, company.party.lang) - + analytic_line.move_line.party.identifiers[0].code + + analytic_line.move_line.party.name + + + + - - /if + + /if - - - - - + + + + + + + + + - - /for + + if test="account[2] == 0 and analytic_line.move_line.party == None" - - - - - - + + + + + + + + + + + - - /if + + analytic_line.account.code - + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + + 0,00% + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + + + + + + + + /if + + + + + + + + + + + + + if test="(account[2] > 0 or account[2] < 0) and analytic_line.move_line.party == None" + + + + + + + + + + + + + + + analytic_line.account.code + + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + (analytic_line.debit-analytic_line.credit)/account[2] + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + + + + + + + + /if + + + + + + + + + + + + + /for + + + + + + + + + + + /if + + + + + - + - - /choose + + /choose - - - - - - - - /if - - - - - - - - - /for - - - - - - - - - - - - UTILIDAD O PERDIDA DEL CENTRO DE COSTOS - - - accounts['balance'] - - - - - - /for - - - + + + + - - + - - - + + /for + + + + + - - + - - - - - UTILIDAD O PERDIDA DE TODOS LOS CENTROS DE COSTOS + + + + + UTILIDAD DEL EJERCICIO - - analytic_balance + + global_result - - + + - - - - - UTILIDAD O PERDIDA DEL EJERCICIO + + + Impresión: format_date(datetime.date.today(), company.party.lang) - - global_result - - - + + + + + + + - - Impresión: format_date(datetime.date.today(), company.party.lang) - - - - + + + + + - + - - - - - - - - - - - + + REPRESENTANTE LEGAL - - + + CONTADOR - - + + - + - - + + - - - + + + - + - - - - + + + + + - + - - - - - + + + + + + - + - + - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + ESTADO DE RESULTADOS DETALLADO CON CUENTAS ANALITICAS + + + + + + + + - + + company.rec_name + + + + + + + + + + + + NIT company.party.identifiers and company.party.identifiers[0].code + + + + + + + + + + + + Dirección: + + + + PERIODO INICIAL: + + start_period.name + + + + + + + + + company.party.address_get().full_address + + + + PERIODO FINAL: + + end_period.name + + + + + + + + + + + if test="analytic_lines" + + + + + + + + + + + + + + + + + + + + + TERCEROS + + + + + + + COD. + + + CUENTA + + CUENTASCONTABLES + + + CUENTAS ANALÍTICAS + + + % + + NÚMEROASIENTO + + FECHAASIENTO + + + IDENTIFICACIÓN + + + NOMBRES + + + + + + + + + /if + + + + + + + + + + + + if test="analytic_lines == False" + + + + + + + + + + + + + + + COD. + + + CUENTA + + CUENTASCONTABLES + + + CUENTAS ANALÍTICAS + + + % + + NÚMEROASIENTO + + FECHAASIENTO + + + + + + + + /if + + + + + + + + + + + + root[0].code + + root[0].name + + global_result + + analytic_balance + + analytic_balance/global_result + + + + + + for each='id, accounts in records.items()' + + + + + + + + + accounts['code'] + + id + + global_result + + accounts['balance'] + + accounts['balance']/global_result + + + + + + for each='key, account in accounts.items()' + + + + + + + + + if test="key != 'balance' and key != 'code' " + + + + + + + + + choose test="" + + + + + + + + + when test="len(account[0].code) == 1 and account[0].balance != 0" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + account[2]/account[0].balance + + + + + + + + /when + + + + + + + + + when test="(len(account[0].code) == 1) and (account[2] != 0 and account[0].balance == 0 or without_balance)" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + + 0,00% + + + + + + /when + + + + + + + + + when test="len(account[0].code) >= 2 and len(account[0].code) < 4 and account[0].balance != 0" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + account[2]/account[0].balance + + + + + + + + + + + + /when + + + + + + + + + when test="(len(account[0].code) >= 2 and len(account[0].code) < 4) and (account[2] != 0 and account[0].balance == 0 or without_balance)" + + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + + 0,00% + + + + + + /when + + + + + + + + + when test="len(account[0].code) >= 4 and len(account[0].code) < 6 and account[0].balance != 0" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + account[2]/account[0].balance + + + + + + + + + + + + /when + + + + + + + + + when test="(len(account[0].code) >= 4 and len(account[0].code) < 6) and (account[2] != 0 and account[0].balance == 0 or without_balance)" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + + 0,00% + + + + + + /when + + + + + + + + + when test="len(account[0].code) >= 6 and len(account[0].code) < 8 and account[0].balance != 0" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + account[2]/account[0].balance + + + + + + + + + + + + /when + + + + + + + + + when test="(len(account[0].code) >= 6 and len(account[0].code) < 8) and (account[2] != 0 and account[0].balance == 0 or without_balance)" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + + 0,00% + + + + + + /when + + + + + + + + + when test="len(account[0].code) >= 8 and account[0].balance != 0 and detailed" + + + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + account[2]/account[0].balance + + + + + + /when + + + + + + + + + when test="(len(account[0].code) >= 8 and detailed) and (account[2] != 0 and account[0].balance == 0 or without_balance)" + + + + + + + + + account[0].code + + account[0].name + + account[0].balance + + account[2] + + + 0,00% + + + + + + /when + + + + + + + + + if test="len(account[1]) > 0 and analytic_lines" + + + + + + + + + for each='analytic_line in account[1]' + + + + + + + + + + if test="account[2] == 0 and analytic_line.move_line.party" + + + + + + + + + + analytic_line.account.code + + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + + 0,00% + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + analytic_line.move_line.party.identifiers[0].code + + analytic_line.move_line.party.name + + + + + /if + + + + + + + + + if test="(account[2] > 0 or account[2] < 0) and analytic_line.move_line.party" + + + + + + + + + + analytic_line.account.code + + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + (analytic_line.debit-analytic_line.credit)/account[0].balance + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + analytic_line.move_line.party.identifiers[0].code + + analytic_line.move_line.party.name + + + + + /if + + + + + + + + + if test="account[2] == 0 and analytic_line.move_line.party == None" + + + + + + + + + + analytic_line.account.code + + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + + 0,00% + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + + + + + + /if + + + + + + + + + if test="(account[2] > 0 or account[2] < 0) and analytic_line.move_line.party == None" + + + + + + + + + + analytic_line.account.code + + analytic_line.move_line.account.name + + analytic_line.debit + + analytic_line.credit + + (analytic_line.debit-analytic_line.credit)/account[0].balance + + analytic_line.move_line.move.number + + format_date(analytic_line.move_line.move.date, company.party.lang) + + + + + + + /if + + + + + + + + + /for + + + + + + + + + + /if + + + + + + + + /choose + + + + + + + + + /if + + + + + + + + + /for + + + + + + + + + Utilidad o Perdida de la Cuenta Analítica ( accounts['code'] - id ) + + + + + accounts['balance'] + + + + + + /for + + + + + + + + + + + + + + + + + UTILIDAD O PERDIDA DE TODAS LAS CUENTAS ANALÍTICAS + + + + + analytic_balance + + + + + + + UTILIDAD O PERDIDA DEL EJERCICIO + + + + + global_result + + + + + + + Impresión: format_date(datetime.date.today(), company.party.lang) + + + + + + + + + + + + + + + + + + + + REPRESENTANTE LEGAL + + + + CONTADOR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/income_statement_colgaap_report.py b/income_statement_colgaap_report.py index 671b268..2f224fb 100644 --- a/income_statement_colgaap_report.py +++ b/income_statement_colgaap_report.py @@ -23,10 +23,6 @@ def compute_report(data, domain, codes): 'posted': data['posted'], } - if data['posted']: - cosa = ['draft'] - else: - cosa = [] def is_child(child, parent): if child in parent.childs: @@ -84,8 +80,6 @@ def compute_report(data, domain, codes): for a in accounts: record = [] record2 = [] - #if a.type: - #if a.type.statement == 'income': a.balance = a.balance * (-1) record.append(a) record2.append(a.code) @@ -162,7 +156,10 @@ def compute_report(data, domain, codes): res['end_date'] = max(periods_dates) res['period'] = period res['fiscalyear'] = fiscalyear - + res['analytic_lines'] = data['analytic_lines'] + res['detailed'] = data['detailed'] + res['without_balance'] = data['without_balance'] + return res @@ -296,9 +293,6 @@ class IncomeStatementCOLGAAP(Report): report_context.update(res) report_context['start_period'] = Period(data['start_period']) report_context['end_period'] = Period(data['end_period']) - report_context['detailed'] = data['detailed'] report_context['company'] = company - report_context['without_balance'] = data['without_balance'] - report_context['analytic_lines'] = data['analytic_lines'] return report_context diff --git a/income_statement_colgaap_report.xml b/income_statement_colgaap_report.xml index b384031..ffc11fe 100644 --- a/income_statement_colgaap_report.xml +++ b/income_statement_colgaap_report.xml @@ -5,7 +5,7 @@ this repository contains the full copyright notices and license terms. --> - Analytic Income Statement COLGAAP + Analytic Income Statement analytic_account_co.income_statement_colgaap analytic_account_co/income_statement_colgaap_report.fods @@ -17,7 +17,7 @@ this repository contains the full copyright notices and license terms. --> print_income_statement_colgaap_start_form - Analytic Income Statement COLGAAP + Analytic Income Statement analytic_account_co.print_income_statement_colgaap