Minor fix for order to invoice mapping

This commit is contained in:
Nabin Hait 2014-11-24 18:17:01 +05:30
parent 0ad7db3bbd
commit b74ae7aa31
2 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ def make_purchase_invoice(source_name, target_doc=None):
def update_item(obj, target, source_parent):
target.amount = flt(obj.amount) - flt(obj.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = target.amount / flt(obj.rate) if flt(obj.rate) else flt(obj.qty)
target.qty = target.amount / flt(obj.rate) if (flt(obj.rate) and flt(obj.billed_amt)) else flt(obj.qty)
doc = get_mapped_doc("Purchase Order", source_name, {
"Purchase Order": {

View File

@ -329,7 +329,7 @@ def make_sales_invoice(source_name, target_doc=None):
def update_item(source, target, source_parent):
target.amount = flt(source.amount) - flt(source.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = source.rate and target.amount / flt(source.rate) or source.qty
target.qty = target.amount / flt(source.rate) if (source.rate and source.billed_amt) else source.qty
doclist = get_mapped_doc("Sales Order", source_name, {
"Sales Order": {