Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/erpnext/patches/jan_mar_2012/dt_map_fix.py b/erpnext/patches/jan_mar_2012/dt_map_fix.py
new file mode 100644
index 0000000..f669009
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/dt_map_fix.py
@@ -0,0 +1,7 @@
+def execute():
+	import webnotes
+	from webnotes.modules.module_manager import reload_doc
+	webnotes.conn.sql("delete from `tabField Mapper Detail` where from_field = 'transaction_date' and parent in ('Sales Order-Delivery Note', 'Purchase Order-Purchase Receipt')")
+
+	reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note')
+	reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt')
diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py
index a5017c2..a57c33d 100644
--- a/erpnext/selling/doctype/sales_common/sales_common.py
+++ b/erpnext/selling/doctype/sales_common/sales_common.py
@@ -32,6 +32,21 @@
 
 from utilities.transaction_base import TransactionBase
 
+
+@webnotes.whitelist()
+def get_comp_base_currency(arg=None):
+	""" get default currency of company"""
+	return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0]
+
+@webnotes.whitelist()
+def get_price_list_currency(arg=None):
+	""" Get all currency in which price list is maintained"""
+	plc = webnotes.conn.sql("select distinct ref_currency from `tabRef Rate Detail` where price_list_name = %s", webnotes.form_dict['price_list'])
+	plc = [d[0] for d in plc]
+	base_currency = get_comp_base_currency(webnotes.form_dict['company'])
+	return plc, base_currency
+
+
 class DocType(TransactionBase):
 	def __init__(self,d,dl):
 		self.doc, self.doclist = d,dl
