Commit 2c1eaf82 by Owo Sugiana

Akhiri dependency URL dengan .git agar dipahami git client lama

1 parent 754ea334
......@@ -24,13 +24,13 @@ def thousand(n):
class AvailableInvoice:
def __init__(self, count=10):
self.count = count
self.count = count
def run(self):
q_pay = DBSession.query(Pembayaran).\
filter(Pembayaran.t_statusbayarspt == None).\
filter(Pembayaran.t_statusbayarspt is None).\
order_by(Pembayaran.t_idpembayaranspt.desc())
offset = -1
offset = -1
self.no = 0
awal = time()
while True:
......
......@@ -22,7 +22,7 @@ from opensipkd.bphtb.cilegon.services import (
)
opensipkd.bphtb.cilegon.services.DBSession = DBSession
opensipkd.bphtb.cilegon.services.DBSession = DBSession
locale.setlocale(locale.LC_ALL, 'id_ID.utf8')
......@@ -71,7 +71,7 @@ def show(inq):
show_val('RW Wajib Pajak', inq.get_rw_wp())
show_val('Kode Pos Wajib Pajak', inq.get_kode_pos_wp())
show_val('Tahun Pajak', inq.get_tahun())
def main(argv=sys.argv):
option, remain = get_option(argv[1:])
......@@ -101,7 +101,9 @@ def main(argv=sys.argv):
rev = Reversal(invoice_id)
pay = rev.payment
if not pay:
print('Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.')
print(
'Pembayaran tidak ditemukan, '
'tidak ada yang perlu dibatalkan.')
return
rev.do_reversal()
print(
......
......@@ -48,7 +48,7 @@ class Inquiry:
q = DBSession.query(Pemeriksaan).filter_by(
p_idpembayaranspt=self.payment.t_idpembayaranspt)
self.pemeriksaan = q.first()
self.profile = self.get_profile()
self.profile = self.get_profile()
self.notaris = self.get_notaris()
self.hitung()
......@@ -177,12 +177,12 @@ class Inquiry:
return not self.payment.t_statusbayarspt
def do_payment(self, ntb):
self.payment.t_tanggalpembayaran = self.tgl_bayar
self.payment.t_tanggalpembayaran = self.tgl_bayar
self.payment.t_nilaipembayaranspt = self.total
self.payment.t_statusbayarspt = True
DBSession.add(self.payment)
return self.payment
return self.payment
class Reversal:
def __init__(self, invoice_id):
......@@ -209,13 +209,13 @@ class AvailableInvoice(BaseAvailableInvoice):
q = DBSession.query(
Pembayaran.t_kodebayarbanksppt, Spt.t_tgljatuhtempospt).\
filter(
Pembayaran.t_idspt==Spt.t_idspt,
or_(Pembayaran.t_statusbayarspt==None,
Pembayaran.t_statusbayarspt==False))
Pembayaran.t_idspt == Spt.t_idspt,
or_(Pembayaran.t_statusbayarspt is None,
Pembayaran.t_statusbayarspt is False))
if self.option.tahun:
q = q.filter(Spt.t_periodespt==self.option.tahun)
q = q.filter(Spt.t_periodespt == self.option.tahun)
if self.option.belum_jatuh_tempo or self.option.lewat_jatuh_tempo:
q = q.filter(Spt.t_tgljatuhtempospt != None)
q = q.filter(Spt.t_tgljatuhtempospt is not None)
kini = date.today()
if self.option.belum_jatuh_tempo:
q = q.filter(Spt.t_tgljatuhtempospt >= kini)
......
......@@ -53,7 +53,7 @@ def show(inq):
show_val('Kota Wajib Pajak', inq.get_kota_wp())
show_val('Tahun Pajak', inq.get_tahun())
show_val('Is Available', inq.is_available())
def show_pkey_values(row):
print('Primary key tabel {}:'.format(row.__table__.name))
......@@ -65,7 +65,7 @@ def show_pkey_values(row):
def main(argv=sys.argv):
option = get_option(argv[1:])
conf_file = option.conf
conf_file = option.conf
invoice_id = option.invoice_id
conf = ConfigParser()
conf.read(conf_file)
......@@ -97,7 +97,8 @@ def main(argv=sys.argv):
rev = services_module.Reversal(invoice_id)
pay = rev.payment
if not pay:
print('Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.')
print(
'Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.')
return
with transaction.manager:
rev.do_reversal()
......
......@@ -61,14 +61,15 @@ class Common:
def get_db_session(self):
return DBSession
def query_invoice(self):
kode = int(self.invoice_struct['Kode'])
kode = str(kode)
DBSession = self.get_db_session()
Invoice = self.get_invoice_model()
return DBSession.query(Invoice).filter_by(
tahun=self.tahun, kode=kode, no_sspd=self.invoice_struct['SSPD No'])
tahun=self.tahun, kode=kode,
no_sspd=self.invoice_struct['SSPD No'])
def is_paid(self):
return self.invoice.status_pembayaran == 1
......@@ -241,8 +242,9 @@ class Inquiry(Common):
def get_payment_amount(self):
DBSession = self.get_db_session()
q = DBSession.query(func.sum(Payment.bayar).label('total_bayar')).\
filter_by(sspd_id=self.invoice.id)
q = DBSession.query(
func.sum(Payment.bayar).
label('total_bayar')).filter_by(sspd_id=self.invoice.id)
row = q.first()
return row.total_bayar or 0
......@@ -303,8 +305,8 @@ class Reversal(Common):
def get_last_payment(self):
DBSession = self.get_db_session()
q = DBSession.query(Payment).filter_by(sspd_id=self.invoice.id).\
order_by(Payment.id.desc())
q = DBSession.query(Payment).filter_by(
sspd_id=self.invoice.id).order_by(Payment.id.desc())
return q.first()
def do_reversal(self): # Override
......@@ -332,7 +334,7 @@ class AvailableInvoice(BaseAvailableInvoice):
if self.option.tahun:
q = q.filter_by(tahun=self.option.tahun)
if self.option.belum_jatuh_tempo or self.option.lewat_jatuh_tempo:
q = q.filter(Invoice.tgl_jatuh_tempo != None)
q = q.filter(Invoice.tgl_jatuh_tempo is not None)
kini = date.today()
if self.option.belum_jatuh_tempo:
q = q.filter(Invoice.tgl_jatuh_tempo >= kini)
......
INVOICE_ID = [
INVOICE_ID = [
['Tahun', 4, 'N'],
['Kode', 2, 'N'],
['SSPD No', 6, 'N'],
......
......@@ -36,12 +36,12 @@ class Inquiry(BaseInquiry):
return Customer
def get_db_session(self): # Override
return DBSession
return DBSession
class Reversal(BaseReversal):
def get_db_session(self): # Override
return DBSession
return DBSession
def get_invoice_model(self): # Override
return Invoice
......@@ -52,7 +52,7 @@ class Reversal(BaseReversal):
class AvailableInvoice(BaseAvailableInvoice):
def get_db_session(self): # Override
return DBSession
return DBSession
def get_inquiry_class(self): # Override
return Inquiry
......
......@@ -18,7 +18,7 @@ def get_db_session():
class Inquiry(BaseInquiry):
def get_db_session(self):
return DBSession
return DBSession
def get_kecamatan(self):
q = DBSession.query(Kecamatan).filter_by(
......@@ -38,12 +38,12 @@ class Inquiry(BaseInquiry):
class Reversal(BaseReversal):
def get_db_session(self):
return DBSession
return DBSession
class AvailableInvoice(BaseAvailableInvoice):
def get_db_session(self):
return DBSession
return DBSession
def get_inquiry_class(self):
return Inquiry
......@@ -12,8 +12,10 @@ version = line.split()[0]
requires = [
'sqlalchemy',
'opensipkd-base @ git+https://git.opensipkd.com/sugiana/opensipkd-base',
'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung',
'opensipkd-base @ '
'git+https://git.opensipkd.com/sugiana/opensipkd-base.git',
'opensipkd-hitung @ '
'git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git',
]
setuptools.setup(
......@@ -33,7 +35,8 @@ setuptools.setup(
],
entry_points={
'console_scripts': [
'bphtb_available_invoice = opensipkd.bphtb.scripts.available_invoice:main',
'bphtb_available_invoice = '
'opensipkd.bphtb.scripts.available_invoice:main',
'bphtb_inquiry = opensipkd.bphtb.scripts.inquiry:main',
]
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!