Commit 8caf32b2 by Owo Sugiana

Kota Tangerang Selatan discount periode 1 September - 28 Desember

1 parent 307957d5
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
bin/pbb_inquiry bin/pbb_inquiry
- bin/pbb_inquiry tambah pilihan --nominal saat --payment - bin/pbb_inquiry tambah pilihan --nominal saat --payment
- bin/pbb_inquiry tambah pilihan --update-denda - bin/pbb_inquiry tambah pilihan --update-denda
- Kota Tangerang Selatan discount periode 1 September - 28 Desember.
0.3.13 2024-07-31 0.3.13 2024-07-31
----------------- -----------------
......
...@@ -11,7 +11,7 @@ dependencies = [ ...@@ -11,7 +11,7 @@ dependencies = [
'psycopg2-binary', 'psycopg2-binary',
'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git', 'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git',
] ]
requires-python = '>= 3.6' requires-python = '>= 3.9'
authors = [ authors = [
{name='Owo Sugiana', email='sugiana@gmail.com'}, {name='Owo Sugiana', email='sugiana@gmail.com'},
] ]
......
...@@ -44,7 +44,7 @@ def get_db_session(): ...@@ -44,7 +44,7 @@ def get_db_session():
def thousand(n): def thousand(n):
return locale.format('%0.f', n, True) return locale.format_string('%0.f', n, True)
def get_nop(row): def get_nop(row):
......
...@@ -23,10 +23,8 @@ from ..models.tangsel import ( ...@@ -23,10 +23,8 @@ from ..models.tangsel import (
) )
AWAL_DISC_1 = date(2024, 1, 3) AWAL_DISC = date(2024, 9, 1)
AKHIR_DISC_1 = date(2024, 4, 30) AKHIR_DISC = date(2024, 12, 28)
AWAL_DISC_2 = date(2024, 5, 1)
AKHIR_DISC_2 = date(2024, 6, 30)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
...@@ -59,6 +57,11 @@ class Inquiry(BaseInquiry): ...@@ -59,6 +57,11 @@ class Inquiry(BaseInquiry):
super().hitung_denda() super().hitung_denda()
self.denda_sblm_diskon = self.denda self.denda_sblm_diskon = self.denda
def hitung_discount_denda(self):
if self.invoice.thn_pajak_sppt <= '2023':
return self.denda
return 0
def hitung_discount_pokok(self): def hitung_discount_pokok(self):
# Abaikan faktor_pengurang_sppt # Abaikan faktor_pengurang_sppt
# (Kabid Jimmy via Eko Novianto, 6-8-2022) # (Kabid Jimmy via Eko Novianto, 6-8-2022)
...@@ -72,12 +75,12 @@ class Inquiry(BaseInquiry): ...@@ -72,12 +75,12 @@ class Inquiry(BaseInquiry):
if q.first(): if q.first():
print('Tanpa Discount Pokok') print('Tanpa Discount Pokok')
return 0 return 0
disc = 0 if self.invoice.thn_pajak_sppt <= '2014':
if self.invoice.thn_pajak_sppt == '2024': disc = 0.75
if AWAL_DISC_1 <= self.tgl_bayar <= AKHIR_DISC_1: elif self.invoice.thn_pajak_sppt <= '2022':
disc = 0.1 disc = 0.3
elif AWAL_DISC_2 <= self.tgl_bayar <= AKHIR_DISC_2: else:
disc = 0.05 return 0
return int(disc * self.tagihan) return int(disc * self.tagihan)
def tahun_lunas(self, tahun): def tahun_lunas(self, tahun):
...@@ -90,8 +93,12 @@ class Inquiry(BaseInquiry): ...@@ -90,8 +93,12 @@ class Inquiry(BaseInquiry):
return row and row.status_pembayaran_sppt == '1' return row and row.status_pembayaran_sppt == '1'
def hitung_discount(self): # Override def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0 if (AWAL_DISC <= self.tgl_bayar <= AKHIR_DISC) and \
self.tahun_lunas('2024'):
self.discount_denda = self.hitung_discount_denda()
self.discount_pokok = self.hitung_discount_pokok() self.discount_pokok = self.hitung_discount_pokok()
else:
self.discount_denda = self.discount_pokok = 0
self.discount = self.discount_denda + self.discount_pokok self.discount = self.discount_denda + self.discount_pokok
def before_save(self, payment): # Override def before_save(self, payment): # Override
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!