# DocType Mapper, Purchase Receipt-Payable Voucher
[

	# These values are common in all dictionaries
	{
		'creation': '2010-08-08 17:09:35',
		'docstatus': 0,
		'modified': '2011-10-12 10:49:26',
		'modified_by': 'Administrator',
		'owner': 'Administrator'
	},

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

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

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

	# DocType Mapper, Purchase Receipt-Payable Voucher
	{
		'doctype': u'DocType Mapper',
		'name': 'Purchase Receipt-Payable Voucher'
	},

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

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

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

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.import_rate)',
		'map': 'Yes',
		'match_id': 1,
		'to_field': 'import_amount'
	},

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

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

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

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

	# 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': 'net_total',
		'map': 'Yes',
		'match_id': 0,
		'to_field': 'net_total'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'grand_total',
		'map': 'Yes',
		'match_id': 0,
		'to_field': 'grand_total'
	},

	# Field Mapper Detail
	{
		'doctype': 'Field Mapper Detail',
		'from_field': 'total_tax',
		'map': 'Yes',
		'match_id': 0,
		'to_field': 'total_tax'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'purchase_receipt_details',
		'from_table': 'Purchase Receipt Detail',
		'match_id': 1,
		'to_field': 'entries',
		'to_table': 'PV Detail',
		'validation_logic': 'ifnull(billed_qty,0)  < qty'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_table': 'Purchase Receipt',
		'match_id': 0,
		'to_table': 'Payable Voucher',
		'validation_logic': 'docstatus=1'
	},

	# Table Mapper Detail
	{
		'doctype': 'Table Mapper Detail',
		'from_field': 'purchase_tax_details',
		'from_table': 'Purchase Tax Detail',
		'match_id': 2,
		'to_field': 'purchase_tax_details',
		'to_table': 'Purchase Tax Detail',
		'validation_logic': 'docstatus=1'
	}
]