summaryrefslogtreecommitdiff
path: root/dynamic_accounts_report/report/financial_report_template.xml
blob: 6bd2608ee4e823cf911fe4fa680c24d85af0abd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="dynamic_accounts_report.balance_sheet">
        <t t-call="web.html_container">
            <t t-call="web.internal_layout">
                <t t-set="data_report_margin_top" t-value="12"/>
                <t t-set="data_report_header_spacing" t-value="9"/>
                <t t-set="data_report_dpi" t-value="110"/>
                <div class="page">
                    <h3><span t-esc="Filters.get('company_name')"/>: <span t-esc="report_name"/>
                    </h3>

                    <div>
                        <span t-if="Filters.get('date_from')">
                        <strong> From:</strong>
                        <t t-esc="Filters['date_from']"/>
                        </span>

                        <span t-if="Filters.get('date_to')">
                        <strong>To:</strong>
                        <t t-esc="Filters['date_to']"/>
                        </span>

                        <div style="width:100%;">
                            <div style="text-align:centre;" class="row">

                                <div class="col-2">
                                    <strong>Journals:</strong>
                                    <t t-foreach="Filters['journals']" t-as="ps">
                                        <li>
                                            <t t-esc="ps"/>
                                        </li>
                                    </t>
                                </div>

                                <div class="col-2">
                                        <strong>Accounts:</strong>
                                        <t t-foreach="Filters['accounts']" t-as="ps">
                                            <li>
                                                <t t-esc="ps"/>
                                            </li>
                                        </t>
                                </div>

                                <div class="col-2">
                                        <strong>Account Tags:</strong>
                                        <t t-foreach="Filters['account_tags']" t-as="ps">
                                            <li>
                                                <t t-esc="ps"/>
                                            </li>
                                        </t>
                                </div>
                                <div class="col-2">
                                    <strong>Analytic:</strong>
                                    <t t-foreach="Filters['analytics']" t-as="ps">
                                        <li>
                                            <t t-esc="ps"/>
                                        </li>
                                    </t>
                                </div>

                                 <div class="col-2">
                                        <strong>Analytic Tag:</strong>
                                        <t t-foreach="Filters['analytic_tags']" t-as="ps">
                                            <li>
                                                <t t-esc="ps"/>
                                            </li>
                                        </t>
                                </div>

                                <div class="col-3">
                                    <strong>Target move:</strong>
                                        <li>
                                            <t t-esc="Filters['target_move']"/>
                                        </li>
                                </div>
                            </div>
                        </div>
                    </div>
                    <br></br>

                    <table class="table table-sm table-reports">
                        <thead>
                            <tr>
                                <th></th>
                                <th class="text-right">Debit</th>
                                <th class="text-right">Credit</th>
                                <th class="text-right">Balance</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr t-foreach="report_lines" t-as="a">

                                <t t-if="a['level'] != 0">
                                    <t t-if="a.get('level') &gt; 2">
                                            <t t-set="style" t-value="'font-weight: normal;'"/>
                                        </t>
                                        <t t-if="not a.get('level') &gt; 2">
                                            <t t-set="style" t-value="'font-weight: bold;'"/>
                                    </t>
                                    <t t-if="a.get('code')">
                                       <t t-foreach="account_data" t-as="line">
                                            <t t-if="line['code'] == a.get('code')">
                                                <tr>
                                                    <td>
                                                        <span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/>
                                                        <span t-att-style="style" t-esc="line['name']"/>
                                                    </td>
                                                    <td class="text-right">
                                                        <span t-esc="line['debit']"
                                                              t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                                    </td>
                                                    <td class="text-right">
                                                        <span t-esc="line['credit']"
                                                              t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                                    </td>
                                                    <td class="text-right">
                                                        <span t-esc="line['balance']"
                                                              t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                                    </td>
                                                </tr>
                                            </t>
                                        </t>
                                    </t>

                                    <t t-else="">

                                        <td>
                                            <span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/>
                                            <span t-att-style="style" t-esc="a.get('name')"/>
                                        </td>
                                        <td class="text-right" style="white-space: text-nowrap;">
                                            <span t-att-style="style" t-esc="a.get('debit')"
                                                  t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                        </td>
                                        <td class="text-right" style="white-space: text-nowrap;">
                                            <span t-att-style="style" t-esc="a.get('credit')"
                                                  t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                        </td>
                                        <td class="text-right" style="white-space: text-nowrap;">
                                            <span t-att-style="style" t-esc="a.get('balance')"
                                                  t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                        </td>
                                    </t>

                                </t>
                            </tr>
                        </tbody>
                    </table>


                </div>
            </t>
        </t>
    </template>

    <record id="action_print_balance_sheet" model="ir.actions.report">
            <field name="name">Financial Report</field>
            <field name="model">dynamic.balance.sheet.report</field>
            <field name="report_type">qweb-pdf</field>
            <field name="report_name">dynamic_accounts_report.balance_sheet</field>
            <field name="report_file">dynamic_accounts_report.balance_sheet</field>
    </record>

</odoo>