Commit 910f09ba by iwan

Kabupaten Kuningan menggunakan versi 2

1 parent 1a66d428
0.5.6 2024-03-04
----------------
- Kabupaten Kuningan menggunakan PAD versi 2
0.5.5 2024-02-26
----------------
- Rumus denda di Kota Serang sama seperti Kota Tangerang Selatan
......
from sqlalchemy import (
Column,
Integer,
DateTime,
Float,
Time,
String,
UniqueConstraint,
ForeignKey,
)
from sqlalchemy.ext.declarative import declarative_base
from .default import Invoice
Base = declarative_base()
class Payment(Base):
__tablename__ = 'pad_sspd'
id = Column(Integer, primary_key=True)
tahun = Column(Integer, nullable=False)
sspdno = Column(Integer, nullable=False)
sspdtgl = Column(DateTime, nullable=False)
spt_id = Column(Integer, ForeignKey(Invoice.id), nullable=False)
bunga = Column(Float)
bulan_telat = Column(Integer)
hitung_bunga = Column(Integer)
printed = Column(Integer)
enabled = Column(Integer)
create_date = Column(DateTime)
create_uid = Column(Integer)
write_date = Column(DateTime)
write_uid = Column(Integer)
sspdjam = Column(Time)
tp_id = Column(Integer)
is_validated = Column(Integer)
keterangan = Column(String(255))
denda = Column(Integer)
jml_bayar = Column(Integer)
is_valid = Column(Integer)
__table_args__ = (
UniqueConstraint(tahun, sspdno),
dict(schema='pad'))
from datetime import date
from ..models.cirebon_kab import Kohir
from ..models.kuningan import Payment
from ..models.subang import Payment
from .banjar import (
Inquiry as BaseInquiry,
Reversal as BaseReversal,
......
from datetime import date
from ..models.cirebon_kab import Kohir
from ..models.kuningan import Payment
from .default import (
Inquiry as BaseInquiry,
Reversal as BaseReversal,
from .subang import (
Inquiry,
Reversal,
AvailableInvoice as BaseAvailableInvoice,
)
def dmy(tgl):
return tgl.strftime('%d-%m-%Y')
AWAL_TAHUN = 2016
AKHIR_TAHUN = 2020
AKHIR_TGL_BAYAR = date(2021, 12, 31)
NOTE_TGL_BAYAR = 'Tanggal bayar {tgl} <= ' + dmy(AKHIR_TGL_BAYAR)
NOTE_TAHUN = str(AWAL_TAHUN) + ' <= field tahun {tahun} <= ' + str(AKHIR_TAHUN)
class Inquiry(BaseInquiry):
def get_discount_denda(self): # Override
tgl_bayar = self.tgl_bayar.date()
if tgl_bayar > AKHIR_TGL_BAYAR:
return 0
notes = [NOTE_TGL_BAYAR.format(tgl=dmy(tgl_bayar))]
if AWAL_TAHUN <= self.invoice.tahun <= AKHIR_TAHUN:
s = NOTE_TAHUN.format(tahun=self.invoice.tahun)
notes.append(s)
self.notes = notes
return self.denda
return 0
def get_kohir_model(self): # Override
return Kohir
def get_payment_model(self): # Override
return Payment
class Reversal(BaseReversal):
def get_kohir_model(self): # Override
return Kohir
def get_payment_model(self): # Override
return Payment
PREFIX = '3210'
class AvailableInvoice(BaseAvailableInvoice):
def get_inquiry_class(self): # Override
return Inquiry
def get_invoice_id(self, row): # Override
invoice_id = super().get_invoice_id(row)
invoice_id['Prefix'] = PREFIX
return invoice_id
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!