Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mehrere Änderungen (Robustere HTML anzeige / config.ini -> gitignore / Anzeige für Draft documente / bugfix customer address null ) #25

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ TemplateFile = print_format/quotation.jinja
DocType = Sales Invoice
TemplateFile = print_format/sales_invoice.jinja

[Ausgangsrechnung kompakt]
DocType = Sales Invoice
TemplateFile = print_format/sales_invoice_compact.jinja

[Auftragsbestätigung]
DocType = Sales Order
TemplateFile = print_format/sales_order.jinja
Expand Down
18 changes: 14 additions & 4 deletions print_format/sales_invoice.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,25 @@
{% endif %}

{% if doc.from_date and doc.to_date %}
{% set from_date = doc.from_date %}
{% set to_date = doc.to_date %}
{% endif %}
{% set timesheet = frappe.get_doc("Timesheet", doc.timesheets.time_sheet)%}
{% if timesheet.start_date and timesheet.end_date %}
{% set from_date = timesheet.start_date %}
{% set to_date = timesheet.end_date %}
{% endif %}
Comment on lines +83 to +90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich denke das sollte nicht Aufgabe des Druckformats sein. Abgesehen davon verwenden wir beispielsweise eine andere Logik (es wird immer ein ganzer Monat vom ersten bis letzten Tag abgerechnet). Besser ein Server Script erstellen, das die entsprechenden Werte nach Belieben in der Rechnung setzt.


{% if from_date and to_date %}
<tr>
<td>{{ _("Performance Period") }}:</td>
{# If the year matches (first 4 chars in ISO-string), omit it for from_date #}
{% if doc.from_date.year is defined %}
{% set date_format = "dd.mm." if doc.from_date.year == doc.to_date.year else "dd.mm.yy" %}
{% if from_date.year is defined %}
{% set date_format = "dd.mm." if from_date.year == to_date.year else "dd.mm.yy" %}
{% else %}
{% set date_format = "dd.mm." if doc.from_date[:4] == doc.to_date[:4] else "dd.mm.yy" %}
{% set date_format = "dd.mm." if from_date[:4] == to_date[:4] else "dd.mm.yy" %}
{% endif %}
<td class="text-right">{{ frappe.utils.formatdate(doc.from_date, date_format) }} - {{ frappe.utils.formatdate(doc.to_date, "dd.mm.yyyy") }}</td>
<td class="text-right">{{ frappe.utils.formatdate(from_date, date_format) }} - {{ frappe.utils.formatdate(to_date, "dd.mm.yyyy") }}</td>
</tr>
{% endif %}
</table>
Expand Down
Loading
Loading