# GL Mapper, Purchase Invoice
[

	# These values are common in all dictionaries
	{
		u'creation': '2012-04-30 19:55:04',
		u'docstatus': 0,
		u'modified': '2012-10-03 11:07:26',
		u'modified_by': u'Administrator',
		u'owner': u'Administrator'
	},

	# These values are common for all GL Mapper
	{
		'doc_type': u'Purchase Invoice',
		u'doctype': u'GL Mapper',
		u'name': u'__common__'
	},

	# These values are common for all GL Mapper Detail
	{
		u'doctype': u'GL Mapper Detail',
		u'name': u'__common__',
		'parent': u'Purchase Invoice',
		'parentfield': u'fields',
		'parenttype': u'GL Mapper'
	},

	# GL Mapper, Purchase Invoice
	{
		u'doctype': u'GL Mapper',
		u'name': u'Purchase Invoice'
	},

	# GL Mapper Detail
	{
		'account': u'expense_head',
		'against': u'parent:credit_to',
		'aging_date': u'parent:aging_date',
		'company': u'parent:company',
		'cost_center': u'cost_center',
		'credit': u'value:0',
		'debit': u'amount',
		u'doctype': u'GL Mapper Detail',
		'fiscal_year': u'parent:fiscal_year',
		'is_opening': u'parent:is_opening',
		'posting_date': u'parent:posting_date',
		'remarks': u'parent:remarks',
		'table_field': u'entries',
		'transaction_date': u'parent:voucher_date',
		'voucher_no': u'parent:name',
		'voucher_type': u'parent:doctype'
	},

	# GL Mapper Detail
	{
		'account': u'account_head',
		'against': u'parent:credit_to',
		'aging_date': u'parent:aging_date',
		'company': u'parent:company',
		'cost_center': u'cost_center',
		'credit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Deduct' and d.fields.get('tax_amount') or 0",
		'debit': u"value:d.fields.get('category') != 'Valuation' and d.fields.get('add_deduct_tax') == 'Add' and d.fields.get('tax_amount') or 0",
		u'doctype': u'GL Mapper Detail',
		'fiscal_year': u'parent:fiscal_year',
		'is_opening': u'parent:is_opening',
		'posting_date': u'parent:posting_date',
		'remarks': u'parent:remarks',
		'table_field': u'purchase_tax_details',
		'transaction_date': u'parent:voucher_date',
		'voucher_no': u'parent:name',
		'voucher_type': u'parent:doctype'
	},

	# GL Mapper Detail
	{
		'account': u'tax_code',
		'against': u'credit_to',
		'aging_date': u'aging_date',
		'company': u'company',
		'credit': u'ded_amount',
		'debit': u'value:0',
		u'doctype': u'GL Mapper Detail',
		'fiscal_year': u'fiscal_year',
		'is_opening': u'is_opening',
		'posting_date': u'posting_date',
		'remarks': u'remarks',
		'transaction_date': u'voucher_date',
		'voucher_no': u'name',
		'voucher_type': u'doctype'
	},

	# GL Mapper Detail
	{
		'account': u'credit_to',
		'against': u'against_expense_account',
		'against_voucher': u'name',
		'against_voucher_type': u"value:'Purchase Invoice'",
		'aging_date': u'aging_date',
		'company': u'company',
		'credit': u'total_amount_to_pay',
		'debit': u'value:0',
		u'doctype': u'GL Mapper Detail',
		'fiscal_year': u'fiscal_year',
		'is_opening': u'is_opening',
		'posting_date': u'posting_date',
		'remarks': u'remarks',
		'transaction_date': u'voucher_date',
		'voucher_no': u'name',
		'voucher_type': u'doctype'
	}
]