mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge PR #1103 into maint
This commit is contained in:
@@ -130,13 +130,13 @@
|
|||||||
\Euro
|
\Euro
|
||||||
%---------------------------------------------------------------------------
|
%---------------------------------------------------------------------------
|
||||||
\begin{letter}{% {% endraw %}
|
\begin{letter}{% {% endraw %}
|
||||||
{{ invoice.GetOwner().GetName().decode("UTF-8") }} \\
|
{{ invoice.GetOwner().GetName() }} \\
|
||||||
{{ invoice.GetOwner().GetAddr().GetAddr1().decode("UTF-8") }} \\
|
{{ invoice.GetOwner().GetAddr().GetAddr1() }} \\
|
||||||
{{ invoice.GetOwner().GetAddr().GetAddr2().decode("UTF-8") }} \\
|
{{ invoice.GetOwner().GetAddr().GetAddr2() }} \\
|
||||||
{{ invoice.GetOwner().GetAddr().GetAddr3().decode("UTF-8") }}
|
{{ invoice.GetOwner().GetAddr().GetAddr3() }}
|
||||||
{# if Addr4 is declared put a linebreak here #}
|
{# if Addr4 is declared put a linebreak here #}
|
||||||
{% if invoice.GetOwner().GetAddr().GetAddr4() %} \\ {% endif %}
|
{% if invoice.GetOwner().GetAddr().GetAddr4() %} \\ {% endif %}
|
||||||
{{ invoice.GetOwner().GetAddr().GetAddr4().decode("UTF-8") }} {% raw %}
|
{{ invoice.GetOwner().GetAddr().GetAddr4() }} {% raw %}
|
||||||
}
|
}
|
||||||
%---------------------------------------------------------------------------
|
%---------------------------------------------------------------------------
|
||||||
% Weitere Optionen
|
% Weitere Optionen
|
||||||
@@ -156,7 +156,7 @@ Ich erlaube mir, Ihnen folgende Beträge in Rechnung zu stellen:
|
|||||||
{%- for ent in invoice.GetEntries() -%}
|
{%- for ent in invoice.GetEntries() -%}
|
||||||
{{- '\Artikel' -}}
|
{{- '\Artikel' -}}
|
||||||
{{- '{' -}} {{- ent.GetQuantity() -}} {{- '}' -}}
|
{{- '{' -}} {{- ent.GetQuantity() -}} {{- '}' -}}
|
||||||
{{- '{' -}} {{- ent.GetDescription().decode("UTF-8") -}} {{- '}' -}}
|
{{- '{' -}} {{- ent.GetDescription() -}} {{- '}' -}}
|
||||||
{{- '{' -}} {{- ent.GetInvPrice().to_double() -}} {{- '}' -}}
|
{{- '{' -}} {{- ent.GetInvPrice().to_double() -}} {{- '}' -}}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
{#- **************** JINJA2 Entries END ********************** -#}
|
{#- **************** JINJA2 Entries END ********************** -#}
|
||||||
|
|||||||
@@ -134,13 +134,13 @@
|
|||||||
\Euro
|
\Euro
|
||||||
%---------------------------------------------------------------------------
|
%---------------------------------------------------------------------------
|
||||||
\begin{letter}{ {%- endraw -%}
|
\begin{letter}{ {%- endraw -%}
|
||||||
{{- invoice.GetOwner().GetName().decode("UTF-8") -}} \\
|
{{- invoice.GetOwner().GetName() -}} \\
|
||||||
{{- invoice.GetOwner().GetAddr().GetAddr1().decode("UTF-8") -}} \\
|
{{- invoice.GetOwner().GetAddr().GetAddr1() -}} \\
|
||||||
{{- invoice.GetOwner().GetAddr().GetAddr2().decode("UTF-8") -}} \\
|
{{- invoice.GetOwner().GetAddr().GetAddr2() -}} \\
|
||||||
{{- invoice.GetOwner().GetAddr().GetAddr3().decode("UTF-8") -}}
|
{{- invoice.GetOwner().GetAddr().GetAddr3() -}}
|
||||||
{# if Addr4 is declared put a linebreak here #}
|
{# if Addr4 is declared put a linebreak here #}
|
||||||
{%- if invoice.GetOwner().GetAddr().GetAddr4() -%} \\ {%- endif -%}
|
{%- if invoice.GetOwner().GetAddr().GetAddr4() -%} \\ {%- endif -%}
|
||||||
{{- invoice.GetOwner().GetAddr().GetAddr4().decode("UTF-8") -}} {%- raw -%}
|
{{- invoice.GetOwner().GetAddr().GetAddr4() -}} {%- raw -%}
|
||||||
}
|
}
|
||||||
%---------------------------------------------------------------------------
|
%---------------------------------------------------------------------------
|
||||||
% Weitere Optionen
|
% Weitere Optionen
|
||||||
@@ -167,7 +167,7 @@ Ich erlaube mir, Ihnen folgende Beträge in Rechnung zu stellen:
|
|||||||
{%- for ent in invoice.GetEntries() %}
|
{%- for ent in invoice.GetEntries() %}
|
||||||
{{ loop.index }} &
|
{{ loop.index }} &
|
||||||
{{- locale.format("%.2f", ent.GetQuantity().to_double()) -}} &
|
{{- locale.format("%.2f", ent.GetQuantity().to_double()) -}} &
|
||||||
{{- ent.GetDescription().decode("UTF-8") -}} &
|
{{- ent.GetDescription() -}} &
|
||||||
\EUR{ {{- locale.format("%.2f", ent.GetInvPrice().to_double()) -}} } &
|
\EUR{ {{- locale.format("%.2f", ent.GetInvPrice().to_double()) -}} } &
|
||||||
\EUR{ {{- locale.format("%.2f", ent.GetInvPrice().to_double() * ent.GetQuantity().to_double()) -}} } \\ \hline
|
\EUR{ {{- locale.format("%.2f", ent.GetInvPrice().to_double() * ent.GetQuantity().to_double()) -}} } \\ \hline
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|||||||
@@ -115,19 +115,19 @@ def invoice_to_lco(invoice):
|
|||||||
add_str = u""
|
add_str = u""
|
||||||
owner = invoice.GetOwner()
|
owner = invoice.GetOwner()
|
||||||
if owner.GetName() != "":
|
if owner.GetName() != "":
|
||||||
add_str += owner.GetName().decode("UTF-8") + "\n"
|
add_str += owner.GetName() + "\n"
|
||||||
|
|
||||||
addr = owner.GetAddr()
|
addr = owner.GetAddr()
|
||||||
if addr.GetName() != "":
|
if addr.GetName() != "":
|
||||||
add_str += addr.GetName().decode("UTF-8") + "\n"
|
add_str += addr.GetName() + "\n"
|
||||||
if addr.GetAddr1() != "":
|
if addr.GetAddr1() != "":
|
||||||
add_str += addr.GetAddr1().decode("UTF-8") + "\n"
|
add_str += addr.GetAddr1() + "\n"
|
||||||
if addr.GetAddr2() != "":
|
if addr.GetAddr2() != "":
|
||||||
add_str += addr.GetAddr2().decode("UTF-8") + "\n"
|
add_str += addr.GetAddr2() + "\n"
|
||||||
if addr.GetAddr3() != "":
|
if addr.GetAddr3() != "":
|
||||||
add_str += addr.GetAddr3().decode("UTF-8") + "\n"
|
add_str += addr.GetAddr3() + "\n"
|
||||||
if addr.GetAddr4() != "":
|
if addr.GetAddr4() != "":
|
||||||
add_str += addr.GetAddr4().decode("UTF-8") + "\n"
|
add_str += addr.GetAddr4() + "\n"
|
||||||
|
|
||||||
lco_out += write_variable("toaddress2", add_str)
|
lco_out += write_variable("toaddress2", add_str)
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ def invoice_to_lco(invoice):
|
|||||||
|
|
||||||
# Write the entries
|
# Write the entries
|
||||||
ent_str = u""
|
ent_str = u""
|
||||||
locale.setlocale(locale.LC_ALL, "de_DE")
|
locale.setlocale(locale.LC_ALL, "")
|
||||||
for n, ent in enumerate(invoice.GetEntries()):
|
for n, ent in enumerate(invoice.GetEntries()):
|
||||||
|
|
||||||
line_str = u""
|
line_str = u""
|
||||||
@@ -160,14 +160,14 @@ def invoice_to_lco(invoice):
|
|||||||
n = ent.GetQuantity()
|
n = ent.GetQuantity()
|
||||||
|
|
||||||
uprice = locale.currency(price).rstrip(" EUR")
|
uprice = locale.currency(price).rstrip(" EUR")
|
||||||
un = unicode(
|
un = str(
|
||||||
int(float(n.num()) / n.denom())
|
int(float(n.num()) / n.denom())
|
||||||
) # choose best way to format numbers according to locale
|
) # choose best way to format numbers according to locale
|
||||||
|
|
||||||
line_str = u"\Artikel{"
|
line_str = u"\Artikel{"
|
||||||
line_str += un
|
line_str += un
|
||||||
line_str += u"}{"
|
line_str += u"}{"
|
||||||
line_str += descr.decode("UTF-8")
|
line_str += descr
|
||||||
line_str += u"}{"
|
line_str += u"}{"
|
||||||
line_str += uprice
|
line_str += uprice
|
||||||
line_str += u"}"
|
line_str += u"}"
|
||||||
@@ -288,7 +288,6 @@ def main(argv=None):
|
|||||||
|
|
||||||
# Opening output file
|
# Opening output file
|
||||||
f = open(output_file_name, "w")
|
f = open(output_file_name, "w")
|
||||||
lco_str = lco_str.encode("latin1")
|
|
||||||
f.write(lco_str)
|
f.write(lco_str)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user