summaryrefslogtreecommitdiff
path: root/dynamic_accounts_report/report/cash_flow_report.xml
blob: b9c6d36fef790290b71974e41d88cb5353029f35 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<odoo>



     <template id="dynamic_accounts_report.cash_flow">
        <t t-call="web.html_container">
            <t t-call="web.internal_layout">
                <div style="font-size:12px" class="col-4">

                    <b>Report Date :</b>
                   <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
                    <span t-esc='today'/>
                    <br/>
                    <span  t-esc='logged_users'/>
                </div>

                <div class="page">
                    <h4 style="padding-left:10px !important">Cash Flow statements</h4>
                    <div style="width:90%;margin:1px auto;font-size:12px" class="row mt32 mb32">


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

                                <div class="col-3">
                                    <t t-if="Filters.get('levels')">
                                        <strong>Level :</strong>
                                        <li>
                                            <t t-esc="Filters['levels']"/>
                                         </li>
                                    </t>

                                </div>

                        <div class="col-4">

                            <p>
                                 <t t-if="Filters.get('date_from')">
                                <strong>Date from :</strong>
                                <span t-esc="Filters.get('date_from')"/>
                                 </t>
                                <br/>
                                <t t-if="Filters.get('date_to')">
                                <strong>Date to :</strong>
                                <span t-esc="Filters.get('date_to')"/>
                                </t>
                            </p>

                        </div>

                    </div>
                    <div>

                        <br></br>
                         <table style="width:90%;margin:2px auto;" class="table table-condensed">
                        <thead>
                            <tr style="font-size:13px;  padding: 0.25rem !important;">
                                <th>Name</th>
                                <th class="text-right">Cash In</th>
                                <th class="text-right">Cash Out</th>
                                <th class="text-right">Balance</th>
                            </tr>
                        </thead>

                        <tbody style="font-size:12px" t-foreach="account_data['fetched_data']" t-as="fetch">
                            <tr t-if="Filters['levels' ] == 'summary'">
                                <td>
                                    <span t-esc="fetch['month_part']"/>

                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_debit']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_credit']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_balance']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                            </tr>

                            <tr style="font-size:13px" t-if="Filters['levels' ] == 'consolidated'">
                                <td>
                                    <span t-esc="fetch['name']"/>
                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_debit']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_credit']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                                <td class="text-right">
                                    <span t-esc="fetch['total_balance']"
                                          t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                </td>
                            </tr>
                        </tbody>

                        <tbody style="font-size:12px" t-if="Filters['levels' ] == 'detailed' " t-foreach="account_data['journal_res']" t-as="res">
                            <tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet">
                                <td>
                                    <strong>
                                        <span t-esc="fet['code']"/>
                                        <span t-esc="fet['name']"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_debit']"
                                              t-options="{'widget': 'monetary',
                                                  'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_credit']"
                                              t-options="{'widget': 'monetary',
                                                   'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_debit'] - fet['total_credit']"
                                              t-options="{'widget': 'monetary',
                                                   'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>
                                <tr t-foreach="res['journal_lines']" t-as="mov">
                                    <td style="padding-left:50px !important" class="text-left">
                                        <span t-esc="mov['name']"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="mov['total_debit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="mov['total_credit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="mov['total_debit'] - mov['total_credit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                </tr>
                            </tr>
                        </tbody>
                        <tbody style="font-size:12px" t-if="Filters['levels' ] == 'very' or Filters['levels' ] ==false " t-foreach="account_data['account_res']" t-as="res">
                            <tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet">
                                <td>
                                    <strong>
                                        <span t-esc="fet['code']"/>
                                        <span t-esc="fet['name']"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_debit']"
                                              t-options="{'widget': 'monetary',
                                                  'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_credit']"
                                              t-options="{'widget': 'monetary',
                                                   'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>
                                <td class="text-right">
                                    <strong>
                                        <span t-esc="fet['total_debit'] - fet['total_credit']"
                                              t-options="{'widget': 'monetary',
                                                   'display_currency': res_company.currency_id}"/>
                                    </strong>
                                </td>


                                <tr t-if="line['account_name'] == res['account']"
                                    t-foreach="res['journal_lines']" t-as="line">
                                    <td style="padding-left:20px !important" class="text-left">
                                        <span t-esc="line['name']"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="line['total_debit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="line['total_credit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                    <td class="text-right">
                                        <span t-esc="line['total_debit'] - line['total_credit']"
                                              t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                    </td>
                                    <tr t-if="mov['name'] == line['name']" t-foreach="res['move_lines']"
                                        t-as="mov">
                                        <td style="padding-left:50px !important" class="text-left">
                                            <span t-esc="mov['move_name']"/>
                                        </td>
                                        <td class="text-right">
                                            <span t-esc="mov['total_debit']"
                                                  t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                        </td>
                                        <td class="text-right">
                                            <span t-esc="mov['total_credit']"
                                                  t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                        </td>
                                        <td class="text-right">
                                            <span t-esc="mov['total_debit'] - mov['total_credit']"
                                                  t-options="{'widget': 'monetary',
                                               'display_currency': res_company.currency_id}"/>
                                        </td>
                                    </tr>
                                </tr>
                            </tr>

                        </tbody>

                    </table>
                    </div>
                    <br></br>
                </div>
            </t>
        </t>
    </template>







    <record id="action_print_cash_flow" model="ir.actions.report">
            <field name="name">cash_flow</field>
            <field name="model">account.cash.flow</field>
            <field name="report_type">qweb-pdf</field>
            <field name="report_name">dynamic_accounts_report.cash_flow</field>
            <field name="report_file">dynamic_accounts_report.cash_flow</field>
    </record>
</odoo>