Commit 2c1eaf82 by Owo Sugiana

Akhiri dependency URL dengan .git agar dipahami git client lama

1 parent 754ea334
...@@ -28,7 +28,7 @@ class AvailableInvoice: ...@@ -28,7 +28,7 @@ class AvailableInvoice:
def run(self): def run(self):
q_pay = DBSession.query(Pembayaran).\ q_pay = DBSession.query(Pembayaran).\
filter(Pembayaran.t_statusbayarspt == None).\ filter(Pembayaran.t_statusbayarspt is None).\
order_by(Pembayaran.t_idpembayaranspt.desc()) order_by(Pembayaran.t_idpembayaranspt.desc())
offset = -1 offset = -1
self.no = 0 self.no = 0
......
...@@ -101,7 +101,9 @@ def main(argv=sys.argv): ...@@ -101,7 +101,9 @@ def main(argv=sys.argv):
rev = Reversal(invoice_id) rev = Reversal(invoice_id)
pay = rev.payment pay = rev.payment
if not pay: if not pay:
print('Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.') print(
'Pembayaran tidak ditemukan, '
'tidak ada yang perlu dibatalkan.')
return return
rev.do_reversal() rev.do_reversal()
print( print(
......
...@@ -209,13 +209,13 @@ class AvailableInvoice(BaseAvailableInvoice): ...@@ -209,13 +209,13 @@ class AvailableInvoice(BaseAvailableInvoice):
q = DBSession.query( q = DBSession.query(
Pembayaran.t_kodebayarbanksppt, Spt.t_tgljatuhtempospt).\ Pembayaran.t_kodebayarbanksppt, Spt.t_tgljatuhtempospt).\
filter( filter(
Pembayaran.t_idspt==Spt.t_idspt, Pembayaran.t_idspt == Spt.t_idspt,
or_(Pembayaran.t_statusbayarspt==None, or_(Pembayaran.t_statusbayarspt is None,
Pembayaran.t_statusbayarspt==False)) Pembayaran.t_statusbayarspt is False))
if self.option.tahun: 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: 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() kini = date.today()
if self.option.belum_jatuh_tempo: if self.option.belum_jatuh_tempo:
q = q.filter(Spt.t_tgljatuhtempospt >= kini) q = q.filter(Spt.t_tgljatuhtempospt >= kini)
......
...@@ -97,7 +97,8 @@ def main(argv=sys.argv): ...@@ -97,7 +97,8 @@ def main(argv=sys.argv):
rev = services_module.Reversal(invoice_id) rev = services_module.Reversal(invoice_id)
pay = rev.payment pay = rev.payment
if not pay: if not pay:
print('Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.') print(
'Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.')
return return
with transaction.manager: with transaction.manager:
rev.do_reversal() rev.do_reversal()
......
...@@ -68,7 +68,8 @@ class Common: ...@@ -68,7 +68,8 @@ class Common:
DBSession = self.get_db_session() DBSession = self.get_db_session()
Invoice = self.get_invoice_model() Invoice = self.get_invoice_model()
return DBSession.query(Invoice).filter_by( 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): def is_paid(self):
return self.invoice.status_pembayaran == 1 return self.invoice.status_pembayaran == 1
...@@ -241,8 +242,9 @@ class Inquiry(Common): ...@@ -241,8 +242,9 @@ class Inquiry(Common):
def get_payment_amount(self): def get_payment_amount(self):
DBSession = self.get_db_session() DBSession = self.get_db_session()
q = DBSession.query(func.sum(Payment.bayar).label('total_bayar')).\ q = DBSession.query(
filter_by(sspd_id=self.invoice.id) func.sum(Payment.bayar).
label('total_bayar')).filter_by(sspd_id=self.invoice.id)
row = q.first() row = q.first()
return row.total_bayar or 0 return row.total_bayar or 0
...@@ -303,8 +305,8 @@ class Reversal(Common): ...@@ -303,8 +305,8 @@ class Reversal(Common):
def get_last_payment(self): def get_last_payment(self):
DBSession = self.get_db_session() DBSession = self.get_db_session()
q = DBSession.query(Payment).filter_by(sspd_id=self.invoice.id).\ q = DBSession.query(Payment).filter_by(
order_by(Payment.id.desc()) sspd_id=self.invoice.id).order_by(Payment.id.desc())
return q.first() return q.first()
def do_reversal(self): # Override def do_reversal(self): # Override
...@@ -332,7 +334,7 @@ class AvailableInvoice(BaseAvailableInvoice): ...@@ -332,7 +334,7 @@ class AvailableInvoice(BaseAvailableInvoice):
if self.option.tahun: if self.option.tahun:
q = q.filter_by(tahun=self.option.tahun) q = q.filter_by(tahun=self.option.tahun)
if self.option.belum_jatuh_tempo or self.option.lewat_jatuh_tempo: 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() kini = date.today()
if self.option.belum_jatuh_tempo: if self.option.belum_jatuh_tempo:
q = q.filter(Invoice.tgl_jatuh_tempo >= kini) q = q.filter(Invoice.tgl_jatuh_tempo >= kini)
......
...@@ -12,8 +12,10 @@ version = line.split()[0] ...@@ -12,8 +12,10 @@ version = line.split()[0]
requires = [ requires = [
'sqlalchemy', 'sqlalchemy',
'opensipkd-base @ git+https://git.opensipkd.com/sugiana/opensipkd-base', 'opensipkd-base @ '
'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung', 'git+https://git.opensipkd.com/sugiana/opensipkd-base.git',
'opensipkd-hitung @ '
'git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git',
] ]
setuptools.setup( setuptools.setup(
...@@ -33,7 +35,8 @@ setuptools.setup( ...@@ -33,7 +35,8 @@ setuptools.setup(
], ],
entry_points={ entry_points={
'console_scripts': [ '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', '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!