Skip to content

Commit

Permalink
[ssi_l10n_id_taxform_bukti_potong_pph_1721_ai]
Browse files Browse the repository at this point in the history
1. Menambahkan Cetakan Form 1721 A1 PDF
2. Menambahkan dependecies ke report_py3o, ssi_print_mixin, partner_contact_in_several_companies
3. Mengganti tax_period_id -> start / end_tax_period_id
  • Loading branch information
mikevhe18 committed Jan 14, 2025
1 parent 3f08480 commit 808101d
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 32 deletions.
4 changes: 4 additions & 0 deletions ssi_l10n_id_taxform_bukti_potong_pph_1721_a1/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"ssi_partner",
"ssi_l10n_id_partner_identification_kependudukan",
"ssi_l10n_id_taxform_pph_21",
"report_py3o",
"ssi_print_mixin",
"partner_contact_in_several_companies",
],
"data": [
"security/ir_module_category_data.xml",
Expand All @@ -30,6 +33,7 @@
"data/sequence_template_data.xml",
"data/policy_template_data.xml",
"data/approval_template_data.xml",
"reports/bukti_potong_pph_1721_a1_report.xml",
"views/bukti_potong_pph_1721_a1_views.xml",
"views/bukti_potong_pph_1721_a1_config_views.xml",
"views/res_company_views.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class BuktiPotongPPh1721A1(models.Model):
"mixin.transaction_cancel",
"mixin.transaction_done",
"mixin.transaction_confirm",
"mixin.print_document",
]
_description = "Bukti Potong PPh 21 1721 A1"

Expand Down Expand Up @@ -100,23 +101,30 @@ def _default_company_id(self):
},
)

@api.depends(
"date",
start_tax_period_id = fields.Many2one(
string="Period Awal",
comodel_name="l10n_id.tax_period",
required=True,
readonly=True,
ondelete="restrict",
states={
"draft": [
("readonly", False),
],
},
)
def _compute_tax_period(self):
obj_tax_period = self.env["l10n_id.tax_period"]
for bukpot in self:
try:
bukpot.tax_period_id = obj_tax_period._find_period(bukpot.date)
except Exception:
bukpot.tax_period_id = False

tax_period_id = fields.Many2one(
string="Tax Period",
end_tax_period_id = fields.Many2one(
string="Period Akhir",
comodel_name="l10n_id.tax_period",
compute="_compute_tax_period",
store=True,
compute_sudo=True,
compute=False,
required=True,
readonly=True,
ondelete="restrict",
states={
"draft": [
("readonly", False),
],
},
)

@api.model
Expand Down Expand Up @@ -631,7 +639,8 @@ def onchange_wajib_pajak_id(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_01(self):
self.penghasilan_01 = 0.0
Expand Down Expand Up @@ -662,7 +671,8 @@ def onchange_penghasilan_01(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_02(self):
self.penghasilan_02 = 0.0
Expand Down Expand Up @@ -693,7 +703,8 @@ def onchange_penghasilan_02(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_03(self):
self.penghasilan_03 = 0.0
Expand Down Expand Up @@ -724,7 +735,8 @@ def onchange_penghasilan_03(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_04(self):
self.penghasilan_04 = 0.0
Expand Down Expand Up @@ -755,7 +767,8 @@ def onchange_penghasilan_04(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_05(self):
self.penghasilan_05 = 0.0
Expand Down Expand Up @@ -786,7 +799,8 @@ def onchange_penghasilan_05(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_06(self):
self.penghasilan_06 = 0.0
Expand Down Expand Up @@ -819,7 +833,8 @@ def onchange_penghasilan_06(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_penghasilan_07(self):
self.penghasilan_07 = 0.0
Expand Down Expand Up @@ -872,7 +887,8 @@ def _compute_penghasilan(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_pengurang_10(self):
self.pengurang_10 = 0.0
Expand Down Expand Up @@ -903,7 +919,8 @@ def onchange_pengurang_10(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_perhitungan_13(self):
self.perhitungan_13 = 0.0
Expand Down Expand Up @@ -934,7 +951,8 @@ def onchange_perhitungan_13(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_perhitungan_18(self):
self.perhitungan_18 = 0.0
Expand Down Expand Up @@ -965,7 +983,8 @@ def onchange_perhitungan_18(self):
@api.onchange(
"company_id",
"wajib_pajak_id",
"tax_period_id",
"start_tax_period_id",
"end_tax_period_id",
)
def onchange_perhitungan_20(self):
self.perhitungan_20 = 0.0
Expand All @@ -992,3 +1011,10 @@ def onchange_perhitungan_20(self):
)
raise UserError(_("%s") % (msg_err))
self.perhitungan_20 = result

@api.onchange(
"tax_year_id",
)
def onchange_tax_year_id(self):
self.start_tax_period_id = False
self.end_tax_period_id = False
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2025 OpenSynergy Indonesia
Copyright 2025 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="bukti_potong_pph_1721_a1_py3o_report" model="ir.actions.report">
<field name="name">Form 1721-A1 PDF</field>
<field name="model">l10n_id.bukti_potong_pph_1721_a1</field>
<field name="report_name">form_1721_a1_pdf</field>
<field name="report_type">py3o</field>
<field name="py3o_filetype">pdf</field>
<field name="module">ssi_l10n_id_taxform_bukti_potong_pph_1721_a1</field>
<field name="py3o_template_fallback">/reports/bukti_potong_pph_1721_a1.odt</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<data>
<xpath expr="//field[@name='company_id']" position="after">
<field name="date" />
<field name="tax_period_id" />
<field name="start_tax_period_id" />
<field name="end_tax_period_id" />
<field name="wajib_pajak_id" />
<field name="pemotong_pajak_id" />
</xpath>
Expand All @@ -39,7 +40,8 @@
<xpath expr="//group[@name='header_right']" position="inside">
<field name="pemotong_pajak_id" domain="[('is_company','=',True)]" />
<field name="date" />
<field name="tax_period_id" />
<field name="start_tax_period_id" />
<field name="end_tax_period_id" />
<field
name="ttd_id"
domain="[('is_company','=',False),('parent_id','=',company_partner_id)]"
Expand Down Expand Up @@ -113,17 +115,23 @@
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='company_id']" position="after">
<field name="tax_period_id" />
<field name="start_tax_period_id" />
<field name="end_tax_period_id" />
<field name="wajib_pajak_id" />
<field name="pemotong_pajak_id" />
<field name="ttd_id" />
</xpath>
<xpath expr="//group[@name='group_by']" position="inside">
<filter name="grp_date" string="Date" context="{'group_by':'date'}" />
<filter
name="filter_grp_tax_period"
string="Tax Period"
context="{'group_by':'tax_period_id'}"
name="filter_grp_start_tax_period_id"
string="Start Tax Period"
context="{'group_by':'start_tax_period_id'}"
/>
<filter
name="filter_grp_end_tax_period_id"
string="End Tax Period"
context="{'group_by':'end_tax_period_id'}"
/>
<filter
name="filter_grp_wp"
Expand Down

0 comments on commit 808101d

Please sign in to comment.