# DocType Mapper, Delivery Note-Installation Note
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:34',
		'docstatus': 0,
		'modified': '2011-09-13 17:28:37',
		'modified_by': 'Administrator',
		'owner': 'Administrator'
	},

	# These values are common for all Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'name': '__common__',
		'parent': 'Delivery Note-Installation Note',
		'parentfield': 'table_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'map': 'Yes',
		'name': '__common__',
		'parent': 'Delivery Note-Installation Note',
		'parentfield': 'field_mapper_details',
		'parenttype': 'DocType Mapper'
	},

	# These values are common for all DocType Mapper
	{
		'doctype': u'DocType Mapper',
		'from_doctype': 'Delivery Note',
		'module': 'Selling',
		'name': '__common__',
		'ref_doc_submitted': 1,
		'to_doctype': 'Installation Note'
	},

	# DocType Mapper, Delivery Note-Installation Note
	{
		'doctype': u'DocType Mapper',
		'name': 'Delivery Note-Installation Note'
	},

	# Field Mapper Detail
	{
		'checking_operator': '=',
		'doctype': 'Field Mapper Detail',
		'from_field': 'company',
		'match_id': 0,
		'to_field': 'company'
	},

	# Field Mapper Detail
	{
		'checking_operator': '=',
		'doctype': 'Field Mapper Detail',
		'from_field': 'customer',
		'match_id': 0,
		'to_field': 'customer'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'name',
		'match_id': 0,
		'to_field': 'delivery_note_no'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'name',
		'match_id': 1,
		'to_field': 'prevdoc_detail_docname'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parent',
		'match_id': 1,
		'to_field': 'prevdoc_docname'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parenttype',
		'match_id': 1,
		'to_field': 'prevdoc_doctype'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: flt(obj.qty) - flt(obj.installed_qty)',
		'match_id': 1,
		'to_field': 'qty'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'posting_date',
		'match_id': 2,
		'to_field': 'prevdoc_date'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'serial_no',
		'match_id': 1,
		'to_field': 'serial_no'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'delivery_note_details',
		'from_table': 'Delivery Note Detail',
		'match_id': 1,
		'to_field': 'installed_item_details',
		'to_table': 'Installed Item Details',
		'validation_logic': 'qty > ifnull(installed_qty,0) and docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_table': 'Delivery Note',
		'match_id': 0,
		'to_table': 'Installation Note',
		'validation_logic': 'docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_table': 'Delivery Note',
		'match_id': 2,
		'reference_doctype_key': 'prevdoc_doctype',
		'reference_key': 'prevdoc_docname',
		'to_field': 'installed_item_details',
		'to_table': 'Installed Item Details',
		'validation_logic': 'docstatus = 1'
	}
]