summaryrefslogtreecommitdiff
path: root/base_accounting_kit/report/report_journal_audit.xml
blob: 0ab38ac4350eb332e48cf4ece01e1c9747fd8f13 (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
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <template id="report_journal_audit">
            <t t-call="web.html_container">
                <t t-call="web.internal_layout">
                    <t t-foreach="docs" t-as="o">
                        <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">
                            <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
                            <h2>
                                <t t-esc="o.name"/>
                                Journal
                            </h2>

                            <div class="row mt32">

                                <div class="col-3">
                                    <strong>Company:</strong>
                                    <p t-esc="env.company.name"/>
                                </div>

                                <div class="col-3">
                                    <strong>Journal:</strong>
                                    <p t-esc="o.name"/>
                                </div>

                                <div class="col-3">
                                    <strong>Entries Sorted By:</strong>
                                    <p t-if="data['form'].get('sort_selection') != 'l.date'">Journal Entry Number</p>
                                    <p t-if="data['form'].get('sort_selection') == 'l.date'">Date</p>
                                </div>

                                <div class="col-3">
                                    <strong>Target Moves:</strong>
                                    <p t-if="data['form']['target_move'] == 'all'">All Entries</p>
                                    <p t-if="data['form']['target_move'] == 'posted'">All Posted Entries</p>
                                </div>

                            </div>

                            <table class="table table-sm">
                                <thead>
                                    <tr>
                                        <th>Move</th>
                                        <th>Date</th>
                                        <th>Account</th>
                                        <th>Partner</th>
                                        <th>Label</th>
                                        <th>Debit</th>
                                        <th>Credit</th>
                                        <th t-if="data['form']['amount_currency']">Currency</th>
                                    </tr>
                                </thead>

                                <tbody>
                                    <tr t-foreach="lines[o.id]" t-as="aml">
                                        <td>
                                            <span t-esc="aml.move_id.name != '/' and aml.move_id.name or ('*'+str(aml.move_id.id))"/>
                                        </td>
                                        <td>
                                            <span t-field="aml.date"/>
                                        </td>
                                        <td>
                                            <span t-field="aml.account_id.code"/>
                                        </td>
                                        <td>
                                            <span t-esc="aml.sudo().partner_id and aml.sudo().partner_id.name and aml.sudo().partner_id.name[:23] or ''"/>
                                        </td>
                                        <td>
                                            <span t-esc="aml.name and aml.name[:35]"/>
                                        </td>
                                        <td>
                                            <span t-esc="aml.debit"
                                                  t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                        </td>
                                        <td>
                                            <span t-esc="aml.credit"
                                                  t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                        </td>
                                        <td t-if="data['form']['amount_currency'] and aml.amount_currency">
                                            <span t-esc="aml.amount_currency"
                                                  t-options="{'widget': 'monetary', 'display_currency': aml.currency_id}"/>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

                            <div class="row">
                                <div class="col-4 pull-right">
                                    <table class="table table-sm">
                                        <tr>
                                            <td>
                                                <strong>Total</strong>
                                            </td>
                                            <td>
                                                <span t-esc="sum_debit(data, o)"
                                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                            </td>
                                            <td>
                                                <span t-esc="sum_credit(data, o)"
                                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-4">
                                    <table class="table table-sm table-reports">
                                        <thead>
                                            <tr>
                                                <th colspan="3">Tax Declaration</th>
                                            </tr>
                                            <tr>
                                                <th>Name</th>
                                                <th>Base Amount</th>
                                                <th>Tax Amount</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <t t-set="taxes" t-value="get_taxes(data, o)"/>
                                            <tr t-foreach="taxes" t-as="tax">
                                                <td>
                                                    <span t-esc="tax.name"/>
                                                </td>
                                                <td>
                                                    <span t-esc="taxes[tax]['base_amount']"
                                                          t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                                </td>
                                                <td>
                                                    <span t-esc="taxes[tax]['tax_amount']"
                                                          t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <p style="page-break-after: always;"/>
                        </div>
                    </t>
                </t>
            </t>
        </template>
    </data>
</odoo>