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