[fix] [mapper]
This commit is contained in:
parent
2e652e8294
commit
55b5dd2f10
@ -249,7 +249,7 @@ def make_purchase_invoice(source_name, target_doclist=None):
|
|||||||
def update_item(obj, target, source_parent):
|
def update_item(obj, target, source_parent):
|
||||||
target.conversion_factor = 1
|
target.conversion_factor = 1
|
||||||
target.import_amount = flt(obj.import_amount) - flt(obj.billed_amt)
|
target.import_amount = flt(obj.import_amount) - flt(obj.billed_amt)
|
||||||
target.amount = target.import_amount / flt(source_parent.conversion_rate)
|
target.amount = target.import_amount * flt(source_parent.conversion_rate)
|
||||||
if flt(obj.purchase_rate):
|
if flt(obj.purchase_rate):
|
||||||
target.qty = target.amount / flt(obj.purchase_rate)
|
target.qty = target.amount / flt(obj.purchase_rate)
|
||||||
|
|
||||||
|
@ -412,9 +412,9 @@ def make_delivery_note(source_name, target_doclist=None):
|
|||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def make_sales_invoice(source_name, target_doclist=None):
|
def make_sales_invoice(source_name, target_doclist=None):
|
||||||
def update_item(obj, target, source_parent):
|
def update_item(obj, target, source_parent):
|
||||||
target.export_amount = flt(obj.amount) - flt(obj.billed_amt)
|
target.export_amount = flt(obj.export_amount) - flt(obj.billed_amt)
|
||||||
target.amount = target.export_amount / flt(source_parent.conversion_rate)
|
target.amount = target.export_amount * flt(source_parent.conversion_rate)
|
||||||
target.qty = obj.basic_rate and target.amount / flt(obj.basic_rate) or obj.qty
|
target.qty = obj.export_rate and target.export_amount / flt(obj.export_rate) or obj.qty
|
||||||
|
|
||||||
doclist = get_mapped_doclist("Sales Order", source_name, {
|
doclist = get_mapped_doclist("Sales Order", source_name, {
|
||||||
"Sales Order": {
|
"Sales Order": {
|
||||||
|
@ -358,12 +358,7 @@ class DocType(SellingController):
|
|||||||
make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2))
|
make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2))
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def make_sales_invoice(source_name, target_doclist=None):
|
def make_sales_invoice(source_name, target_doclist=None):
|
||||||
def update_item(obj, target, source_parent):
|
|
||||||
target.export_amount = flt(obj.amount)
|
|
||||||
target.amount = target.export_amount / flt(source_parent.conversion_rate)
|
|
||||||
target.qty = obj.basic_rate and target.amount / flt(obj.basic_rate) or obj.qty
|
|
||||||
|
|
||||||
def update_accounts(source, target):
|
def update_accounts(source, target):
|
||||||
si = webnotes.bean(target)
|
si = webnotes.bean(target)
|
||||||
si.run_method("onload_post_render")
|
si.run_method("onload_post_render")
|
||||||
@ -384,7 +379,6 @@ def make_sales_invoice(source_name, target_doclist=None):
|
|||||||
"prevdoc_docname": "sales_order",
|
"prevdoc_docname": "sales_order",
|
||||||
"serial_no": "serial_no"
|
"serial_no": "serial_no"
|
||||||
},
|
},
|
||||||
"postprocess": update_item
|
|
||||||
},
|
},
|
||||||
"Sales Taxes and Charges": {
|
"Sales Taxes and Charges": {
|
||||||
"doctype": "Sales Taxes and Charges",
|
"doctype": "Sales Taxes and Charges",
|
||||||
|
@ -352,10 +352,6 @@ def make_purchase_invoice(source_name, target_doclist=None):
|
|||||||
|
|
||||||
def update_item(obj, target, source_parent):
|
def update_item(obj, target, source_parent):
|
||||||
target.conversion_factor = 1
|
target.conversion_factor = 1
|
||||||
target.import_amount = flt(obj.import_amount)
|
|
||||||
target.amount = target.import_amount / flt(source_parent.conversion_rate)
|
|
||||||
if flt(obj.purchase_rate):
|
|
||||||
target.qty = target.amount / flt(obj.purchase_rate)
|
|
||||||
|
|
||||||
doclist = get_mapped_doclist("Purchase Receipt", source_name, {
|
doclist = get_mapped_doclist("Purchase Receipt", source_name, {
|
||||||
"Purchase Receipt": {
|
"Purchase Receipt": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user