summaryrefslogtreecommitdiff
path: root/addons/account/views/report_statement.xml
blob: 39503d5ddb8e71d06ad2d08447ff6c9ea4c2881b (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
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <template id="report_statement">
            <t t-call="web.html_container">
                <t t-foreach="docs" t-as="o">
                    <t t-call="web.internal_layout">
                        <div class="page">
                            <div class="border border-top-0 border-right-0 border-left-0 border-info">
                                <div class="row">
                                    <div class="col-12">
                                        <h4 class="text-right w-100">
                                            <strong>
                                                <span t-if="o.journal_id.type == 'bank'">Bank Statement</span>
                                                <span t-else="">Cash Statement</span>
                                            </strong>
                                        </h4>
                                    </div>
                                </div>
                            </div>

                            <div class="pt-2 pb-2">
                                <div class="row">
                                    <div class="col-12">
                                        <h5>
                                            <strong>
                                                <span t-field="o.journal_id"/>
                                                <t t-if="o.journal_id.bank_account_id"> -
                                                    <span t-field="o.journal_id.bank_account_id"/>
                                                </t>
                                                <t t-if="o.journal_id.code"> -                                                
                                                    <span t-field="o.journal_id.code"/>
                                                </t>
                                            </strong>
                                        </h5>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-12">
                                        <h5>
                                            <strong>
                                                <t t-if="o.name">
                                                    <span t-field="o.name"/> 
                                                - </t>
                                                <span t-field="o.date"/>
                                            </strong>
                                        </h5>
                                    </div>
                                </div>
                            </div>

                            <table class="table table-lg m-0 table-borderless border border-right-0 border-left-0 border-info">
                                <tbody>
                                    <tr>
                                        <td class="pt-2 pb-2 pl-0 pr-0">
                                            <table class="table table-borderless m-0">
                                                <tr>
                                                    <td class="p-0 w-25">
                                                        <strong>Starting Balance</strong>
                                                    </td>
                                                    <td class="p-0">
                                                        <strong>
                                                            <span t-esc="o.line_ids and o.line_ids.sorted(lambda line: line.date)[0].date" t-options='{"widget": "date"}'/>
                                                        </strong>
                                                    </td>
                                                    <td class="text-right p-0">
                                                        <strong>
                                                            <span t-field="o.balance_start"/>
                                                        </strong>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="p-0 w-25">
                                                        <strong>Ending Balance</strong>
                                                    </td>
                                                    <td class="p-0">
                                                        <strong>
                                                            <span t-esc="o.line_ids and o.line_ids.sorted(lambda line: line.date)[-1].date" t-options='{"widget": "date"}'/>
                                                        </strong>
                                                    </td>
                                                    <td class="text-right p-0">
                                                        <strong>
                                                            <span t-field="o.balance_end_real"/>
                                                        </strong>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

                            <table class="table table-borderless m-0">
                                <tbody>
                                    <tr t-foreach="o.line_ids" t-as="line" class="pb-2">
                                        <td class="pl-0 pr-0">
                                            <table class="table table-borderless">
                                                <tr>
                                                    <td class="p-0 w-25">
                                                        <span class="d-block font-weight-bold" t-field="line.date"/>
                                                    </td>
                                                    <td class="p-0">
                                                        <span class="d-block font-weight-bold" t-if="line.partner_id" t-field="line.partner_id"/>
                                                        <span class="d-block" t-if="line.partner_bank_id" t-field="line.partner_bank_id"/>
                                                        <span class="d-block" t-if="line.payment_ref" t-field="line.payment_ref"/>
                                                        <span class="d-block" t-if="line.narration" t-field="line.narration"/>
                                                    </td>
                                                    <td class="text-right p-0">
                                                        <span class="d-block font-weight-bold" t-field="line.amount"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </t>
                </t>
            </t>
        </template>
    </data>
</odoo>