Commit 8bd9da68 by Owo Sugiana

Perubahan rumus discount Kabupaten Tasik

1 parent 5812b05e
0.1.29 2021-12-11
-----------------
- Perubahan rumus discount Kabupaten Tasik
- Penggunaan pkgutil agar fleksibel saat pip install -e
0.1.28 2021-06-16 0.1.28 2021-06-16
----------------- -----------------
- Bug fixed available invoice pada Kabupaten Tasikmalaya - Bug fixed available invoice pada Kabupaten Tasikmalaya
......
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
from datetime import date
from sqlalchemy import func from sqlalchemy import func
from opensipkd.hitung import round_up from opensipkd.hitung import round_up
from ..models.tasik_kab import ( from ..models.tasik_kab import (
...@@ -16,6 +17,9 @@ from .base import ( ...@@ -16,6 +17,9 @@ from .base import (
) )
MAX_DISC_DATE = date(2021, 12, 24)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
def get_op_model(self): # Override def get_op_model(self): # Override
return ObjekPajak return ObjekPajak
...@@ -54,6 +58,21 @@ class Inquiry(BaseInquiry): ...@@ -54,6 +58,21 @@ class Inquiry(BaseInquiry):
else: else:
self.tagihan = round_up(tagihan) self.tagihan = round_up(tagihan)
def hitung_discount(self): # Override
if self.tgl_bayar <= MAX_DISC_DATE and \
self.invoice.thn_pajak_sppt >= '2014' and \
self.invoice.thn_pajak_sppt <= '2020':
self.discount = self.denda
else:
self.discount = 0
def before_save(self, payment): # Override
payment.denda_sppt = self.denda - self.discount
# Sekedar catatan
payment.denda_sblm_diskon = self.denda
payment.discount_denda = self.discount
payment.descount = self.discount
class Reversal(BaseReversal): class Reversal(BaseReversal):
def get_invoice_model(self): def get_invoice_model(self):
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!