@@ -770,16 +785,3 @@
 							name="%(name)s"
 					""" % args)
 
-
-@webnotes.whitelist()
-def get_comp_base_currency(arg=None):
-	""" get default currency of company"""
-	return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0]
-
-@webnotes.whitelist()
-def get_price_list_currency(arg=None):
-	""" Get all currency in which price list is maintained"""
-	plc = webnotes.conn.sql("select distinct ref_currency from `tabRef Rate Detail` where price_list_name = %s", webnotes.form_dict['price_list'])
-	plc = [d[0] for d in plc]
-	base_currency = get_comp_base_currency(webnotes.form_dict['company'])
-	return plc, base_currency
diff --git a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt
index c7e1557..e3f0dc9 100644
--- a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt
+++ b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt
@@ -3,9 +3,9 @@
 
 	# These values are common in all dictionaries
 	{
-		'creation': '2010-09-20 12:33:34',
+		'creation': '2010-08-08 17:09:35',
 		'docstatus': 0,
-		'modified': '2012-03-01 14:01:03',
+		'modified': '2012-03-01 17:58:16',
 		'modified_by': u'Administrator',
 		'owner': u'Administrator'
 	},
@@ -22,6 +22,7 @@
 	# These values are common for all Field Mapper Detail
 	{
 		'doctype': u'Field Mapper Detail',
+		'map': u'Yes',
 		'name': '__common__',
 		'parent': u'Purchase Order-Purchase Receipt',
 		'parentfield': u'field_mapper_details',
@@ -49,7 +50,6 @@
 		'checking_operator': u'=',
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'supplier',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'supplier'
 	},
@@ -59,7 +59,6 @@
 		'checking_operator': u'=',
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'company',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'company'
 	},
@@ -69,7 +68,6 @@
 		'checking_operator': u'=',
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'currency',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'currency'
 	},
@@ -78,7 +76,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'name',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'prevdoc_detail_docname'
 	},
@@ -87,7 +84,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'parent',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'prevdoc_docname'
 	},
@@ -96,7 +92,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'parenttype',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'prevdoc_doctype'
 	},
@@ -106,7 +101,6 @@
 		'checking_operator': u'=',
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'item_code',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'item_code'
 	},
@@ -115,7 +109,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) ',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'received_qty'
 	},
@@ -124,7 +117,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) ',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'qty'
 	},
@@ -133,7 +125,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'stock_qty'
 	},
@@ -142,7 +133,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.import_rate)',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'import_amount'
 	},
@@ -151,7 +141,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.purchase_rate)',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'amount'
 	},
@@ -160,7 +149,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'schedule_date',
-		'map': u'Yes',
 		'match_id': 1,
 		'to_field': u'schedule_date'
 	},
@@ -169,7 +157,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'net_total',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'net_total'
 	},
@@ -178,7 +165,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'grand_total',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'grand_total'
 	},
@@ -187,7 +173,6 @@
 	{
 		'doctype': u'Field Mapper Detail',
 		'from_field': u'total_tax',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'total_tax'
 	},
@@ -195,17 +180,7 @@
 	# Field Mapper Detail
 	{
 		'doctype': u'Field Mapper Detail',
-		'from_field': u'transaction_date',
-		'map': u'No',
-		'match_id': 0,
-		'to_field': u'transaction_date'
-	},
-
-	# Field Mapper Detail
-	{
-		'doctype': u'Field Mapper Detail',
 		'from_field': u'conversion_rate',
-		'map': u'Yes',
 		'match_id': 0,
 		'to_field': u'conversion_rate'
 	},
diff --git a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt
index 561019b..fcadcd4 100644
--- a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt
+++ b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt
@@ -5,273 +5,263 @@
 	{
 		'creation': '2010-08-08 17:09:35',
 		'docstatus': 0,
-		'modified': '2011-09-14 12:36:25',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
+		'modified': '2012-03-01 17:58:16',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all Table Mapper Detail
 	{
-		'doctype': 'Table Mapper Detail',
+		'doctype': u'Table Mapper Detail',
 		'name': '__common__',
-		'parent': 'Sales Order-Delivery Note',
-		'parentfield': 'table_mapper_details',
-		'parenttype': 'DocType Mapper'
+		'parent': u'Sales Order-Delivery Note',
+		'parentfield': u'table_mapper_details',
+		'parenttype': u'DocType Mapper'
 	},
 
 	# These values are common for all Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
+		'doctype': u'Field Mapper Detail',
 		'name': '__common__',
-		'parent': 'Sales Order-Delivery Note',
-		'parentfield': 'field_mapper_details',
-		'parenttype': 'DocType Mapper'
+		'parent': u'Sales Order-Delivery Note',
+		'parentfield': u'field_mapper_details',
+		'parenttype': u'DocType Mapper'
 	},
 
 	# These values are common for all DocType Mapper
 	{
 		'doctype': u'DocType Mapper',
-		'from_doctype': 'Sales Order',
-		'module': 'Stock',
+		'from_doctype': u'Sales Order',
+		'module': u'Stock',
 		'name': '__common__',
 		'ref_doc_submitted': 1,
-		'to_doctype': 'Delivery Note'
+		'to_doctype': u'Delivery Note'
 	},
 
 	# DocType Mapper, Sales Order-Delivery Note
 	{
 		'doctype': u'DocType Mapper',
-		'name': 'Sales Order-Delivery Note'
+		'name': u'Sales Order-Delivery Note'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '>=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'transaction_date',
-		'map': 'No',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'name',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'transaction_date'
+		'to_field': u'sales_order_no'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'name',
-		'map': 'Yes',
+		'checking_operator': u'=',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'company',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'sales_order_no'
+		'to_field': u'company'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'company',
-		'map': 'Yes',
+		'checking_operator': u'=',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'currency',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'company'
+		'to_field': u'currency'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'currency',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'shipping_address_name',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'currency'
+		'to_field': u'customer_address'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'shipping_address_name',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'shipping_address',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'customer_address'
+		'to_field': u'address_display'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'shipping_address',
-		'map': 'Yes',
-		'match_id': 0,
-		'to_field': 'address_display'
-	},
-
-	# Field Mapper Detail
-	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'parent',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'parent',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'prevdoc_docname'
+		'to_field': u'prevdoc_docname'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'parenttype',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'parenttype',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'prevdoc_doctype'
+		'to_field': u'prevdoc_doctype'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'name',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'name',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'prevdoc_detail_docname'
+		'to_field': u'prevdoc_detail_docname'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'export_amount'
+		'to_field': u'export_amount'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'basic_rate',
-		'map': 'Yes',
+		'checking_operator': u'=',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'basic_rate',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'basic_rate'
+		'to_field': u'basic_rate'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'eval: flt(obj.qty) - flt(obj.delivered_qty)',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'eval: flt(obj.qty) - flt(obj.delivered_qty)',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'qty'
+		'to_field': u'qty'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'amount'
+		'to_field': u'amount'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'reserved_warehouse',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'reserved_warehouse',
+		'map': u'Yes',
 		'match_id': 1,
-		'to_field': 'warehouse'
+		'to_field': u'warehouse'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'project_name',
-		'map': 'Yes',
+		'checking_operator': u'=',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'project_name',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'project_name'
+		'to_field': u'project_name'
 	},
 
 	# Field Mapper Detail
 	{
-		'checking_operator': '=',
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'customer',
-		'map': 'Yes',
+		'checking_operator': u'=',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'customer',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'customer'
+		'to_field': u'customer'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'naming_series',
-		'map': 'No',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'naming_series',
+		'map': u'No',
 		'match_id': 0,
-		'to_field': 'naming_series'
+		'to_field': u'naming_series'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'status',
-		'map': 'No',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'status',
+		'map': u'No',
 		'match_id': 0,
-		'to_field': 'status'
+		'to_field': u'status'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'incentives',
-		'map': 'No',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'incentives',
+		'map': u'No',
 		'match_id': 3,
-		'to_field': 'incentives'
+		'to_field': u'incentives'
 	},
 
 	# Field Mapper Detail
 	{
-		'doctype': 'Field Mapper Detail',
-		'from_field': 'allocated_amount',
-		'map': 'Yes',
+		'doctype': u'Field Mapper Detail',
+		'from_field': u'allocated_amount',
+		'map': u'Yes',
 		'match_id': 0,
-		'to_field': 'customer_mobile_no'
+		'to_field': u'customer_mobile_no'
 	},
 
 	# Table Mapper Detail
 	{
-		'doctype': 'Table Mapper Detail',
-		'from_field': 'sales_team',
-		'from_table': 'Sales Team',
+		'doctype': u'Table Mapper Detail',
+		'from_field': u'sales_team',
+		'from_table': u'Sales Team',
 		'match_id': 3,
-		'to_field': 'sales_team',
-		'to_table': 'Sales Team',
-		'validation_logic': 'name is not null'
+		'to_field': u'sales_team',
+		'to_table': u'Sales Team',
+		'validation_logic': u'name is not null'
 	},
 
 	# Table Mapper Detail
 	{
-		'doctype': 'Table Mapper Detail',
-		'from_field': 'other_charges',
-		'from_table': 'RV Tax Detail',
+		'doctype': u'Table Mapper Detail',
+		'from_field': u'other_charges',
+		'from_table': u'RV Tax Detail',
 		'match_id': 2,
-		'to_field': 'other_charges',
-		'to_table': 'RV Tax Detail',
-		'validation_logic': 'name is not null'
+		'to_field': u'other_charges',
+		'to_table': u'RV Tax Detail',
+		'validation_logic': u'name is not null'
 	},
 
 	# Table Mapper Detail
 	{
-		'doctype': 'Table Mapper Detail',
-		'from_field': 'sales_order_details',
-		'from_table': 'Sales Order Detail',
+		'doctype': u'Table Mapper Detail',
+		'from_field': u'sales_order_details',
+		'from_table': u'Sales Order Detail',
 		'match_id': 1,
-		'reference_doctype_key': 'prevdoc_doctype',
-		'reference_key': 'prevdoc_detail_docname',
-		'to_field': 'delivery_note_details',
-		'to_table': 'Delivery Note Detail',
-		'validation_logic': 'qty > ifnull(delivered_qty,0) and docstatus = 1'
+		'reference_doctype_key': u'prevdoc_doctype',
+		'reference_key': u'prevdoc_detail_docname',
+		'to_field': u'delivery_note_details',
+		'to_table': u'Delivery Note Detail',
+		'validation_logic': u'qty > ifnull(delivered_qty,0) and docstatus = 1'
 	},
 
 	# Table Mapper Detail
 	{
-		'doctype': 'Table Mapper Detail',
-		'from_table': 'Sales Order',
+		'doctype': u'Table Mapper Detail',
+		'from_table': u'Sales Order',
 		'match_id': 0,
-		'reference_key': 'prevdoc_docname',
-		'to_table': 'Delivery Note',
-		'validation_logic': 'docstatus = 1'
+		'reference_key': u'prevdoc_docname',
+		'to_table': u'Delivery Note',
+		'validation_logic': u'docstatus = 1'
 	}
 ]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 0bca9d0..e8af7ef 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -240,9 +240,9 @@
 
 			if prevdoc_docname and prevdoc:
 				# ::::::::::: Validates Transaction Date of DN and previous doc (i.e. SO , PO, PR) *********
-				trans_date = sql("select transaction_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0]
-				if trans_date and getdate(self.doc.transaction_date) < (trans_date):
-					msgprint("Your Voucher Date cannot be before "+cstr(prevdoc)+" Date.")
+				trans_date = sql("select posting_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0]
+				if trans_date and getdate(self.doc.posting_date) < (trans_date):
+					msgprint("Your Posting Date cannot be before "+cstr(prevdoc)+" Date.")
 					raise Exception
 				# ::::::::: Validates DN and previous doc details ::::::::::::::::::
 				get_name = sql("select name from `tab%s` where name = '%s'" % (prevdoc, prevdoc_docname))
@@ -452,7 +452,7 @@
 		self.values.append({
 			'item_code'					 : d[1],
 			'warehouse'					 : wh,
-			'transaction_date'		: self.doc.transaction_date,
+			'transaction_date'		: getdate(self.doc.modified).strftime('%Y-%m-%d'),
 			'posting_date'				: self.doc.posting_date,
 			'posting_time'				: self.doc.posting_time,
 			'voucher_type'				: 'Delivery Note',
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index f3e5d77..88cfbe3 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -57,7 +57,7 @@
 
 #-----------------Validation For Fiscal Year------------------------
 	def validate_fiscal_year(self):
-		get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.transaction_date,'Transaction Date')
+		get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date')
 
 
 	# Get Item Details
@@ -226,7 +226,7 @@
 
 					ord_qty = -flt(curr_qty)
 					# update order qty in bin
-					bin = get_obj('Warehouse', d.warehouse).update_bin(0, 0, (is_submit and 1 or -1) * flt(ord_qty), 0, 0, d.item_code, self.doc.transaction_date)
+					bin = get_obj('Warehouse', d.warehouse).update_bin(0, 0, (is_submit and 1 or -1) * flt(ord_qty), 0, 0, d.item_code, self.doc.posting_date)
 
 				# UPDATE actual qty to warehouse by pr_qty
 				self.make_sl_entry(d, d.warehouse, flt(pr_qty), d.valuation_rate, is_submit)
@@ -245,7 +245,7 @@
 		self.values.append({
 			'item_code'					 : d.fields.has_key('item_code') and d.item_code or d.rm_item_code,
 			'warehouse'					 : wh,
-			'transaction_date'		: self.doc.transaction_date,
+			'transaction_date'			: getdate(self.doc.modified).strftime('%Y-%m-%d'),
 			'posting_date'				: self.doc.posting_date,
 			'posting_time'				: self.doc.posting_time,
 			'voucher_type'				: 'Purchase Receipt',