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 b7cbb306
authored
Jul 31, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
pln
1 parent
f7a10959
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
src/agratek/api/merchant/views/merchan.py
src/agratek/api/merchant/views/merchan.py
View file @
b7cbb30
...
@@ -224,18 +224,24 @@ def purchase(request, data, **kwargs):
...
@@ -224,18 +224,24 @@ def purchase(request, data, **kwargs):
ar_invoice_det
.
amt_sell
=
vendor_produk
.
produk
.
harga
ar_invoice_det
.
amt_sell
=
vendor_produk
.
produk
.
harga
flush_row
(
ar_invoice_det
)
flush_row
(
ar_invoice_det
)
result
=
build_purchase
(
vendor_produk
,
ar_invoice_det
)
result
=
build_purchase
(
vendor_produk
,
ar_invoice_det
)
total
=
"price"
in
result
and
result
[
"price"
]
or
0
if
total
:
if
vendor_produk
.
produk
.
harga
<
total
:
total
+=
vendor_produk
.
produk
.
harga
prod
.
update
(
dict
(
total
=
result
[
"price"
]))
# ar_invoice_det.status = 'status' in result and result["status"] or 'FAILED'
# ar_invoice_det.status = 'status' in result and result["status"] or 'FAILED'
if
result
[
"code"
]
==
9
:
#
if result["code"] == 9:
ar_invoice_det
.
amt_buy
=
result
[
"response"
]
.
total
#
ar_invoice_det.amt_buy = result["response"].total
discount
=
0
#
discount = 0
prod
.
update
(
#
prod.update(
dict
(
#
dict(
subtotal
=
ar_invoice_det
.
amt_sell
,
#
subtotal=ar_invoice_det.amt_sell,
discount
=
discount
,
#
discount=discount,
total
=
ar_invoice_det
.
amt_sell
+
discount
#
total=ar_invoice_det.amt_sell + discount
)
#
)
)
#
)
prod
.
update
(
status
=
result
[
"status"
])
#
prod.update(status=result["status"])
r_prod
.
append
(
prod
)
r_prod
.
append
(
prod
)
ar_invoice
.
payment
[
"response"
]
=
r_prod
ar_invoice
.
payment
[
"response"
]
=
r_prod
...
...
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