← Back to team overview

clearcorp team mailing list archive

lp:~juan-munoz-clearcorp/openerp-ccorp-addons/reports_features_fixes into lp:openerp-ccorp-addons/6.1

 

Juan Felipe Muñoz Ramos has proposed merging lp:~juan-munoz-clearcorp/openerp-ccorp-addons/reports_features_fixes into lp:openerp-ccorp-addons/6.1.

Requested reviews:
  CLEARCORP development team (clearcorp)

For more details, see:
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/reports_features_fixes/+merge/102153

fixes the reports of check and receipt
-- 
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/reports_features_fixes/+merge/102153
Your team CLEARCORP development team is requested to review the proposed merge of lp:~juan-munoz-clearcorp/openerp-ccorp-addons/reports_features_fixes into lp:openerp-ccorp-addons/6.1.
=== modified file 'account_voucher_check/report/amount_to_text.py'
--- account_voucher_check/report/amount_to_text.py	2012-04-12 15:55:51 +0000
+++ account_voucher_check/report/amount_to_text.py	2012-04-16 18:05:22 +0000
@@ -104,7 +104,7 @@
     if (len(number_dec) < 2 ):
       number_dec+='0'         
 
-    has_decimal = float(number_dec) != 0 and join_dec + number_dec + " CENTIMOS" or ' EXACTOS'
+    has_decimal = float(number_dec) != 0 and join_dec + number_dec + "/100" or ' EXACTOS'
     converted += currency +  has_decimal
     
 

=== modified file 'account_voucher_check/report/check_voucher.mako'
--- account_voucher_check/report/check_voucher.mako	2012-04-12 18:51:14 +0000
+++ account_voucher_check/report/check_voucher.mako	2012-04-16 18:05:22 +0000
@@ -20,9 +20,19 @@
 					<span class = "amount">${formatLang(check.amount)}</span>
 				</div>
 			</div>
-			<div class = "amount_text">
-				<span class="amount_desc">${get_text(check.amount,check.currency_id,check.partner_id.lang) or ''|entity}</span>
-			</div>
+            %if count_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) < 50 :
+			<div class = "amount_text">
+				<span class="amount_desc">${get_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) or ''|entity}</span>
+			</div>
+            %elif count_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) > 50 and get_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) < 80:
+			<div class = "amount_text">
+				<span class="amount_desc_medium">${get_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) or ''|entity}</span>
+			</div>
+            %else :
+			<div class = "amount_text">
+				<span class="amount_desc_small">${get_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) or ''|entity}</span>
+			</div>
+            %endif
 		</div>
 		<div id = "accounting_data">
 			<div id = "document_desc">

=== modified file 'account_voucher_check/report/check_voucher.py'
--- account_voucher_check/report/check_voucher.py	2012-04-10 21:15:45 +0000
+++ account_voucher_check/report/check_voucher.py	2012-04-16 18:05:22 +0000
@@ -41,31 +41,44 @@
 
 class check_voucher(report_sxw.rml_parse):
 
