summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/advance_payment_settlement.xml
blob: a8bf1de75be6ffaa55ccecbf2d649f015e2c64ca (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
<odoo>
    <record id="view_form_advance_payment_settlement" model="ir.ui.view">
        <field name="name">advance.payment.settlement.form</field>
        <field name="model">advance.payment.settlement</field>
        <field name="arch" type="xml">
            <form string="Advance Payment Settlement" duplicate="0" delete="false">
                <header>
                    <button name="action_cab"
                        type="object"
                        class="btn-info"
                        attrs="{'invisible': [ '|', ('is_cab_visible', '=', True),('status', '!=', 'approved')]}"
                        string="Buat Jurnal Realisasi"/>
                    <button name="action_approval_check"
                        type="object"
                        string="Checking/Approval"
                        class="btn-success"
                        attrs="{'invisible': [('status', '=', 'approved')]}"/>
                    <field name="status" widget="statusbar"
                        statusbar_visible="pengajuan1,pengajuan2,pengajuan3,approved"
                        statusbar_colors='{"reject":"red"}'
                        readonly="1"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <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)], 'readonly': [('is_current_user_ap', '=', False)]}"
                            style="width: 200px;">
                            <field name="move_id" widget="statinfo" string="Journal Entries"/>
                            <span class="o_stat_text">
                                <t t-esc="record.move_misc_id.name"/>
                            </span>
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1>
                            <field name="name" readonly="1"/>
                        </h1>
                    </div>
                    <group col="2">
                        <group>
                            <field name="pum_id" readonly="1"/>
                            <field name="title" required="1"/>
                            <field name="goals" required="1"/>
                            <field name="related" required="1"/>
                            <field name="note_approval"/>
                            <p style="font-size: 11px; color: grey; font-style: italic">*Lengkapi keterangan berikut selaras dengan realisasi yang dilakukan (sesuai dengan format surat yang ada)</p>
                            <br/><br/>
                            <field name="lot_of_attachment"/>
                            <field name="approved_by" readonly="1"/>
                            <field name="applicant_name" readonly="1"/>
                            <field name="user_id" readonly="1"/>  
                        </group>
                        <group attrs="{'invisible': [('lot_of_attachment', '!=', 'one_for_all_line')]}">
                            <field name="attachment_type" attrs="{'readonly': [('status', '=', 'approved')]}"/>

                            <field name="attachment_file_pdf" filename="attachment_filename"
                                widget="pdf_viewer"
                                attrs="{'invisible': [('attachment_type', '!=', 'pdf')], 'readonly': [('status', '=', 'approved')]}"/>

                            <field name="attachment_file_image" filename="attachment_filename"
                                widget="image"
                                attrs="{'invisible': [('attachment_type', '!=', 'image')], 'readonly': [('status', '=', 'approved')]}"
                                style="max-width:250px; max-height:250px; object-fit:contain;"/>
                            <br/>
                        </group>
                    </group>

                    <notebook>
                        <page string="Rincian Penggunaan">
                            <field name="penggunaan_line_ids" nolabel="1">
                                <tree>
                                    <field name="sequence" widget="handle"/>
                                    <field name="date"/>
                                    <field name="description"/>
                                    <field name="nominal" sum="Total Penggunaan"/>
                                    <field name="done_attachment"/>
                                </tree>

                                <form>
                                    <group col="2">
                                        <group string = "Form">
                                            <field name="lot_of_attachment" invisible="1"/>
                                            <field name="date"/>
                                            <field name="description"/>
                                            <field name="nominal"/>
                                            <field name="attachment_type"
                                                attrs="{
                                                    'invisible': [('lot_of_attachment', '=', 'one_for_all_line')]
                                                }"/>
                                            <field name="attachment_file_pdf"
                                                filename="attachment_filename_pdf"
                                                widget="pdf_viewer"
                                                attrs="{
                                                    'invisible': [
                                                        '|',
                                                        ('lot_of_attachment', '=', 'one_for_all_line'),
                                                        ('attachment_type', '!=', 'pdf')
                                                    ]
                                                }"/>
                                            <field name="attachment_file_image"
                                                filename="attachment_filename_image"
                                                widget="image"
                                                attrs="{
                                                    'invisible': [
                                                        '|',
                                                        ('lot_of_attachment', '=', 'one_for_all_line'),
                                                        ('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="account_id" attrs="{'readonly': [('is_current_user_ap', '=', False)]}"/>
                                            <field name="done_attachment" attrs="{'readonly': [('is_current_user_ap', '=', False)]}"/>
                                        </group>
                                    </group>
                                </form>
                            </field>
                        </page>
                    </notebook>

                   <div style="text-align:right;">
                        <button name="action_toggle_check_attachment"
                                type="object"
                                string="Check/Uncheck All Line Use PUM"
                                class="btn-secondary"/>
                    </div>

                    <group col="2">
                        <group class="oe_subtotal_footer oe_right">
                            <field name="currency_id" invisible="1"/>
                            <field name="grand_total_use" readonly="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                            <field name="nominal_pum" readonly="1" widget="monetary" options="{'currency_field': 'currency_id'}" style="font-weight: bold;"/>
                            <field name="remaining_value" readonly="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                        </group>
                    </group> 
                </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="action_advance_payment_settlement" model="ir.actions.act_window">
        <field name="name">Realisasi Pengajuan Uang Muka</field>
        <field name="res_model">advance.payment.settlement</field>
        <field name="view_mode">tree,form</field>
    </record>

    <record id="view_tree_advance_payment_settlement" model="ir.ui.view">
        <field name="name">advance.payment.settlement.tree</field>
        <field name="model">advance.payment.settlement</field>
        <field name="arch" type="xml">
            <tree create="false" delete="false">
                <field name="name"/>
                <field name="applicant_name"/>
                <!-- <field name="pum_id"/> -->
                <field name="nominal_pum" string="Total Pengajuan"/>
                <field name="grand_total_use" string="Total Penggunaan"/>
                <field name="remaining_value" string="Sisa PUM"/>
                <field name="status" widget="badge" decoration-success="status == 'approved'"/>
                <field name="is_cab_visible" widget="boolean"/>
                </tree>
        </field>
    </record>

    <menuitem id="menu_advance_payment_settlement_acct"
        name="Realisasi PUM"
        parent="account.menu_finance_entries"
        sequence="114"
        action="action_advance_payment_settlement"
    />
    
    <menuitem id="menu_advance_payment_settlement_sales"
        name="Realisasi PUM"
        parent="indoteknik_custom.menu_monitoring_in_sale"
        sequence="101"
        action="action_advance_payment_settlement"
    />
</odoo>