Skip to content

Commit

Permalink
Merge pull request #57 from chazuttu/minor_bug_fixes
Browse files Browse the repository at this point in the history
minor bug fixes for PDF generation
  • Loading branch information
reingart authored Jun 12, 2021
2 parents 5db4da7 + ae1976f commit 68cfe1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyfepdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def fmt_num(self, i, fmt="%0.2f", monetary=True):
import locale

locale.setlocale(locale.LC_ALL, loc)
return locale.format(
return locale.format_string(
fmt,
Decimal(str(i).replace(",", ".")),
grouping=True,
Expand Down Expand Up @@ -1541,7 +1541,7 @@ def ProcesarPlantilla(self, num_copias=3, lineas_max=36, qty_pos="izq"):
else:
barras = ""

f.set("CodigoBarras", unicode(barras))
f.set("CodigoBarras", str(barras))
f.set("CodigoBarrasLegible", barras)

if not HOMO and barras and fact.get("resultado") == "A":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
kwargs["package_dir"] = {"pyafipws": "."}
kwargs["packages"] = ["pyafipws"]
opts = {}
data_files = []
data_files = [("pyafipws/plantillas", glob.glob("plantillas/*"))]


long_desc = (
Expand Down
1 change: 0 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,6 @@ def norm(x, encoding="latin1"):
def date(fmt=None, timestamp=None):
"Manejo de fechas (simil PHP)"
if fmt == "U": # return timestamp
# use universal standard time to avoid timezone differences
t = datetime.datetime.utcnow()
return int(time.mktime(t.timetuple()))
if fmt == "c": # return isoformat
Expand Down

0 comments on commit 68cfe1c

Please sign in to comment.