diff --git a/accounts/doctype/payable_voucher/payable_voucher.py b/accounts/doctype/payable_voucher/payable_voucher.py
index 7e90d71..0e930e3 100644
--- a/accounts/doctype/payable_voucher/payable_voucher.py
+++ b/accounts/doctype/payable_voucher/payable_voucher.py
@@ -19,489 +19,489 @@
 from utilities.transaction_base import TransactionBase
 
 class DocType(TransactionBase):
-  def __init__(self,d,dl):
-    self.doc, self.doclist = d, dl 
-    self.tname = 'PV Detail'
-    self.fname = 'entries'
+	def __init__(self,d,dl):
+		self.doc, self.doclist = d, dl 
+		self.tname = 'PV Detail'
+		self.fname = 'entries'
 
-  # Autoname
-  # ---------
-  def autoname(self):
-    self.doc.name = make_autoname(self.doc.naming_series+'.####')
+	# Autoname
+	# ---------
+	def autoname(self):
+		self.doc.name = make_autoname(self.doc.naming_series+'.####')
 
 
 # ************************** Trigger Functions ****************************
 
-  # Credit To
-  # ----------
-  def get_credit_to(self):
-    acc_head = sql("select name, credit_days from `tabAccount` where (name = %s or (master_name = %s and master_type = 'supplier')) and docstatus != 2", (cstr(self.doc.supplier) + " - " + self.get_company_abbr(),self.doc.supplier))    
-    #supp_detail = sql("select supplier_name,address from `tabSupplier` where name = %s", self.doc.supplier, as_dict =1)
-    #ret = {
-    #  'supplier_name' : supp_detail and supp_detail[0]['supplier_name'] or '',
-    #  'supplier_address': supp_detail and supp_detail[0]['address'] or ''
-    #}
-    ret = {}
-    if acc_head and acc_head[0][0]:
-      ret['credit_to'] = acc_head[0][0]
-      if not self.doc.due_date:
-        ret['due_date'] = add_days(cstr(self.doc.posting_date), acc_head and cint(acc_head[0][1]) or 0)
-    elif not acc_head:
-      msgprint("%s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
-    return cstr(ret)
-    
-  def get_cust(self):
-    ret = {}
-    if self.doc.credit_to:      
-      ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name')
-      
-    return cstr(ret)  
+	# Credit To
+	# ----------
+	def get_credit_to(self):
+		acc_head = sql("select name, credit_days from `tabAccount` where (name = %s or (master_name = %s and master_type = 'supplier')) and docstatus != 2", (cstr(self.doc.supplier) + " - " + self.get_company_abbr(),self.doc.supplier))		
+		#supp_detail = sql("select supplier_name,address from `tabSupplier` where name = %s", self.doc.supplier, as_dict =1)
+		#ret = {
+		#	'supplier_name' : supp_detail and supp_detail[0]['supplier_name'] or '',
+		#	'supplier_address': supp_detail and supp_detail[0]['address'] or ''
+		#}
+		ret = {}
+		if acc_head and acc_head[0][0]:
+			ret['credit_to'] = acc_head[0][0]
+			if not self.doc.due_date:
+				ret['due_date'] = add_days(cstr(self.doc.posting_date), acc_head and cint(acc_head[0][1]) or 0)
+		elif not acc_head:
+			msgprint("%s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
+		return cstr(ret)
+		
+	def get_cust(self):
+		ret = {}
+		if self.doc.credit_to:			
+			ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name')
+			
+		return cstr(ret)	
 
 
-  # Get Default Cost Center and Expense Head from Item Master
-  # ----------------------------------------------------------
-  def get_default_values(self,args):
-    args = eval(args)
-    ret = {}
-    if sql("select name from `tabItem` where name = '%s'" % args['item_code']):
-      if not args['expense_head'] or args['expense_head'] == 'undefined':
-        expense_head = sql("select name from `tabAccount` where account_name in (select purchase_account from `tabItem` where name = '%s')" % args['item_code'])
-        ret['expense_head'] = expense_head and expense_head[0][0] or ''
-      if not args['cost_center'] or args['cost_center'] == 'undefined':
-        cost_center = sql("select cost_center from `tabItem` where name = '%s'" % args['item_code'])
-        ret['cost_center'] = cost_center and cost_center[0][0] or ''
-    return cstr(ret)
-     
-  
-  # Get Items based on PO or PR
-  # ----------------------------
-  def pull_details(self):
-    if self.doc.purchase_receipt_main:
-      self.validate_duplicate_docname('purchase_receipt')
-      self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Payable Voucher').dt_map('Purchase Receipt', 'Payable Voucher', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Payable Voucher'],['Purchase Receipt Detail', 'PV Detail']]")
+	# Get Default Cost Center and Expense Head from Item Master
+	# ----------------------------------------------------------
+	def get_default_values(self,args):
+		args = eval(args)
+		ret = {}
+		if sql("select name from `tabItem` where name = '%s'" % args['item_code']):
+			if not args['expense_head'] or args['expense_head'] == 'undefined':
+				expense_head = sql("select name from `tabAccount` where account_name in (select purchase_account from `tabItem` where name = '%s')" % args['item_code'])
+				ret['expense_head'] = expense_head and expense_head[0][0] or ''
+			if not args['cost_center'] or args['cost_center'] == 'undefined':
+				cost_center = sql("select cost_center from `tabItem` where name = '%s'" % args['item_code'])
+				ret['cost_center'] = cost_center and cost_center[0][0] or ''
+		return cstr(ret)
+		 
+	
+	# Get Items based on PO or PR
+	# ----------------------------
+	def pull_details(self):
+		if self.doc.purchase_receipt_main:
+			self.validate_duplicate_docname('purchase_receipt')
+			self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Payable Voucher').dt_map('Purchase Receipt', 'Payable Voucher', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Payable Voucher'],['Purchase Receipt Detail', 'PV Detail']]")
 
