# DocType Mapper, Purchase Request-Purchase Order
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:34',
		'docstatus': 0,
		'modified': '2012-04-03 12:49:50',
		'modified_by': u'Administrator',
		'owner': u'Administrator'
	},

	# These values are common for all Table Mapper Detail
	{
		'doctype': u'Table Mapper Detail',
		'name': '__common__',
		'parent': u'Purchase Request-Purchase Order',
		'parentfield': u'table_mapper_details',
		'parenttype': u'DocType Mapper'
	},

	# These values are common for all Field Mapper Detail
	{
		'doctype': u'Field Mapper Detail',
		'map': u'Yes',
		'name': '__common__',
		'parent': u'Purchase Request-Purchase Order',
		'parentfield': u'field_mapper_details',
		'parenttype': u'DocType Mapper'
	},

	# These values are common for all DocType Mapper
	{
		'doctype': u'DocType Mapper',
		'from_doctype': u'Purchase Request',
		'module': u'Buying',
		'name': '__common__',
		'ref_doc_submitted': 1,
		'to_doctype': u'Purchase Order'
	},

	# DocType Mapper, Purchase Request-Purchase Order
	{
		'doctype': u'DocType Mapper',
		'name': u'Purchase Request-Purchase Order'
	},

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

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

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

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

	# Field Mapper Detail
	{
		'doctype': u'Field Mapper Detail',
		'from_field': u'uom',
		'match_id': 1,
		'to_field': u'stock_uom'
	},

	# Field Mapper Detail
	{
		'doctype': u'Field Mapper Detail',
		'from_field': u'eval:flt(1)',
		'match_id': 1,
		'to_field': u'conversion_factor'
	},

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

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

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

	# Table Mapper Detail
	{
		'doctype': u'Table Mapper Detail',
		'from_table': u'Purchase Request',
		'match_id': 0,
		'reference_key': u'prevdoc_docname',
		'to_table': u'Purchase Order',
		'validation_logic': u'docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': u'Table Mapper Detail',
		'from_field': u'indent_details',
		'from_table': u'Purchase Request Item',
		'match_id': 1,
		'reference_doctype_key': u'prevdoc_doctype',
		'to_field': u'po_details',
		'to_table': u'Purchase Order Item',
		'validation_logic': u'qty > ifnull(ordered_qty,0) and docstatus =1'
	}
]