Commit f89eb240 by Solo Group

pln

1 parent 618afbf9
......@@ -225,14 +225,14 @@ def purchase(request, data, **kwargs):
flush_row(ar_invoice_det)
result = build_purchase(vendor_produk, ar_invoice_det)
total = "total" in result and result["total"] or 0
prod.update(result)
if total:
if vendor_produk.produk.harga < total:
total += vendor_produk.produk.harga
elif vendor_produk.produk.harga > total:
total = vendor_produk.produk.harga
prod.update(dict(total=total,
status=result["status"]))
prod.update(dict(total=total))
# ar_invoice_det.status = 'status' in result and result["status"] or 'FAILED'
# if result["code"] == 9:
# ar_invoice_det.amt_buy = result["response"].total
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!