-    elif self.doc.purchase_order_main:
-      self.validate_duplicate_docname('purchase_order')
-      self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail']]")
-    
-    ret = eval(self.get_credit_to())
-    #self.doc.supplier_name = ret['supplier_name']
-    #self.doc.supplier_address = ret['supplier_address']
-    
-    #self.doc.cst_no =ret['cst_no']
-    #self.doc.bst_no = ret['bst_no']
-    #self.doc.vat_tin_no = ret['vat_tin_no']
+		elif self.doc.purchase_order_main:
+			self.validate_duplicate_docname('purchase_order')
+			self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail']]")
+		
+		ret = eval(self.get_credit_to())
+		#self.doc.supplier_name = ret['supplier_name']
+		#self.doc.supplier_address = ret['supplier_address']
+		
+		#self.doc.cst_no =ret['cst_no']
+		#self.doc.bst_no = ret['bst_no']
+		#self.doc.vat_tin_no = ret['vat_tin_no']
 
-    if ret.has_key('credit_to'):
-      self.doc.credit_to = ret['credit_to']
-      
+		if ret.has_key('credit_to'):
+			self.doc.credit_to = ret['credit_to']
+			
 
-  # Get Item Details
-  # -----------------    
-  def get_item_details(self,arg):
-    item_det = sql("select item_name, brand, description, item_group,purchase_account,cost_center from tabItem where name=%s",arg,as_dict=1)
-    tax = sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , arg)
-    t = {}
-    for x in tax: t[x[0]] = flt(x[1])
-    ret = {
-      'item_name' : item_det and item_det[0]['item_name'] or '',
-      'brand' : item_det and item_det[0]['brand'] or '',
-      'description' : item_det and item_det[0]['description'] or '',
-      'item_group'  : item_det and item_det[0]['item_group'] or '',
-      'rate' : 0.00,
-      'qty' : 0.00,
-      'amount' : 0.00,
-      'expense_head' : item_det and item_det[0]['purchase_account'] or '',
-      'cost_center' : item_det and item_det[0]['cost_center'] or '',
-      'item_tax_rate'      : str(t)
-    }
-    return cstr(ret)
-    
-  # Advance Allocation
-  # -------------------
-  def get_advances(self):
-    get_obj('GL Control').get_advances( self, self.doc.credit_to, 'Advance Allocation Detail','advance_allocation_details','debit')
-    
-    
-  # ============= OTHER CHARGES ====================
-  
-  # Get Tax rate if account type is TAX
-  # ------------------------------------
-  def get_rate(self,arg):
-    return get_obj('Purchase Common').get_rate(arg,self)
+	# Get Item Details
+	# -----------------		
+	def get_item_details(self,arg):
+		item_det = sql("select item_name, brand, description, item_group,purchase_account,cost_center from tabItem where name=%s",arg,as_dict=1)
+		tax = sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , arg)
+		t = {}
+		for x in tax: t[x[0]] = flt(x[1])
+		ret = {
+			'item_name' : item_det and item_det[0]['item_name'] or '',
+			'brand' : item_det and item_det[0]['brand'] or '',
+			'description' : item_det and item_det[0]['description'] or '',
+			'item_group'	: item_det and item_det[0]['item_group'] or '',
+			'rate' : 0.00,
+			'qty' : 0.00,
+			'amount' : 0.00,
+			'expense_head' : item_det and item_det[0]['purchase_account'] or '',
+			'cost_center' : item_det and item_det[0]['cost_center'] or '',
+			'item_tax_rate'			: str(t)
+		}
+		return cstr(ret)
+		
+	# Advance Allocation
+	# -------------------
+	def get_advances(self):
+		get_obj('GL Control').get_advances( self, self.doc.credit_to, 'Advance Allocation Detail','advance_allocation_details','debit')
+		
+		
+	# ============= OTHER CHARGES ====================
+	
+	# Get Tax rate if account type is TAX
+	# ------------------------------------
+	def get_rate(self,arg):
+		return get_obj('Purchase Common').get_rate(arg,self)
 
-  # Pull details from other charges master (Get Other Charges)
-  # -----------------------------------------------------------
-  def get_purchase_tax_details(self):
-    return get_obj('Purchase Common').get_purchase_tax_details(self)
+	# Pull details from other charges master (Get Other Charges)
+	# -----------------------------------------------------------
+	def get_purchase_tax_details(self):
+		return get_obj('Purchase Common').get_purchase_tax_details(self)
 
 
-  def get_rate1(self,acc):
-    rate = sql("select tax_rate from `tabAccount` where name='%s'"%(acc))
-    ret={'add_tax_rate' :rate and flt(rate[0][0]) or 0 }
-    return cstr(ret)
-  
+	def get_rate1(self,acc):
+		rate = sql("select tax_rate from `tabAccount` where name='%s'"%(acc))
+		ret={'add_tax_rate' :rate and flt(rate[0][0]) or 0 }
+		return cstr(ret)
+	
 
 # *************************** Server Utility Functions *****************************
-  # Get Company abbr
-  # -----------------
-  def get_company_abbr(self):
-    return sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0]
+	# Get Company abbr
+	# -----------------
+	def get_company_abbr(self):
+		return sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0]
 
-  # Check whether PO or PR is already fetched
-  # ------------------------------------------
-  def validate_duplicate_docname(self,doctype):
-    for d in getlist(self.doclist, 'entries'): 
-      if doctype == 'purchase_receipt' and cstr(self.doc.purchase_receipt_main) == cstr(d.purchase_receipt):
-        msgprint(cstr(self.doc.purchase_receipt_main) + " purchase receipt details have already been pulled.")
-        raise Exception , " Validation Error. "
+	# Check whether PO or PR is already fetched
+	# ------------------------------------------
+	def validate_duplicate_docname(self,doctype):
+		for d in getlist(self.doclist, 'entries'): 
+			if doctype == 'purchase_receipt' and cstr(self.doc.purchase_receipt_main) == cstr(d.purchase_receipt):
+				msgprint(cstr(self.doc.purchase_receipt_main) + " purchase receipt details have already been pulled.")
+				raise Exception , " Validation Error. "
 
