mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 10:41:21 +00:00
[mapper]
This commit is contained in:
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -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]
|
||||
Reference in New Issue
Block a user