Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Taufik Yulianto
/
esipkd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 469ed17b
authored
Aug 21, 2024
by
Taufikyu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tambahkan timezone untuk payment dan perbaiki query tgl_bayar qris, va
1 parent
37247eeb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
esipkd/tools.py
esipkd/views/bjb_qris.py
esipkd/views/bjb_va.py
esipkd/tools.py
View file @
469ed17
...
...
@@ -26,6 +26,8 @@ from datetime import (
from
pyramid.threadlocal
import
get_current_registry
wib
=
pytz
.
timezone
(
'Asia/Jakarta'
)
STATUS
=
(
(
1
,
'Aktif'
),
(
0
,
'Inaktif'
),
...
...
@@ -193,7 +195,8 @@ def datetime_from_str(values):
t
=
[
0
,
0
,
0
]
if
len
(
values
)
>
1
:
t
=
values
[
1
]
.
split
(
':'
)
return
datetime
(
tgl
.
year
,
tgl
.
month
,
tgl
.
day
,
int
(
t
[
0
]),
int
(
t
[
1
]),
int
(
t
[
2
]))
dttime
=
datetime
(
tgl
.
year
,
tgl
.
month
,
tgl
.
day
,
int
(
t
[
0
]),
int
(
t
[
1
]),
int
(
t
[
2
]))
return
wib
.
localize
(
dttime
)
def
dmy_to_date
(
tgl
):
return
datetime
.
strptime
(
tgl
,
'
%
d-
%
m-
%
Y'
)
...
...
esipkd/views/bjb_qris.py
View file @
469ed17
...
...
@@ -393,7 +393,11 @@ class view(object):
query
=
DBSession
.
query
(
BJBQRIS
.
id
,
BJBQRIS
.
va_number
,
BJBQRIS
.
invoice_no
,
BJBQRIS
.
description
,
BJBQRIS
.
customer_name
,
BJBQRIS
.
amount
,
BJBQRIS
.
client_refnum
,
func
.
coalesce
(
func
.
to_char
(
BJBQRIS
.
expired_date
,
'DD-MM-YYYY HH24:MI:SS'
),
''
)
.
label
(
'expired_date'
),
func
.
coalesce
(
func
.
to_char
(
ArPayment
.
tgl_bayar
,
'DD-MM-YYYY HH24:MI:SS'
),
''
)
.
label
(
'tgl_bayar'
),
case
([
(
BJBQRIS
.
status
.
in_
([
'1'
,
'2'
]),
func
.
coalesce
(
func
.
to_char
(
ArPayment
.
tgl_bayar
,
'DD-MM-YYYY HH24:MI:SS'
),
''
))
],
else_
=
literal
(
''
))
.
label
(
'tgl_bayar'
),
ArInvoice
.
jumlah
.
label
(
'jml_bayar'
),
case
([
(
BJBQRIS
.
status
==
'0'
,
literal
(
'Belum Dibayar'
))
...
...
@@ -505,6 +509,9 @@ def callback(request, data):
and
data
[
'transaction_amount'
]
or
get_va
.
amount
get_va
.
transaction_date
=
'transaction_date'
in
data
and
data
[
'transaction_date'
]
\
and
data
[
'transaction_date'
]
or
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
get_va
.
transactionDate
=
getattr
(
get_va
,
'transactionDate'
,
None
)
get_va
.
transactionAmount
=
getattr
(
get_va
,
'transaction_amount'
,
None
)
get_va
.
transactionStatus
=
getattr
(
get_va
,
'status'
,
None
)
pay
=
save_pembayaran
(
request
,
...
...
esipkd/views/bjb_va.py
View file @
469ed17
...
...
@@ -464,7 +464,11 @@ class view(object):
query
=
DBSession
.
query
(
BJBVA
.
id
,
BJBVA
.
va_number
,
BJBVA
.
invoice_no
,
BJBVA
.
description
,
BJBVA
.
customer_name
,
BJBVA
.
amount
,
BJBVA
.
client_refnum
,
func
.
coalesce
(
func
.
to_char
(
BJBVA
.
expired_date
,
'DD-MM-YYYY HH24:MI:SS'
),
''
)
.
label
(
'expired_date'
),
func
.
coalesce
(
func
.
to_char
(
ArPayment
.
tgl_bayar
,
'DD-MM-YYYY HH24:MI:SS'
),
''
)
.
label
(
'tgl_bayar'
),
case
([
(
BJBVA
.
status
.
in_
([
'1'
,
'2'
]),
func
.
coalesce
(
func
.
to_char
(
ArPayment
.
tgl_bayar
,
'DD-MM-YYYY HH24:MI:SS'
),
''
))
],
else_
=
literal
(
''
))
.
label
(
'tgl_bayar'
),
ArInvoice
.
jumlah
.
label
(
'jml_bayar'
),
case
([
(
BJBVA
.
status
==
'0'
,
literal
(
'Belum Dibayar'
))
...
...
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