-      if doctype == 'purchase_order' and cstr(self.doc.purchase_order_main) == cstr(d.purchase_order) and not d.purchase_receipt:
-        msgprint(cstr(self.doc.purchase_order_main) + " purchase order details have already been pulled.")
-        raise Exception , " Validation Error. "
+			if doctype == 'purchase_order' and cstr(self.doc.purchase_order_main) == cstr(d.purchase_order) and not d.purchase_receipt:
+				msgprint(cstr(self.doc.purchase_order_main) + " purchase order details have already been pulled.")
+				raise Exception , " Validation Error. "
 
-    
+		
 # **************************** VALIDATE ********************************
 
-  # Check for Item.is_Purchase_item = 'Yes' and Item is active
-  # ------------------------------------------------------------------
-  def check_active_purchase_items(self):
-    for d in getlist(self.doclist, 'entries'):
-      if d.item_code:    # extra condn coz item_code is not mandatory in PV
-        valid_item = sql("select docstatus,is_purchase_item from tabItem where name = %s",d.item_code)
-        if valid_item[0][0] == 2:
-          msgprint("Item : '%s' is Inactive, you can restore it from Trash" %(d.item_code))
-          raise Exception
-        if not valid_item[0][1] == 'Yes':
-          msgprint("Item : '%s' is not Purchase Item"%(d.item_code))
-          raise Exception
-          
-  # Check Conversion Rate
-  # ----------------------
-  def check_conversion_rate(self):
-    default_currency = get_obj('Manage Account').doc.default_currency
-    if not default_currency:
-      msgprint('Message: Please enter default currency in Manage Account')
-      raise Exception
-    if (self.doc.currency == default_currency and flt(self.doc.conversion_rate) != 1.00) or not self.doc.conversion_rate or (self.doc.currency != default_currency and flt(self.doc.conversion_rate) == 1.00):
-      msgprint("Message: Please Enter Appropriate Conversion Rate.")
-      raise Exception        
+	# Check for Item.is_Purchase_item = 'Yes' and Item is active
+	# ------------------------------------------------------------------
+	def check_active_purchase_items(self):
+		for d in getlist(self.doclist, 'entries'):
+			if d.item_code:		# extra condn coz item_code is not mandatory in PV
+				valid_item = sql("select docstatus,is_purchase_item from tabItem where name = %s",d.item_code)
+				if valid_item[0][0] == 2:
+					msgprint("Item : '%s' is Inactive, you can restore it from Trash" %(d.item_code))
+					raise Exception
+				if not valid_item[0][1] == 'Yes':
+					msgprint("Item : '%s' is not Purchase Item"%(d.item_code))
+					raise Exception
+						
+	# Check Conversion Rate
+	# ----------------------
+	def check_conversion_rate(self):
+		default_currency = TransactionBase().get_company_currency(self.doc.company)		
+		if not default_currency:
+			msgprint('Message: Please enter default currency in Company Master')
+			raise Exception
+		if (self.doc.currency == default_currency and flt(self.doc.conversion_rate) != 1.00) or not self.doc.conversion_rate or (self.doc.currency != default_currency and flt(self.doc.conversion_rate) == 1.00):
+			msgprint("Message: Please Enter Appropriate Conversion Rate.")
+			raise Exception				
 
