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 838b9d62
authored
Jul 31, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ar_invoce
1 parent
0bb582cf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletions
src/agratek/api/merchant/tools.py
src/agratek/api/merchant/views/merchan.py
src/agratek/api/merchant/views/vendor.py
src/agratek/api/merchant/tools.py
View file @
838b9d6
src/agratek/api/merchant/views/merchan.py
View file @
838b9d6
...
@@ -142,6 +142,9 @@ def build_purchase(vendor_produk, partner_log=None):
...
@@ -142,6 +142,9 @@ def build_purchase(vendor_produk, partner_log=None):
return
build_request
(
'payment'
,
vendor_produk
,
partner_log
)
return
build_request
(
'payment'
,
vendor_produk
,
partner_log
)
from
..tools
import
JsonRpcInvoiceFoundError
@jsonrpc_method
(
method
=
'purchase'
,
endpoint
=
'api-merchant'
)
@jsonrpc_method
(
method
=
'purchase'
,
endpoint
=
'api-merchant'
)
def
purchase
(
request
,
data
,
**
kwargs
):
def
purchase
(
request
,
data
,
**
kwargs
):
"""
"""
...
@@ -191,6 +194,9 @@ def purchase(request, data, **kwargs):
...
@@ -191,6 +194,9 @@ def purchase(request, data, **kwargs):
inv_no
=
dat
[
"inv_no"
]
inv_no
=
dat
[
"inv_no"
]
produk
=
dat
[
"produk"
]
produk
=
dat
[
"produk"
]
# todo cek apakah invoice sudah ada atau belum
# todo cek apakah invoice sudah ada atau belum
ar_invoice
=
H2hArInvoice
.
query
()
.
filter_by
(
cust_inv_no
=
inv_no
)
.
first
()
if
ar_invoice
:
raise
JsonRpcInvoiceFoundError
()
ar_invoice
=
H2hArInvoice
()
ar_invoice
=
H2hArInvoice
()
ar_invoice
.
customer_id
=
customer
.
id
ar_invoice
.
customer_id
=
customer
.
id
ar_invoice
.
cust_inv_no
=
inv_no
ar_invoice
.
cust_inv_no
=
inv_no
...
...
src/agratek/api/merchant/views/vendor.py
View file @
838b9d6
...
@@ -193,7 +193,7 @@ def proses_odeo(request):
...
@@ -193,7 +193,7 @@ def proses_odeo(request):
order
.
status
=
1
order
.
status
=
1
else
:
else
:
order
.
status
=
-
2
order
.
status
=
-
2
order
.
notify
=
d
ata
order
.
notify
=
d
ict
(
post
=
data
)
flush_row
(
order
)
flush_row
(
order
)
#todo: add to customer notify table
#todo: add to customer notify table
#todo: create cron for notify
#todo: create cron for notify
...
...
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