-	def __init__(self, cr, uid, name, context):
-		super(check_voucher, self).__init__(cr, uid, name, context=context)
-		self.localcontext.update({
-			'time': time,
-			'cr'  : cr,
-			'uid' : uid,
-			'get_text':self.get_text,
-		})
-		self.context = context
-		self._node = None
-
-	def get_text(self,amount,currency,lang):
-		separator = ','
-		decimal_point = '.'
-		if lang:
-			lang_pool = self.pool.get('res.lang')
-			id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
-			obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
-			separator = obj_lang  and obj_lang.thousands_sep or separator
-			decimal_point = obj_lang  and obj_lang.decimal_point or decimal_point
-		#debug(separator)
-		#debug(decimal_point)
-		res = number_to_text_es(amount,currency.currency_name,separator=separator,decimal_point=decimal_point)
-		return res
-		
+    def __init__(self, cr, uid, name, context):
+        super(check_voucher, self).__init__(cr, uid, name, context=context)
+        self.localcontext.update({
+            'time': time,
+            'cr'  : cr,
+            'uid' : uid,
+            'get_text':self.get_text,
+            'count_text':self.count_text,
+        })
+        self.context = context
+        self._node = None
+
+
+    def get_text(self,amount,currency,lang,company_id):
+        separator = ','
+        decimal_point = '.'
+        name_currency = currency.currency_name
+        if name_currency == False:
+            name_currency = company_id.currency_id.currency_name
+        if name_currency == None:
+            name_currency = company_id.currency_id.currency_name
+        if lang:
+            lang_pool = self.pool.get('res.lang')
+            id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
+            obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
+            separator = obj_lang  and obj_lang.thousands_sep or separator
+            decimal_point = obj_lang  and obj_lang.decimal_point or decimal_point
+        #debug(separator)
+        #debug(decimal_point)
+        res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
+        return res
+        
+        
+        
+    def count_text(self,amount,currency,lang,company_id):
+        res = len(self.get_text(amount,currency,lang,company_id))
+        return res
+        
 report_sxw.report_sxw(
     'report.check.voucher.layout_ccorp',
     'account.voucher',

=== modified file 'ccorp_payment_receipt/report/amount_to_text.py'
--- ccorp_payment_receipt/report/amount_to_text.py	2012-04-11 19:18:27 +0000
+++ ccorp_payment_receipt/report/amount_to_text.py	2012-04-16 18:05:22 +0000
@@ -101,7 +101,7 @@
     if (len(number_dec) < 2 ):
       number_dec+='0'         
 
-    has_decimal = float(number_dec) != 0 and join_dec + number_dec + " CENTIMOS" or ' EXACTOS'
+    has_decimal = float(number_dec) != 0 and join_dec + number_dec + "/100" or ' EXACTOS'
     converted += currency +  has_decimal
     
 

=== modified file 'ccorp_payment_receipt/report/payment_receipt.mako'
--- ccorp_payment_receipt/report/payment_receipt.mako	2012-04-12 20:49:29 +0000
+++ ccorp_payment_receipt/report/payment_receipt.mako	2012-04-16 18:05:22 +0000
@@ -20,7 +20,7 @@
 				<span class="text_doct">${_("The amount of")}:</span> <span class = "amount_text">${check.currency_id.symbol_prefix or ''|entity } ${formatLang(check.amount)} ${check.currency_id.symbol_suffix or ''|entity }</span>
 			</div>
 			<div class = "detail">
-				<span class="text_doct">${_("In words")}:</span> <span class = "amount_text">${get_text(check.amount,check.currency_id,check.partner_id.lang) or ''|entity}</span>
+				<span class="text_doct">${_("In words")}:</span> <span class = "amount_text">${get_text(check.amount,check.currency_id,check.partner_id.lang,check.company_id) or ''|entity}</span>
 			</div>
 			<div class = "detail">
 				<span class="text_doct">${_("Concept of")}:</span> <span class="text_font">${check.name or ''|entity}</span>

=== modified file 'ccorp_payment_receipt/report/payment_receipt.py'
--- ccorp_payment_receipt/report/payment_receipt.py	2012-01-06 16:01:31 +0000
+++ ccorp_payment_receipt/report/payment_receipt.py	2012-04-16 18:05:22 +0000
@@ -48,18 +48,23 @@
             'get_text':self.get_text,
         })
             
-    def get_text(self,amount,currency,lang):
-		separator = ','
-		decimal_point = '.'
-		if lang:
-			lang_pool = self.pool.get('res.lang')
-			id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
-			obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
-			separator = obj_lang  and obj_lang.thousands_sep or separator
-			decimal_point = obj_lang  and obj_lang.decimal_point or decimal_point
-		res = number_to_text_es(amount,currency.currency_name,separator=separator,decimal_point=decimal_point)
-		return res
-		
+    def get_text(self,amount,currency,lang,company_id):
+        separator = ','
+        decimal_point = '.'
+        name_currency = currency.currency_name
+        if name_currency == False:
+            name_currency = company_id.currency_id.currency_name
+        if name_currency == None:
+            name_currency = company_id.currency_id.currency_name
+        if lang:
+            lang_pool = self.pool.get('res.lang')
+            id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
+            obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
+            separator = obj_lang  and obj_lang.thousands_sep or separator
+            decimal_point = obj_lang  and obj_lang.decimal_point or decimal_point
+        res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
+        return res
+        
 report_sxw.report_sxw(
     'report.account.voucher.layout_ccorp',
     'account.voucher',


Follow ups