-  # 1. Check whether bill is already booked against this bill no. or not
-  # 2. Add Remarks
-  # ---------------------------------------------------------------------
-  def validate_bill_no(self):
-    if self.doc.bill_no and self.doc.bill_no.lower().strip()  not in ['na', 'not applicable', 'none']:
-      b_no = sql("select bill_no, name, ifnull(is_opening,'') from `tabPayable Voucher` where bill_no = '%s' and credit_to = '%s' and docstatus = 1 and name != '%s' " % (self.doc.bill_no, self.doc.credit_to, self.doc.name))
-      if b_no and cstr(b_no[0][2]) == cstr(self.doc.is_opening):
-        msgprint("Please check you have already booked expense against Bill No. %s in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])))
-        raise Exception , "Validation Error"
-      if not self.doc.remarks:
-        self.doc.remarks = (self.doc.remarks or '') + "\n" + ("Against Bill %s dated %s" % (self.doc.bill_no, formatdate(self.doc.bill_date)))
-        if self.doc.ded_amount:
-          self.doc.remarks = (self.doc.remarks or '') + "\n" + ("Grand Total: %s, Tax Deduction Amount: %s" %(self.doc.grand_total, self.doc.ded_amount))
-    else:
-      if not self.doc.remarks:
-        self.doc.remarks = "No Remarks"
-          
-  # Validate Bill No Date
-  # ---------------------
-  def validate_bill_no_date(self):
-    if self.doc.bill_no and not self.doc.bill_date and self.doc.bill_no.lower().strip() not in ['na', 'not applicable', 'none']:
-      msgprint("Please enter Bill Date")
-      raise Exception          
+	# 1. Check whether bill is already booked against this bill no. or not
+	# 2. Add Remarks
+	# ---------------------------------------------------------------------
+	def validate_bill_no(self):
+		if self.doc.bill_no and self.doc.bill_no.lower().strip()	not in ['na', 'not applicable', 'none']:
+			b_no = sql("select bill_no, name, ifnull(is_opening,'') from `tabPayable Voucher` where bill_no = '%s' and credit_to = '%s' and docstatus = 1 and name != '%s' " % (self.doc.bill_no, self.doc.credit_to, self.doc.name))
+			if b_no and cstr(b_no[0][2]) == cstr(self.doc.is_opening):
+				msgprint("Please check you have already booked expense against Bill No. %s in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])))
+				raise Exception , "Validation Error"
+			if not self.doc.remarks:
+				self.doc.remarks = (self.doc.remarks or '') + "\n" + ("Against Bill %s dated %s" % (self.doc.bill_no, formatdate(self.doc.bill_date)))
+				if self.doc.ded_amount:
+					self.doc.remarks = (self.doc.remarks or '') + "\n" + ("Grand Total: %s, Tax Deduction Amount: %s" %(self.doc.grand_total, self.doc.ded_amount))
+		else:
+			if not self.doc.remarks:
+				self.doc.remarks = "No Remarks"
+					
+	# Validate Bill No Date
+	# ---------------------
+	def validate_bill_no_date(self):
+		if self.doc.bill_no and not self.doc.bill_date and self.doc.bill_no.lower().strip() not in ['na', 'not applicable', 'none']:
+			msgprint("Please enter Bill Date")
+			raise Exception					
 
 
  
-  # Clear Advances
-  # ---------------
-  def clear_advances(self):
-    get_obj('GL Control').clear_advances( self, 'Advance Allocation Detail','advance_allocation_details')
+	# Clear Advances
+	# ---------------
+	def clear_advances(self):
+		get_obj('GL Control').clear_advances( self, 'Advance Allocation Detail','advance_allocation_details')
 
 
-  # 1. Credit To Account Exists
-  # 2. Is a Credit Account
-  # 3. Is not a PL Account
-  # ----------------------------
-  def validate_credit_acc(self):
-    acc = sql("select debit_or_credit, is_pl_account from tabAccount where name = '%s'" % self.doc.credit_to)
-    if not acc:
-      msgprint("Account: "+ self.doc.credit_to + "does not exist")
-      raise Exception
-    elif acc[0][0] and acc[0][0] != 'Credit':
-      msgprint("Account: "+ self.doc.credit_to + "is not a credit account")
-      raise Exception
-    elif acc[0][1] and acc[0][1] != 'No':
-      msgprint("Account: "+ self.doc.credit_to + "is a pl account")
-      raise Exception
-  
-  # Validate Acc Head of Supplier and Credit To Account entered
-  # ------------------------------------------------------------
-  def check_for_acc_head_of_supplier(self): 
-    acc_head = sql("select name from `tabAccount` where name = %s", (cstr(self.doc.supplier) + " - " + self.get_company_abbr()))
-    if self.doc.supplier:
-      if acc_head and acc_head[0][0]:
-        if not cstr(acc_head[0][0]) == cstr(self.doc.credit_to):
-          msgprint("Credit To: %s do not match with Supplier: %s for Company: %s i.e. %s" %(self.doc.credit_to,self.doc.supplier,self.doc.company,cstr(acc_head[0][0])))
-          raise Exception, "Validation Error "
-      if not acc_head:
-        msgprint("Supplier %s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
-        raise Exception, "Validation Error "
-        
-  # Check for Stopped PO
-  # ---------------------
-  def check_for_stopped_status(self):
-    check_list = []
-    for d in getlist(self.doclist,'entries'):
-      if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
-        check_list.append(d.purhcase_order)
-        stopped = sql("select name from `tabPurchase Order` where status = 'Stopped' and name = '%s'" % d.purchase_order)
-        if stopped:
-          msgprint("One cannot do any transaction against 'Purchase Order' : %s, it's status is 'Stopped'" % (d.purhcase_order))
-          raise Exception
-          
-  # Validate Supplier
-  # -----------------
-  def validate_supplier(self, d):
-    supplier = ''
-    if d.purchase_order and not d.purchase_order in self.po_list:
-      supplier = sql("select supplier from `tabPurchase Order` where name = '%s'" % d.purchase_order)[0][0]
-      doctype = 'purchase order'
-      doctype_no = cstr(d.purchase_order)
-      if supplier and not cstr(self.doc.supplier) == cstr(supplier):
-        msgprint("Supplier name %s do not match with supplier name  of %s %s." %(self.doc.supplier,doctype,doctype_no))
-        raise Exception , " Validation Error "
+	# 1. Credit To Account Exists
+	# 2. Is a Credit Account
+	# 3. Is not a PL Account
+	# ----------------------------
+	def validate_credit_acc(self):
+		acc = sql("select debit_or_credit, is_pl_account from tabAccount where name = '%s'" % self.doc.credit_to)
+		if not acc:
+			msgprint("Account: "+ self.doc.credit_to + "does not exist")
+			raise Exception
+		elif acc[0][0] and acc[0][0] != 'Credit':
+			msgprint("Account: "+ self.doc.credit_to + "is not a credit account")
+			raise Exception
+		elif acc[0][1] and acc[0][1] != 'No':
+			msgprint("Account: "+ self.doc.credit_to + "is a pl account")
+			raise Exception
+	
+	# Validate Acc Head of Supplier and Credit To Account entered
+	# ------------------------------------------------------------
+	def check_for_acc_head_of_supplier(self): 
+		acc_head = sql("select name from `tabAccount` where name = %s", (cstr(self.doc.supplier) + " - " + self.get_company_abbr()))
+		if self.doc.supplier:
+			if acc_head and acc_head[0][0]:
+				if not cstr(acc_head[0][0]) == cstr(self.doc.credit_to):
+					msgprint("Credit To: %s do not match with Supplier: %s for Company: %s i.e. %s" %(self.doc.credit_to,self.doc.supplier,self.doc.company,cstr(acc_head[0][0])))
+					raise Exception, "Validation Error "
+			if not acc_head:
+				msgprint("Supplier %s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
+				raise Exception, "Validation Error "
+				
+	# Check for Stopped PO
+	# ---------------------
+	def check_for_stopped_status(self):
+		check_list = []
+		for d in getlist(self.doclist,'entries'):
+			if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
+				check_list.append(d.purhcase_order)
+				stopped = sql("select name from `tabPurchase Order` where status = 'Stopped' and name = '%s'" % d.purchase_order)
+				if stopped:
+					msgprint("One cannot do any transaction against 'Purchase Order' : %s, it's status is 'Stopped'" % (d.purhcase_order))
+					raise Exception
+					
+	# Validate Supplier
+	# -----------------
+	def validate_supplier(self, d):
+		supplier = ''
+		if d.purchase_order and not d.purchase_order in self.po_list:
+			supplier = sql("select supplier from `tabPurchase Order` where name = '%s'" % d.purchase_order)[0][0]
+			doctype = 'purchase order'
+			doctype_no = cstr(d.purchase_order)
+			if supplier and not cstr(self.doc.supplier) == cstr(supplier):
+				msgprint("Supplier name %s do not match with supplier name	of %s %s." %(self.doc.supplier,doctype,doctype_no))
+				raise Exception , " Validation Error "
 
-    if d.purchase_receipt and not d.purchase_receipt in self.pr_list:
-      supplier = sql("select supplier from `tabPurchase Receipt` where name = '%s'" % d.purchase_receipt)[0][0]
-      doctype = 'purchase receipt'
-      doctype_no = cstr(d.purchase_receipt)
-      if supplier and not cstr(self.doc.supplier) == cstr(supplier):
-        msgprint("Supplier name %s do not match with supplier name  of %s %s." %(self.doc.supplier,doctype,doctype_no))
-        raise Exception , " Validation Error "
+		if d.purchase_receipt and not d.purchase_receipt in self.pr_list:
+			supplier = sql("select supplier from `tabPurchase Receipt` where name = '%s'" % d.purchase_receipt)[0][0]
+			doctype = 'purchase receipt'
+			doctype_no = cstr(d.purchase_receipt)
+			if supplier and not cstr(self.doc.supplier) == cstr(supplier):
+				msgprint("Supplier name %s do not match with supplier name	of %s %s." %(self.doc.supplier,doctype,doctype_no))
+				raise Exception , " Validation Error "
 
-  # Validate values with reference document
-  #----------------------------------------
-  def validate_reference_value(self):
-    get_obj('DocType Mapper', 'Purchase Order-Payable Voucher', with_children = 1).validate_reference_value(self, self.doc.name)
+	# Validate values with reference document
+	#----------------------------------------
+	def validate_reference_value(self):
+		get_obj('DocType Mapper', 'Purchase Order-Payable Voucher', with_children = 1).validate_reference_value(self, self.doc.name)
 
-        
-  # Validate PO and PR
-  # -------------------
-  def validate_po_pr(self, d):
-    # check po / pr for qty and rates and currency and conversion rate
+				
+	# Validate PO and PR
+	# -------------------
+	def validate_po_pr(self, d):
+		# check po / pr for qty and rates and currency and conversion rate
 
-    # always import_rate must be equal to import_rate of purchase order
-    if d.purchase_order and not d.purchase_order in self.po_list:
-      # currency
-      currency = cstr(sql("select currency from `tabPurchase Order` where name = '%s'" % d.purchase_order)[0][0])
-      if not cstr(currency) == cstr(self.doc.currency):
-        msgprint("Purchase Order: " + cstr(d.purchase_order) + " currency : " + cstr(currency) + " does not match with currency of current document.")
-        raise Exception
-      # import_rate
-      rate = flt(sql('select import_rate from `tabPO Detail` where item_code=%s and parent=%s and name = %s', (d.item_code, d.purchase_order, d.po_detail))[0][0])
-      if abs(rate - flt(d.import_rate)) > 1:
-        msgprint("Import Rate for %s in the Purchase Order is %s. Rate must be same as Purchase Order Rate" % (d.item_code,rate))
-        raise Exception
-                  
-    if d.purchase_receipt and not d.purchase_receipt in self.pr_list:
-      # currency , conversion_rate
-      data = sql("select currency, conversion_rate from `tabPurchase Receipt` where name = '%s'" % d.purchase_receipt, as_dict = 1)
-      if not cstr(data[0]['currency']) == cstr(self.doc.currency):
-        msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " currency : " + cstr(data[0]['currency']) + " does not match with currency of current document.")
-        raise Exception
-      if not flt(data[0]['conversion_rate']) == flt(self.doc.conversion_rate):
-        msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " conversion_rate : " + cstr(data[0]['conversion_rate']) + " does not match with conversion_rate of current document.")
-        raise Exception
-          
-  # Build tds table if applicable
-  #------------------------------
-  def get_tds(self):
-    if cstr(self.doc.is_opening) != 'Yes':
-      if not self.doc.credit_to:
-        msgprint("Please Enter Credit To account first")
-        raise Exception
-      else:
-        tds_applicable = sql("select tds_applicable from tabAccount where name = '%s'" % self.doc.credit_to)
-        if tds_applicable and cstr(tds_applicable[0][0]) == 'Yes':
-          if not self.doc.tds_applicable:
-            msgprint("Please enter whether TDS Applicable or not")
-            raise Exception
-          if self.doc.tds_applicable == 'Yes':
-            if not self.doc.tds_category:
-              msgprint("Please select TDS Category")
-              raise Exception
-            else:
-              get_obj('TDS Control').get_tds_amount(self)
-              self.doc.total_tds_on_voucher = self.doc.ded_amount
-              self.doc.total_amount_to_pay=flt(self.doc.grand_total)-flt(self.doc.ded_amount)-flt(self.doc.other_tax_deducted)
-          elif self.doc.tds_applicable == 'No':
-            self.doc.tds_category = ''
-            self.doc.tax_code = ''
-            self.doc.rate = 0
-            self.doc.ded_amount = 0
-            self.doc.total_tds_on_voucher = 0
+		# always import_rate must be equal to import_rate of purchase order
+		if d.purchase_order and not d.purchase_order in self.po_list:
+			# currency
+			currency = cstr(sql("select currency from `tabPurchase Order` where name = '%s'" % d.purchase_order)[0][0])
+			if not cstr(currency) == cstr(self.doc.currency):
+				msgprint("Purchase Order: " + cstr(d.purchase_order) + " currency : " + cstr(currency) + " does not match with currency of current document.")
+				raise Exception
+			# import_rate
+			rate = flt(sql('select import_rate from `tabPO Detail` where item_code=%s and parent=%s and name = %s', (d.item_code, d.purchase_order, d.po_detail))[0][0])
+			if abs(rate - flt(d.import_rate)) > 1:
+				msgprint("Import Rate for %s in the Purchase Order is %s. Rate must be same as Purchase Order Rate" % (d.item_code,rate))
+				raise Exception
+									
+		if d.purchase_receipt and not d.purchase_receipt in self.pr_list:
+			# currency , conversion_rate
+			data = sql("select currency, conversion_rate from `tabPurchase Receipt` where name = '%s'" % d.purchase_receipt, as_dict = 1)
+			if not cstr(data[0]['currency']) == cstr(self.doc.currency):
+				msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " currency : " + cstr(data[0]['currency']) + " does not match with currency of current document.")
+				raise Exception
+			if not flt(data[0]['conversion_rate']) == flt(self.doc.conversion_rate):
+				msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " conversion_rate : " + cstr(data[0]['conversion_rate']) + " does not match with conversion_rate of current document.")
+				raise Exception
+					
+	# Build tds table if applicable
+	#------------------------------
+	def get_tds(self):
+		if cstr(self.doc.is_opening) != 'Yes':
+			if not self.doc.credit_to:
+				msgprint("Please Enter Credit To account first")
+				raise Exception
+			else:
+				tds_applicable = sql("select tds_applicable from tabAccount where name = '%s'" % self.doc.credit_to)
+				if tds_applicable and cstr(tds_applicable[0][0]) == 'Yes':
+					if not self.doc.tds_applicable:
+						msgprint("Please enter whether TDS Applicable or not")
+						raise Exception
+					if self.doc.tds_applicable == 'Yes':
+						if not self.doc.tds_category:
+							msgprint("Please select TDS Category")
+							raise Exception
+						else:
+							get_obj('TDS Control').get_tds_amount(self)
+							self.doc.total_tds_on_voucher = self.doc.ded_amount
+							self.doc.total_amount_to_pay=flt(self.doc.grand_total)-flt(self.doc.ded_amount)-flt(self.doc.other_tax_deducted)
+					elif self.doc.tds_applicable == 'No':
+						self.doc.tds_category = ''
+						self.doc.tax_code = ''
+						self.doc.rate = 0
+						self.doc.ded_amount = 0
+						self.doc.total_tds_on_voucher = 0
 
