Skip to content

Commit

Permalink
PyFePdf: ajusto formateo de cuit
Browse files Browse the repository at this point in the history
  • Loading branch information
reingart committed Jun 3, 2011
1 parent 10e947e commit 9b23a7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyfepdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ def fmt_num(self, i, fmt="%0.2f", monetary=True):
fmt_imp = lambda self, i: self.fmt_num(i, "%0.2f")
fmt_qty = lambda self, i: self.fmt_num(i, "%" + self.FmtCantidad + "f", False)
fmt_pre = lambda self, i: self.fmt_num(i, "%" + self.FmtPrecio + "f")
fmt_cuit = lambda self, c: len(c)==11 and "%s-%s-%s" % (c[0:2], c[2:10], c[10:]) or c

def fmt_cuit(self, c):
if c is not None and str(c):
c=str(c)
return len(str(c))==11 and "%s-%s-%s" % (c[0:2], c[2:10], c[10:]) or c
return ''

def fmt_fact(self, tipo_cbte, punto_vta, cbte_nro):
"Formatear tipo, letra y punto de venta y número de factura"
Expand Down

0 comments on commit 9b23a7e

Please sign in to comment.