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 c36f2f48
authored
Aug 03, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
VSI
1 parent
f6e0ee93
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
src/agratek/api/merchant/views/odeo/__init__.py
src/agratek/api/merchant/views/odeo/__init__.py
View file @
c36f2f4
...
...
@@ -3,10 +3,12 @@ import json
import
requests
from
opensipkd.base
import
get_settings
from
opensipkd.pasar.models
import
PartnerProduk
from
..vendor
import
VendorClass
from
...tools
import
log
import
logging
log
=
logging
.
getLogger
(
__name__
)
import
urllib3
urllib3
.
disable_warnings
()
...
...
@@ -142,7 +144,6 @@ class Vendor(VendorClass):
if
self
.
vendor_produk
.
produk
.
kategori
.
kode
==
"e-payment"
:
inq
=
self
.
inquiry
()
resp
=
self
.
request_post
(
params
,
'/prepaid/purchase'
)
try
:
result
=
json
.
loads
(
resp
.
text
)
...
...
@@ -165,7 +166,6 @@ class Vendor(VendorClass):
if
"rc"
in
data
:
parsd
[
"code"
]
=
int
(
data
[
"rc"
])
if
data
[
"rc"
]
==
"13"
:
parsd
[
"status"
]
=
"FAILED"
self
.
status
=
-
2
...
...
@@ -186,13 +186,19 @@ class Vendor(VendorClass):
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
None
if
not
inq
:
if
parsd
[
"code"
]
==
0
or
parsd
[
"code"
]
==
68
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
[
"total"
]
=
self
.
amt_buy
product_id
=
self
.
invoice_det
.
produk
.
id
partner_id
=
self
.
invoice_det
.
h2h_ar_invoice
.
customer_id
discount
=
PartnerProduk
.
get_discount
(
partner_id
,
product_id
)
harga
=
self
.
vendor_produk
.
produk
.
harga
self
.
amt_sell
=
int
(
harga
-
discount
)
parsd
[
"total"
]
=
self
.
amt_sell
parsd
[
"discount"
]
=
int
(
discount
)
parsd
[
"subtotal"
]
=
int
(
harga
)
else
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
[
"total"
]
=
inq
[
"total"
]
parsd
[
"subtotal"
]
=
inq
[
"subtotal"
]
parsd
[
"discount"
]
=
inq
[
"discount"
]
self
.
result
=
parsd
log
.
info
(
"Payment Result:
%
s"
%
self
.
result
)
...
...
@@ -315,14 +321,6 @@ class Vendor(VendorClass):
inquirieses
=
type
(
inquiries
)
is
list
and
inquiries
or
[
inquiries
]
i
=
0
for
inquiries
in
inquirieses
:
# if "name" in inquiries:
# result['nama'] = inquiries["name"]
#
# if "tariff" in inquiries:
# result['tarif'] = inquiries["tariff"]
# if "power" in data:
# result['daya'] = data["power"]
#
if
"base_price"
in
inquiries
:
if
"pokok"
in
rincian
:
rincian
[
'pokok'
]
+=
inquiries
[
"base_price"
]
...
...
@@ -402,11 +400,15 @@ class Vendor(VendorClass):
rincian
[
'anggota'
]
=
inquiries
[
"participant_counts"
]
i
+=
1
self
.
amt_buy
=
result
[
"total"
]
jual
=
self
.
vendor_produk
.
produk
.
harga
*
i
log
.
info
(
rincian
)
self
.
discount
=
int
(
rincian
[
"admin"
])
-
jual
self
.
amt_sell
=
int
(
result
[
"subtotal"
])
-
int
(
self
.
discount
)
adm_jual
=
self
.
vendor_produk
.
produk
.
harga
*
i
product_id
=
self
.
invoice_det
.
produk
.
id
partner_id
=
self
.
invoice_det
.
h2h_ar_invoice
.
customer_id
discount
=
PartnerProduk
.
get_discount
(
partner_id
,
product_id
)
self
.
discount
=
discount
*
i
harga_pokok
=
self
.
amt_buy
-
rincian
[
"admin"
]
self
.
amt_sell
=
int
(
harga_pokok
)
+
adm_jual
result
[
"discount"
]
=
self
.
discount
result
[
"total"
]
=
self
.
amt_sell
result
[
'jml_data'
]
=
i
...
...
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