-  # get tds rate
-  # -------------
-  def get_tds_rate(self):
-    return str({'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))})
+	# get tds rate
+	# -------------
+	def get_tds_rate(self):
+		return str({'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))})
 
-  # set aging date
-  #-------------------
-  def set_aging_date(self):
-    if self.doc.is_opening != 'Yes':
-      self.doc.aging_date = self.doc.posting_date
-    elif not self.doc.aging_date:
-      msgprint("Aging Date is mandatory for opening entry")
-      raise Exception
-      
+	# set aging date
+	#-------------------
+	def set_aging_date(self):
+		if self.doc.is_opening != 'Yes':
+			self.doc.aging_date = self.doc.posting_date
+		elif not self.doc.aging_date:
+			msgprint("Aging Date is mandatory for opening entry")
+			raise Exception
+			
 
-  # Set against account for debit to account
-  #------------------------------------------
-  def set_against_expense_account(self):
-    against_acc = []
-    for d in getlist(self.doclist, 'entries'):
-      if d.expense_account not in against_acc:
-        against_acc.append(d.expense_account)
-    self.doc.against_expense_account = ','.join(against_acc)
+	# Set against account for debit to account
+	#------------------------------------------
+	def set_against_expense_account(self):
+		against_acc = []
+		for d in getlist(self.doclist, 'entries'):
+			if d.expense_account not in against_acc:
+				against_acc.append(d.expense_account)
+		self.doc.against_expense_account = ','.join(against_acc)
 
-  #check in manage account if purchase order required or not.
-  # ====================================================================================
-  def po_required(self):
-    res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'po_required'")
-    if res and res[0][0] == 'Yes':
-       for d in getlist(self.doclist,'entries'):
-         if not d.purchase_order:
-           msgprint("Purchse Order No. required against item %s"%d.item_code)
-           raise Exception
+	#check in manage account if purchase order required or not.
+	# ====================================================================================
+	def po_required(self):
+		res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'po_required'")
+		if res and res[0][0] == 'Yes':
+			 for d in getlist(self.doclist,'entries'):
+				 if not d.purchase_order:
+					 msgprint("Purchse Order No. required against item %s"%d.item_code)
+					 raise Exception
 
-  #check in manage account if purchase receipt required or not.
-  # ====================================================================================
-  def pr_required(self):
-    res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'pr_required'")
-    if res and res[0][0] == 'Yes':
-       for d in getlist(self.doclist,'entries'):
-         if not d.purchase_receipt:
-           msgprint("Purchase Receipt No. required against item %s"%d.item_code)
-           raise Exception
+	#check in manage account if purchase receipt required or not.
+	# ====================================================================================
+	def pr_required(self):
+		res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'pr_required'")
+		if res and res[0][0] == 'Yes':
+			 for d in getlist(self.doclist,'entries'):
+				 if not d.purchase_receipt:
+					 msgprint("Purchase Receipt No. required against item %s"%d.item_code)
+					 raise Exception
 
-  # VALIDATE
-  # ====================================================================================
-  def validate(self):
-    self.po_required()
-    self.pr_required()
-    self.check_active_purchase_items()
-    self.check_conversion_rate()
-    self.validate_bill_no_date()
-    self.validate_bill_no()
-    self.validate_reference_value()
-    self.clear_advances()
-    self.validate_credit_acc()
-    self.check_for_acc_head_of_supplier()
-    self.check_for_stopped_status()
+	# VALIDATE
+	# ====================================================================================
+	def validate(self):
+		self.po_required()
+		self.pr_required()
+		self.check_active_purchase_items()
+		self.check_conversion_rate()
+		self.validate_bill_no_date()
+		self.validate_bill_no()
+		self.validate_reference_value()
+		self.clear_advances()
+		self.validate_credit_acc()
+		self.check_for_acc_head_of_supplier()
+		self.check_for_stopped_status()
 
-    self.po_list, self.pr_list = [], []
-    for d in getlist(self.doclist, 'entries'):
-      self.validate_supplier(d)
-      self.validate_po_pr(d)
-      if not d.purchase_order in self.po_list:
-        self.po_list.append(d.purchase_order)
-      if not d.purhcase_receipt in self.pr_list:
-        self.pr_list.append(d.purchase_receipt)
-    # tds
-    get_obj('TDS Control').validate_first_entry(self)
-    if not flt(self.doc.ded_amount):
-      self.get_tds()
-      self.doc.save()
+		self.po_list, self.pr_list = [], []
+		for d in getlist(self.doclist, 'entries'):
+			self.validate_supplier(d)
+			self.validate_po_pr(d)
+			if not d.purchase_order in self.po_list:
+				self.po_list.append(d.purchase_order)
+			if not d.purhcase_receipt in self.pr_list:
+				self.pr_list.append(d.purchase_receipt)
+		# tds
+		get_obj('TDS Control').validate_first_entry(self)
+		if not flt(self.doc.ded_amount):
+			self.get_tds()
+			self.doc.save()
 
-    if not self.doc.is_opening:
-      self.doc.is_opening = 'No'
+		if not self.doc.is_opening:
+			self.doc.is_opening = 'No'
 
-    self.set_aging_date()
+		self.set_aging_date()
 
-    #set against account for credit to
-    self.set_against_expense_account()
+		#set against account for credit to
+		self.set_against_expense_account()
 
-    #FY validation
-    get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date')
-    
-    #get Purchase Common Obj
-    pc_obj = get_obj(dt='Purchase Common')
-    
-     # get total in words
-    self.doc.in_words = pc_obj.get_total_in_words('Rs', self.doc.grand_total)
-    self.doc.in_words_import = pc_obj.get_total_in_words(self.doc.currency, self.doc.grand_total_import)
+		#FY validation
+		get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date')
+		
+		#get Purchase Common Obj
+		pc_obj = get_obj(dt='Purchase Common')
+		
+		 # get total in words
+		self.doc.in_words = pc_obj.get_total_in_words('Rs', self.doc.grand_total)
+		self.doc.in_words_import = pc_obj.get_total_in_words(self.doc.currency, self.doc.grand_total_import)
 # ***************************** SUBMIT *****************************
-  # Check Ref Document docstatus
-  # -----------------------------
-  def check_prev_docstatus(self):
-    for d in getlist(self.doclist,'entries'):
-      if d.purchase_order:
-        submitted = sql("select name from `tabPurchase Order` where docstatus = 1 and name = '%s'" % d.purchase_order)
-        if not submitted:
-          msgprint("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
-          raise Exception , "Validation Error."
-      if d.purchase_receipt:
-        submitted = sql("select name from `tabPurchase Receipt` where docstatus = 1 and name = '%s'" % d.purchase_receipt)
-        if not submitted:
-          msgprint("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
-          raise Exception , "Validation Error."
+	# Check Ref Document docstatus
+	# -----------------------------
+	def check_prev_docstatus(self):
+		for d in getlist(self.doclist,'entries'):
+			if d.purchase_order:
+				submitted = sql("select name from `tabPurchase Order` where docstatus = 1 and name = '%s'" % d.purchase_order)
+				if not submitted:
+					msgprint("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
+					raise Exception , "Validation Error."
+			if d.purchase_receipt:
+				submitted = sql("select name from `tabPurchase Receipt` where docstatus = 1 and name = '%s'" % d.purchase_receipt)
+				if not submitted:
+					msgprint("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
+					raise Exception , "Validation Error."
 
-  def update_against_document_in_jv(self, against_document_no, against_document_doctype):
-    get_obj('GL Control').update_against_document_in_jv( self,'advance_allocation_details', against_document_no, against_document_doctype, self.doc.credit_to, 'debit',self.doc.doctype)
+	def update_against_document_in_jv(self, against_document_no, against_document_doctype):
+		get_obj('GL Control').update_against_document_in_jv( self,'advance_allocation_details', against_document_no, against_document_doctype, self.doc.credit_to, 'debit',self.doc.doctype)
 
-  # On Submit
-  # ----------
-  def on_submit(self):
-    self.check_prev_docstatus()
-    
-    # Check for Approving Authority
-    get_obj('Authorization Control').validate_approving_authority(self.doc.doctype,self.doc.company, self.doc.grand_total)
-    
-    
-    # this sequence because outstanding may get -negative
-    get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist)
-    self.update_against_document_in_jv(self.doc.name, self.doc.doctype)
-    get_obj(dt = 'Purchase Common').update_prevdoc_detail(self, is_submit = 1)
+	# On Submit
+	# ----------
+	def on_submit(self):
+		self.check_prev_docstatus()
+		
+		# Check for Approving Authority
+		get_obj('Authorization Control').validate_approving_authority(self.doc.doctype,self.doc.company, self.doc.grand_total)
+		
+		
+		# this sequence because outstanding may get -negative
+		get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist)
+		self.update_against_document_in_jv(self.doc.name, self.doc.doctype)
+		get_obj(dt = 'Purchase Common').update_prevdoc_detail(self, is_submit = 1)
 
 
 
 # ********************************* CANCEL *********************************
-  # Check Next Document's docstatus
-  # --------------------------------
-  def check_next_docstatus(self):
-    submit_jv = sql("select t1.name from `tabJournal Voucher` t1,`tabJournal Voucher Detail` t2 where t1.name = t2.parent and t2.against_voucher = '%s' and t1.docstatus = 1" % (self.doc.name))
-    if submit_jv:
-      msgprint("Journal Voucher : " + cstr(submit_jv[0][0]) + " has been created against " + cstr(self.doc.doctype) + ". So " + cstr(self.doc.doctype) + " cannot be Cancelled.")
-      raise Exception, "Validation Error."
-    
-  # On Cancel
-  # ----------
-  def on_cancel(self):
-    self.check_next_docstatus()
+	# Check Next Document's docstatus
+	# --------------------------------
+	def check_next_docstatus(self):
+		submit_jv = sql("select t1.name from `tabJournal Voucher` t1,`tabJournal Voucher Detail` t2 where t1.name = t2.parent and t2.against_voucher = '%s' and t1.docstatus = 1" % (self.doc.name))
+		if submit_jv:
+			msgprint("Journal Voucher : " + cstr(submit_jv[0][0]) + " has been created against " + cstr(self.doc.doctype) + ". So " + cstr(self.doc.doctype) + " cannot be Cancelled.")
+			raise Exception, "Validation Error."
+		
+	# On Cancel
+	# ----------
+	def on_cancel(self):
+		self.check_next_docstatus()
 
-    # Check whether tds payment voucher has been created against this voucher
-    self.check_tds_payment_voucher()
-    
-    get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist, cancel=1)
-    get_obj(dt = 'Purchase Common').update_prevdoc_detail(self, is_submit = 0)
+		# Check whether tds payment voucher has been created against this voucher
+		self.check_tds_payment_voucher()
+		
+		get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist, cancel=1)
+		get_obj(dt = 'Purchase Common').update_prevdoc_detail(self, is_submit = 0)
 
 
-  # Check whether tds payment voucher has been created against this voucher
-  #---------------------------------------------------------------------------
-  def check_tds_payment_voucher(self):
-    tdsp =  sql("select parent from `tabTDS Payment Detail` where voucher_no = '%s' and docstatus = 1 and parent not like 'old%'")
-    if tdsp:
-      msgprint("TDS Payment voucher '%s' has been made against this voucher. Please cancel the payment voucher to proceed." % (tdsp and tdsp[0][0] or ''))
-      raise Exception
+	# Check whether tds payment voucher has been created against this voucher
+	#---------------------------------------------------------------------------
+	def check_tds_payment_voucher(self):
+		tdsp =	sql("select parent from `tabTDS Payment Detail` where voucher_no = '%s' and docstatus = 1 and parent not like 'old%'")
+		if tdsp:
+			msgprint("TDS Payment voucher '%s' has been made against this voucher. Please cancel the payment voucher to proceed." % (tdsp and tdsp[0][0] or ''))
+			raise Exception
 
-  # on update
-  def on_update(self):
-    pass
-    
+	# on update
+	def on_update(self):
+		pass
+		
 ########################################################################
 # Repair Outstanding
 #######################################################################
-  def repair_pv_outstanding(self):
-    get_obj(dt = 'GL Control').repair_voucher_outstanding(self)
+	def repair_pv_outstanding(self):
+		get_obj(dt = 'GL Control').repair_voucher_outstanding(self)
diff --git a/buying/doctype/purchase_common/purchase_common.py b/buying/doctype/purchase_common/purchase_common.py
index 2350d7c..fe8c8e6 100644
--- a/buying/doctype/purchase_common/purchase_common.py
+++ b/buying/doctype/purchase_common/purchase_common.py
@@ -15,9 +15,9 @@
 convert_to_lists = webnotes.conn.convert_to_lists
 	
 # -----------------------------------------------------------------------------------------
+from utilities.transaction_base import TransactionBase
 
-
-class DocType:
+class DocType(TransactionBase):
 	def __init__(self, doc, doclist=[]):
 		self.doc = doc
 		self.doclist = doclist
@@ -268,14 +268,11 @@
 
 	# validate conversion rate
 	def validate_conversion_rate(self, obj):
-		default_currency = get_obj('Manage Account').doc.default_currency
+		default_currency = TransactionBase().get_company_currency(obj.doc.company)			
 		if not default_currency:
-			msgprint('Message: Please enter default currency in Global Defaults')
+			msgprint('Message: Please enter default currency in Company Master')
 			raise Exception
-
-		company_currency = sql("select default_currency from `tabCompany` where name = '%s'" % obj.doc.company)
-		curr = company_currency and cstr(company_currency[0][0]) or default_currency
-		if (obj.doc.currency == curr and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != curr and flt(obj.doc.conversion_rate) == 1.00):
+		if (obj.doc.currency == default_currency and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != default_currency and flt(obj.doc.conversion_rate) == 1.00):
 			msgprint("Message: Please Enter Appropriate Conversion Rate.")
 			raise Exception
 
diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py
index 3f0735f..25dd960 100644
--- a/selling/doctype/sales_common/sales_common.py
+++ b/selling/doctype/sales_common/sales_common.py
@@ -15,8 +15,9 @@
 	
 # -----------------------------------------------------------------------------------------
 
+from utilities.transaction_base import TransactionBase
 
-class DocType:
+class DocType(TransactionBase):
 	def __init__(self,d,dl):
 		self.doc, self.doclist = d,dl
 
@@ -262,10 +263,11 @@
 	# Check Conversion Rate (i.e. it will not allow conversion rate to be 1 for Currency other than default currency set in Global Defaults)
 	# ===========================================================================
 	def check_conversion_rate(self, obj):
-		default_currency = get_obj('Manage Account').doc.default_currency
-		company_currency = sql("select default_currency from `tabCompany` where name = '%s'" % obj.doc.company)
-		curr = company_currency and cstr(company_currency[0][0]) or default_currency
-		if (obj.doc.currency == curr and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != curr and flt(obj.doc.conversion_rate) == 1.00):
+		default_currency = TransactionBase().get_company_currency(obj.doc.company)
+		if not default_currency:
+			msgprint('Message: Please enter default currency in Company Master')
+			raise Exception		
+		if (obj.doc.currency == default_currency and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != default_currency and flt(obj.doc.conversion_rate) == 1.00):
 			msgprint("Please Enter Appropriate Conversion Rate.")
 			raise Exception
 	
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py
index 44cd2c7..0eda680 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -140,7 +140,8 @@
     self.check_for_stopped_status(pc_obj)
 
     # get total in words
-    self.doc.in_words = pc_obj.get_total_in_words(get_defaults().get('currency') or 'INR', self.doc.grand_total)
+    dcc = TransactionBase().get_company_currency(self.doc.company)    
+    self.doc.in_words = pc_obj.get_total_in_words(dcc, self.doc.grand_total)
     self.doc.in_words_import = pc_obj.get_total_in_words(self.doc.currency, self.doc.grand_total_import)
     # update valuation rate
     self.update_valuation_rate()
