# DocType Mapper, Delivery Note-Receivable Voucher
[

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

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

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

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

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

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: obj.basic_rate and (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.basic_rate) or obj.qty',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'qty'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'parent',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'delivery_note'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'name',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'dn_detail'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'prevdoc_docname',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'sales_order'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'prevdoc_detail_docname',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'so_detail'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: flt(obj.amount) - flt(obj.billed_amt)',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'amount'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: (flt(obj.amount) - flt(obj.billed_amt)) * flt(obj.export_rate)/flt(obj.basic_rate)',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'export_amount'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'naming_series',
		'map': 'No',
		'match_id': 0,
		'to_field': 'naming_series'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'incentives',
		'map': 'No',
		'match_id': 3,
		'to_field': 'incentives'
	},

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

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

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'delivery_note_details',
		'from_table': 'Delivery Note Detail',
		'match_id': 1,
		'to_field': 'entries',
		'to_table': 'RV Detail',
		'validation_logic': '(ifnull(amount, 0) = 0 or amount > ifnull(billed_amt, 0)) and docstatus = 1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'other_charges',
		'from_table': 'RV Tax Detail',
		'match_id': 2,
		'to_field': 'other_charges',
		'to_table': 'RV Tax Detail',
		'validation_logic': 'name is not null'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'sales_team',
		'from_table': 'Sales Team',
		'match_id': 3,
		'to_field': 'sales_team',
		'to_table': 'Sales Team',
		'validation_logic': 'name is not null'
	}
]