summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/advance_payment_request.xml
blob: 4faf905e831ec3446b78091e1b2ffcb7a28fad28 (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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="view_form_advance_payment_request" model="ir.ui.view">
        <field name="name">advance.payment.request.form</field>
        <field name="model">advance.payment.request</field>
        <field name="arch" type="xml">
            <form string="Advance Payment Request &amp; Reimburse" duplicate="0" delete="false">
                <header>
                    <button name="action_realisasi_pum"
                        type="object"
                        string="Realisasi"
                        class="btn-primary"
                        attrs="{'invisible': ['|',
                            ('status', '!=', 'approved'), 
                            '|', ('type_request', '!=', 'pum'),
                            ('has_settlement', '=', True)]}"/>
                    <button name="action_approval_check"
                        type="object"
                        string="Checking/Approval"
                        class="btn-success"
                         attrs="{'invisible': [('status', 'in', ['approved','cancel','draft'])]}"/>
                    <button name="action_confirm_payment"
                        type="object"
                        string="Konfirmasi Pembayaran"
                        class="btn-info"
                        attrs="{'invisible': ['|', ('status', 'not in', ['approved']), ('status_pay_down_payment', '=', 'payment')]}"/>
                    <button name="action_ap_only"
                        type="object"
                        string="Buat Jurnal PUM"
                        class="btn-info"
                        attrs="{'invisible': ['|', 
                            ('status', 'not in', ['approved']), 
                            '|', 
                            ('is_cab_visible', '=', True), 
                            ('type_request', '!=', 'pum')
                        ]}"/>
                    <button name="action_open_create_reimburse_cab"
                        type="object"
                        string="Buat Jurnal Reimburse"
                        class="btn-info"
                        attrs="{'invisible': ['|', 
                            ('status', 'not in', ['approved']), 
                            '|', 
                            ('is_cab_visible', '=', True), 
                            ('type_request', '!=', 'reimburse')
                        ]}"/>
                    <button name="action_open_cancel_wizard" 
                        string="Cancel" 
                        type="object" 
                        class="btn-danger" 
                        attrs="{'invisible': ['|',('status', 'in', ['draft', 'cancel']), ('status_pay_down_payment', '=', 'payment')]}"/>
                    <field name="status" widget="statusbar"
                        statusbar_visible="draft,pengajuan1,pengajuan2,pengajuan3,approved"
                        statusbar_colors='{"reject":"red"}'
                        readonly="1"/>
                </header>
                <sheet>
                    <widget name="web_ribbon" title="Payment" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'payment'), ('status', '=', 'draft')]}"/>
                    <widget name="web_ribbon" title="Pending" bg_color="bg-warning" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'pending'), ('status', '=', 'draft')]}"/>
                    <widget name="web_ribbon" title="Cancel" bg_color="bg-danger" attrs="{'invisible': ['|', ('status_pay_down_payment', '!=', 'cancel'), ('status', '=', 'draft')]}"/>
                    <div class="oe_button_box" name="button_box" style="right: 150px;">
                        <field name="has_settlement" invisible="1"/>
                        <button name="action_realisasi_pum"
                                type="object"
                                class="oe_stat_button"
                                icon="fa-check-square-o"
                                style="width: 280px;"
                                attrs="{'invisible': ['|', ('status', '!=', 'approved'), ('has_settlement', '=', False)]}">
                                <!-- <field name="settlement_ids" widget="statinfo" string="Realisasi PUM"/> -->
                                <field name="settlement_name" widget="statinfo" string="Realisasi PUM"/>
                        </button>
                        <field name="is_cab_visible" invisible="1"/>
                        <field name="is_current_user_ap" invisible="1"/>
                        <button type="object"
                            name="action_view_journal_uangmuka"
                            class="oe_stat_button"
                            icon="fa-book"
                            attrs="{'invisible': [('is_cab_visible', '=', False)]}"
                            style="width: 200px;">
                            <field name="move_id" widget="statinfo" string="Journal Uang Muka"/>
                            <span class="o_stat_text">
                                <t t-esc="record.move_id.name"/>
                            </span>
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1>
                            <field name="number" readonly="1"/>
                        </h1>
                    </div>
                    <group col="2">
                        <group string=" ">
                            <field name="type_request" attrs="{'readonly': [('status', '=', 'approved')]}"/>
                            <field name="is_represented" attrs="{'readonly': [('status', '=', 'approved')]}"/>
                            <p style="font-size: 11px; color: grey; font-style: italic" >*Centang jika Anda membuat pengajuan ini untuk orang lain.</p>
                            <field name="applicant_name" colspan="2" attrs="{'readonly': ['|', ('status', '=', 'approved'), ('is_represented', '=', False)]}" force_save="1"/>
                            <field name="position_type" force_save="1" readonly="1"/>
                            <field name="nominal" colspan="2" attrs="{'readonly': ['|', ('status', '=', 'approved'), ('type_request', '=', 'reimburse')]}" force_save="1"/>
                            <p style="font-size: 11px; color: grey; font-style: italic" attrs="{'invisible': [('type_request', '!=', 'reimburse')]}">*Nominal terisi otomatis sesuai grand total rincian reimburse</p>
                            <field name="bank_name" colspan="2" attrs="{'readonly': [('status', '=', 'approved')]}"/>
                            <field name="account_name" colspan="2" attrs="{'readonly': ['|', ('status', '=', 'approved'), ('is_represented', '=', False)]}" force_save="1"/>
                            <field name="bank_account" colspan="2" attrs="{'readonly': [('status', '=', 'approved')]}"/>
                            <field name="detail_note" attrs="{'readonly': [('status', '=', 'approved')]}"/>
                            <br/>
                            <field name="user_id" readonly="1"/>
                            <!-- <field name="position_type" readonly="1"/> -->
                            <!-- <field name="partner_id" readonly="1"/> -->
                            <field name="departement_type"/>
                            <field name="apr_perjalanan" attrs="{'invisible': [('type_request', '=', 'reimburse')]}"/>
                            <field name="date_back_to_office" attrs="{'invisible': [('apr_perjalanan', '=', False)]}"/>
                            <p style="font-size: 10px; color: grey; font-style: italic" attrs="{'invisible': [('apr_perjalanan', '=', False)]}">*Setelah tanggal kembali, pemohon diharapkan untuk segera memproses realisasi PUM</p>
                            <field name="estimated_return_date" readonly="1" widget="badge" attrs="{'invisible': [('type_request', '=', 'reimburse')]}"/>
                            <field name="days_remaining" readonly="1" widget="badge" attrs="{'invisible': [('type_request', '=', 'reimburse')]}"/>
                            <field name="approved_by" readonly="1"/>
                            <field name="create_date" readonly="1"/>
                            <field name="status_pay_down_payment"
                                readonly="1"            
                                decoration-success="status_pay_down_payment == 'payment'"
                                decoration-warning="status_pay_down_payment == 'pending'"
                                decoration-danger="status_pay_down_payment == 'cancel'"
                                widget="badge" invisible = "1"/>
                        </group>
                        <group string="Bukti Transfer">
                            <field name="upload_attachment_date" readonly="1"/>
                            <field name="attachment_type" attrs="{'readonly': [('is_current_user_ap', '=', False)]}" />
                                <field name="attachment_file_pdf" filename="attachment_filename"
                                    widget="pdf_viewer"
                                    attrs="{'invisible': [('attachment_type', '!=', 'pdf')], 'readonly': [('is_current_user_ap', '=', False)]}"/>

                                <field name="attachment_file_image" filename="attachment_filename"
                                    widget="image"
                                    attrs="{'invisible': [('attachment_type', '!=', 'image')], 'readonly': [('is_current_user_ap', '=', False)]}"
                                    style="max-width:250px; max-height:250px; object-fit:contain;"/>
                                <br/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Rincian Estimasi PUM" attrs="{'invisible': [('type_request', '!=', 'pum')]}">
                            <p style="font-size: 12px; color: grey; font-style: italic">*Masukkan estimasi alokasi biaya sebagai gambaran rencana penggunaan dana, tidak harus diisi dengan nominal yang akurat</p>
                            <field name="estimate_line_ids">
                                <tree>
                                    <field name="category_estimate"/>
                                    <field name="description"/>
                                    <field name="nominal" sum="Total"/>
                                    <field name="currency_id" invisible="1"/>
                                </tree>
                                <form>
                                    <group col="2">
                                        <field name="request_id" invisible="1"/>
                                        <field name="category_estimate"/>
                                        <field name="description" placeholder="Deskripsi tambahan untuk rincian estimasi..."/>
                                        <field name="nominal"/>
                                        <field name="currency_id" invisible="1"/>
                                    </group>
                                </form>
                            </field>
                        </page>
                        <page string="Rincian Reimburse" attrs="{'invisible': [('type_request', '!=', 'reimburse')]}">
                            <field name="reimburse_line_ids">
                                <tree>
                                    <field name="sequence" widget="handle"/>
                                    <field name="date"/>
                                    <field name="description"/>
                                    <field name="account_id"/>
                                    <!-- <field name="distance"/> -->
                                    <field name="quantity"/>
                                    <field name="price_unit"/>
                                    <field name="total" sum="Total"/>
                                    <field name="is_checked"/>
                                    <field name="currency_id" invisible="1"/>
                                </tree>
                                <form>
                                    <group col="2">
                                        <group string="Form">
                                            <field name="request_id" invisible="1"/>
                                            <field name="date"/>
                                            <field name="is_vehicle"/>
                                            <field name="vehicle_type" attrs="{'invisible': [('is_vehicle', '=', False)]}"/>
                                            <field name="description"/>
                                            <field name="distance_departure" attrs="{'invisible': [('is_vehicle', '=', False)]}"/>
                                            <field name="distance_return" attrs="{'invisible': [('is_vehicle', '=', False)]}"/>
                                            <field name="quantity"/>
                                            <field name="price_unit" attrs="{'readonly': [('is_vehicle', '=', True)]}" force_save ="1"/>
                                            <field name="total" readonly="1"/>
                                            <field name="currency_id" invisible="1"/>
                                            <field name="attachment_type"/>
                                            <field name="attachment_pdf" filename="attachment_filename"
                                                widget="pdf_viewer"
                                                attrs="{'invisible': [('attachment_type', '!=', 'pdf')]}"/>
                                            <field name="attachment_image" filename="attachment_filename"
                                                widget="image"
                                                attrs="{'invisible': [('attachment_type', '!=', 'image')]}"
                                                style="max-width:250px; max-height:250px; object-fit:contain;"/>
                                        </group>
                                        <group string="Finance">
                                            <field name="is_current_user_ap" invisible="1"/>
                                            <field name="is_checked" attrs="{'readonly': [('is_current_user_ap', '=', False)]}"/>
                                            <field name="account_id" placeholder="Hanya Finance yang boleh isi" attrs="{'readonly': [('is_current_user_ap', '=', False)]}"/>
                                        </group>
                                    </group>
                                </form>
                            </field>
                            <group class="oe_subtotal_footer oe_right" name="reimburse_total">
                                <field name="currency_id" invisible="1"/>
                                <field name="grand_total_reimburse" 
                                    widget="monetary" 
                                    options="{'currency_field': 'currency_id'}"/>
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>

    <record id="view_tree_advance_payment_request" model="ir.ui.view">
        <field name="name">advance.payment.request.tree</field>
        <field name="model">advance.payment.request</field>
        <field name="arch" type="xml">
            <tree delete="false">
                <field name="number"/>
                <field name="applicant_name"/>
                <field name="nominal"/>
                <field name="departement_type" optional='hide'/>
                <field name="status"
                    readonly="1"
                    decoration-success="status == 'approved'"
                    decoration-danger="status == 'reject'"
                    widget="badge" optional="show"/>
                <field name="status_pay_down_payment"
                    readonly="1"
                    decoration-success="status_pay_down_payment == 'payment'"
                    decoration-warning="status_pay_down_payment == 'pending'"
                    decoration-danger="status_pay_down_payment == 'cancel'"
                    widget="badge"/>
                <field name="days_remaining" readonly="1" widget="badge" optional="hide"/>
                <field name="estimated_return_date" widget="badge" optional="hide"/>
                <field name="user_id" optional="hide"/>
            </tree>
        </field>
    </record>

    <record id="view_advance_payment_request_filter" model="ir.ui.view">
        <field name="name">advance.payment.request.filter</field>
        <field name="model">advance.payment.request</field>
        <field name="arch" type="xml">
            <search string="Search APR &amp; Reimburse">
                <field name="number" string="No. Dokumen"/>
                <field name="applicant_name" string="Nama Pemohon"/>
                <filter string="My Requests" name="my_requests" domain="['|', ('applicant_name', '=', uid), ('user_id', '=', uid)]"/>
                <separator/>
                <filter string="PUM" name="filter_pum" domain="[('type_request','=','pum')]"/>
                <filter string="Reimburse" name="filter_reimburse" domain="[('type_request','=','reimburse')]"/>
                <separator/>
                <filter string="Cancelled" name="filter_cancelled" domain="[('status','=','cancel')]"/>
                <filter string="Waiting for Approval" name="filter_waiting_approval" domain="[('status','in',['pengajuan1','pengajuan2','pengajuan3'])]"/>
                <filter string="Approved" name="filter_approved" domain="[('status','=','approved')]"/>
                <separator/>
                <filter string="Payment Pending" name="filter_payment_pending" domain="[('status_pay_down_payment','=','pending')]"/>
                <filter string="Payment Done" name="filter_payment_done" domain="[('status_pay_down_payment','=','payment')]"/>
                <group expand="0" string="Group By">
                    <filter string="Pemohon" name="group_by_applicant" context="{'group_by':'applicant_name'}"/>
                    <filter string="Departement" name="group_by_departement" context="{'group_by':'departement_type'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="action_advance_payment_request" model="ir.actions.act_window">
        <field name="name">Pengajuan Uang Muka &amp; Reimburse</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">advance.payment.request</field>
        <field name="view_mode">tree,form</field>
        <field name="context">{'search_default_my_requests': 1}</field>
        <field name="search_view_id" ref="view_advance_payment_request_filter"/> 
    </record>

    <menuitem id="menu_advance_payment_request_acct"
        name="Pengajuan Uang Muka &amp; Reimburse"
        parent="account.menu_finance_entries"
        sequence="114"
        action="action_advance_payment_request"
    />
    
    <menuitem id="menu_advance_payment_request_sales"
        name="Pengajuan Uang Muka &amp; Reimburse"
        parent="indoteknik_custom.menu_monitoring_in_sale"
        sequence="101"
        action="action_advance_payment_request"
    />

    <record id="view_advance_payment_create_bill_form" model="ir.ui.view">
        <field name="name">advance.payment.create.bill.form</field>
        <field name="model">advance.payment.create.bill</field>
        <field name="arch" type="xml">
            <form string="Create CAB AP Only">
                <group>
                    <field name="nominal"/>
                    <field name="account_id"/>
                </group>
                <footer>
                    <button name="action_create_cab" type="object" string="Create CAB" class="btn-primary"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_advance_payment_create_bill" model="ir.actions.act_window">
        <field name="name">Create CAB AP Only</field>
        <field name="res_model">advance.payment.create.bill</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_advance_payment_create_bill_form"/>
        <field name="target">new</field>
    </record>


    <record id="view_form_create_reimburse_cab_wizard" model="ir.ui.view">
        <field name="name">create.reimburse.cab.wizard.form</field>
        <field name="model">create.reimburse.cab.wizard</field>
        <field name="arch" type="xml">
            <form string="Buat Jurnal Reimburse">
                <p>Pilih akun bank yang akan digunakan untuk jurnal kredit.</p>
                <group>
                    <field name="total_reimburse"/>
                    <field name="account_id" options="{'no_create': True, 'no_open': True}"/>
                    <field name="currency_id" invisible="1"/>
                </group>
                <footer>
                    <button name="action_create_reimburse_cab" type="object" string="Buat Jurnal" class="btn-primary"/>
                    <button string="Batal" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_create_reimburse_cab_wizard" model="ir.actions.act_window">
        <field name="name">Buat Jurnal Reimburse</field>
        <field name="res_model">create.reimburse.cab.wizard</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_form_create_reimburse_cab_wizard"/>
        <field name="target">new</field>
    </record>

    <record id="view_advance_payment_cancel_wizard_form" model="ir.ui.view">
            <field name="name">advance.payment.cancel.wizard.form</field>
            <field name="model">advance.payment.cancel.wizard</field>
            <field name="arch" type="xml">
                <form string="Batalkan Pengajuan">
                    <sheet>
                        <group>
                            <div class="alert alert-warning" role="alert" style="margin-bottom: 10px;">
                                Apakah Anda yakin ingin membatalkan pengajuan ini? 
                                Silakan isi alasan pembatalan di bawah ini.
                            </div>
                        </group>
                        <group>
                            <field name="reason"/>
                        </group>
                    </sheet>
                    <footer>
                        <button name="action_confirm_cancel" 
                                string="Konfirmasi Cancel" 
                                type="object" 
                                class="btn-danger"/>
                        
                        <button string="Tutup" 
                                class="btn-secondary" 
                                special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>
</odoo>