Commit 2c1eaf82 by Owo Sugiana

Akhiri dependency URL dengan .git agar dipahami git client lama

1 parent 754ea334
......@@ -28,7 +28,7 @@ class AvailableInvoice:
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
self.no = 0
......
......@@ -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(
......
......@@ -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)
......
......@@ -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()
......
......@@ -68,7 +68,8 @@ class Common:
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)
......
......@@ -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!