|
36 | 36 | <t t-call="account_financial_report.report_trial_balance_filters" /> |
37 | 37 | <div class="act_as_table list_table" style="margin-top: 10px;" /> |
38 | 38 | <!-- Display account lines --> |
| 39 | + <t t-set="aml_domain_extra" t-value="[]" /> |
39 | 40 | <t t-if="not show_partner_details"> |
40 | | - <div class="act_as_table data_table" style="width: 100%;"> |
41 | | - <!-- Display account header --> |
42 | | - <t |
43 | | - t-call="account_financial_report.report_trial_balance_lines_header" |
44 | | - /> |
45 | | - <!-- Display each lines --> |
46 | | - <t t-foreach="trial_balance" t-as="balance"> |
47 | | - <!-- Adapt --> |
48 | | - <t t-set="style" t-value="'font-size:12px;'" /> |
49 | | - <!-- Different style for account group --> |
50 | | - <t t-if="show_hierarchy"> |
51 | | - <t |
52 | | - t-if="balance['type'] == 'group_type'" |
53 | | - > |
| 41 | + <t t-if="trial_balance_grouped"> |
| 42 | + <t t-foreach="trial_balance_grouped" t-as="grouped_item"> |
| 43 | + <div class="act_as_table data_table" style="width: 100%;"> |
| 44 | + <div class="act_as_thead"> |
| 45 | + <div class="act_as_row labels"> |
| 46 | + <div class="act_as_cell" style="width: 100%;"> |
| 47 | + <t t-esc="grouped_item['name']" /> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + <t |
| 53 | + t-set="aml_domain_extra" |
| 54 | + t-if="grouped_item['id'] > 0" |
| 55 | + t-value="[('analytic_account_id', '=', grouped_item['id'])]" |
| 56 | + /> |
| 57 | + <t |
| 58 | + t-set="aml_domain_extra" |
| 59 | + t-else="" |
| 60 | + t-value="[('analytic_account_id', '=', False)]" |
| 61 | + /> |
| 62 | + <div class="act_as_table data_table" style="width: 100%;"> |
| 63 | + <t |
| 64 | + t-call="account_financial_report.report_trial_balance_lines_header" |
| 65 | + /> |
| 66 | + <!-- Display each lines --> |
| 67 | + <t t-foreach="grouped_item['account_data']" t-as="balance"> |
| 68 | + <!-- Adapt --> |
| 69 | + <t t-set="style" t-value="'font-size:12px;'" /> |
54 | 70 | <t |
55 | | - t-set="style" |
56 | | - t-value="style + 'font-weight: bold; color: blue;'" |
| 71 | + t-call="account_financial_report.report_trial_balance_line" |
57 | 72 | /> |
58 | 73 | </t> |
59 | | - </t> |
60 | | - <t t-if="show_hierarchy and limit_hierarchy_level"> |
61 | | - <t |
62 | | - t-if="show_hierarchy_level > balance['level'] and (not hide_parent_hierarchy_level or (show_hierarchy_level - 1) == balance['level'])" |
63 | | - > |
| 74 | + </div> |
| 75 | + <!-- Display footer with totals !--> |
| 76 | + <t t-set="balance" t-value="grouped_item" /> |
| 77 | + <t |
| 78 | + t-call="account_financial_report.report_trial_balance_account_footer" |
| 79 | + /> |
| 80 | + </t> |
| 81 | + <!-- TOTAL !--> |
| 82 | + <t t-if="grouped_by"> |
| 83 | + <t t-set="balance" t-value="total_amount_grouped" /> |
| 84 | + <t |
| 85 | + t-call="account_financial_report.report_trial_balance_account_footer" |
| 86 | + /> |
| 87 | + </t> |
| 88 | + </t> |
| 89 | + <t t-else=""> |
| 90 | + <div class="act_as_table data_table" style="width: 100%;"> |
| 91 | + <!-- Display account header --> |
| 92 | + <t |
| 93 | + t-call="account_financial_report.report_trial_balance_lines_header" |
| 94 | + /> |
| 95 | + <!-- Display each lines --> |
| 96 | + <t t-foreach="trial_balance" t-as="balance"> |
| 97 | + <!-- Adapt --> |
| 98 | + <t t-set="style" t-value="'font-size:12px;'" /> |
| 99 | + <!-- Different style for account group --> |
| 100 | + <t t-if="show_hierarchy"> |
| 101 | + <t |
| 102 | + t-if="balance['type'] == 'group_type'" |
| 103 | + > |
| 104 | + <t |
| 105 | + t-set="style" |
| 106 | + t-value="style + 'font-weight: bold; color: blue;'" |
| 107 | + /> |
| 108 | + </t> |
| 109 | + </t> |
| 110 | + <t t-if="show_hierarchy and limit_hierarchy_level"> |
| 111 | + <t |
| 112 | + t-if="show_hierarchy_level > balance['level'] and (not hide_parent_hierarchy_level or (show_hierarchy_level - 1) == balance['level'])" |
| 113 | + > |
| 114 | + <t |
| 115 | + t-call="account_financial_report.report_trial_balance_line" |
| 116 | + /> |
| 117 | + </t> |
| 118 | + </t> |
| 119 | + <t t-else=""> |
64 | 120 | <t |
65 | 121 | t-call="account_financial_report.report_trial_balance_line" |
66 | 122 | /> |
67 | 123 | </t> |
68 | 124 | </t> |
69 | | - <t t-else=""> |
70 | | - <t |
71 | | - t-call="account_financial_report.report_trial_balance_line" |
72 | | - /> |
73 | | - </t> |
74 | | - </t> |
75 | | - </div> |
| 125 | + </div> |
| 126 | + </t> |
76 | 127 | </t> |
77 | 128 | <!-- Display partner lines --> |
78 | 129 | <t t-if="show_partner_details"> |
|
279 | 330 | ('date', '<', date_from)]" |
280 | 331 | /> |
281 | 332 | <span |
282 | | - t-att-domain="domain+aml_domain_common" |
| 333 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
283 | 334 | res-model="account.move.line" |
284 | 335 | > |
285 | 336 | <t |
|
335 | 386 | ('debit', '<>', 0)]" |
336 | 387 | /> |
337 | 388 | <span |
338 | | - t-att-domain="domain+aml_domain_common" |
| 389 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
339 | 390 | res-model="account.move.line" |
340 | 391 | > |
341 | 392 | <t |
|
395 | 446 | ('credit', '<>', 0)]" |
396 | 447 | /> |
397 | 448 | <span |
398 | | - t-att-domain="domain+aml_domain_common" |
| 449 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
399 | 450 | res-model="account.move.line" |
400 | 451 | > |
401 | 452 | <t |
|
455 | 506 | ('balance', '<>', 0)]" |
456 | 507 | /> |
457 | 508 | <span |
458 | | - t-att-domain="domain+aml_domain_common" |
| 509 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
459 | 510 | res-model="account.move.line" |
460 | 511 | > |
461 | 512 | <t |
|
512 | 563 | ('date', '<=', date_to)]" |
513 | 564 | /> |
514 | 565 | <span |
515 | | - t-att-domain="domain+aml_domain_common" |
| 566 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
516 | 567 | res-model="account.move.line" |
517 | 568 | > |
518 | 569 | <t |
|
570 | 621 | t-value="[('account_id', '=', balance['id'])]" |
571 | 622 | /> |
572 | 623 | <span |
573 | | - t-att-domain="domain+aml_domain_common" |
| 624 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
574 | 625 | res-model="account.move.line" |
575 | 626 | > |
576 | 627 | <t |
|
629 | 680 | t-value="[('account_id', '=', balance['id'])]" |
630 | 681 | /> |
631 | 682 | <span |
632 | | - t-att-domain="domain+aml_domain_common" |
| 683 | + t-att-domain="domain+aml_domain_common+aml_domain_extra" |
633 | 684 | res-model="account.move.line" |
634 | 685 | > |
635 | 686 | <t |
|
835 | 886 | <div class="act_as_row labels" style="font-weight: bold;"> |
836 | 887 | <!--## date--> |
837 | 888 | <div class="act_as_cell first_column" style="width: 33%;"> |
838 | | - <span t-out="accounts_data[account_id]['code']" /> |
839 | | - - |
840 | | - <span t-out="accounts_data[account_id]['name']" /> |
| 889 | + <t |
| 890 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 891 | + > |
| 892 | + <span t-out="balance['name']" /> |
| 893 | + </t> |
| 894 | + <t t-else=""> |
| 895 | + <span t-out="accounts_data[account_id]['code']" /> |
| 896 | + - |
| 897 | + <span t-out="accounts_data[account_id]['name']" /> |
| 898 | + </t> |
841 | 899 | </div> |
842 | 900 | <!--## Initial Balance--> |
843 | 901 | <div class="act_as_cell amount" style="width: 9%;"> |
844 | | - <span |
845 | | - t-out="total_amount[account_id]['initial_balance']" |
846 | | - t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
847 | | - /> |
| 902 | + <t |
| 903 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 904 | + > |
| 905 | + <span |
| 906 | + t-out="balance['initial_balance']" |
| 907 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 908 | + /> |
| 909 | + </t> |
| 910 | + <t t-else=""> |
| 911 | + <span |
| 912 | + t-out="total_amount[account_id]['initial_balance']" |
| 913 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 914 | + /> |
| 915 | + </t> |
848 | 916 | </div> |
849 | 917 | <!--## Debit--> |
850 | 918 | <div class="act_as_cell amount" style="width: 9%;"> |
851 | | - <span |
852 | | - t-out="total_amount[account_id]['debit']" |
853 | | - t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
854 | | - /> |
| 919 | + <t |
| 920 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 921 | + > |
| 922 | + <span |
| 923 | + t-out="balance['debit']" |
| 924 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 925 | + /> |
| 926 | + </t> |
| 927 | + <t t-else=""> |
| 928 | + <span |
| 929 | + t-out="total_amount[account_id]['debit']" |
| 930 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 931 | + /> |
| 932 | + </t> |
855 | 933 | </div> |
856 | 934 | <!--## Credit--> |
857 | 935 | <div class="act_as_cell amount" style="width: 9%;"> |
858 | | - <span |
859 | | - t-out="total_amount[account_id]['credit']" |
860 | | - t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
861 | | - /> |
| 936 | + <t |
| 937 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 938 | + > |
| 939 | + <span |
| 940 | + t-out="balance['credit']" |
| 941 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 942 | + /> |
| 943 | + </t> |
| 944 | + <t t-else=""> |
| 945 | + <span |
| 946 | + t-out="total_amount[account_id]['credit']" |
| 947 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 948 | + /> |
| 949 | + </t> |
862 | 950 | </div> |
863 | 951 | <!--## Period balance--> |
864 | 952 | <div class="act_as_cell amount" style="width: 9%;"> |
865 | | - <span |
866 | | - t-out="total_amount[account_id]['balance']" |
867 | | - t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
868 | | - /> |
| 953 | + <t |
| 954 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 955 | + > |
| 956 | + <span |
| 957 | + t-out="balance['balance']" |
| 958 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 959 | + /> |
| 960 | + </t> |
| 961 | + <t t-else=""> |
| 962 | + <span |
| 963 | + t-out="total_amount[account_id]['balance']" |
| 964 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 965 | + /> |
| 966 | + </t> |
869 | 967 | </div> |
870 | 968 | <!--## Ending balance--> |
871 | 969 | <div class="act_as_cell amount" style="width: 9%;"> |
872 | | - <span |
873 | | - t-out="total_amount[account_id]['ending_balance']" |
874 | | - t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
875 | | - /> |
| 970 | + <t |
| 971 | + t-if="grouped_by and balance['type'] in ('analytic_account_type', 'total')" |
| 972 | + > |
| 973 | + <span |
| 974 | + t-out="balance['ending_balance']" |
| 975 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 976 | + /> |
| 977 | + </t> |
| 978 | + <t t-else=""> |
| 979 | + <span |
| 980 | + t-out="total_amount[account_id]['ending_balance']" |
| 981 | + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" |
| 982 | + /> |
| 983 | + </t> |
876 | 984 | </div> |
877 | 985 | <t t-if="foreign_currency"> |
878 | 986 | <!--## amount_total_due_currency--> |
|
0 commit comments