# DocType Mapper, Sales Order-Receivable Voucher
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:36',
		'docstatus': 0,
		'modified': '2011-08-08 16:56:40',
		'modified_by': 'Administrator',
		'owner': 'Administrator'
	},

	# These values are common for all Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'name': '__common__',
		'parent': 'Sales Order-Receivable Voucher',
		'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': 'Sales Order-Receivable Voucher',
		'parentfield': 'field_mapper_details',
		'parenttype': 'DocType Mapper'
	},

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

	# DocType Mapper, Sales Order-Receivable Voucher
	{
		'doctype': 'DocType Mapper',
		'name': 'Sales Order-Receivable Voucher'
	},

	# 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': 'eval: (flt(obj.amount) - flt(obj.billed_amt))/flt(obj.basic_rate)',
		'match_id': 1,
		'to_field': 'qty'
	},

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

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

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval:flt(obj.amount) - flt(obj.billed_amt)',
		'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)',
		'match_id': 1,
		'to_field': 'export_amount'
	},

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

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

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

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'sales_order_detail',
		'from_table': 'Sales Order Detail',
		'match_id': 1,
		'to_field': 'entries',
		'to_table': 'RV Detail',
		'validation_logic': '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'
	}
]