[fixes] check party_account_currency while creating Pull Request from Sales Invoice

This commit is contained in:
Saurabh 2016-03-14 14:01:26 +05:30
parent 9f94266892
commit c54619570a

View File

@ -211,7 +211,10 @@ def get_amount(ref_doc, dt):
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
if dt == "Sales Invoice":
grand_total = flt(ref_doc.grand_total)
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.outstanding_amount)
else:
grand_total = flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate
if grand_total > 0 :
return grand_total