Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Kunto
/
backoffice
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 bb17d32e
authored
Oct 14, 2019
by
yasir
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan
1 parent
f9e31bca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
src/agratek/api/merchant/views/payment_list.py
src/agratek/api/merchant/views/purchase_list.py
src/agratek/api/merchant/views/templates/payment/list.pt
src/agratek/api/merchant/views/templates/purchase/list.pt
src/agratek/api/merchant/views/payment_list.py
View file @
bb17d32
...
...
@@ -148,6 +148,9 @@ class ViewData(BaseView):
awal
=
request
.
session
[
'awal'
]
+
' 00:00:00'
#None
akhir
=
request
.
session
[
'akhir'
]
+
' 23:59:59'
#None
print
(
'isi awal dan akhir >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'
)
print
(
awal
)
print
(
akhir
)
if
awal
and
akhir
:
tglawal
=
datetime
.
strptime
(
awal
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
tglakhir
=
datetime
.
strptime
(
akhir
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
...
...
@@ -188,6 +191,7 @@ class ViewData(BaseView):
else_
=
PartnerPay
.
status
),
mData
=
'status'
),
]
# print('masuk query grid')
query
=
DBSession
.
query
()
.
select_from
(
PartnerPay
)
\
.
join
(
vendor
,
vendor
.
id
==
PartnerPay
.
vendor_id
)
\
.
join
(
customer
,
customer
.
id
==
PartnerPay
.
customer_id
)
...
...
@@ -196,7 +200,7 @@ class ViewData(BaseView):
query
=
query
.
filter
(
PartnerPay
.
status
<=
status
)
else
:
query
=
query
.
filter
(
PartnerPay
.
status
==
status
)
filter_tanggal
(
query
,
PartnerPay
.
created
)
query
=
filter_tanggal
(
query
,
PartnerPay
.
created
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
return
row_table
.
output_result
()
elif
act
==
"csv"
:
...
...
src/agratek/api/merchant/views/purchase_list.py
View file @
bb17d32
...
...
@@ -25,16 +25,7 @@ status_purchase = (
# (1, 'Payment'),
# (2, 'Register'),
# )
def
filter_tanggal
(
request
,
query
,
field
):
awal
=
request
.
session
[
'awal'
]
+
' 00:00:00'
#None
akhir
=
request
.
session
[
'akhir'
]
+
' 23:59:59'
#None
if
awal
and
akhir
:
tglawal
=
datetime
.
strptime
(
awal
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
tglakhir
=
datetime
.
strptime
(
akhir
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
query
=
query
.
filter
(
field
.
between
(
tglawal
,
tglakhir
))
return
query
def
query_csv
(
request
,
status
):
vendor
=
aliased
(
Partner
,
name
=
'vendor'
)
...
...
@@ -156,7 +147,16 @@ class ViewData(BaseView):
url_dict
=
request
.
matchdict
act
=
url_dict
[
'act'
]
def
filter_tanggal
(
request
,
query
,
field
):
awal
=
request
.
session
[
'awal'
]
+
' 00:00:00'
#None
akhir
=
request
.
session
[
'akhir'
]
+
' 23:59:59'
#None
if
awal
and
akhir
:
tglawal
=
datetime
.
strptime
(
awal
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
tglakhir
=
datetime
.
strptime
(
akhir
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
query
=
query
.
filter
(
field
.
between
(
tglawal
,
tglakhir
))
return
query
if
act
==
"grid"
:
# jenis = 'jenis' in request.params and request.params['jenis'] and int(request.params['jenis']) or None
...
...
@@ -195,7 +195,7 @@ class ViewData(BaseView):
query
=
query
.
filter
(
H2hArInvoiceDet
.
status
<=
status
)
else
:
query
=
query
.
filter
(
H2hArInvoiceDet
.
status
==
status
)
filter_tanggal
(
request
,
query
,
H2hArInvoice
.
created
)
query
=
filter_tanggal
(
request
,
query
,
H2hArInvoice
.
created
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
return
row_table
.
output_result
()
elif
act
==
"csv"
:
...
...
src/agratek/api/merchant/views/templates/payment/list.pt
View file @
bb17d32
...
...
@@ -115,7 +115,7 @@
columns
:
[
{
'data'
:
'id'
,
'width'
:
'0px'
},
{
'data'
:
'nomor'
,
'width'
:
'150px'
},
{
'data'
:
'
tanggal
'
,
'width'
:
'85px'
},
{
'data'
:
'
created
'
,
'width'
:
'85px'
},
{
'data'
:
'customer'
,
'width'
:
'80px'
},
{
'data'
:
'vendor'
,
'width'
:
'80px'
},
{
'data'
:
'amount_buy'
,
'width'
:
'70px'
},
...
...
src/agratek/api/merchant/views/templates/purchase/list.pt
View file @
bb17d32
...
...
@@ -115,7 +115,7 @@
columns
:
[
{
'data'
:
'id'
,
'width'
:
'0px'
},
{
'data'
:
'nomor'
,
'width'
:
'150px'
},
{
'data'
:
'
tanggal
'
,
'width'
:
'60px'
},
{
'data'
:
'
created
'
,
'width'
:
'60px'
},
{
'data'
:
'id_pel'
,
'width'
:
'150px'
},
{
'data'
:
'customer'
,
'width'
:
'80px'
},
{
'data'
:
'vendor'
,
'width'
:
'80px'
},
...
...
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