mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
shifted get_company_currency from transaction base to setup/utils.py
This commit is contained in:
@@ -18,10 +18,10 @@ from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import cstr, flt, getdate
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.wrapper import getlist, copy_doclist
|
||||
from webnotes.model.wrapper import getlist
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import msgprint
|
||||
from setup.utils import get_company_currency
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
@@ -149,7 +149,7 @@ class DocType(TransactionBase):
|
||||
sales_com_obj.check_conversion_rate(self)
|
||||
|
||||
# Get total in Words
|
||||
dcc = TransactionBase().get_company_currency(self.doc.company)
|
||||
dcc = get_company_currency(self.doc.company)
|
||||
self.doc.in_words = sales_com_obj.get_total_in_words(dcc, self.doc.rounded_total)
|
||||
self.doc.in_words_export = sales_com_obj.get_total_in_words(self.doc.currency, self.doc.rounded_total_export)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ from webnotes.model.doc import addchild
|
||||
from webnotes.model.wrapper import getlist
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import msgprint
|
||||
from setup.utils import get_company_currency
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
@@ -131,13 +132,12 @@ class DocType(BuyingController):
|
||||
pc_obj = get_obj(dt='Purchase Common')
|
||||
pc_obj.validate_for_items(self)
|
||||
pc_obj.validate_mandatory(self)
|
||||
pc_obj.validate_conversion_rate(self)
|
||||
pc_obj.get_prevdoc_date(self)
|
||||
pc_obj.validate_reference_value(self)
|
||||
self.check_for_stopped_status(pc_obj)
|
||||
|
||||
# get total in words
|
||||
dcc = super(DocType, self).get_company_currency(self.doc.company)
|
||||
dcc = 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
|
||||
|
||||
Reference in New Issue
Block a user