shifted get_company_currency from transaction base to setup/utils.py

This commit is contained in:
Anand Doshi
2013-01-17 15:44:57 +05:30
parent 03fa78597d
commit 9d9aec1ed4
15 changed files with 65 additions and 55 deletions

View File

@@ -23,6 +23,7 @@ from webnotes.model.wrapper import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint
from buying.utils import get_last_purchase_details
from setup.utils import get_company_currency
sql = webnotes.conn.sql
@@ -57,9 +58,6 @@ class DocType(BuyingController):
# Step 4:=> validate for items
pc_obj.validate_for_items(self)
# Step 5:=> validate conversion rate
pc_obj.validate_conversion_rate(self)
# Get po date
pc_obj.get_prevdoc_date(self)
@@ -70,7 +68,7 @@ class DocType(BuyingController):
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)

View File

@@ -17,6 +17,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.model.code import get_obj
from setup.utils import get_company_currency
from controllers.buying_controller import BuyingController
class DocType(BuyingController):
@@ -77,12 +78,11 @@ class DocType(BuyingController):
pc = get_obj('Purchase Common')
pc.validate_mandatory(self)
pc.validate_for_items(self)
pc.validate_conversion_rate(self)
pc.get_prevdoc_date(self)
pc.validate_reference_value(self)
def set_in_words(self):
pc = get_obj('Purchase Common')
company_currency = super(DocType, self).get_company_currency(self.doc.company)
company_currency = get_company_currency(self.doc.company)
self.doc.in_words = pc.get_total_in_words(company_currency, self.doc.grand_total)
self.doc.in_words_import = pc.get_total_in_words(self.doc.currency, self.doc.grand_total_import)