Commit 4d23405e by aa.gusti

perbuhanan denda pbb

1 parent 37a0b573
......@@ -3,17 +3,17 @@
# from types import (
# StringType,
# UnicodeType)
from sqlalchemy import func
from ..tools import FixLength, get_settings
import re
# from models import pbbDBSession
# from models.ref import TempatPembayaran
# from models.pegawai import DatLogin
from datetime import timedelta, datetime
from datetime import datetime
from math import ceil
import re
from sqlalchemy import func
from . import left, right
from ..tools import FixLength, get_settings
PROPINSI = [('kd_propinsi', 2, 'N'), ]
......@@ -213,18 +213,22 @@ class FixBerkas(BaseFixLength):
def get_nopel_det(self):
return get_value(self, NOPELDET)
class FixFormulir(BaseFixLength):
def get_structure(self):
return FORMULIR
########### baru untuk penagihan ###########
UPTD = list(DATI2)
UPTD.append(('kd_uptd', 2, 'N'))
class FixUptd(BaseFixLength):
def get_structure(self):
return UPTD
############################################
def ensure_datetime(d):
......@@ -257,6 +261,9 @@ def hitung_denda(piutang_pokok, jatuh_tempo, tanggal=None, max_denda=24):
if bln_tunggakan > max_denda:
bln_tunggakan = max_denda
if jatuh_tempo.year > 2023:
persen_denda = 1
return int(ceil(bln_tunggakan * persen_denda / 100.0 * piutang_pokok))
......@@ -264,8 +271,8 @@ def nop_formatted(row):
if type(row) == str:
row = FixNop(row)
return "%s.%s-%s.%s-%s.%s.%s" % (
row.kd_propinsi, row.kd_dati2, row.kd_kecamatan,
row.kd_kelurahan, row.kd_blok, row.no_urut, row.kd_jns_op)
row.kd_propinsi, row.kd_dati2, row.kd_kecamatan,
row.kd_kelurahan, row.kd_blok, row.no_urut, row.kd_jns_op)
def nop_to_id(row):
......@@ -278,12 +285,24 @@ def nop_to_id(row):
def query_nop(table):
return func.concat(table.kd_propinsi, func.concat('.',
func.concat(table.kd_dati2, func.concat('-',
func.concat(table.kd_kecamatan, func.concat('.',
func.concat(table.kd_kelurahan, func.concat('-',
func.concat(table.kd_blok, func.concat('.',
func.concat(table.no_urut, func.concat('-',
table.kd_jns_op))))))))))))
func.concat(table.kd_dati2, func.concat('-',
func.concat(
table.kd_kecamatan,
func.concat(
'.',
func.concat(
table.kd_kelurahan,
func.concat(
'-',
func.concat(
table.kd_blok,
func.concat(
'.',
func.concat(
table.no_urut,
func.concat(
'-',
table.kd_jns_op))))))))))))
# JEnis REstitusi Kompensasi
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!