def _cargar_pagare(self, str_pagare_text): str_ret = "" text_default = '________________' list_values_remplace = { '$compania_nombre$': self.env['res.users'].browse(self.env.uid).company_id.name or text_default, '$compania_direccion$': self.env['res.users'].browse(self.env.uid).company_id.street or text_default, '$compania_ciudad$': self.env['res.users'].browse(self.env.uid).company_id.city or text_default, '$compania_provincia$': self.env['res.users'].browse(self.env.uid).company_id.state_id.name or text_default, '$compania_zip$': self.env['res.users'].browse(self.env.uid).company_id.zip or text_default, '$compania_pais$': self.env['res.users'].browse(self.env.uid).company_id.country_id.name or text_default, '$compania_cuit$': self.env['res.users'].browse(self.env.uid).company_id.company_registry or text_default, '$cliente_nombre$': self.prestamo_cuenta_id.cliente_id.name or text_default, '$cliente_direccion$': self.prestamo_cuenta_id.cliente_id.street or text_default, '$cliente_ciudad$': self.prestamo_cuenta_id.cliente_id.city or text_default, '$cliente_provincia$': self.prestamo_cuenta_id.cliente_id.state_id.name or text_default, '$cliente_codigo_postal$': self.prestamo_cuenta_id.cliente_id.zip or text_default, '$cliente_pais$': self.prestamo_cuenta_id.cliente_id.country_id.name or text_default, '$cliente_dni$': self.prestamo_cuenta_id.cliente_dni or text_default, '$prestamo_fecha_primer_vencimiento$': str(self.fecha_primer_vencimiento) or text_default, '$prestamo_fecha$': str(self.fecha) or text_default, '$prestamo_monto_en_letras$': amount_to_text_es_MX.get_amount_to_text(self, self.monto_otorgado, 'centavos', 'pesos con ') or text_default, '$prestamo_monto$': str(self.monto_otorgado) or text_default, '$prestamo_cuotas$': str(self.prestamo_plan_id.cuotas) or text_default, '$prestamo_total_adeudado_en_letras$': amount_to_text_es_MX.get_amount_to_text(self, self._monto_total_adeudado(), 'centavos', 'pesos con ') or text_default, '$prestamo_total_adeudado$': str(self._monto_total_adeudado()) or text_default, '$cuota_monto_en_letras$': amount_to_text_es_MX.get_amount_to_text(self, self.prestamo_cuota_ids[0].monto_cuota, 'centavos', 'pesos con ') or text_default, '$cuota_monto$': str(self.prestamo_cuota_ids[0].monto_cuota) or text_default, } for value in list_values_remplace: str_pagare_text = str_pagare_text.replace(value, list_values_remplace[value]) self.prestamo_pagare_text = str_pagare_text
def _cfdi_cantidad_con_letra(self, cr, uid, ids, field_names, arg, context=None): res = dict([(i, {}) for i in ids]) for line in self.browse(cr, uid, ids, context=context): amount_to_text = amount_to_text_es_MX.get_amount_to_text(self, line.amount_total, 'es_cheque', 'code' in line.currency_id._columns and line.currency_id.code or line.currency_id.name) res[line.id]['cfdi_cantidad_con_letra'] = amount_to_text return res
def _cargar_comprobante(self, str_comprobante_text): str_ret = "" text_default = '________________' list_values_remplace = { '$compania_nombre$': self.env['res.users'].browse(self.env.uid).company_id.name or text_default, '$compania_direccion$': self.env['res.users'].browse(self.env.uid).company_id.street or text_default, '$compania_ciudad$': self.env['res.users'].browse(self.env.uid).company_id.city or text_default, '$compania_provincia$': self.env['res.users'].browse(self.env.uid).company_id.state_id.name or text_default, '$compania_zip$': self.env['res.users'].browse(self.env.uid).company_id.zip or text_default, '$compania_pais$': self.env['res.users'].browse(self.env.uid).company_id.country_id.name or text_default, '$compania_cuit$': self.env['res.users'].browse(self.env.uid).company_id.company_registry or text_default, '$cliente_nombre$': self.prestamo_cuenta_id.cliente_id.name or text_default, '$cliente_direccion$': self.prestamo_cuenta_id.cliente_id.street or text_default, '$cliente_ciudad$': self.prestamo_cuenta_id.cliente_id.city or text_default, '$cliente_provincia$': self.prestamo_cuenta_id.cliente_id.state_id.name or text_default, '$cliente_codigo_postal$': self.prestamo_cuenta_id.cliente_id.zip or text_default, '$cliente_pais$': self.prestamo_cuenta_id.cliente_id.country_id.name or text_default, '$cliente_dni$': self.prestamo_cuenta_id.cliente_dni or text_default, '$monto_pagado$': str(self.monto) or text_default, '$monto_pagado_en_letras$': amount_to_text_es_MX.get_amount_to_text(self, self.monto, 'centavos', 'pesos con ') or text_default, '$detalle$': str(self.detalle) or text_default, '$numero_de_recibo$': str(self.id) or text_default, } for value in list_values_remplace: str_comprobante_text = str_comprobante_text.replace(value, list_values_remplace[value]) self.prestamo_comprobante_de_pago_text = str_comprobante_text
def _get_amount_to_text(self): if not context: context = {} res = {} for invoice in self.browse(cr, uid, ids, context=context): amount_to_text = amount_to_text_es_MX.get_amount_to_text( self, invoice.amount_total, 'es_cheque', 'code' in invoice.\ currency_id._columns and invoice.currency_id.code or invoice.\ currency_id.name) res[invoice.id] = amount_to_text return res
def _get_amount_to_text(self, cr, uid, ids, field_names=None, arg=False, context=None): if context is None: context = {} res = {} for invoice in self.browse(cr, uid, ids, context=context): amount_to_text = amount_to_text_es_MX.get_amount_to_text( self, invoice.amount_total, 'es_cheque', 'code' in invoice.\ currency_id._columns and invoice.currency_id.code or invoice.\ currency_id.name) res[invoice.id] = amount_to_text return res
def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None): """ Inherited - add amount_in_word and allow_check_writting in returned value dictionary """ if not context: context = {} default = super(account_voucher_tcn, self).onchange_amount(cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=context) if 'value' in default: amount = 'amount' in default['value'] and default['value']['amount'] or amount # Cambios para definir el monto de manera literal #amount_in_word = self._amount_to_text(cr, uid, amount, currency_id, context=context) currency_name = self.pool.get('res.currency').browse(cr, uid, currency_id, context)['name'] amount_in_word = amount_to_text_es_MX.get_amount_to_text(self, amount, 'es_cheque', currency_name) default['value'].update({'amount_in_word':amount_in_word}) if journal_id: allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing default['value'].update({'allow_check':allow_check_writing}) return default
def amount_to_text(self, pack_operation_product_ids, type): #print "##### calculate_sp_total" text_total = '' total = 0.0 moneda = self.company_id.currency_id.name if not pack_operation_product_ids: return text_total for line in pack_operation_product_ids: if line.qty_done > 0: if type == 'incoming': total += (line.qty_done * line.product_id.standard_price) * 1.16 else: total += (line.qty_done * line.product_id.lst_price) * 1.16 text_total = amount_to_text_es_MX.get_amount_to_text( self, float(total), moneda) #rec.amount_to_text = amount_to_text_es_MX.get_amount_to_text(rec,rec.amount_total, rec.currency_id.name) return text_total
def _compute_tons_text(self): self.tons_text = amount_to_text_es_MX.get_amount_to_text( self, self.tons, 'es_MX', 'MX')
def _get_amount_total_text(self): for rec in self: rec.amount_total_text = amount_to_text_es_MX.get_amount_to_text( rec.amount_total, rec.currency_id.name)
def _get_amount_2_text(self, amount_total): return amount_to_text_es_MX.get_amount_to_text(self, amount_total, 'es_cheque', self.currency_id.name)
def _get_amount_to_text(self): self.amount_to_text = amount_to_text_es_MX.get_amount_to_text( self, self.amount_total, 'es_cheque', self.currency_id.name)
def _get_amount_to_text(self): #_logger.info(_("ENNTRO a monto texto ")) self.amount_to_text = amount_to_text_es_MX.get_amount_to_text( self, self.amount_total, self.pricelist_id.currency_id.name)
def _compute_tons_text(self): self.tons_text = amount_to_text_es_MX.get_amount_to_text(self, self.tons, 'es_MX', 'MX')