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 6aa5f382
authored
Sep 20, 2019
by
Tatang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ketuker
1 parent
9e225abb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
174 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 @
6aa5f38
...
@@ -4,10 +4,10 @@ from deform import widget, Form, ValidationFailure
...
@@ -4,10 +4,10 @@ from deform import widget, Form, ValidationFailure
from
opensipkd.base.views
import
DataTables
from
opensipkd.base.views
import
DataTables
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.view
import
view_config
from
pyramid.view
import
view_config
from
sqlalchemy
import
func
from
sqlalchemy
.orm
import
aliased
from
.
import
BaseView
from
.
import
BaseView
from
..models
import
(
DBSession
,
H2hArInvoice
,
H2hArInvoiceDet
,
Partner
)
from
..models
import
(
DBSession
,
PartnerPay
,
Partner
)
from
opensipkd.base.tools
import
format_json
from
opensipkd.base.tools
import
format_json
from
opensipkd.base.tools.db
import
column_concat
from
opensipkd.base.tools.db
import
column_concat
...
@@ -18,12 +18,6 @@ status_payment = (
...
@@ -18,12 +18,6 @@ status_payment = (
(
2
,
'Batal'
),
(
2
,
'Batal'
),
)
)
invoice_type
=
(
(
0
,
'--None--'
),
(
1
,
'Purchase'
),
(
2
,
'Register'
),
)
def
form_validator
(
form
,
value
):
def
form_validator
(
form
,
value
):
pass
pass
...
@@ -35,10 +29,9 @@ class ViewData(BaseView):
...
@@ -35,10 +29,9 @@ class ViewData(BaseView):
renderer
=
'templates/payment/list.pt'
)
renderer
=
'templates/payment/list.pt'
)
def
view_list
(
self
):
def
view_list
(
self
):
class
ToolbarSchema
(
colander
.
Schema
):
class
ToolbarSchema
(
colander
.
Schema
):
inv_type
=
colander
.
SchemaNode
(
status
=
colander
.
SchemaNode
(
colander
.
Integer
(),
colander
.
String
(),
default
=
1
,
oid
=
"status"
,
widget
=
widget
.
SelectWidget
(
values
=
status_payment
,
css_class
=
'form-toolbar'
)
oid
=
"inv_type"
,
widget
=
widget
.
SelectWidget
(
values
=
invoice_type
,
css_class
=
'form-toolbar'
)
)
)
toolbar
=
ToolbarSchema
(
Validator
=
form_validator
)
toolbar
=
ToolbarSchema
(
Validator
=
form_validator
)
...
@@ -47,18 +40,22 @@ class ViewData(BaseView):
...
@@ -47,18 +40,22 @@ class ViewData(BaseView):
params
=
{
params
=
{
'form'
:
form
,
'form'
:
form
,
'
invoice_type'
:
[
k
and
s
or
'-'
for
k
,
s
in
invoice_type
],
'
status_payment'
:
[
s
for
k
,
s
in
status_payment
if
k
>
-
1
],
'columns'
:
[
'columns'
:
[
dict
(
title
=
"ID"
),
dict
(
title
=
"ID"
),
dict
(
title
=
"No. Invoice"
),
dict
(
title
=
"No. Invoice"
),
dict
(
title
=
"Customer"
),
dict
(
title
=
"Customer"
),
dict
(
title
=
"Jenis"
),
dict
(
title
=
"Vendor"
),
dict
(
title
=
"Amount"
),
dict
(
title
=
"Status"
),
],
],
'column_data'
:
[
'column_data'
:
[
dict
(
data
=
"id"
,
width
=
"0px"
),
dict
(
data
=
"id"
,
width
=
"0px"
),
dict
(
data
=
"nomor"
,
width
=
"150px"
),
dict
(
data
=
"nomor"
,
width
=
"150px"
),
dict
(
data
=
"customer"
),
dict
(
data
=
"customer"
),
dict
(
data
=
"inv_type"
,
width
=
"100px"
),
dict
(
data
=
"vendor"
),
dict
(
data
=
"amount"
,
width
=
"100px"
),
dict
(
data
=
"status"
,
width
=
"100px"
),
],
],
'buttons'
:
[
'buttons'
:
[
dict
(
id
=
"btn_view"
,
cls
=
"btn btn btn-primary"
,
title
=
"View"
),
dict
(
id
=
"btn_view"
,
cls
=
"btn btn btn-primary"
,
title
=
"View"
),
...
@@ -82,17 +79,34 @@ class ViewData(BaseView):
...
@@ -82,17 +79,34 @@ class ViewData(BaseView):
url_dict
=
request
.
matchdict
url_dict
=
request
.
matchdict
act
=
url_dict
[
'act'
]
act
=
url_dict
[
'act'
]
if
act
==
"grid"
:
if
act
==
"grid"
:
jenis
=
'jenis'
in
request
.
params
and
request
.
params
[
'jenis'
]
and
int
(
request
.
params
[
'jenis'
])
or
None
status
=
-
1
if
'status'
in
request
.
params
:
status
=
int
(
request
.
params
[
'status'
])
vendor
=
aliased
(
Partner
,
name
=
'vendor'
)
customer
=
aliased
(
Partner
,
name
=
'customer'
)
columns
=
[
columns
=
[
ColumnDT
(
H2hArInvoice
.
id
,
mData
=
'id'
),
ColumnDT
(
PartnerPay
.
id
,
mData
=
'id'
),
ColumnDT
(
H2hArInvoice
.
cust_inv_no
,
mData
=
'nomor'
),
ColumnDT
(
PartnerPay
.
cust_inv_no
,
mData
=
'nomor'
),
ColumnDT
(
Partner
.
nama
,
mData
=
'customer'
),
ColumnDT
(
ColumnDT
(
func
.
coalesce
(
H2hArInvoice
.
cust_inv_type
,
0
),
mData
=
'inv_type'
),
column_concat
([
PartnerPay
.
inv_cust_nm
,
' - ('
,
customer
.
nama
,
')'
]),
mData
=
'customer'
),
ColumnDT
(
vendor
.
nama
,
mData
=
'vendor'
),
ColumnDT
(
PartnerPay
.
amt_sell
,
mData
=
'amount'
),
ColumnDT
(
PartnerPay
.
status
,
mData
=
'status'
),
]
]
query
=
DBSession
.
query
()
.
select_from
(
H2hArInvoice
)
\
query
=
DBSession
.
query
()
.
select_from
(
PartnerPay
)
\
.
join
(
Partner
,
Partner
.
id
==
H2hArInvoice
.
customer_id
)
.
join
(
vendor
,
vendor
.
id
==
PartnerPay
.
vendor_id
)
\
query
=
query
.
filter
(
H2hArInvoice
.
cust_inv_type
==
jenis
)
.
join
(
customer
,
customer
.
id
==
PartnerPay
.
customer_id
)
if
status
>
-
1
:
query
=
query
.
filter
(
PartnerPay
.
status
==
status
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
return
row_table
.
output_result
()
return
row_table
.
output_result
()
...
@@ -103,19 +117,75 @@ class ViewData(BaseView):
...
@@ -103,19 +117,75 @@ class ViewData(BaseView):
request
=
self
.
req
request
=
self
.
req
url_dict
=
request
.
matchdict
url_dict
=
request
.
matchdict
view_id
=
url_dict
[
'id'
]
view_id
=
url_dict
[
'id'
]
data
=
H2hArInvoice
.
query_id
(
id
=
view_id
)
.
first
()
data
=
PartnerPay
.
query_id
(
id
=
view_id
)
.
first
()
params
=
dict
(
params
=
dict
(
form
=
None
form
=
None
)
)
if
data
:
if
data
:
customer
=
'{cust} - ({merc})'
.
format
(
cust
=
data
.
inv_cust_nm
,
merc
=
data
.
customer
.
nama
)
form_list
=
(
form_list
=
(
(
'inv_no'
,
data
.
cust_inv_no
or
''
,
'text'
),
(
'vend_inv_no'
,
data
.
vend_inv_no
or
''
,
'text'
),
(
'customer'
,
data
.
customer
.
nama
,
'text'
),
(
'cust_inv_no'
,
data
.
cust_inv_no
or
''
,
'text'
),
(
'tx_id'
,
data
.
tx_id
or
''
,
'text'
),
(
'amount'
,
data
.
amount
or
0
,
'text'
),
(
'vendor'
,
data
.
vendor
.
nama
,
'text'
),
(
'produk'
,
data
.
produk
.
nama
,
'text'
),
# ('id_pel', data.id_pel or '', 'text'),
(
'customer'
,
customer
,
'text'
),
(
'cust_addr'
,
data
.
inv_cust_addr
or
''
,
'text'
),
(
'cust_phone'
,
data
.
inv_cust_phone
or
''
,
'text'
),
(
'cust_email'
,
data
.
inv_cust_email
or
''
,
'text'
),
(
'cust_city'
,
data
.
inv_cust_city
or
''
,
'text'
),
(
'cust_state'
,
data
.
inv_cust_state
or
''
,
'text'
),
(
'cust_pos'
,
data
.
inv_cust_pos
or
''
,
'text'
),
(
'cust_country'
,
data
.
inv_cust_country
or
''
,
'text'
),
# ('inv_valid_date', data.description, 'text'),
# ('inv_valid_time', data.description, 'text'),
# ('inv_time_stamp', data.description, 'text'),
# ('inv_cust_va', data.description, 'text'),
#
# ('delivery_addr', data.description, 'text'),
# ('delivery_city', data.description, 'text'),
# ('delivery_country', data.description, 'text'),
# ('delivery_nm', data.description, 'text'),
# ('delivery_phone', data.description, 'text'),
# ('delivery_pos', data.description, 'text'),
# ('delivery_state', data.description, 'text'),
# ('delivery_email', data.description, 'text'),
# ('subtotal', data.subtotal, 'text'),
# ('discount', data.discount, 'text'),
# ('amt_sell', data.amt_sell, 'text'),
(
'inquiry'
,
format_json
(
data
.
inquiry
),
'textarea'
),
(
'inquiry'
,
format_json
(
data
.
inquiry
),
'textarea'
),
(
'payment'
,
format_json
(
data
.
payment
),
'textarea'
),
(
'payment'
,
format_json
(
data
.
payment
),
'textarea'
),
(
'advice'
,
format_json
(
data
.
advice
),
'textarea'
),
(
'advice'
,
format_json
(
data
.
advice
),
'textarea'
),
(
'notify'
,
format_json
(
data
.
notify
),
'textarea'
),
(
'cancel'
,
format_json
(
data
.
cancel
),
'textarea'
),
(
'cart'
,
format_json
(
data
.
cart
),
'textarea'
),
# ('notes', data.notes, 'text'),
# ('description', data.description, 'text'),
# ('fee', data.description, 'text'),
# ('instmnt_mon', data.description, 'text'),
# ('instmnt_type', data.description, 'text'),
# ('recurr_opt', data.description, 'text'),
# ('m_ref_no', data.description, 'text'),
# ('notax_amt', data.description, 'text'),
# ('pay_valid_dt', data.description, 'text'),
# ('pay_valid_tm', data.description, 'text'),
#
# ('req_dt', data.description, 'text'),
# ('req_tm', data.description, 'text'),
#
# ('vat', data.description, 'text'),
# ('trans_dt', data.description, 'text'),
# ('trans_tm', data.description, 'text'),
# ('card_no', data.description, 'text'),
# ('callback_url', data.description, 'text'),
)
)
sm
=
colander
.
Schema
()
sm
=
colander
.
Schema
()
...
...
src/agratek/api/merchant/views/purchase_list.py
View file @
6aa5f38
...
@@ -4,18 +4,16 @@ from deform import widget, Form, ValidationFailure
...
@@ -4,18 +4,16 @@ from deform import widget, Form, ValidationFailure
from
opensipkd.base.views
import
DataTables
from
opensipkd.base.views
import
DataTables
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.view
import
view_config
from
pyramid.view
import
view_config
from
sqlalchemy
.orm
import
aliased
from
sqlalchemy
import
func
from
.
import
BaseView
from
.
import
BaseView
from
..models
import
(
DBSession
,
PartnerPay
,
Partner
)
from
..models
import
(
DBSession
,
H2hArInvoice
,
H2hArInvoiceDet
,
Partner
)
from
opensipkd.base.tools
import
format_json
from
opensipkd.base.tools
import
format_json
from
opensipkd.base.tools.db
import
column_concat
status_payment
=
(
invoice_type
=
(
(
-
1
,
'--Semua--'
),
(
0
,
'--None--'
),
(
0
,
'Pending'
),
(
1
,
'Payment'
),
(
1
,
'Sukses'
),
(
2
,
'Register'
),
(
2
,
'Batal'
),
)
)
...
@@ -29,9 +27,10 @@ class ViewData(BaseView):
...
@@ -29,9 +27,10 @@ class ViewData(BaseView):
renderer
=
'templates/purchase/list.pt'
)
renderer
=
'templates/purchase/list.pt'
)
def
view_list
(
self
):
def
view_list
(
self
):
class
ToolbarSchema
(
colander
.
Schema
):
class
ToolbarSchema
(
colander
.
Schema
):
status
=
colander
.
SchemaNode
(
inv_type
=
colander
.
SchemaNode
(
colander
.
String
(),
colander
.
Integer
(),
oid
=
"status"
,
widget
=
widget
.
SelectWidget
(
values
=
status_payment
,
css_class
=
'form-toolbar'
)
default
=
1
,
oid
=
"inv_type"
,
widget
=
widget
.
SelectWidget
(
values
=
invoice_type
,
css_class
=
'form-toolbar'
)
)
)
toolbar
=
ToolbarSchema
(
Validator
=
form_validator
)
toolbar
=
ToolbarSchema
(
Validator
=
form_validator
)
...
@@ -40,22 +39,18 @@ class ViewData(BaseView):
...
@@ -40,22 +39,18 @@ class ViewData(BaseView):
params
=
{
params
=
{
'form'
:
form
,
'form'
:
form
,
'
status_payment'
:
[
s
for
k
,
s
in
status_payment
if
k
>
-
1
],
'
invoice_type'
:
[
k
and
s
or
'-'
for
k
,
s
in
invoice_type
],
'columns'
:
[
'columns'
:
[
dict
(
title
=
"ID"
),
dict
(
title
=
"ID"
),
dict
(
title
=
"No. Invoice"
),
dict
(
title
=
"No. Invoice"
),
dict
(
title
=
"Customer"
),
dict
(
title
=
"Customer"
),
dict
(
title
=
"Vendor"
),
dict
(
title
=
"Jenis"
),
dict
(
title
=
"Amount"
),
dict
(
title
=
"Status"
),
],
],
'column_data'
:
[
'column_data'
:
[
dict
(
data
=
"id"
,
width
=
"0px"
),
dict
(
data
=
"id"
,
width
=
"0px"
),
dict
(
data
=
"nomor"
,
width
=
"150px"
),
dict
(
data
=
"nomor"
,
width
=
"150px"
),
dict
(
data
=
"customer"
),
dict
(
data
=
"customer"
),
dict
(
data
=
"vendor"
),
dict
(
data
=
"inv_type"
,
width
=
"100px"
),
dict
(
data
=
"amount"
,
width
=
"100px"
),
dict
(
data
=
"status"
,
width
=
"100px"
),
],
],
'buttons'
:
[
'buttons'
:
[
dict
(
id
=
"btn_view"
,
cls
=
"btn btn btn-primary"
,
title
=
"View"
),
dict
(
id
=
"btn_view"
,
cls
=
"btn btn btn-primary"
,
title
=
"View"
),
...
@@ -79,34 +74,17 @@ class ViewData(BaseView):
...
@@ -79,34 +74,17 @@ class ViewData(BaseView):
url_dict
=
request
.
matchdict
url_dict
=
request
.
matchdict
act
=
url_dict
[
'act'
]
act
=
url_dict
[
'act'
]
if
act
==
"grid"
:
if
act
==
"grid"
:
status
=
-
1
jenis
=
'jenis'
in
request
.
params
and
request
.
params
[
'jenis'
]
and
int
(
request
.
params
[
'jenis'
])
or
None
if
'status'
in
request
.
params
:
status
=
int
(
request
.
params
[
'status'
])
vendor
=
aliased
(
Partner
,
name
=
'vendor'
)
customer
=
aliased
(
Partner
,
name
=
'customer'
)
columns
=
[
columns
=
[
ColumnDT
(
PartnerPay
.
id
,
mData
=
'id'
),
ColumnDT
(
H2hArInvoice
.
id
,
mData
=
'id'
),
ColumnDT
(
PartnerPay
.
cust_inv_no
,
mData
=
'nomor'
),
ColumnDT
(
H2hArInvoice
.
cust_inv_no
,
mData
=
'nomor'
),
ColumnDT
(
ColumnDT
(
Partner
.
nama
,
mData
=
'customer'
),
column_concat
([
ColumnDT
(
func
.
coalesce
(
H2hArInvoice
.
cust_inv_type
,
0
),
mData
=
'inv_type'
),
PartnerPay
.
inv_cust_nm
,
' - ('
,
customer
.
nama
,
')'
]),
mData
=
'customer'
),
ColumnDT
(
vendor
.
nama
,
mData
=
'vendor'
),
ColumnDT
(
PartnerPay
.
amt_sell
,
mData
=
'amount'
),
ColumnDT
(
PartnerPay
.
status
,
mData
=
'status'
),
]
]
query
=
DBSession
.
query
()
.
select_from
(
PartnerPay
)
\
query
=
DBSession
.
query
()
.
select_from
(
H2hArInvoice
)
\
.
join
(
vendor
,
vendor
.
id
==
PartnerPay
.
vendor_id
)
\
.
join
(
Partner
,
Partner
.
id
==
H2hArInvoice
.
customer_id
)
.
join
(
customer
,
customer
.
id
==
PartnerPay
.
customer_id
)
query
=
query
.
filter
(
H2hArInvoice
.
cust_inv_type
==
jenis
)
if
status
>
-
1
:
query
=
query
.
filter
(
PartnerPay
.
status
==
status
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
row_table
=
DataTables
(
request
.
GET
,
query
,
columns
)
return
row_table
.
output_result
()
return
row_table
.
output_result
()
...
@@ -117,75 +95,19 @@ class ViewData(BaseView):
...
@@ -117,75 +95,19 @@ class ViewData(BaseView):
request
=
self
.
req
request
=
self
.
req
url_dict
=
request
.
matchdict
url_dict
=
request
.
matchdict
view_id
=
url_dict
[
'id'
]
view_id
=
url_dict
[
'id'
]
data
=
PartnerPay
.
query_id
(
id
=
view_id
)
.
first
()
data
=
H2hArInvoice
.
query_id
(
id
=
view_id
)
.
first
()
params
=
dict
(
params
=
dict
(
form
=
None
form
=
None
)
)
if
data
:
if
data
:
customer
=
'{cust} - ({merc})'
.
format
(
cust
=
data
.
inv_cust_nm
,
merc
=
data
.
customer
.
nama
)
form_list
=
(
form_list
=
(
(
'vend_inv_no'
,
data
.
vend_inv_no
or
''
,
'text'
),
(
'inv_no'
,
data
.
cust_inv_no
or
''
,
'text'
),
(
'cust_inv_no'
,
data
.
cust_inv_no
or
''
,
'text'
),
(
'customer'
,
data
.
customer
.
nama
,
'text'
),
(
'tx_id'
,
data
.
tx_id
or
''
,
'text'
),
(
'vendor'
,
data
.
vendor
.
nama
,
'text'
),
(
'amount'
,
data
.
amount
or
0
,
'text'
),
(
'produk'
,
data
.
produk
.
nama
,
'text'
),
# ('id_pel', data.id_pel or '', 'text'),
(
'customer'
,
customer
,
'text'
),
(
'cust_addr'
,
data
.
inv_cust_addr
or
''
,
'text'
),
(
'cust_phone'
,
data
.
inv_cust_phone
or
''
,
'text'
),
(
'cust_email'
,
data
.
inv_cust_email
or
''
,
'text'
),
(
'cust_city'
,
data
.
inv_cust_city
or
''
,
'text'
),
(
'cust_state'
,
data
.
inv_cust_state
or
''
,
'text'
),
(
'cust_pos'
,
data
.
inv_cust_pos
or
''
,
'text'
),
(
'cust_country'
,
data
.
inv_cust_country
or
''
,
'text'
),
# ('inv_valid_date', data.description, 'text'),
# ('inv_valid_time', data.description, 'text'),
# ('inv_time_stamp', data.description, 'text'),
# ('inv_cust_va', data.description, 'text'),
#
# ('delivery_addr', data.description, 'text'),
# ('delivery_city', data.description, 'text'),
# ('delivery_country', data.description, 'text'),
# ('delivery_nm', data.description, 'text'),
# ('delivery_phone', data.description, 'text'),
# ('delivery_pos', data.description, 'text'),
# ('delivery_state', data.description, 'text'),
# ('delivery_email', data.description, 'text'),
# ('subtotal', data.subtotal, 'text'),
# ('discount', data.discount, 'text'),
# ('amt_sell', data.amt_sell, 'text'),
(
'inquiry'
,
format_json
(
data
.
inquiry
),
'textarea'
),
(
'inquiry'
,
format_json
(
data
.
inquiry
),
'textarea'
),
(
'payment'
,
format_json
(
data
.
payment
),
'textarea'
),
(
'payment'
,
format_json
(
data
.
payment
),
'textarea'
),
(
'advice'
,
format_json
(
data
.
advice
),
'textarea'
),
(
'advice'
,
format_json
(
data
.
advice
),
'textarea'
),
(
'notify'
,
format_json
(
data
.
notify
),
'textarea'
),
(
'cancel'
,
format_json
(
data
.
cancel
),
'textarea'
),
(
'cart'
,
format_json
(
data
.
cart
),
'textarea'
),
# ('notes', data.notes, 'text'),
# ('description', data.description, 'text'),
# ('fee', data.description, 'text'),
# ('instmnt_mon', data.description, 'text'),
# ('instmnt_type', data.description, 'text'),
# ('recurr_opt', data.description, 'text'),
# ('m_ref_no', data.description, 'text'),
# ('notax_amt', data.description, 'text'),
# ('pay_valid_dt', data.description, 'text'),
# ('pay_valid_tm', data.description, 'text'),
#
# ('req_dt', data.description, 'text'),
# ('req_tm', data.description, 'text'),
#
# ('vat', data.description, 'text'),
# ('trans_dt', data.description, 'text'),
# ('trans_tm', data.description, 'text'),
# ('card_no', data.description, 'text'),
# ('callback_url', data.description, 'text'),
)
)
sm
=
colander
.
Schema
()
sm
=
colander
.
Schema
()
...
@@ -211,4 +133,3 @@ class ViewData(BaseView):
...
@@ -211,4 +133,3 @@ class ViewData(BaseView):
params
[
'form'
]
=
form
params
[
'form'
]
=
form
return
dict
(
params
=
params
)
return
dict
(
params
=
params
)
src/agratek/api/merchant/views/templates/payment/list.pt
View file @
6aa5f38
...
@@ -54,10 +54,10 @@
...
@@ -54,10 +54,10 @@
var oTable;
var oTable;
var oTableUri = "${request._host}${params.route}"
var oTableUri = "${request._host}${params.route}"
var oTableUrl = oTableUri + "/grid/act";
var oTableUrl = oTableUri + "/grid/act";
function getDataUrl() {
function getDataUrl() {
var opt = $('select#
inv_type
').val();
var opt = $('select#
status
').val();
return oTableUrl + '?
jeni
s=' + opt.toString();
return oTableUrl + '?
statu
s=' + opt.toString();
}
}
function getViewUrl(vid) {
function getViewUrl(vid) {
...
@@ -82,18 +82,20 @@
...
@@ -82,18 +82,20 @@
[10, 25, 50, 100],
[10, 25, 50, 100],
[10, 25, 50, 100]
[10, 25, 50, 100]
],
],
columns: [
// columns: [
{'data': 'id', 'width': '0px'},
// {'data': 'id', 'width': '0px'},
{'data': 'nomor', 'width': '150px'},
// {'data': 'nomor', 'width': '150px'},
{'data': 'customer'},
// {'data': 'customer'},
{'data': 'inv_type', 'width': '100px',
// {'data': 'vendor'},
'render': function(data, type, full, meta) {
// {'data': 'amount', 'width': '100px'},
var st = ${params.invoice_type};
// {'data': 'status', 'width': '100px',
return st[data];
// 'render': function(data, type, full, meta) {
}
// var st = ${params.status_payment};
}
// return st[data];
],
// }
//columns: ${params.column_data},
// }
// ],
columns: ${params.column_data},
columnDefs: [{
columnDefs: [{
searchable: false,
searchable: false,
visible: false,
visible: false,
...
@@ -143,13 +145,14 @@
...
@@ -143,13 +145,14 @@
$(this).addClass('row_selected');
$(this).addClass('row_selected');
}
}
});
});
${params.scripts}
${params.scripts}
$('#btn_view').click(function() {
$('#btn_view').click(function() {
if (mID) {
if (mID) {
//window.location = oTableUri + '/' + mID + '/view';
$('#payment-view').modal('show');
$('#payment-view').modal('show');
} else {
} else {
$.SmartMessageBox({
$.SmartMessageBox({
title : "View",
title : "View",
content : "Pilih Baris yang akan di lihat...",
content : "Pilih Baris yang akan di lihat...",
...
@@ -170,11 +173,11 @@
...
@@ -170,11 +173,11 @@
}
}
});
});
$('select#
inv_type
').on('change', function() {
$('select#
status
').on('change', function() {
mID = 0;
mID = 0;
oTable.ajax.url(getDataUrl()).load();
oTable.ajax.url(getDataUrl()).load();
});
});
});
});
</script>
</script>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
src/agratek/api/merchant/views/templates/purchase/list.pt
View file @
6aa5f38
...
@@ -54,10 +54,10 @@
...
@@ -54,10 +54,10 @@
var oTable;
var oTable;
var oTableUri = "${request._host}${params.route}"
var oTableUri = "${request._host}${params.route}"
var oTableUrl = oTableUri + "/grid/act";
var oTableUrl = oTableUri + "/grid/act";
function getDataUrl() {
function getDataUrl() {
var opt = $('select#
status
').val();
var opt = $('select#
inv_type
').val();
return oTableUrl + '?
statu
s=' + opt.toString();
return oTableUrl + '?
jeni
s=' + opt.toString();
}
}
function getViewUrl(vid) {
function getViewUrl(vid) {
...
@@ -82,20 +82,18 @@
...
@@ -82,20 +82,18 @@
[10, 25, 50, 100],
[10, 25, 50, 100],
[10, 25, 50, 100]
[10, 25, 50, 100]
],
],
// columns: [
columns: [
// {'data': 'id', 'width': '0px'},
{'data': 'id', 'width': '0px'},
// {'data': 'nomor', 'width': '150px'},
{'data': 'nomor', 'width': '150px'},
// {'data': 'customer'},
{'data': 'customer'},
// {'data': 'vendor'},
{'data': 'inv_type', 'width': '100px',
// {'data': 'amount', 'width': '100px'},
'render': function(data, type, full, meta) {
// {'data': 'status', 'width': '100px',
var st = ${params.invoice_type};
// 'render': function(data, type, full, meta) {
return st[data];
// var st = ${params.status_payment};
}
// return st[data];
}
// }
],
// }
//columns: ${params.column_data},
// ],
columns: ${params.column_data},
columnDefs: [{
columnDefs: [{
searchable: false,
searchable: false,
visible: false,
visible: false,
...
@@ -145,14 +143,13 @@
...
@@ -145,14 +143,13 @@
$(this).addClass('row_selected');
$(this).addClass('row_selected');
}
}
});
});
${params.scripts}
${params.scripts}
$('#btn_view').click(function() {
$('#btn_view').click(function() {
if (mID) {
if (mID) {
//window.location = oTableUri + '/' + mID + '/view';
$('#payment-view').modal('show');
$('#payment-view').modal('show');
} else {
} else {
$.SmartMessageBox({
$.SmartMessageBox({
title : "View",
title : "View",
content : "Pilih Baris yang akan di lihat...",
content : "Pilih Baris yang akan di lihat...",
...
@@ -173,11 +170,11 @@
...
@@ -173,11 +170,11 @@
}
}
});
});
$('select#
status
').on('change', function() {
$('select#
inv_type
').on('change', function() {
mID = 0;
mID = 0;
oTable.ajax.url(getDataUrl()).load();
oTable.ajax.url(getDataUrl()).load();
});
});
});
});
</script>
</script>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
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