diff --git a/buying/DocType Mapper/Supplier Quotation-Purchase Order/Supplier Quotation-Purchase Order.txt b/buying/DocType Mapper/Supplier Quotation-Purchase Order/Supplier Quotation-Purchase Order.txt deleted file mode 100644 index a1c65f98f8..0000000000 --- a/buying/DocType Mapper/Supplier Quotation-Purchase Order/Supplier Quotation-Purchase Order.txt +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2012-08-03 12:33:04", - "modified_by": "Administrator", - "modified": "2012-08-06 16:45:56" - }, - { - "name": "__common__", - "parent": "Supplier Quotation-Purchase Order", - "doctype": "Table Mapper Detail", - "parenttype": "DocType Mapper", - "validation_logic": "docstatus = 1", - "parentfield": "table_mapper_details" - }, - { - "name": "__common__", - "parent": "Supplier Quotation-Purchase Order", - "doctype": "Field Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "field_mapper_details" - }, - { - "name": "__common__", - "to_doctype": "Purchase Order", - "module": "Buying", - "doctype": "DocType Mapper", - "ref_doc_submitted": 1, - "from_doctype": "Supplier Quotation" - }, - { - "name": "Supplier Quotation-Purchase Order", - "doctype": "DocType Mapper" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "company", - "doctype": "Field Mapper Detail", - "from_field": "company", - "checking_operator": "=" - }, - { - "map": "No", - "match_id": 0, - "to_field": "transaction_date", - "doctype": "Field Mapper Detail", - "from_field": "transaction_date", - "checking_operator": ">=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "conversion_rate", - "doctype": "Field Mapper Detail", - "from_field": "conversion_rate" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "net_total", - "doctype": "Field Mapper Detail", - "from_field": "net_total" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "total_tax", - "doctype": "Field Mapper Detail", - "from_field": "total_tax" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "grand_total", - "doctype": "Field Mapper Detail", - "from_field": "grand_total" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "supplier_quotation", - "doctype": "Field Mapper Detail", - "from_field": "parent" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "supplier_quotation_item", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "stock_uom", - "doctype": "Field Mapper Detail", - "from_field": "uom" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "conversion_factor", - "doctype": "Field Mapper Detail", - "from_field": "eval:flt(1)" - }, - { - "reference_key": "prevdoc_docname", - "match_id": 0, - "doctype": "Table Mapper Detail", - "from_table": "Supplier Quotation", - "to_table": "Purchase Order" - }, - { - "match_id": 1, - "reference_doctype_key": "prevdoc_doctype", - "to_field": "po_details", - "doctype": "Table Mapper Detail", - "from_field": "quotation_details", - "from_table": "Supplier Quotation Item", - "to_table": "Purchase Order Item" - }, - { - "match_id": 2, - "to_field": "purchase_tax_details", - "doctype": "Table Mapper Detail", - "from_field": "purchase_tax_details", - "from_table": "Purchase Taxes and Charges", - "to_table": "Purchase Taxes and Charges" - } -] \ No newline at end of file diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py index ac86e250a3..6fe21a8725 100644 --- a/buying/doctype/purchase_order/purchase_order.py +++ b/buying/doctype/purchase_order/purchase_order.py @@ -252,10 +252,9 @@ def make_purchase_invoice(source_name, target_doclist=None): def update_item(obj, target, source_parent): target.conversion_factor = 1 - target.qty = (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.purchase_rate) - target.import_amount = (flt(obj.amount) - flt(obj.billed_amt)) / \ - flt(source_parent.conversion_rate) - target.amount = flt(obj.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.qty = target.amount / flt(obj.purchase_rate) doclist = get_mapped_doclist("Purchase Order", source_name, { "Purchase Order": { diff --git a/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt b/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt deleted file mode 100644 index c5806a6da2..0000000000 --- a/selling/DocType Mapper/Lead-Customer/Lead-Customer.txt +++ /dev/null @@ -1,63 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2010-08-08 17:09:34", - "modified_by": "Administrator", - "modified": "2011-09-14 12:36:24" - }, - { - "match_id": 0, - "parent": "Lead-Customer", - "name": "__common__", - "doctype": "Table Mapper Detail", - "parenttype": "DocType Mapper", - "from_table": "Lead", - "to_table": "Customer", - "validation_logic": "name is not null", - "parentfield": "table_mapper_details" - }, - { - "map": "Yes", - "match_id": 0, - "parent": "Lead-Customer", - "name": "__common__", - "doctype": "Field Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "field_mapper_details" - }, - { - "name": "__common__", - "to_doctype": "Customer", - "module": "Selling", - "doctype": "DocType Mapper", - "from_doctype": "Lead" - }, - { - "name": "Lead-Customer", - "doctype": "DocType Mapper" - }, - { - "to_field": "lead_name", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "to_field": "customer_name", - "doctype": "Field Mapper Detail", - "from_field": "company_name" - }, - { - "to_field": "phone_1", - "doctype": "Field Mapper Detail", - "from_field": "contact_no" - }, - { - "to_field": "fax_1", - "doctype": "Field Mapper Detail", - "from_field": "fax" - }, - { - "doctype": "Table Mapper Detail" - } -] \ No newline at end of file diff --git a/selling/DocType Mapper/Lead-Opportunity/Lead-Opportunity.txt b/selling/DocType Mapper/Lead-Opportunity/Lead-Opportunity.txt deleted file mode 100644 index fb9be22989..0000000000 --- a/selling/DocType Mapper/Lead-Opportunity/Lead-Opportunity.txt +++ /dev/null @@ -1,66 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2010-08-08 17:09:34", - "modified_by": "Administrator", - "modified": "2012-04-03 12:49:50" - }, - { - "match_id": 0, - "parent": "Lead-Opportunity", - "name": "__common__", - "doctype": "Table Mapper Detail", - "parenttype": "DocType Mapper", - "from_table": "Lead", - "to_table": "Opportunity", - "validation_logic": "name is not null", - "parentfield": "table_mapper_details" - }, - { - "match_id": 0, - "parent": "Lead-Opportunity", - "name": "__common__", - "doctype": "Field Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "field_mapper_details" - }, - { - "name": "__common__", - "to_doctype": "Opportunity", - "module": "Selling", - "doctype": "DocType Mapper", - "from_doctype": "Lead" - }, - { - "name": "Lead-Opportunity", - "doctype": "DocType Mapper" - }, - { - "map": "Yes", - "to_field": "campaign", - "doctype": "Field Mapper Detail", - "from_field": "campaign_name" - }, - { - "map": "Yes", - "to_field": "enquiry_from", - "doctype": "Field Mapper Detail", - "from_field": "doctype" - }, - { - "map": "Yes", - "to_field": "lead", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "map": "No", - "to_field": "status", - "doctype": "Field Mapper Detail", - "from_field": "status" - }, - { - "doctype": "Table Mapper Detail" - } -] \ No newline at end of file diff --git a/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt b/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt deleted file mode 100644 index a20a434920..0000000000 --- a/selling/DocType Mapper/Quotation-Sales Order/Quotation-Sales Order.txt +++ /dev/null @@ -1,130 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2010-08-08 17:09:35", - "modified_by": "Administrator", - "modified": "2011-09-14 12:36:24" - }, - { - "name": "__common__", - "parent": "Quotation-Sales Order", - "doctype": "Table Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "table_mapper_details" - }, - { - "name": "__common__", - "parent": "Quotation-Sales Order", - "doctype": "Field Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "field_mapper_details" - }, - { - "name": "__common__", - "to_doctype": "Sales Order", - "module": "Selling", - "doctype": "DocType Mapper", - "ref_doc_submitted": 1, - "from_doctype": "Quotation" - }, - { - "name": "Quotation-Sales Order", - "doctype": "DocType Mapper" - }, - { - "map": "No", - "match_id": 0, - "to_field": "transaction_date", - "doctype": "Field Mapper Detail", - "from_field": "transaction_date", - "checking_operator": ">=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "quotation_date", - "doctype": "Field Mapper Detail", - "from_field": "transaction_date" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "quotation_no", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "company", - "doctype": "Field Mapper Detail", - "from_field": "company", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "fiscal_year", - "doctype": "Field Mapper Detail", - "from_field": "fiscal_year", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "prevdoc_docname", - "doctype": "Field Mapper Detail", - "from_field": "parent" - }, - { - "map": "No", - "match_id": 0, - "to_field": "naming_series", - "doctype": "Field Mapper Detail", - "from_field": "naming_series" - }, - { - "map": "No", - "match_id": 0, - "to_field": "status", - "doctype": "Field Mapper Detail", - "from_field": "status" - }, - { - "match_id": 3, - "to_field": "sales_team", - "doctype": "Table Mapper Detail", - "from_field": "sales_team", - "from_table": "Sales Team", - "to_table": "Sales Team", - "validation_logic": "name is not null" - }, - { - "match_id": 2, - "to_field": "other_charges", - "doctype": "Table Mapper Detail", - "from_field": "other_charges", - "from_table": "Sales Taxes and Charges", - "to_table": "Sales Taxes and Charges", - "validation_logic": "name is not null" - }, - { - "match_id": 1, - "reference_doctype_key": "prevdoc_doctype", - "to_field": "sales_order_details", - "doctype": "Table Mapper Detail", - "from_field": "quotation_details", - "from_table": "Quotation Item", - "to_table": "Sales Order Item", - "validation_logic": "name is not null" - }, - { - "reference_key": "prevdoc_docname", - "match_id": 0, - "doctype": "Table Mapper Detail", - "from_table": "Quotation", - "to_table": "Sales Order", - "validation_logic": "docstatus = 1" - } -] \ No newline at end of file diff --git a/selling/doctype/sales_order/sales_order.py b/selling/doctype/sales_order/sales_order.py index c5e9302724..9c8a70962c 100644 --- a/selling/doctype/sales_order/sales_order.py +++ b/selling/doctype/sales_order/sales_order.py @@ -448,11 +448,10 @@ def make_delivery_note(source_name, target_doclist=None): def make_sales_invoice(source_name, target_doclist=None): from webnotes.model.mapper import get_mapped_doclist - def update_item(obj, target): - target.export_amount = (flt(obj.amount) - flt(obj.billed_amt))* flt(obj.export_rate)/flt(obj.basic_rate) - target.qty = obj.basic_rate and \ - (flt(obj.amount) - flt(obj.billed_amt))/flt(obj.basic_rate) or obj.qty - target.amount = flt(obj.amount) - flt(obj.billed_amt) + def update_item(obj, target, source_parent): + target.export_amount = flt(obj.amount) - flt(obj.billed_amt) + 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): si = webnotes.bean(target) @@ -483,4 +482,4 @@ def make_sales_invoice(source_name, target_doclist=None): } }, target_doclist, update_accounts) - return [d.fields for d in doclist] + return [d.fields for d in doclist] \ No newline at end of file diff --git a/stock/DocType Mapper/Material Request-Stock Entry/Material Request-Stock Entry.txt b/stock/DocType Mapper/Material Request-Stock Entry/Material Request-Stock Entry.txt deleted file mode 100644 index 5d116dafc3..0000000000 --- a/stock/DocType Mapper/Material Request-Stock Entry/Material Request-Stock Entry.txt +++ /dev/null @@ -1,107 +0,0 @@ -[ - { - "creation": "2013-02-20 16:54:17", - "docstatus": 0, - "modified": "2013-02-20 16:54:17", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Table Mapper Detail", - "name": "__common__", - "parent": "Material Request-Stock Entry", - "parentfield": "table_mapper_details", - "parenttype": "DocType Mapper" - }, - { - "doctype": "Field Mapper Detail", - "map": "Yes", - "name": "__common__", - "parent": "Material Request-Stock Entry", - "parentfield": "field_mapper_details", - "parenttype": "DocType Mapper" - }, - { - "doctype": "DocType Mapper", - "from_doctype": "Material Request", - "module": "Stock", - "name": "__common__", - "ref_doc_submitted": 1, - "to_doctype": "Stock Entry" - }, - { - "doctype": "DocType Mapper", - "name": "Material Request-Stock Entry" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:\"Material Transfer\"", - "match_id": 0, - "to_field": "purpose" - }, - { - "checking_operator": "=", - "doctype": "Field Mapper Detail", - "from_field": "company", - "match_id": 0, - "to_field": "company" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "parent", - "match_id": 1, - "to_field": "material_request" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "name", - "match_id": 1, - "to_field": "material_request_item" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "uom", - "match_id": 1, - "to_field": "stock_uom" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:flt(1)", - "match_id": 1, - "to_field": "conversion_factor" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:flt(obj.qty) - flt(obj.ordered_qty)", - "match_id": 1, - "to_field": "transfer_qty" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:flt(obj.qty) - flt(obj.ordered_qty)", - "match_id": 1, - "to_field": "qty" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "warehouse", - "match_id": 1, - "to_field": "t_warehouse" - }, - { - "doctype": "Table Mapper Detail", - "from_table": "Material Request", - "match_id": 0, - "to_table": "Stock Entry", - "validation_logic": "docstatus = 1" - }, - { - "doctype": "Table Mapper Detail", - "from_field": "indent_details", - "from_table": "Material Request Item", - "match_id": 1, - "to_field": "mtn_details", - "to_table": "Stock Entry Detail", - "validation_logic": "qty > ifnull(ordered_qty,0) and docstatus =1" - } -] \ No newline at end of file diff --git a/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt deleted file mode 100644 index 0833aaa849..0000000000 --- a/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt +++ /dev/null @@ -1,170 +0,0 @@ -[ - { - "creation": "2013-02-22 01:28:05", - "docstatus": 0, - "modified": "2013-03-26 07:58:20", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Table Mapper Detail", - "name": "__common__", - "parent": "Purchase Order-Purchase Receipt", - "parentfield": "table_mapper_details", - "parenttype": "DocType Mapper" - }, - { - "doctype": "Field Mapper Detail", - "map": "Yes", - "name": "__common__", - "parent": "Purchase Order-Purchase Receipt", - "parentfield": "field_mapper_details", - "parenttype": "DocType Mapper" - }, - { - "doctype": "DocType Mapper", - "from_doctype": "Purchase Order", - "module": "Stock", - "name": "__common__", - "ref_doc_submitted": 1, - "to_doctype": "Purchase Receipt" - }, - { - "doctype": "DocType Mapper", - "name": "Purchase Order-Purchase Receipt" - }, - { - "checking_operator": "=", - "doctype": "Field Mapper Detail", - "from_field": "supplier", - "match_id": 0, - "to_field": "supplier" - }, - { - "checking_operator": "=", - "doctype": "Field Mapper Detail", - "from_field": "company", - "match_id": 0, - "to_field": "company" - }, - { - "checking_operator": "=", - "doctype": "Field Mapper Detail", - "from_field": "currency", - "match_id": 0, - "to_field": "currency" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "name", - "match_id": 1, - "to_field": "prevdoc_detail_docname" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "parent", - "match_id": 1, - "to_field": "prevdoc_docname" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "parenttype", - "match_id": 1, - "to_field": "prevdoc_doctype" - }, - { - "checking_operator": "=", - "doctype": "Field Mapper Detail", - "from_field": "item_code", - "match_id": 1, - "to_field": "item_code" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) ", - "match_id": 1, - "to_field": "received_qty" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) ", - "match_id": 1, - "to_field": "qty" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)", - "match_id": 1, - "to_field": "stock_qty" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.import_rate)", - "match_id": 1, - "to_field": "import_amount" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.purchase_rate)", - "match_id": 1, - "to_field": "amount" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "schedule_date", - "match_id": 1, - "to_field": "schedule_date" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "net_total", - "match_id": 0, - "to_field": "net_total" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "grand_total", - "match_id": 0, - "to_field": "grand_total" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "total_tax", - "match_id": 0, - "to_field": "total_tax" - }, - { - "doctype": "Field Mapper Detail", - "from_field": "conversion_rate", - "match_id": 0, - "to_field": "conversion_rate" - }, - { - "doctype": "Table Mapper Detail", - "from_field": "po_details", - "from_table": "Purchase Order Item", - "match_id": 1, - "reference_doctype_key": "prevdoc_doctype", - "reference_key": "prevdoc_detail_docname", - "to_field": "purchase_receipt_details", - "to_table": "Purchase Receipt Item", - "validation_logic": "docstatus=1 and qty > ifnull(received_qty,0)" - }, - { - "doctype": "Table Mapper Detail", - "from_table": "Purchase Order", - "match_id": 0, - "reference_key": "prevdoc_docname", - "to_table": "Purchase Receipt", - "validation_logic": "docstatus = 1" - }, - { - "doctype": "Table Mapper Detail", - "from_field": "purchase_tax_details", - "from_table": "Purchase Taxes and Charges", - "match_id": 2, - "to_field": "purchase_tax_details", - "to_table": "Purchase Taxes and Charges", - "validation_logic": "docstatus = 1" - } -] \ No newline at end of file diff --git a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt deleted file mode 100644 index f5e4cc38de..0000000000 --- a/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt +++ /dev/null @@ -1,203 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2010-08-08 17:09:35", - "modified_by": "Administrator", - "modified": "2012-05-08 11:50:18" - }, - { - "name": "__common__", - "parent": "Sales Order-Delivery Note", - "doctype": "Table Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "table_mapper_details" - }, - { - "name": "__common__", - "parent": "Sales Order-Delivery Note", - "doctype": "Field Mapper Detail", - "parenttype": "DocType Mapper", - "parentfield": "field_mapper_details" - }, - { - "name": "__common__", - "to_doctype": "Delivery Note", - "module": "Stock", - "doctype": "DocType Mapper", - "ref_doc_submitted": 1, - "from_doctype": "Sales Order" - }, - { - "name": "Sales Order-Delivery Note", - "doctype": "DocType Mapper" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "sales_order_no", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "company", - "doctype": "Field Mapper Detail", - "from_field": "company", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "currency", - "doctype": "Field Mapper Detail", - "from_field": "currency", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "customer_address", - "doctype": "Field Mapper Detail", - "from_field": "shipping_address_name" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "address_display", - "doctype": "Field Mapper Detail", - "from_field": "shipping_address" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "prevdoc_docname", - "doctype": "Field Mapper Detail", - "from_field": "parent" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "prevdoc_doctype", - "doctype": "Field Mapper Detail", - "from_field": "parenttype" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "prevdoc_detail_docname", - "doctype": "Field Mapper Detail", - "from_field": "name" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "export_amount", - "doctype": "Field Mapper Detail", - "from_field": "eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "export_rate", - "doctype": "Field Mapper Detail", - "from_field": "export_rate", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "qty", - "doctype": "Field Mapper Detail", - "from_field": "eval: flt(obj.qty) - flt(obj.delivered_qty)" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "amount", - "doctype": "Field Mapper Detail", - "from_field": "eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)" - }, - { - "map": "Yes", - "match_id": 1, - "to_field": "warehouse", - "doctype": "Field Mapper Detail", - "from_field": "reserved_warehouse" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "project_name", - "doctype": "Field Mapper Detail", - "from_field": "project_name", - "checking_operator": "=" - }, - { - "map": "Yes", - "match_id": 0, - "to_field": "customer", - "doctype": "Field Mapper Detail", - "from_field": "customer", - "checking_operator": "=" - }, - { - "map": "No", - "match_id": 0, - "to_field": "naming_series", - "doctype": "Field Mapper Detail", - "from_field": "naming_series" - }, - { - "map": "No", - "match_id": 0, - "to_field": "status", - "doctype": "Field Mapper Detail", - "from_field": "status" - }, - { - "map": "No", - "match_id": 3, - "to_field": "incentives", - "doctype": "Field Mapper Detail", - "from_field": "incentives" - }, - { - "match_id": 3, - "to_field": "sales_team", - "doctype": "Table Mapper Detail", - "from_field": "sales_team", - "from_table": "Sales Team", - "to_table": "Sales Team", - "validation_logic": "name is not null" - }, - { - "match_id": 2, - "to_field": "other_charges", - "doctype": "Table Mapper Detail", - "from_field": "other_charges", - "from_table": "Sales Taxes and Charges", - "to_table": "Sales Taxes and Charges", - "validation_logic": "name is not null" - }, - { - "reference_key": "prevdoc_detail_docname", - "match_id": 1, - "reference_doctype_key": "prevdoc_doctype", - "to_field": "delivery_note_details", - "doctype": "Table Mapper Detail", - "from_field": "sales_order_details", - "from_table": "Sales Order Item", - "to_table": "Delivery Note Item", - "validation_logic": "qty > ifnull(delivered_qty,0) and docstatus = 1" - }, - { - "reference_key": "prevdoc_docname", - "match_id": 0, - "doctype": "Table Mapper Detail", - "from_table": "Sales Order", - "to_table": "Delivery Note", - "validation_logic": "docstatus = 1" - } -] \ No newline at end of file diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py index af87083d49..9983d95029 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/stock/doctype/purchase_receipt/purchase_receipt.py @@ -339,10 +339,9 @@ def make_purchase_invoice(source_name, target_doclist=None): def update_item(obj, target, source_parent): target.conversion_factor = 1 - target.qty = (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.purchase_rate) - target.import_amount = (flt(obj.amount) - flt(obj.billed_amt)) / \ - flt(source_parent.conversion_rate) - target.amount = flt(obj.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.qty = target.amount / flt(obj.purchase_rate) doclist = get_mapped_doclist("Purchase Receipt", source_name, { "Purchase Receipt": {