Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-bphtb-models
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 86a04410
authored
Jun 14, 2021
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tambah Kota Bogor
1 parent
bb7b099c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
168 deletions
CHANGES.txt
opensipkd/bphtb/models/banjar.py
opensipkd/bphtb/models/cirebon_kabupaten.py → opensipkd/bphtb/models/bogor_kota.py
opensipkd/bphtb/models/default.py
opensipkd/bphtb/models/iso_payment.py
opensipkd/bphtb/models/iso_reversal.py
opensipkd/bphtb/models/tangsel.py
opensipkd/bphtb/models/tasik_kabupaten.py
opensipkd/bphtb/services/bogor_kota/__init__.py
opensipkd/bphtb/services/bogor_kota/structure.py
opensipkd/bphtb/services/default/__init__.py
CHANGES.txt
View file @
86a0441
0.4 2021-06-14
--------------
- Tambah Kota Bogor
- Tidak ada lagi tabel terkait ISO8583 karena itu ranah paket
opensipkd-iso8583-bjb.
0.3.4 2021-06-14
----------------
- Parameter default.do_payment() tidak lagi memuat angka bit ISO8583
...
...
opensipkd/bphtb/models/banjar.py
View file @
86a0441
...
...
@@ -15,8 +15,6 @@ from .customer import CustomerMixin
from
.perolehan
import
PerolehanMixin
from
.invoice
import
InvoiceMixin
from
.payment
import
BasePaymentMixin
from
.iso_payment
import
IsoPaymentMixin
from
.iso_reversal
import
IsoReversalMixin
Base
=
declarative_base
()
...
...
@@ -52,12 +50,3 @@ class Invoice(InvoiceMixin, Base):
class
Payment
(
BasePaymentMixin
,
Base
):
pass
class
IsoPayment
(
IsoPaymentMixin
,
Base
):
pass
class
IsoReversal
(
IsoReversalMixin
,
Base
):
__table_args__
=
dict
(
schema
=
None
)
id
=
Column
(
Integer
,
ForeignKey
(
'bphtb_payment.id'
),
primary_key
=
True
)
opensipkd/bphtb/models/
cirebon_kabupaten
.py
→
opensipkd/bphtb/models/
bogor_kota
.py
View file @
86a0441
...
...
@@ -7,27 +7,25 @@ from .customer import CustomerMixin
from
.perolehan
import
PerolehanMixin
from
.invoice
import
InvoiceMixin
from
.payment
import
PaymentMixin
from
.iso_payment
import
IsoPaymentMixin
from
.iso_reversal
import
IsoReversalMixin
Base
=
declarative_base
()
class
Provinsi
(
ProvinsiMixin
,
Base
):
pass
__table_args__
=
dict
(
schema
=
None
)
class
Kabupaten
(
KabupatenMixin
,
Base
):
pass
__table_args__
=
dict
(
schema
=
None
)
class
Kecamatan
(
KecamatanMixin
,
Base
):
pass
__table_args__
=
dict
(
schema
=
None
)
class
Kelurahan
(
KelurahanMixin
,
Base
):
pass
__table_args__
=
dict
(
schema
=
None
)
class
Customer
(
CustomerMixin
,
Base
):
...
...
@@ -44,11 +42,3 @@ class Invoice(InvoiceMixin, Base):
class
Payment
(
PaymentMixin
,
Base
):
pass
class
IsoPayment
(
IsoPaymentMixin
,
Base
):
__table_args__
=
dict
(
schema
=
'bphtb'
)
class
IsoReversal
(
IsoReversalMixin
,
Base
):
__table_args__
=
dict
(
schema
=
'bphtb'
)
opensipkd/bphtb/models/default.py
View file @
86a0441
...
...
@@ -11,8 +11,6 @@ from .customer import CustomerMixin
from
.perolehan
import
PerolehanMixin
from
.invoice
import
InvoiceMixin
from
.payment
import
PaymentMixin
from
.iso_payment
import
IsoPaymentMixin
from
.iso_reversal
import
IsoReversalMixin
Base
=
declarative_base
()
...
...
@@ -48,11 +46,3 @@ class Invoice(InvoiceMixin, Base):
class
Payment
(
PaymentMixin
,
Base
):
pass
class
IsoPayment
(
IsoPaymentMixin
,
Base
):
pass
class
IsoReversal
(
IsoReversalMixin
,
Base
):
pass
opensipkd/bphtb/models/iso_payment.py
deleted
100644 → 0
View file @
bb7b099
from
datetime
import
datetime
from
sqlalchemy
import
(
Column
,
Integer
,
DateTime
,
String
,
Date
,
ForeignKey
,
)
from
sqlalchemy.ext.declarative
import
declared_attr
class
IsoPaymentMixin
:
@declared_attr
def
__tablename__
(
self
):
return
'bphtb_payment'
@declared_attr
def
__table_args__
(
self
):
return
dict
(
schema
=
'bphtb'
)
@declared_attr
def
id
(
self
):
return
Column
(
Integer
,
ForeignKey
(
'bphtb.bphtb_bank.id'
),
primary_key
=
True
)
@declared_attr
def
tgl
(
self
):
return
Column
(
DateTime
(
timezone
=
True
),
nullable
=
False
,
default
=
datetime
.
now
)
@declared_attr
def
iso_request
(
self
):
return
Column
(
String
(
1024
),
nullable
=
False
)
@declared_attr
def
transmission
(
self
):
return
Column
(
DateTime
(
timezone
=
True
),
nullable
=
False
)
@declared_attr
def
settlement
(
self
):
return
Column
(
Date
,
nullable
=
False
)
@declared_attr
def
stan
(
self
):
return
Column
(
Integer
,
nullable
=
False
)
@declared_attr
def
invoice_id
(
self
):
return
Column
(
Integer
,
ForeignKey
(
'bphtb.bphtb_sspd.id'
),
nullable
=
False
)
@declared_attr
def
invoice_no
(
self
):
return
Column
(
String
(
32
),
nullable
=
False
)
@declared_attr
def
ntb
(
self
):
return
Column
(
String
(
32
),
nullable
=
False
)
@declared_attr
def
ntp
(
self
):
return
Column
(
String
(
32
),
nullable
=
False
,
unique
=
True
)
@declared_attr
def
bank_id
(
self
):
return
Column
(
Integer
)
@declared_attr
def
channel_id
(
self
):
return
Column
(
Integer
)
@declared_attr
def
bank_ip
(
self
):
return
Column
(
String
(
15
),
nullable
=
False
)
opensipkd/bphtb/models/iso_reversal.py
deleted
100644 → 0
View file @
bb7b099
from
datetime
import
datetime
from
sqlalchemy
import
(
Column
,
Integer
,
DateTime
,
String
,
ForeignKey
,
)
from
sqlalchemy.ext.declarative
import
declared_attr
class
IsoReversalMixin
:
@declared_attr
def
__tablename__
(
self
):
return
'bphtb_reversal'
@declared_attr
def
__table_args__
(
self
):
return
dict
(
schema
=
'bphtb'
)
@declared_attr
def
id
(
self
):
return
Column
(
Integer
,
ForeignKey
(
'bphtb.bphtb_payment.id'
),
primary_key
=
True
)
@declared_attr
def
tgl
(
self
):
return
Column
(
DateTime
(
timezone
=
True
),
nullable
=
False
,
default
=
datetime
.
now
)
@declared_attr
def
iso_request
(
self
):
return
Column
(
String
(
1024
),
nullable
=
False
)
opensipkd/bphtb/models/tangsel.py
View file @
86a0441
...
...
@@ -7,8 +7,6 @@ from .customer import CustomerMixin
from
.perolehan
import
PerolehanMixin
from
.invoice
import
InvoiceMixin
from
.payment
import
PaymentMixin
from
.iso_payment
import
IsoPaymentMixin
from
.iso_reversal
import
IsoReversalMixin
Base
=
declarative_base
()
...
...
@@ -44,11 +42,3 @@ class Invoice(InvoiceMixin, Base):
class
Payment
(
PaymentMixin
,
Base
):
pass
class
IsoPayment
(
IsoPaymentMixin
,
Base
):
__table_args__
=
dict
(
schema
=
'bphtb'
)
class
IsoReversal
(
IsoReversalMixin
,
Base
):
pass
opensipkd/bphtb/models/tasik_kabupaten.py
View file @
86a0441
...
...
@@ -8,8 +8,6 @@ from .customer import CustomerMixin
from
.perolehan
import
PerolehanMixin
from
.invoice
import
InvoiceMixin
from
.payment
import
PaymentMixin
from
.iso_payment
import
IsoPaymentMixin
from
.iso_reversal
import
IsoReversalMixin
Base
=
declarative_base
()
...
...
@@ -54,11 +52,3 @@ class Invoice(InvoiceMixin, Base):
class
Payment
(
PaymentMixin
,
Base
):
pass
class
IsoPayment
(
IsoPaymentMixin
,
Base
):
pass
class
IsoReversal
(
IsoReversalMixin
,
Base
):
pass
opensipkd/bphtb/services/bogor_kota/__init__.py
0 → 100644
View file @
86a0441
from
datetime
import
(
date
,
datetime
,
)
from
sqlalchemy
import
func
from
opensipkd.hitung
import
(
hitung_denda
,
round_up
,
)
from
opensipkd.string
import
FixLength
from
..default
import
(
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
from
opensipkd.bphtb.models.bogor_kota
import
(
Invoice
,
Payment
,
Customer
,
Kecamatan
,
Kelurahan
,
)
from
.structure
import
(
INVOICE_ID
,
INVOICE_ID_LENGTH
,
)
class
Inquiry
(
BaseInquiry
):
kecamatan_model
=
Kecamatan
kelurahan_model
=
Kelurahan
invoice_model
=
Invoice
payment_model
=
Payment
customer_model
=
Customer
invoice_id_structure
=
INVOICE_ID
invoice_id_length
=
INVOICE_ID_LENGTH
class
Reversal
(
BaseReversal
):
invoice_id_structure
=
INVOICE_ID
invoice_id_length
=
INVOICE_ID_LENGTH
class
AvailableInvoice
(
BaseAvailableInvoice
):
inquiry_cls
=
Inquiry
invoice_id_structure
=
INVOICE_ID
opensipkd/bphtb/services/bogor_kota/structure.py
0 → 100644
View file @
86a0441
INVOICE_ID
=
[
[
'Tahun'
,
4
,
'N'
],
[
'SSPD No'
,
6
,
'N'
],
[
'Kode'
,
2
,
'N'
],
]
INVOICE_ID_LENGTH
=
0
for
nama
,
size
,
tipe
in
INVOICE_ID
:
INVOICE_ID_LENGTH
+=
size
# Ini adalah komponen Kode pada Invoice ID tergolong kurang bayar
KODE_KURANG_BAYAR
=
[
'2'
,
'4'
]
opensipkd/bphtb/services/default/__init__.py
View file @
86a0441
...
...
@@ -2,7 +2,6 @@
from
datetime
import
(
date
,
datetime
,
time
,
)
from
sqlalchemy
import
func
from
opensipkd.hitung
import
(
...
...
@@ -36,13 +35,15 @@ class Common:
invoice_model
=
Invoice
payment_model
=
Payment
customer_model
=
Customer
invoice_id_structure
=
INVOICE_ID
invoice_id_length
=
INVOICE_ID_LENGTH
def
__init__
(
self
,
invoice_id
):
self
.
invoice_id
=
invoice_id
self
.
invoice
=
None
if
len
(
invoice_id
)
!=
INVOICE_ID_LENGTH
:
if
len
(
invoice_id
)
!=
self
.
invoice_id_length
:
return
self
.
invoice_struct
=
FixLength
(
INVOICE_ID
)
self
.
invoice_struct
=
FixLength
(
self
.
invoice_id_structure
)
self
.
invoice_struct
.
set_raw
(
invoice_id
)
self
.
tahun
=
self
.
invoice_struct
[
'Tahun'
]
self
.
tahun
=
int
(
self
.
tahun
)
...
...
@@ -116,7 +117,7 @@ class Inquiry(Common):
self
.
total
=
self
.
tagihan
+
self
.
denda
-
self
.
discount
def
hitung_denda
(
self
):
if
self
.
kode
not
in
KODE_KURANG_BAYAR
:
if
self
.
kode
in
KODE_KURANG_BAYAR
:
return
if
isinstance
(
self
.
tgl_bayar
,
datetime
):
tgl_bayar
=
self
.
tgl_bayar
.
date
()
...
...
@@ -309,6 +310,7 @@ class Reversal(Common):
class
AvailableInvoice
(
BaseAvailableInvoice
):
invoice_model
=
Invoice
inquiry_cls
=
Inquiry
invoice_id_structure
=
INVOICE_ID
def
get_query
(
self
):
db_session
=
get_db_session
()
...
...
@@ -327,7 +329,7 @@ class AvailableInvoice(BaseAvailableInvoice):
return
q
.
order_by
(
self
.
invoice_model
.
id
.
desc
())
def
get_message
(
self
,
row
):
invoice_id_struct
=
FixLength
(
INVOICE_ID
)
invoice_id_struct
=
FixLength
(
self
.
invoice_id_structure
)
invoice_id_struct
[
'Tahun'
]
=
row
.
tahun
invoice_id_struct
[
'Kode'
]
=
row
.
kode
.
zfill
(
2
)
invoice_id_struct
[
'SSPD No'
]
=
row
.
no_sspd
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment