From 29e947e3062d41e5ce588c6e1f20be2663b24c8b Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 11 Mar 2024 15:15:05 +0100 Subject: [PATCH 01/31] first commit --- lib/org/openpsa/invoices/config/routes.yml | 4 ++++ lib/org/openpsa/invoices/handler/invoice/action.php | 13 ++++++++++++- lib/org/openpsa/invoices/handler/invoice/view.php | 8 +++++++- lib/org/openpsa/invoices/invoice/pdf.php | 11 ++++++++--- lib/org/openpsa/invoices/locale/default.de.txt | 4 ++++ lib/org/openpsa/invoices/locale/default.en.txt | 4 ++++ 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/lib/org/openpsa/invoices/config/routes.yml b/lib/org/openpsa/invoices/config/routes.yml index 06ca04e720..19874075a1 100644 --- a/lib/org/openpsa/invoices/config/routes.yml +++ b/lib/org/openpsa/invoices/config/routes.yml @@ -58,6 +58,10 @@ create_pdf: path: /invoice/action/create_pdf/ defaults: { _controller: 'org_openpsa_invoices_handler_invoice_action::create_pdf' } +create_reminder: + path: /invoice/action/create_reminder/ + defaults: { _controller: 'org_openpsa_invoices_handler_invoice_action::create_pdf_reminder' } + recalc_invoice: path: /invoice/recalculation/{guid}/ defaults: { _controller: 'org_openpsa_invoices_handler_invoice_items::recalculation' } diff --git a/lib/org/openpsa/invoices/handler/invoice/action.php b/lib/org/openpsa/invoices/handler/invoice/action.php index 3de3382a88..b5dfe83a95 100644 --- a/lib/org/openpsa/invoices/handler/invoice/action.php +++ b/lib/org/openpsa/invoices/handler/invoice/action.php @@ -123,13 +123,24 @@ public function _handler_create_pdf() { $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); try { - $pdf_helper->render_and_attach(); + $pdf_helper->render_and_attach('bill'); return $this->reply(true, $this->_l10n->get('pdf created')); } catch (midcom_error $e) { return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); } } + public function _handler_create_pdf_reminder() + { + $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); + try { + $pdf_helper->render_and_attach('reminder'); + return $this->reply(true, $this->_l10n->get('pdf created')); + } catch (midcom_error $e) { + return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); + } + } + public function _handler_send_by_mail() { $customerCard = org_openpsa_widgets_contact::get($this->invoice->customerContact); diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 7ad34e7b8c..62acdd1913 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -84,7 +84,7 @@ private function populate_toolbar() $buttons[] = $this->build_button('mark_paid', 'check'); } - if ($this->_config->get('invoice_pdfbuilder_class')) { + if ($this->_config->get('invoice_pdfbuilder_class_bill')) { $button = $this->build_button('create_pdf', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); @@ -96,6 +96,11 @@ private function populate_toolbar() && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } + + $button = $this->build_button('create_reminder', 'file-pdf-o'); + $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); + $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); + $buttons[] = $button; } if ($this->invoice->is_cancelable()) { @@ -104,6 +109,7 @@ private function populate_toolbar() $this->_view_toolbar->add_items($buttons); $this->add_next_previous($this->invoice, 'invoice/'); + } private function build_button(string $action, string $icon) : array diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 8b0d9309a5..3729f3fd54 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -30,7 +30,7 @@ public function get_attachment(bool $autocreate = false) : ?midcom_db_attachment if (!$autocreate) { return null; } - return $this->render_and_attach(); + return $this->render_and_attach('bill'); } public function get_button_options() : array @@ -63,9 +63,14 @@ public function get_button_options() : array ]; } - public function render_and_attach() : midcom_db_attachment + public function render_and_attach($kind) : midcom_db_attachment { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); + if($kind == 'bill') { + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_bill'); + }else { + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_reminder'); + } + if (!class_exists($client_class)) { throw new midcom_error('Could not find PDF renderer ' . $client_class); } diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index ab8b723f76..947ca411eb 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -414,6 +414,10 @@ Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich er PDF erzeugen ---STRINGEND +---STRING create_reminder +Mahnung erzeugen +---STRINGEND + ---STRING pdf created PDF-Datei wurde erfolgreich erzeugt ---STRINGEND diff --git a/lib/org/openpsa/invoices/locale/default.en.txt b/lib/org/openpsa/invoices/locale/default.en.txt index 5157f771a1..0c08c365db 100644 --- a/lib/org/openpsa/invoices/locale/default.en.txt +++ b/lib/org/openpsa/invoices/locale/default.en.txt @@ -46,6 +46,10 @@ Billing data Create invoice ---STRINGEND +---STRING create_reminder +Create reminder +---STRINGEND + ---STRING customer Customer ---STRINGEND From 5ed3972103e11d83ac9b5f744cfe52dd0f31b790 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 11 Mar 2024 16:38:44 +0100 Subject: [PATCH 02/31] make class parameers optional / change classnames --- lib/org/openpsa/invoices/handler/invoice/action.php | 2 +- lib/org/openpsa/invoices/handler/invoice/view.php | 3 +-- lib/org/openpsa/invoices/invoice/pdf.php | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/action.php b/lib/org/openpsa/invoices/handler/invoice/action.php index b5dfe83a95..c254fb9dbc 100644 --- a/lib/org/openpsa/invoices/handler/invoice/action.php +++ b/lib/org/openpsa/invoices/handler/invoice/action.php @@ -123,7 +123,7 @@ public function _handler_create_pdf() { $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); try { - $pdf_helper->render_and_attach('bill'); + $pdf_helper->render_and_attach(); return $this->reply(true, $this->_l10n->get('pdf created')); } catch (midcom_error $e) { return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 62acdd1913..9fc647d0c3 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -84,7 +84,7 @@ private function populate_toolbar() $buttons[] = $this->build_button('mark_paid', 'check'); } - if ($this->_config->get('invoice_pdfbuilder_class_bill')) { + if ($this->_config->get('invoice_pdfbuilder_class')) { $button = $this->build_button('create_pdf', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); @@ -109,7 +109,6 @@ private function populate_toolbar() $this->_view_toolbar->add_items($buttons); $this->add_next_previous($this->invoice, 'invoice/'); - } private function build_button(string $action, string $icon) : array diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 3729f3fd54..70520a5d84 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -30,7 +30,7 @@ public function get_attachment(bool $autocreate = false) : ?midcom_db_attachment if (!$autocreate) { return null; } - return $this->render_and_attach('bill'); + return $this->render_and_attach(); } public function get_button_options() : array @@ -63,12 +63,12 @@ public function get_button_options() : array ]; } - public function render_and_attach($kind) : midcom_db_attachment + public function render_and_attach(string $kind = null) : midcom_db_attachment { - if($kind == 'bill') { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_bill'); + if($kind == null) { + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); }else { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_reminder'); + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_'); } if (!class_exists($client_class)) { From f745895f326fc4a46defdb78cce7cf6298d81e2b Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 11:19:08 +0100 Subject: [PATCH 03/31] add ability to distinguish between attachments --- lib/midcom/admin/folder/locale/default.de.txt | 428 +++++++++++++----- lib/midcom/admin/folder/locale/default.en.txt | 428 +++++++++++++----- .../openpsa/invoices/handler/invoice/view.php | 1 + lib/org/openpsa/invoices/invoice/pdf.php | 23 +- 4 files changed, 653 insertions(+), 227 deletions(-) diff --git a/lib/midcom/admin/folder/locale/default.de.txt b/lib/midcom/admin/folder/locale/default.de.txt index 31748dab57..947ca411eb 100644 --- a/lib/midcom/admin/folder/locale/default.de.txt +++ b/lib/midcom/admin/folder/locale/default.de.txt @@ -2,222 +2,430 @@ ---VERSION 2.1.0 ---LANGUAGE de ----STRING author -Verfasser +---STRING account data +Kontodaten ---STRINGEND ----STRING authors -Verfasser +---STRING account number +Konto-Nummer ---STRINGEND ----STRING by score -von Hand sortiert +---STRING add new invoice item +Neue Rechnungsposition hinzufügen ---STRINGEND ----STRING cancelled -Abgebrochen +---STRING all invoices +Alle Rechnungen ---STRINGEND ----STRING could not save folder: %s -Ordner konnte nicht gespeichert werden. Ursache: %s +---STRING all invoices for customer %s +Rechnungen des Kunden %s ---STRINGEND ----STRING create folder -Ordner anlegen +---STRING all invoices for deliverable %s +Rechnungen zur Bestellung %s ---STRINGEND ----STRING create subfolder -Unterordner anlegen +---STRING amount +Betrag ---STRINGEND ----STRING created -Erstellungszeit +---STRING bank code +BLZ ---STRINGEND ----STRING creator -Ersteller +---STRING basic information +Basisdaten ---STRINGEND ----STRING default -Standard +---STRING billing data +Rechnungsdaten ---STRINGEND ----STRING default sort order -Standard-Sortierreihenfolge +---STRING canceled +Storniert ---STRINGEND ----STRING delete folder -Ordner löschen +---STRING create invoice +Rechnung erstellen ---STRINGEND ----STRING edit folder -Ordner bearbeiten +---STRING customer +Kunde ---STRINGEND ----STRING edit folder %s -Ordner "%s" bearbeiten +---STRING customer contact +Kundenkontakt ---STRINGEND ----STRING edit folder metadata -Metadaten des Ordners bearbeiten +---STRING dashboard +Übersicht ---STRINGEND ----STRING edit layout template -Layout-Vorlage bearbeiten +---STRING due +Fällig ---STRINGEND ----STRING edit metadata -Metadaten bearbeiten +---STRING due date +Fälligkeitsdatum ---STRINGEND ----STRING edit metadata of %s -Metadaten von '%s' bearbeiten +---STRING due on %s +Fällig am %s ---STRINGEND ----STRING exported -Exportiert +---STRING edit invoice items +Rechnungspositionen bearbeiten ---STRINGEND ----STRING failed to create a new style template: %s -Neue Stilvorlage konnte nicht erstellt werden: %s +---STRING failed to create invoice, reason +Rechnung konnte nicht erstellt werden. Ursache: ---STRINGEND ----STRING folder created -Ordner erstellt +---STRING files +Dateien ---STRINGEND ----STRING folder page class -Ordner-Klasse +---STRING go to customer +Kunden anzeigen ---STRINGEND ----STRING folder saved -Ordner gespeichert +---STRING go to deliverable +Bestellung anzeigen ---STRINGEND ----STRING folder type -Ordner-Typ +---STRING invoice +Rechnung ---STRINGEND ----STRING folders first -Ordner zuerst +---STRING invoices +Rechnungen ---STRINGEND ----STRING hide from navigation -In der Navigation unsichtbar +---STRING invoice address +Rechnungsadresse ---STRINGEND ----STRING imported -Importiert +---STRING invoice date +Rechnungsdatum ---STRINGEND ----STRING inherit style -Stilvorlage an Unterordner vererben +---STRING invoice delivery date +Lieferdatum ---STRINGEND ----STRING midcom.admin.folder -Ordnerverwaltung +---STRING invoice %s created +Rechnung %s wurde erstellt ---STRINGEND ----STRING move -Verschieben +---STRING invoice data +Rechnungsdaten ---STRINGEND ----STRING move %s -Verschiebe %s +---STRING invoice has already been sent. should it be replaced? +Diese Rechnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? ---STRINGEND ----STRING moved %s to %s -%s wurde nach %s verschoben +---STRING invoice items +Rechnungspositionen ---STRINGEND ----STRING nav order -Reihenfolge der Navigationselemente +---STRING invoice number +Rechnungsnummer ---STRINGEND ----STRING new layout template -[Neue Stilvorlage] +---STRING invoiceable reports +Abrechenbare Stundenberichte ---STRINGEND ----STRING new style created -Neue Stilvorlage wurde erstellt +---STRING invoicing information +Rechnungsdaten ---STRINGEND ----STRING no sortable elements found -keine sortierbaren Elemente gefunden +---STRING cancelation invoice +Stornorechnung ---STRINGEND ----STRING order navigation -Navigationselemente anordnen +---STRING cancelation invoice for +Stornorechnung zu ---STRINGEND ----STRING order navigation in folder %s -Navigationselemente im Ordner "%s" anordnen +---STRING canceled by +Storniert durch ---STRINGEND ----STRING owner -Besitzer +---STRING invoice got canceled by %s +Rechnung wurde storniert durch %s ---STRINGEND ----STRING pages first -Seiten zuerst +---STRING invoice canceled on %s +Storniert am %s ---STRINGEND ----STRING prevent entering -Zugriff verhindern +---STRING create_cancelation +stornieren ---STRINGEND ----STRING privilege template_management -Stilvorlagen-Verwaltung +---STRING cancelation for invoice %s already exists +Für Rechnung %s liegt bereits eine Stornorechnung vor ---STRINGEND ----STRING privilege topic_management -Ordner-Verwaltung +---STRING could not create cancelation for invoice %s +Für Rechnung %s konnte keine Stornorechnung erzeugt werden ---STRINGEND ----STRING published -Veröffentlicht +---STRING cancelation for invoice %s, item %s +Storno zur Rechnung %s, Position %s ---STRINGEND ----STRING revised -Letzte Bearbeitung +---STRING mark_paid +bezahlt ---STRINGEND ----STRING revision -Revision +---STRING mark_sent +verschickt ---STRINGEND ----STRING revisor -Revisor +---STRING send_by_mail +Mail versenden ---STRINGEND ----STRING schedule end -Anzeigen bis (für unbegrenzte Anzeige frei lassen) +---STRING marked invoice %s paid +Rechnung %s wurde als bezahlt markiert ---STRINGEND ----STRING schedule start -Veröffentlichen am (für sofortige Veröffentlichung frei lassen) +---STRING marked invoice %s sent +Rechnung %s wurde als verschickt markiert ---STRINGEND ----STRING scheduling -Zeitgesteuerte Veröffentlichung +---STRING marked invoice %s sent per mail +Rechnung %s wurde per E-Mail versendet ---STRINGEND ----STRING select the ordering method first to sort the pages -Wählen Sie eine Sortiermethode, um die Seiten anzuordnen +---STRING marked task "%s" finished +Aufgabe "%s" wurde als fertiggestellt markiert ---STRINGEND ----STRING size -Größe +---STRING name of bank +Name des Geldinstituts ---STRINGEND ----STRING style -Stilvorlage +---STRING next action +Nächste Aktion ---STRINGEND ----STRING style template -Stilvorlage +---STRING no customer +Kein Kunde ---STRINGEND ----STRING objects with no navigation entry are still accessible on-site if the url is known -Objekte ohne Navigationseintrag sind weiterhin verfügbar, insofern die URL bekannt ist +---STRING not paid +Nicht bezahlt +---STRINGEND + +---STRING open +Offen +---STRINGEND + +---STRING open invoices +Offene Rechnungen +---STRINGEND + +---STRING org.openpsa.invoices +Rechnungs-Tracking +---STRINGEND + +---STRING overdue +Überfällig +---STRINGEND + +---STRING overdue invoices +Überfällige Rechnungen +---STRINGEND + +---STRING overdue since %s +Überfällig seit %s +---STRINGEND + +---STRING paid +Bezahlt +---STRINGEND + +---STRING paid date +Zahlungsdatum +---STRINGEND + +---STRING paid invoices +Bezahlte Rechnungen +---STRINGEND + +---STRING paid on %s +Bezahlt am %s +---STRINGEND + +---STRING pdf file +PDF-Datei +---STRINGEND + +---STRING price +Preis +---STRINGEND + +---STRING project invoicing +Projekt-Abrechnung +---STRINGEND + +---STRING remarks +Anmerkungen +---STRINGEND + +---STRING quantity +Menge +---STRINGEND + +---STRING recipient +Empfänger +---STRINGEND + +---STRING recently paid invoices +Neueste Zahlungseingänge +---STRINGEND + +---STRING scheduled +Geplant +---STRINGEND + +---STRING scheduled invoices +Geplante Rechnungsläufe +---STRINGEND + +---STRING sent +Versanddatum +---STRINGEND + +---STRING sent date +Versanddatum +---STRINGEND + +---STRING sum +Summe +---STRINGEND + +---STRING sum including vat +Betrag inkl. MwSt +---STRINGEND + +---STRING sum excluding vat +Netto-Betrag +---STRINGEND + +---STRING totals +Gesamtsumme +---STRINGEND + +---STRING unable to deliver mail: %s +E-Mail konnte nicht verschickt werden: %s +---STRINGEND + +---STRING unsent +Unverschickt +---STRINGEND + +---STRING unsent invoices +Unverschickte Rechnungen +---STRINGEND + +---STRING vat +MwSt-Satz +---STRINGEND + +---STRING vat reg no +USt-ID. +---STRINGEND + +---STRING vat sum +MwSt-Betrag +---STRINGEND + +---STRING sending option +Versandmethode +---STRINGEND + +---STRING send per email +Per E-Mail +---STRINGEND + +---STRING send manually +Manuell +---STRINGEND + +---STRING tax identification number +Steuernummer +---STRINGEND + +---STRING payment target +Zahlungsziel (in Tagen) +---STRINGEND + +---STRING there is no invoice with number %s +Es gibt keine Rechnung mit der Nummer %s +---STRINGEND + +---STRING invoice was not found +Die Rechnung wurde nicht gefunden +---STRINGEND + +---STRING search title +Zeige Rechnung Nummer +---STRINGEND + +---STRING search +Suche +---STRINGEND + +---STRING goto +Zeige +---STRINGEND + +---STRING no invoice number was handed over +Es wurde keine Nummer zu einer Rechnung übergeben +---STRINGEND + +---STRING recalculate_by_reports +Neuberechnung mittels Stundenberichten +---STRINGEND + +---STRING price per unit +Stückpreis +---STRINGEND + +---STRING units +Stückzahl +---STRINGEND + +---STRING use contact address +Adresse aus Kontaktdaten benutzen +---STRINGEND + +---STRING current pdf file was manually uploaded shall it be replaced ? +Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich ersetzt werden? +---STRINGEND + +---STRING create_pdf +PDF erzeugen +---STRINGEND + +---STRING create_reminder +Mahnung erzeugen +---STRINGEND + +---STRING pdf created +PDF-Datei wurde erfolgreich erzeugt +---STRINGEND + +---STRING pdf creation failed +PDF-Datei konnte nicht erzeugt werden +---STRINGEND + +---STRING position +Position ---STRINGEND diff --git a/lib/midcom/admin/folder/locale/default.en.txt b/lib/midcom/admin/folder/locale/default.en.txt index f5407f7dc2..ef9909d96d 100644 --- a/lib/midcom/admin/folder/locale/default.en.txt +++ b/lib/midcom/admin/folder/locale/default.en.txt @@ -2,222 +2,430 @@ ---VERSION 2.1.0 ---LANGUAGE en ----STRING author -Author +---STRING account data +Account data ---STRINGEND ----STRING authors -Authors +---STRING account number +Account number ---STRINGEND ----STRING by score -Manually ordered +---STRING add new invoice item +Add a new invoice item ---STRINGEND ----STRING cancelled -Cancelled +---STRING all invoices +All invoices ---STRINGEND ----STRING could not save folder: %s -Could not save folder. Reason: %s +---STRING all invoices for customer %s +All invoices for customer %s ---STRINGEND ----STRING create folder -Create folder +---STRING all invoices for deliverable %s +All invoices for deliverable %s ---STRINGEND ----STRING create subfolder -Create subfolder +---STRING amount +Amount ---STRINGEND ----STRING created -Created +---STRING bank code +Bankcode ---STRINGEND ----STRING creator -Creator +---STRING basic information +Basic information ---STRINGEND ----STRING default -Default +---STRING billing data +Billing data ---STRINGEND ----STRING default sort order -Default sort order +---STRING create invoice +Create invoice ---STRINGEND ----STRING delete folder -Delete folder +---STRING customer +Customer ---STRINGEND ----STRING edit folder -Edit folder +---STRING customer contact +Customer contact ---STRINGEND ----STRING edit folder %s -Edit folder "%s" +---STRING dashboard +Dashboard ---STRINGEND ----STRING edit folder metadata -Edit folder metadata +---STRING due +Due date ---STRINGEND ----STRING edit layout template -Edit layout template +---STRING due date +Due date ---STRINGEND ----STRING edit metadata -Edit metadata +---STRING due on %s +Due on %s ---STRINGEND ----STRING edit metadata of %s -Edit metadata of '%s' +---STRING edit invoice items +Edit invoice items ---STRINGEND ----STRING exported -Exported +---STRING failed to create invoice, reason +Failed to create invoice, reason ---STRINGEND ----STRING failed to create a new style template: %s -Failed to create a new style template: %s +---STRING files +Files ---STRINGEND ----STRING folder created -Folder created +---STRING go to customer +Go to customer ---STRINGEND ----STRING folder page class -Folder's class +---STRING go to deliverable +Go to deliverable ---STRINGEND ----STRING folder saved -Folder saved +---STRING search title +Go to invoice number ---STRINGEND ----STRING folder type -Folder type +---STRING goto +goto ---STRINGEND ----STRING folders first -Folder first +---STRING invoice +Invoice ---STRINGEND ----STRING hide from navigation -Hide from navigation +---STRING invoices +Invoices ---STRINGEND ----STRING imported -Imported +---STRING invoice address +Invoice address ---STRINGEND ----STRING inherit style -Inherit template to subfolders +---STRING invoice date +Invoice date ---STRINGEND ----STRING midcom.admin.folder -Folder management +---STRING invoice delivery date +Delivery date ---STRINGEND ----STRING move -Move +---STRING invoice %s created +Invoice %s created ---STRINGEND ----STRING move %s -Move %s +---STRING invoice data +Invoice data ---STRINGEND ----STRING moved %s to %s -moved %s to %s +---STRING invoice has already been sent. should it be replaced? +This invoice has already been sent. Should the file be regenerated anyways? ---STRINGEND ----STRING nav order -Order of navigation items +---STRING invoice items +Invoice items ---STRINGEND ----STRING new layout template -[New layout template] +---STRING invoice number +Invoice number ---STRINGEND ----STRING new style created -New style created +---STRING invoice was not found +The invoice was not found ---STRINGEND ----STRING no sortable elements found -No sortable elements found +---STRING invoiceable reports +Billable Reports ---STRINGEND ----STRING order navigation -Arrange navigation items +---STRING invoicing information +Invoicing information ---STRINGEND ----STRING order navigation in folder %s -Arrange navigation under folder "%s" +---STRING canceled +Canceled ---STRINGEND ----STRING owner -Owner +---STRING cancelation invoice +Cancelation invoice ---STRINGEND ----STRING pages first -Pages first +---STRING cancelation invoice for +This is the cancelation for ---STRINGEND ----STRING prevent entering -Prevent entering +---STRING create_cancelation +Create cancelation ---STRINGEND ----STRING privilege template_management -Layout template management +---STRING cancelation for invoice %s already exists +Invoice %s has already been canceled ---STRINGEND ----STRING privilege topic_management -Folder management +---STRING could not create cancelation for invoice %s +Failed to create cancelation for invoice %s ---STRINGEND ----STRING published -Published +---STRING cancelation for invoice %s, item %s +Cancelation for invoice %s, item %s ---STRINGEND ----STRING revised -Revised +---STRING canceled by +Canceled by ---STRINGEND ----STRING revision -Revision +---STRING invoice got canceled by %s +Invoice was canceled by %s ---STRINGEND ----STRING revisor -Revisor +---STRING mark_paid +Mark paid ---STRINGEND ----STRING schedule end -Display until (leave empty for unlimited display) +---STRING mark_sent +Mark sent ---STRINGEND ----STRING schedule start -Publish at (leave empty for immediate publication) +---STRING send_by_mail +send by mail ---STRINGEND ----STRING scheduling -Scheduling +---STRING marked invoice %s paid +Marked invoice %s as paid ---STRINGEND ----STRING select the ordering method first to sort the pages -Select the ordering method first to sort the pages +---STRING marked invoice %s sent +Marked invoice %s as sent ---STRINGEND ----STRING size -Size +---STRING marked invoice %s sent per mail +Sent invoice %s per mail ---STRINGEND ----STRING style -Style template +---STRING marked task "%s" finished +Marked task "%s" as finished ---STRINGEND ----STRING style template -Style template +---STRING name of bank +Name of institute ---STRINGEND ----STRING objects with no navigation entry are still accessible on-site if the url is known -Objects that are hidden from navigation are still accessible on-site if the URL is known +---STRING next action +Next Action +---STRINGEND + +---STRING no customer +No customer +---STRINGEND + +---STRING no invoice number was handed over +No invoice number was handed over +---STRINGEND + +---STRING not paid +Not paid +---STRINGEND + +---STRING open +Open +---STRINGEND + +---STRING open invoices +Open invoices +---STRINGEND + +---STRING org.openpsa.invoices +Invoice tracking +---STRINGEND + +---STRING overdue +Overdue +---STRINGEND + +---STRING overdue invoices +Overdue invoices +---STRINGEND + +---STRING overdue since %s +Overdue since %s +---STRINGEND + +---STRING recipient +Recipient +---STRINGEND + +---STRING paid +paid +---STRINGEND + +---STRING paid date +Paid date +---STRINGEND + +---STRING paid invoices +Paid invoices +---STRINGEND + +---STRING paid on %s +Paid on %s +---STRINGEND + +---STRING pdf file +PDF file +---STRINGEND + +---STRING price +Price +---STRINGEND + +---STRING project invoicing +Project invoicing +---STRINGEND + +---STRING quantity +Quantity +---STRINGEND + +---STRING recently paid invoices +Recently paid invoices +---STRINGEND + +---STRING remarks +Remarks +---STRINGEND + +---STRING scheduled +Scheduled +---STRINGEND + +---STRING scheduled invoices +Scheduled invoices +---STRINGEND + +---STRING search +search +---STRINGEND + +---STRING sent +Sending date +---STRINGEND + +---STRING sent date +Sent date +---STRINGEND + +---STRING sum +Sum +---STRINGEND + +---STRING sum including vat +Sum including VAT +---STRINGEND + +---STRING sum excluding vat +Sum (excl. VAT) +---STRINGEND + +---STRING tax identification number +Taxpayer identification number +---STRINGEND + +---STRING payment target +Payment target (in days) +---STRINGEND + +---STRING there is no invoice with number %s +There is no invoice with number %s +---STRINGEND + +---STRING totals +Totals +---STRINGEND + +---STRING unable to deliver mail: %s +Unable to deliver mail: %s +---STRINGEND + +---STRING unsent +Unsent +---STRINGEND + +---STRING unsent invoices +Unsent invoices +---STRINGEND + +---STRING vat +VAT +---STRINGEND + +---STRING vat reg no +VAT registration number +---STRINGEND + +---STRING vat sum +VAT amount +---STRINGEND + +---STRING sending option +How to send? +---STRINGEND + +---STRING send per email +By email +---STRINGEND + +---STRING send manually +Manually +---STRINGEND + +---STRING recalculate_by_reports +Recalculate by hour-reports +---STRINGEND + +---STRING invoice canceled on %s +Canceled on %s +---STRINGEND + +---STRING price per unit +Price per unit +---STRINGEND + +---STRING units +Units +---STRINGEND + +---STRING use contact address +Use the address given in contact +---STRINGEND + +---STRING current pdf file was manually uploaded shall it be replaced ? +The current PDF file was manually uploaded. So shall it really be replaced ? +---STRINGEND + +---STRING create_pdf +Create PDF +---STRINGEND + +---STRING pdf created +PDF file created successfully +---STRINGEND + +---STRING pdf creation failed +Could not create PDF +---STRINGEND + +---STRING position +Position +---STRINGEND + +---STRING create_reminder +create reminder ---STRINGEND diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 9fc647d0c3..5fe1714066 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -55,6 +55,7 @@ private function load_datamanager() : datamanager if ($this->_config->get('invoice_pdfbuilder_class')) { $schemadb->get('default')->get_field('pdf_file')['hidden'] = false; + $schemadb->get('default')->get_field('pdf_file_reminder')['hidden'] = false; } $dm = new datamanager($schemadb); diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 70520a5d84..99ca5e4054 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -21,9 +21,13 @@ public function __construct(org_openpsa_invoices_invoice_dba $invoice) $this->invoice = $invoice; } - public function get_attachment(bool $autocreate = false) : ?midcom_db_attachment + public function get_attachment(bool $autocreate = false, $kind = null) : ?midcom_db_attachment { - $pdf_files = blobs::get_attachments($this->invoice, "pdf_file"); + if ($kind == 'reminder') { + $pdf_files = blobs::get_attachments($this->invoice, "pdf_file_reminder"); + } else { + $pdf_files = blobs::get_attachments($this->invoice, "pdf_file"); + } if (!empty($pdf_files)) { return reset($pdf_files); } @@ -68,7 +72,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment if($kind == null) { $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); }else { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_'); + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_reminder'); } if (!class_exists($client_class)) { @@ -83,15 +87,20 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment } // renders the pdf and attaches it to the invoice $pdf_builder = new $client_class($this->invoice); - $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '.pdf'; + if ($kind == 'reminder') { + $name = "guids_pdf_file_reminder"; + $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '_reminder' . '.pdf'; + } else { + $name = "guids_pdf_file"; + $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '.pdf'; + } // tmp filename $tmp_file = midcom::get()->config->get('midcom_tempdir') . "/" . $filename; // render pdf to tmp filename $pdf_builder->render($tmp_file); - - $attachment = $this->get_attachment(); + $attachment = $this->get_attachment(false, $kind); //sucht nach 'pdf_file' if ($attachment) { $attachment->name = $filename; $attachment->title = $this->invoice->get_label(); @@ -100,7 +109,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment } else { $attachment = $this->invoice->create_attachment($filename, $this->invoice->get_label(), "application/pdf"); if ( !$attachment - || !$this->invoice->set_parameter("midcom.helper.datamanager2.type.blobs", "guids_pdf_file", $attachment->guid . ":" . $attachment->guid)) { + || !$this->invoice->set_parameter("midcom.helper.datamanager2.type.blobs", $name, $attachment->guid . ":" . $attachment->guid)) { throw new midcom_error("Failed to create invoice attachment for pdf: " . midcom_connection::get_error_string()); } } From 4489eb6c89355665ec3ef48171af72c415b8e894 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 12:33:32 +0100 Subject: [PATCH 04/31] repair shemadb_default --- lib/org/openpsa/invoices/config/schemadb_default.inc | 11 +++++++++++ lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/config/schemadb_default.inc b/lib/org/openpsa/invoices/config/schemadb_default.inc index 8f62760a4b..5d8456207a 100644 --- a/lib/org/openpsa/invoices/config/schemadb_default.inc +++ b/lib/org/openpsa/invoices/config/schemadb_default.inc @@ -163,6 +163,17 @@ 'index_method' => 'attachment', 'hidden' => true, ], + 'pdf_file_reminder' => [ + 'title' => 'pdf file', + 'type' => 'blobs', + 'widget' => 'downloads', + 'type_config' => [ + 'sortable' => false, + 'max_count' => 1, + ], + 'index_method' => 'attachment', + 'hidden' => true, + ], 'files' => [ 'title' => 'Files', 'type' => 'blobs', diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 99ca5e4054..e8ce2efa37 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -100,7 +100,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment // render pdf to tmp filename $pdf_builder->render($tmp_file); - $attachment = $this->get_attachment(false, $kind); //sucht nach 'pdf_file' + $attachment = $this->get_attachment(false, $kind); if ($attachment) { $attachment->name = $filename; $attachment->title = $this->invoice->get_label(); From 000e1aaf6a806a34a14f3e7fef7a2a6fdb1d2afc Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 12:34:48 +0100 Subject: [PATCH 05/31] remove superflous line --- lib/org/openpsa/invoices/handler/invoice/view.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 5fe1714066..9fc647d0c3 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -55,7 +55,6 @@ private function load_datamanager() : datamanager if ($this->_config->get('invoice_pdfbuilder_class')) { $schemadb->get('default')->get_field('pdf_file')['hidden'] = false; - $schemadb->get('default')->get_field('pdf_file_reminder')['hidden'] = false; } $dm = new datamanager($schemadb); From adccafb0d937383b38b690fa3822e4036ec5ebca Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 15:07:09 +0100 Subject: [PATCH 06/31] remove lacalization --- lib/midcom/admin/folder/locale/default.de.txt | 4 ---- lib/midcom/admin/folder/locale/default.en.txt | 3 --- 2 files changed, 7 deletions(-) diff --git a/lib/midcom/admin/folder/locale/default.de.txt b/lib/midcom/admin/folder/locale/default.de.txt index 947ca411eb..2c921d51e4 100644 --- a/lib/midcom/admin/folder/locale/default.de.txt +++ b/lib/midcom/admin/folder/locale/default.de.txt @@ -410,10 +410,6 @@ Adresse aus Kontaktdaten benutzen Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich ersetzt werden? ---STRINGEND ----STRING create_pdf -PDF erzeugen ----STRINGEND - ---STRING create_reminder Mahnung erzeugen ---STRINGEND diff --git a/lib/midcom/admin/folder/locale/default.en.txt b/lib/midcom/admin/folder/locale/default.en.txt index ef9909d96d..9645defd92 100644 --- a/lib/midcom/admin/folder/locale/default.en.txt +++ b/lib/midcom/admin/folder/locale/default.en.txt @@ -426,6 +426,3 @@ Could not create PDF Position ---STRINGEND ----STRING create_reminder -create reminder ----STRINGEND From e76d759981b85854275090a0851514ca39430cd9 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 15:12:21 +0100 Subject: [PATCH 07/31] add "create_reminder" to localization --- lib/midcom/admin/folder/locale/default.de.txt | 4 ++++ lib/midcom/admin/folder/locale/default.en.txt | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/midcom/admin/folder/locale/default.de.txt b/lib/midcom/admin/folder/locale/default.de.txt index 2c921d51e4..947ca411eb 100644 --- a/lib/midcom/admin/folder/locale/default.de.txt +++ b/lib/midcom/admin/folder/locale/default.de.txt @@ -410,6 +410,10 @@ Adresse aus Kontaktdaten benutzen Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich ersetzt werden? ---STRINGEND +---STRING create_pdf +PDF erzeugen +---STRINGEND + ---STRING create_reminder Mahnung erzeugen ---STRINGEND diff --git a/lib/midcom/admin/folder/locale/default.en.txt b/lib/midcom/admin/folder/locale/default.en.txt index 9645defd92..ef9909d96d 100644 --- a/lib/midcom/admin/folder/locale/default.en.txt +++ b/lib/midcom/admin/folder/locale/default.en.txt @@ -426,3 +426,6 @@ Could not create PDF Position ---STRINGEND +---STRING create_reminder +create reminder +---STRINGEND From 2d2e6add023b52522d36285e8fd21d48be2dfbc5 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 15:15:12 +0100 Subject: [PATCH 08/31] remove lacalization from admin folder --- lib/midcom/admin/folder/locale/default.de.txt | 4 ---- lib/midcom/admin/folder/locale/default.en.txt | 3 --- 2 files changed, 7 deletions(-) diff --git a/lib/midcom/admin/folder/locale/default.de.txt b/lib/midcom/admin/folder/locale/default.de.txt index 947ca411eb..ab8b723f76 100644 --- a/lib/midcom/admin/folder/locale/default.de.txt +++ b/lib/midcom/admin/folder/locale/default.de.txt @@ -414,10 +414,6 @@ Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich er PDF erzeugen ---STRINGEND ----STRING create_reminder -Mahnung erzeugen ----STRINGEND - ---STRING pdf created PDF-Datei wurde erfolgreich erzeugt ---STRINGEND diff --git a/lib/midcom/admin/folder/locale/default.en.txt b/lib/midcom/admin/folder/locale/default.en.txt index ef9909d96d..9645defd92 100644 --- a/lib/midcom/admin/folder/locale/default.en.txt +++ b/lib/midcom/admin/folder/locale/default.en.txt @@ -426,6 +426,3 @@ Could not create PDF Position ---STRINGEND ----STRING create_reminder -create reminder ----STRINGEND From ef788cacb2bd5a955e59c95706f434c4dffc961e Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 20 Mar 2024 15:24:08 +0100 Subject: [PATCH 09/31] repaired midgard l10n --- lib/midcom/admin/folder/locale/default.de.txt | 426 +++++------------ lib/midcom/admin/folder/locale/default.en.txt | 427 +++++------------- 2 files changed, 222 insertions(+), 631 deletions(-) diff --git a/lib/midcom/admin/folder/locale/default.de.txt b/lib/midcom/admin/folder/locale/default.de.txt index ab8b723f76..f2897b039f 100644 --- a/lib/midcom/admin/folder/locale/default.de.txt +++ b/lib/midcom/admin/folder/locale/default.de.txt @@ -2,426 +2,222 @@ ---VERSION 2.1.0 ---LANGUAGE de ----STRING account data -Kontodaten +---STRING author +Verfasser ---STRINGEND ----STRING account number -Konto-Nummer +---STRING authors +Verfasser ---STRINGEND ----STRING add new invoice item -Neue Rechnungsposition hinzufügen +---STRING by score +von Hand sortiert ---STRINGEND ----STRING all invoices -Alle Rechnungen +---STRING cancelled +Abgebrochen ---STRINGEND ----STRING all invoices for customer %s -Rechnungen des Kunden %s +---STRING could not save folder: %s +Ordner konnte nicht gespeichert werden. Ursache: %s ---STRINGEND ----STRING all invoices for deliverable %s -Rechnungen zur Bestellung %s +---STRING create folder +Ordner anlegen ---STRINGEND ----STRING amount -Betrag +---STRING create subfolder +Unterordner anlegen ---STRINGEND ----STRING bank code -BLZ +---STRING created +Erstellungszeit ---STRINGEND ----STRING basic information -Basisdaten +---STRING creator +Ersteller ---STRINGEND ----STRING billing data -Rechnungsdaten +---STRING default +Standard ---STRINGEND ----STRING canceled -Storniert +---STRING default sort order +Standard-Sortierreihenfolge ---STRINGEND ----STRING create invoice -Rechnung erstellen +---STRING delete folder +Ordner löschen ---STRINGEND ----STRING customer -Kunde +---STRING edit folder +Ordner bearbeiten ---STRINGEND ----STRING customer contact -Kundenkontakt +---STRING edit folder %s +Ordner "%s" bearbeiten ---STRINGEND ----STRING dashboard -Übersicht +---STRING edit folder metadata +Metadaten des Ordners bearbeiten ---STRINGEND ----STRING due -Fällig +---STRING edit layout template +Layout-Vorlage bearbeiten ---STRINGEND ----STRING due date -Fälligkeitsdatum +---STRING edit metadata +Metadaten bearbeiten ---STRINGEND ----STRING due on %s -Fällig am %s +---STRING edit metadata of %s +Metadaten von '%s' bearbeiten ---STRINGEND ----STRING edit invoice items -Rechnungspositionen bearbeiten +---STRING exported +Exportiert ---STRINGEND ----STRING failed to create invoice, reason -Rechnung konnte nicht erstellt werden. Ursache: +---STRING failed to create a new style template: %s +Neue Stilvorlage konnte nicht erstellt werden: %s ---STRINGEND ----STRING files -Dateien +---STRING folder created +Ordner erstellt ---STRINGEND ----STRING go to customer -Kunden anzeigen +---STRING folder page class +Ordner-Klasse ---STRINGEND ----STRING go to deliverable -Bestellung anzeigen +---STRING folder saved +Ordner gespeichert ---STRINGEND ----STRING invoice -Rechnung +---STRING folder type +Ordner-Typ ---STRINGEND ----STRING invoices -Rechnungen +---STRING folders first +Ordner zuerst ---STRINGEND ----STRING invoice address -Rechnungsadresse +---STRING hide from navigation +In der Navigation unsichtbar ---STRINGEND ----STRING invoice date -Rechnungsdatum +---STRING imported +Importiert ---STRINGEND ----STRING invoice delivery date -Lieferdatum +---STRING inherit style +Stilvorlage an Unterordner vererben ---STRINGEND ----STRING invoice %s created -Rechnung %s wurde erstellt +---STRING midcom.admin.folder +Ordnerverwaltung ---STRINGEND ----STRING invoice data -Rechnungsdaten +---STRING move +Verschieben ---STRINGEND ----STRING invoice has already been sent. should it be replaced? -Diese Rechnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? +---STRING move %s +Verschiebe %s ---STRINGEND ----STRING invoice items -Rechnungspositionen +---STRING moved %s to %s +%s wurde nach %s verschoben ---STRINGEND ----STRING invoice number -Rechnungsnummer +---STRING nav order +Reihenfolge der Navigationselemente ---STRINGEND ----STRING invoiceable reports -Abrechenbare Stundenberichte +---STRING new layout template +[Neue Stilvorlage] ---STRINGEND ----STRING invoicing information -Rechnungsdaten +---STRING new style created +Neue Stilvorlage wurde erstellt ---STRINGEND ----STRING cancelation invoice -Stornorechnung +---STRING no sortable elements found +keine sortierbaren Elemente gefunden ---STRINGEND ----STRING cancelation invoice for -Stornorechnung zu +---STRING order navigation +Navigationselemente anordnen ---STRINGEND ----STRING canceled by -Storniert durch +---STRING order navigation in folder %s +Navigationselemente im Ordner "%s" anordnen ---STRINGEND ----STRING invoice got canceled by %s -Rechnung wurde storniert durch %s +---STRING owner +Besitzer ---STRINGEND ----STRING invoice canceled on %s -Storniert am %s +---STRING pages first +Seiten zuerst ---STRINGEND ----STRING create_cancelation -stornieren +---STRING prevent entering +Zugriff verhindern ---STRINGEND ----STRING cancelation for invoice %s already exists -Für Rechnung %s liegt bereits eine Stornorechnung vor +---STRING privilege template_management +Stilvorlagen-Verwaltung ---STRINGEND ----STRING could not create cancelation for invoice %s -Für Rechnung %s konnte keine Stornorechnung erzeugt werden +---STRING privilege topic_management +Ordner-Verwaltung ---STRINGEND ----STRING cancelation for invoice %s, item %s -Storno zur Rechnung %s, Position %s +---STRING published +Veröffentlicht ---STRINGEND ----STRING mark_paid -bezahlt +---STRING revised +Letzte Bearbeitung ---STRINGEND ----STRING mark_sent -verschickt +---STRING revision +Revision ---STRINGEND ----STRING send_by_mail -Mail versenden +---STRING revisor +Revisor ---STRINGEND ----STRING marked invoice %s paid -Rechnung %s wurde als bezahlt markiert +---STRING schedule end +Anzeigen bis (für unbegrenzte Anzeige frei lassen) ---STRINGEND ----STRING marked invoice %s sent -Rechnung %s wurde als verschickt markiert +---STRING schedule start +Veröffentlichen am (für sofortige Veröffentlichung frei lassen) ---STRINGEND ----STRING marked invoice %s sent per mail -Rechnung %s wurde per E-Mail versendet +---STRING scheduling +Zeitgesteuerte Veröffentlichung ---STRINGEND ----STRING marked task "%s" finished -Aufgabe "%s" wurde als fertiggestellt markiert +---STRING select the ordering method first to sort the pages +Wählen Sie eine Sortiermethode, um die Seiten anzuordnen ---STRINGEND ----STRING name of bank -Name des Geldinstituts +---STRING size +Größe ---STRINGEND ----STRING next action -Nächste Aktion +---STRING style +Stilvorlage ---STRINGEND ----STRING no customer -Kein Kunde +---STRING style template +Stilvorlage ---STRINGEND ----STRING not paid -Nicht bezahlt ----STRINGEND - ----STRING open -Offen ----STRINGEND - ----STRING open invoices -Offene Rechnungen ----STRINGEND - ----STRING org.openpsa.invoices -Rechnungs-Tracking ----STRINGEND - ----STRING overdue -Überfällig ----STRINGEND - ----STRING overdue invoices -Überfällige Rechnungen ----STRINGEND - ----STRING overdue since %s -Überfällig seit %s ----STRINGEND - ----STRING paid -Bezahlt ----STRINGEND - ----STRING paid date -Zahlungsdatum ----STRINGEND - ----STRING paid invoices -Bezahlte Rechnungen ----STRINGEND - ----STRING paid on %s -Bezahlt am %s ----STRINGEND - ----STRING pdf file -PDF-Datei ----STRINGEND - ----STRING price -Preis ----STRINGEND - ----STRING project invoicing -Projekt-Abrechnung ----STRINGEND - ----STRING remarks -Anmerkungen ----STRINGEND - ----STRING quantity -Menge ----STRINGEND - ----STRING recipient -Empfänger ----STRINGEND - ----STRING recently paid invoices -Neueste Zahlungseingänge ----STRINGEND - ----STRING scheduled -Geplant ----STRINGEND - ----STRING scheduled invoices -Geplante Rechnungsläufe ----STRINGEND - ----STRING sent -Versanddatum ----STRINGEND - ----STRING sent date -Versanddatum ----STRINGEND - ----STRING sum -Summe ----STRINGEND - ----STRING sum including vat -Betrag inkl. MwSt ----STRINGEND - ----STRING sum excluding vat -Netto-Betrag ----STRINGEND - ----STRING totals -Gesamtsumme ----STRINGEND - ----STRING unable to deliver mail: %s -E-Mail konnte nicht verschickt werden: %s ----STRINGEND - ----STRING unsent -Unverschickt ----STRINGEND - ----STRING unsent invoices -Unverschickte Rechnungen ----STRINGEND - ----STRING vat -MwSt-Satz ----STRINGEND - ----STRING vat reg no -USt-ID. ----STRINGEND - ----STRING vat sum -MwSt-Betrag ----STRINGEND - ----STRING sending option -Versandmethode ----STRINGEND - ----STRING send per email -Per E-Mail ----STRINGEND - ----STRING send manually -Manuell ----STRINGEND - ----STRING tax identification number -Steuernummer ----STRINGEND - ----STRING payment target -Zahlungsziel (in Tagen) ----STRINGEND - ----STRING there is no invoice with number %s -Es gibt keine Rechnung mit der Nummer %s ----STRINGEND - ----STRING invoice was not found -Die Rechnung wurde nicht gefunden ----STRINGEND - ----STRING search title -Zeige Rechnung Nummer ----STRINGEND - ----STRING search -Suche ----STRINGEND - ----STRING goto -Zeige ----STRINGEND - ----STRING no invoice number was handed over -Es wurde keine Nummer zu einer Rechnung übergeben ----STRINGEND - ----STRING recalculate_by_reports -Neuberechnung mittels Stundenberichten ----STRINGEND - ----STRING price per unit -Stückpreis ----STRINGEND - ----STRING units -Stückzahl ----STRINGEND - ----STRING use contact address -Adresse aus Kontaktdaten benutzen ----STRINGEND - ----STRING current pdf file was manually uploaded shall it be replaced ? -Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich ersetzt werden? ----STRINGEND - ----STRING create_pdf -PDF erzeugen ----STRINGEND - ----STRING pdf created -PDF-Datei wurde erfolgreich erzeugt ----STRINGEND - ----STRING pdf creation failed -PDF-Datei konnte nicht erzeugt werden ----STRINGEND - ----STRING position -Position ----STRINGEND +---STRING objects with no navigation entry are still accessible on-site if the url is known +Objekte ohne Navigationseintrag sind weiterhin verfügbar, insofern die URL bekannt ist +---STRINGEND \ No newline at end of file diff --git a/lib/midcom/admin/folder/locale/default.en.txt b/lib/midcom/admin/folder/locale/default.en.txt index 9645defd92..b332e8fe2b 100644 --- a/lib/midcom/admin/folder/locale/default.en.txt +++ b/lib/midcom/admin/folder/locale/default.en.txt @@ -2,427 +2,222 @@ ---VERSION 2.1.0 ---LANGUAGE en ----STRING account data -Account data +---STRING author +Author ---STRINGEND ----STRING account number -Account number +---STRING authors +Authors ---STRINGEND ----STRING add new invoice item -Add a new invoice item +---STRING by score +Manually ordered ---STRINGEND ----STRING all invoices -All invoices +---STRING cancelled +Cancelled ---STRINGEND ----STRING all invoices for customer %s -All invoices for customer %s +---STRING could not save folder: %s +Could not save folder. Reason: %s ---STRINGEND ----STRING all invoices for deliverable %s -All invoices for deliverable %s +---STRING create folder +Create folder ---STRINGEND ----STRING amount -Amount +---STRING create subfolder +Create subfolder ---STRINGEND ----STRING bank code -Bankcode +---STRING created +Created ---STRINGEND ----STRING basic information -Basic information +---STRING creator +Creator ---STRINGEND ----STRING billing data -Billing data +---STRING default +Default ---STRINGEND ----STRING create invoice -Create invoice +---STRING default sort order +Default sort order ---STRINGEND ----STRING customer -Customer +---STRING delete folder +Delete folder ---STRINGEND ----STRING customer contact -Customer contact +---STRING edit folder +Edit folder ---STRINGEND ----STRING dashboard -Dashboard +---STRING edit folder %s +Edit folder "%s" ---STRINGEND ----STRING due -Due date +---STRING edit folder metadata +Edit folder metadata ---STRINGEND ----STRING due date -Due date +---STRING edit layout template +Edit layout template ---STRINGEND ----STRING due on %s -Due on %s +---STRING edit metadata +Edit metadata ---STRINGEND ----STRING edit invoice items -Edit invoice items +---STRING edit metadata of %s +Edit metadata of '%s' ---STRINGEND ----STRING failed to create invoice, reason -Failed to create invoice, reason +---STRING exported +Exported ---STRINGEND ----STRING files -Files +---STRING failed to create a new style template: %s +Failed to create a new style template: %s ---STRINGEND ----STRING go to customer -Go to customer +---STRING folder created +Folder created ---STRINGEND ----STRING go to deliverable -Go to deliverable +---STRING folder page class +Folder's class ---STRINGEND ----STRING search title -Go to invoice number +---STRING folder saved +Folder saved ---STRINGEND ----STRING goto -goto +---STRING folder type +Folder type ---STRINGEND ----STRING invoice -Invoice +---STRING folders first +Folder first ---STRINGEND ----STRING invoices -Invoices +---STRING hide from navigation +Hide from navigation ---STRINGEND ----STRING invoice address -Invoice address +---STRING imported +Imported ---STRINGEND ----STRING invoice date -Invoice date +---STRING inherit style +Inherit template to subfolders ---STRINGEND ----STRING invoice delivery date -Delivery date +---STRING midcom.admin.folder +Folder management ---STRINGEND ----STRING invoice %s created -Invoice %s created +---STRING move +Move ---STRINGEND ----STRING invoice data -Invoice data +---STRING move %s +Move %s ---STRINGEND ----STRING invoice has already been sent. should it be replaced? -This invoice has already been sent. Should the file be regenerated anyways? +---STRING moved %s to %s +moved %s to %s ---STRINGEND ----STRING invoice items -Invoice items +---STRING nav order +Order of navigation items ---STRINGEND ----STRING invoice number -Invoice number +---STRING new layout template +[New layout template] ---STRINGEND ----STRING invoice was not found -The invoice was not found +---STRING new style created +New style created ---STRINGEND ----STRING invoiceable reports -Billable Reports +---STRING no sortable elements found +No sortable elements found ---STRINGEND ----STRING invoicing information -Invoicing information +---STRING order navigation +Arrange navigation items ---STRINGEND ----STRING canceled -Canceled +---STRING order navigation in folder %s +Arrange navigation under folder "%s" ---STRINGEND ----STRING cancelation invoice -Cancelation invoice +---STRING owner +Owner ---STRINGEND ----STRING cancelation invoice for -This is the cancelation for +---STRING pages first +Pages first ---STRINGEND ----STRING create_cancelation -Create cancelation +---STRING prevent entering +Prevent entering ---STRINGEND ----STRING cancelation for invoice %s already exists -Invoice %s has already been canceled +---STRING privilege template_management +Layout template management ---STRINGEND ----STRING could not create cancelation for invoice %s -Failed to create cancelation for invoice %s +---STRING privilege topic_management +Folder management ---STRINGEND ----STRING cancelation for invoice %s, item %s -Cancelation for invoice %s, item %s +---STRING published +Published ---STRINGEND ----STRING canceled by -Canceled by +---STRING revised +Revised ---STRINGEND ----STRING invoice got canceled by %s -Invoice was canceled by %s +---STRING revision +Revision ---STRINGEND ----STRING mark_paid -Mark paid +---STRING revisor +Revisor ---STRINGEND ----STRING mark_sent -Mark sent +---STRING schedule end +Display until (leave empty for unlimited display) ---STRINGEND ----STRING send_by_mail -send by mail +---STRING schedule start +Publish at (leave empty for immediate publication) ---STRINGEND ----STRING marked invoice %s paid -Marked invoice %s as paid +---STRING scheduling +Scheduling ---STRINGEND ----STRING marked invoice %s sent -Marked invoice %s as sent +---STRING select the ordering method first to sort the pages +Select the ordering method first to sort the pages ---STRINGEND ----STRING marked invoice %s sent per mail -Sent invoice %s per mail +---STRING size +Size ---STRINGEND ----STRING marked task "%s" finished -Marked task "%s" as finished +---STRING style +Style template ---STRINGEND ----STRING name of bank -Name of institute ----STRINGEND - ----STRING next action -Next Action ----STRINGEND - ----STRING no customer -No customer ----STRINGEND - ----STRING no invoice number was handed over -No invoice number was handed over ----STRINGEND - ----STRING not paid -Not paid ----STRINGEND - ----STRING open -Open ----STRINGEND - ----STRING open invoices -Open invoices ----STRINGEND - ----STRING org.openpsa.invoices -Invoice tracking ----STRINGEND - ----STRING overdue -Overdue ----STRINGEND - ----STRING overdue invoices -Overdue invoices ----STRINGEND - ----STRING overdue since %s -Overdue since %s ----STRINGEND - ----STRING recipient -Recipient ----STRINGEND - ----STRING paid -paid ----STRINGEND - ----STRING paid date -Paid date ----STRINGEND - ----STRING paid invoices -Paid invoices ----STRINGEND - ----STRING paid on %s -Paid on %s ----STRINGEND - ----STRING pdf file -PDF file ----STRINGEND - ----STRING price -Price ----STRINGEND - ----STRING project invoicing -Project invoicing ----STRINGEND - ----STRING quantity -Quantity ----STRINGEND - ----STRING recently paid invoices -Recently paid invoices ----STRINGEND - ----STRING remarks -Remarks ----STRINGEND - ----STRING scheduled -Scheduled ----STRINGEND - ----STRING scheduled invoices -Scheduled invoices ----STRINGEND - ----STRING search -search ----STRINGEND - ----STRING sent -Sending date ----STRINGEND - ----STRING sent date -Sent date ----STRINGEND - ----STRING sum -Sum ----STRINGEND - ----STRING sum including vat -Sum including VAT ----STRINGEND - ----STRING sum excluding vat -Sum (excl. VAT) ----STRINGEND - ----STRING tax identification number -Taxpayer identification number ----STRINGEND - ----STRING payment target -Payment target (in days) ----STRINGEND - ----STRING there is no invoice with number %s -There is no invoice with number %s ----STRINGEND - ----STRING totals -Totals ----STRINGEND - ----STRING unable to deliver mail: %s -Unable to deliver mail: %s ----STRINGEND - ----STRING unsent -Unsent ----STRINGEND - ----STRING unsent invoices -Unsent invoices ----STRINGEND - ----STRING vat -VAT ----STRINGEND - ----STRING vat reg no -VAT registration number ----STRINGEND - ----STRING vat sum -VAT amount ----STRINGEND - ----STRING sending option -How to send? ----STRINGEND - ----STRING send per email -By email ----STRINGEND - ----STRING send manually -Manually ----STRINGEND - ----STRING recalculate_by_reports -Recalculate by hour-reports ----STRINGEND - ----STRING invoice canceled on %s -Canceled on %s ----STRINGEND - ----STRING price per unit -Price per unit ----STRINGEND - ----STRING units -Units ----STRINGEND - ----STRING use contact address -Use the address given in contact ----STRINGEND - ----STRING current pdf file was manually uploaded shall it be replaced ? -The current PDF file was manually uploaded. So shall it really be replaced ? ----STRINGEND - ----STRING create_pdf -Create PDF ----STRINGEND - ----STRING pdf created -PDF file created successfully ----STRINGEND - ----STRING pdf creation failed -Could not create PDF ----STRINGEND - ----STRING position -Position +---STRING style template +Style template ---STRINGEND +---STRING objects with no navigation entry are still accessible on-site if the url is known +Objects that are hidden from navigation are still accessible on-site if the URL is known +---STRINGEND \ No newline at end of file From 1bcc2558b39f5b894bdda70790bd86f28340fde9 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Thu, 21 Mar 2024 11:58:32 +0100 Subject: [PATCH 10/31] make class name dynamic --- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index e8ce2efa37..f5df66836f 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -72,7 +72,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment if($kind == null) { $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); }else { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_reminder'); + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_' . $kind); } if (!class_exists($client_class)) { From e12885a8bf02cdbef073c6f2e6e720d9811c6f28 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Thu, 21 Mar 2024 15:37:42 +0100 Subject: [PATCH 11/31] add typehint to get_attachment --- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index f5df66836f..3f62b152d4 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -21,7 +21,7 @@ public function __construct(org_openpsa_invoices_invoice_dba $invoice) $this->invoice = $invoice; } - public function get_attachment(bool $autocreate = false, $kind = null) : ?midcom_db_attachment + public function get_attachment(bool $autocreate = false, string $kind = null) : ?midcom_db_attachment { if ($kind == 'reminder') { $pdf_files = blobs::get_attachments($this->invoice, "pdf_file_reminder"); From 7a6b8edbd45874081416ca2518d8987d72fd803b Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Thu, 21 Mar 2024 16:11:01 +0100 Subject: [PATCH 12/31] hide button, when not needed / codingstyle --- lib/org/openpsa/invoices/handler/invoice/view.php | 15 ++++++++------- lib/org/openpsa/invoices/invoice/pdf.php | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 9fc647d0c3..3e984e19ee 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -32,7 +32,7 @@ public function _handler_read(string $guid, array &$data) $data['object_view'] = $dm->get_content_html(); $data['invoice_items'] = $this->invoice->get_invoice_items(); - $this->populate_toolbar(); + $this->populate_toolbar($this->invoice); $this->update_breadcrumb(); midcom::get()->metadata->set_request_metadata($this->invoice->metadata->revised, $guid); @@ -61,7 +61,7 @@ private function load_datamanager() : datamanager return $dm->set_storage($this->invoice); } - private function populate_toolbar() + private function populate_toolbar($invoice) { $buttons = []; if ($this->invoice->can_do('midgard:update')) { @@ -96,11 +96,12 @@ private function populate_toolbar() && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } - - $button = $this->build_button('create_reminder', 'file-pdf-o'); - $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); - $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); - $buttons[] = $button; + if ($invoice->due > date("Y-m-d") ) { + $button = $this->build_button('create_reminder', 'file-pdf-o'); + $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); + $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); + $buttons[] = $button; + } } if ($this->invoice->is_cancelable()) { diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 3f62b152d4..cb03a1119d 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -69,9 +69,9 @@ public function get_button_options() : array public function render_and_attach(string $kind = null) : midcom_db_attachment { - if($kind == null) { + if ($kind == null) { $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); - }else { + } else { $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_' . $kind); } From 6374582e3f2e2100998b8819c1d72b1e49530d54 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Fri, 22 Mar 2024 09:46:50 +0100 Subject: [PATCH 13/31] reminder button appers after 14 days --- lib/org/openpsa/invoices/handler/invoice/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 3e984e19ee..d2140661f1 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -96,7 +96,7 @@ private function populate_toolbar($invoice) && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } - if ($invoice->due > date("Y-m-d") ) { + if ((new datetime(date($this->_l10n_midcom->get('short date'), $invoice->deliverydate)))->modify("+14 days") > date("Y-m-d") ) { $button = $this->build_button('create_reminder', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); From e2c5b0027c4824ea7cfd5265648aa5ff09c144b7 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Fri, 22 Mar 2024 10:54:43 +0100 Subject: [PATCH 14/31] use overdue for status --- lib/org/openpsa/invoices/handler/invoice/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index d2140661f1..30f11f1d10 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -96,7 +96,7 @@ private function populate_toolbar($invoice) && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } - if ((new datetime(date($this->_l10n_midcom->get('short date'), $invoice->deliverydate)))->modify("+14 days") > date("Y-m-d") ) { + if ($invoice->get_status() == 'overdue') { $button = $this->build_button('create_reminder', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); From d49b802b5a319eb08ade296d5de8f9d72bc0e4a2 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 25 Mar 2024 11:45:30 +0100 Subject: [PATCH 15/31] remove $invoice variable /change reminder classname --- lib/org/openpsa/invoices/handler/invoice/view.php | 4 ++-- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index 30f11f1d10..db724582df 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -61,7 +61,7 @@ private function load_datamanager() : datamanager return $dm->set_storage($this->invoice); } - private function populate_toolbar($invoice) + private function populate_toolbar() { $buttons = []; if ($this->invoice->can_do('midgard:update')) { @@ -96,7 +96,7 @@ private function populate_toolbar($invoice) && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } - if ($invoice->get_status() == 'overdue') { + if ($this->_config->get('invoice_pdfbuilder_reminder_class') && $this->invoice->get_status() == 'overdue') { $button = $this->build_button('create_reminder', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index cb03a1119d..58e190ef0b 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -72,7 +72,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment if ($kind == null) { $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class'); } else { - $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_class_' . $kind); + $client_class = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('invoice_pdfbuilder_' . $kind . '_class'); } if (!class_exists($client_class)) { From 6b24e4c0fcbee0fd13f2e04cf52b9f35d9245283 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 25 Mar 2024 11:54:06 +0100 Subject: [PATCH 16/31] change seccess / error message reminder pdf creation --- lib/org/openpsa/invoices/handler/invoice/action.php | 4 ++-- lib/org/openpsa/invoices/locale/default.de.txt | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/action.php b/lib/org/openpsa/invoices/handler/invoice/action.php index c254fb9dbc..c7c975ae4f 100644 --- a/lib/org/openpsa/invoices/handler/invoice/action.php +++ b/lib/org/openpsa/invoices/handler/invoice/action.php @@ -135,9 +135,9 @@ public function _handler_create_pdf_reminder() $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); try { $pdf_helper->render_and_attach('reminder'); - return $this->reply(true, $this->_l10n->get('pdf created')); + return $this->reply(true, $this->_l10n->get('reminder pdf created')); } catch (midcom_error $e) { - return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); + return $this->reply(false, $this->_l10n->get('reminder pdf creation failed') . ': ' . $e->getMessage()); } } diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index 947ca411eb..aed122921f 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -422,10 +422,18 @@ Mahnung erzeugen PDF-Datei wurde erfolgreich erzeugt ---STRINGEND +---STRING reminder pdf created +Mahnungs PDF-Datei wurde erfolgreich erzeugt +---STRINGEND + ---STRING pdf creation failed PDF-Datei konnte nicht erzeugt werden ---STRINGEND +---STRING reminder pdf creation failed +Mahnungs PDF-Datei konnte nicht erzeugt werden +---STRINGEND + ---STRING position Position ---STRINGEND From c059462578bcbc89470a13397c51cf1ae8bc53cc Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 25 Mar 2024 13:11:56 +0100 Subject: [PATCH 17/31] change config /remove lacalization --- lib/org/openpsa/invoices/config/config.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/org/openpsa/invoices/config/config.inc b/lib/org/openpsa/invoices/config/config.inc index ed5286f806..89280cd79d 100644 --- a/lib/org/openpsa/invoices/config/config.inc +++ b/lib/org/openpsa/invoices/config/config.inc @@ -7,6 +7,7 @@ 'invoice_number_format' => '#%06d', //contains the class file to create the pdf for the invoice, if set to false pdf-creation is disabled 'invoice_pdfbuilder_class' => false, //implements org_openpsa_invoices_interfaces_pdfbuilder +'invoice_pdfbuilder_reminder_class' => false, 'invoice_mail_bcc' => false, 'invoice_mail_from_address' => 'foo@example.org', From 9072a3a3c6a22b8e151accf50c461c77fa5d9401 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 25 Mar 2024 15:25:58 +0100 Subject: [PATCH 18/31] change dialog window on reminder re-creation --- lib/org/openpsa/invoices/handler/invoice/view.php | 2 +- lib/org/openpsa/invoices/invoice/pdf.php | 10 +++++++--- lib/org/openpsa/invoices/locale/default.de.txt | 4 ++++ lib/org/openpsa/invoices/locale/default.en.txt | 12 ++++++++---- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index db724582df..d4066f3b96 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -99,7 +99,7 @@ private function populate_toolbar() if ($this->_config->get('invoice_pdfbuilder_reminder_class') && $this->invoice->get_status() == 'overdue') { $button = $this->build_button('create_reminder', 'file-pdf-o'); $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); - $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options(); + $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options('reminder'); $buttons[] = $button; } } diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 58e190ef0b..9a560f84e1 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -37,17 +37,21 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : return $this->render_and_attach(); } - public function get_button_options() : array + public function get_button_options(string $kind = null) : array { if ($attachment = $this->get_attachment()) { if ($this->invoice->sent) { - $message = 'invoice has already been sent. should it be replaced?'; + if ($kind == 'reminder') { + $message = 'reminder has already been sent. should it be replaced?'; + } else { + $message = 'invoice has already been sent. should it be replaced?'; + } } // check if auto generated parameter is same as md5 in current-file // if not the file was manually uploaded elseif ($checksum = $attachment->get_parameter('org.openpsa.invoices', 'auto_generated')) { if ($checksum !== md5_file($attachment->get_path())) { - $message = 'current pdf file was manually uploaded shall it be replaced ?'; + $message = 'current pdf file was manually uploaded shall it be replaced ?'; } } } diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index aed122921f..988fbf10d0 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -126,6 +126,10 @@ Rechnungsdaten Diese Rechnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? ---STRINGEND +---STRING reminder has already been sent. should it be replaced? +Diese Mahnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? +---STRINGEND + ---STRING invoice items Rechnungspositionen ---STRINGEND diff --git a/lib/org/openpsa/invoices/locale/default.en.txt b/lib/org/openpsa/invoices/locale/default.en.txt index 0c08c365db..138dde7440 100644 --- a/lib/org/openpsa/invoices/locale/default.en.txt +++ b/lib/org/openpsa/invoices/locale/default.en.txt @@ -46,10 +46,6 @@ Billing data Create invoice ---STRINGEND ----STRING create_reminder -Create reminder ----STRINGEND - ---STRING customer Customer ---STRINGEND @@ -134,6 +130,10 @@ Invoice data This invoice has already been sent. Should the file be regenerated anyways? ---STRINGEND +---STRING reminder has already been sent. should it be replaced? +This reminder has already been sent. Should the file be regenerated anyways? +---STRINGEND + ---STRING invoice items Invoice items ---STRINGEND @@ -429,3 +429,7 @@ Could not create PDF ---STRING position Position ---STRINGEND + +---STRING create_reminder +create reminder +---STRINGEND From ff1df3ef3bc572e5df0b88155174881e988b75f3 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 25 Mar 2024 16:28:56 +0100 Subject: [PATCH 19/31] remove 'kind switch' --- lib/org/openpsa/invoices/invoice/pdf.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 9a560f84e1..3765683af0 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -37,15 +37,11 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : return $this->render_and_attach(); } - public function get_button_options(string $kind = null) : array + public function get_button_options(string $kind = 'invoice') : array { if ($attachment = $this->get_attachment()) { if ($this->invoice->sent) { - if ($kind == 'reminder') { - $message = 'reminder has already been sent. should it be replaced?'; - } else { - $message = 'invoice has already been sent. should it be replaced?'; - } + $message = $kind . ' has already been sent. should it be replaced?'; } // check if auto generated parameter is same as md5 in current-file // if not the file was manually uploaded From 7b987a9cc3739edecc2cb7636450acd42900ef9b Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Tue, 26 Mar 2024 12:18:58 +0100 Subject: [PATCH 20/31] remove "has alredy sent" message for overdue reminder --- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 3765683af0..9f628d2576 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -40,7 +40,7 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : public function get_button_options(string $kind = 'invoice') : array { if ($attachment = $this->get_attachment()) { - if ($this->invoice->sent) { + if ($this->invoice->sent && (!($kind == 'reminder' && $this->invoice->get_status() == 'overdue'))) { $message = $kind . ' has already been sent. should it be replaced?'; } // check if auto generated parameter is same as md5 in current-file From f0c7a80bb1b1ef8033d98e7390e182ba7c298e86 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Tue, 26 Mar 2024 12:55:47 +0100 Subject: [PATCH 21/31] include reminder view --- lib/org/openpsa/invoices/style/admin-read.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/org/openpsa/invoices/style/admin-read.php b/lib/org/openpsa/invoices/style/admin-read.php index e21f15ab81..c2c12f936f 100644 --- a/lib/org/openpsa/invoices/style/admin-read.php +++ b/lib/org/openpsa/invoices/style/admin-read.php @@ -124,6 +124,10 @@

get('pdf file'); ?>

+

get('pdf file'); ?>

+ Date: Tue, 26 Mar 2024 15:55:29 +0100 Subject: [PATCH 22/31] remove nested if from populate_toolbar() --- lib/org/openpsa/invoices/handler/invoice/view.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index d4066f3b96..dfc4ddd273 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -96,12 +96,13 @@ private function populate_toolbar() && intval($billing_data->sendingoption) == 2) { $buttons[] = $this->build_button('send_by_mail', 'paper-plane'); } - if ($this->_config->get('invoice_pdfbuilder_reminder_class') && $this->invoice->get_status() == 'overdue') { - $button = $this->build_button('create_reminder', 'file-pdf-o'); - $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); - $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options('reminder'); - $buttons[] = $button; - } + } + + if ($this->_config->get('invoice_pdfbuilder_reminder_class') && $this->invoice->get_status() == 'overdue') { + $button = $this->build_button('create_reminder', 'file-pdf-o'); + $pdf_helper = new org_openpsa_invoices_invoice_pdf($this->invoice); + $button[MIDCOM_TOOLBAR_OPTIONS] = $pdf_helper->get_button_options('reminder'); + $buttons[] = $button; } if ($this->invoice->is_cancelable()) { From 03299558b3be787ca84abb57ef86a8f97ad7033b Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 27 Mar 2024 12:57:14 +0100 Subject: [PATCH 23/31] add l10n to filename --- lib/org/openpsa/invoices/invoice/pdf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 9f628d2576..076b827adc 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -87,9 +87,10 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment } // renders the pdf and attaches it to the invoice $pdf_builder = new $client_class($this->invoice); + $l10n = midcom::get()->i18n->get_l10n('org.openpsa.invoices'); if ($kind == 'reminder') { $name = "guids_pdf_file_reminder"; - $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '_reminder' . '.pdf'; + $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '_' . $l10n->get('reminder') . '.pdf'; } else { $name = "guids_pdf_file"; $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '.pdf'; From 355331564195b29edda843ec50fedafc5dab41d1 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Tue, 2 Apr 2024 16:36:32 +0200 Subject: [PATCH 24/31] coding style / remove $kind variable / change l10n --- lib/org/openpsa/invoices/handler/invoice/view.php | 2 +- lib/org/openpsa/invoices/invoice/pdf.php | 6 +++--- lib/org/openpsa/invoices/locale/default.de.txt | 4 ---- lib/org/openpsa/invoices/locale/default.en.txt | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/org/openpsa/invoices/handler/invoice/view.php b/lib/org/openpsa/invoices/handler/invoice/view.php index dfc4ddd273..226caa8d40 100644 --- a/lib/org/openpsa/invoices/handler/invoice/view.php +++ b/lib/org/openpsa/invoices/handler/invoice/view.php @@ -32,7 +32,7 @@ public function _handler_read(string $guid, array &$data) $data['object_view'] = $dm->get_content_html(); $data['invoice_items'] = $this->invoice->get_invoice_items(); - $this->populate_toolbar($this->invoice); + $this->populate_toolbar(); $this->update_breadcrumb(); midcom::get()->metadata->set_request_metadata($this->invoice->metadata->revised, $guid); diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index 076b827adc..cee033e414 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -40,14 +40,14 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : public function get_button_options(string $kind = 'invoice') : array { if ($attachment = $this->get_attachment()) { - if ($this->invoice->sent && (!($kind == 'reminder' && $this->invoice->get_status() == 'overdue'))) { - $message = $kind . ' has already been sent. should it be replaced?'; + if ($this->invoice->sent && (!($kind == 'reminder'))) { + $message = 'invoice has already been sent. should it be replaced?'; } // check if auto generated parameter is same as md5 in current-file // if not the file was manually uploaded elseif ($checksum = $attachment->get_parameter('org.openpsa.invoices', 'auto_generated')) { if ($checksum !== md5_file($attachment->get_path())) { - $message = 'current pdf file was manually uploaded shall it be replaced ?'; + $message = 'current pdf file was manually uploaded shall it be replaced ?'; } } } diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index 988fbf10d0..aed122921f 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -126,10 +126,6 @@ Rechnungsdaten Diese Rechnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? ---STRINGEND ----STRING reminder has already been sent. should it be replaced? -Diese Mahnung wurde bereits verschickt. Soll die Datei trotzdem neu erzeugt werden? ----STRINGEND - ---STRING invoice items Rechnungspositionen ---STRINGEND diff --git a/lib/org/openpsa/invoices/locale/default.en.txt b/lib/org/openpsa/invoices/locale/default.en.txt index 138dde7440..ef9909d96d 100644 --- a/lib/org/openpsa/invoices/locale/default.en.txt +++ b/lib/org/openpsa/invoices/locale/default.en.txt @@ -130,10 +130,6 @@ Invoice data This invoice has already been sent. Should the file be regenerated anyways? ---STRINGEND ----STRING reminder has already been sent. should it be replaced? -This reminder has already been sent. Should the file be regenerated anyways? ----STRINGEND - ---STRING invoice items Invoice items ---STRINGEND From 4179a8c717070de4caaa629604da486faa72f86c Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Tue, 2 Apr 2024 16:42:56 +0200 Subject: [PATCH 25/31] change label name to reminder --- lib/org/openpsa/invoices/style/admin-read.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/style/admin-read.php b/lib/org/openpsa/invoices/style/admin-read.php index c2c12f936f..5a3295d26a 100644 --- a/lib/org/openpsa/invoices/style/admin-read.php +++ b/lib/org/openpsa/invoices/style/admin-read.php @@ -125,7 +125,7 @@ -

get('pdf file'); ?>

+

get('reminder'); ?>

Date: Tue, 2 Apr 2024 16:52:13 +0200 Subject: [PATCH 26/31] remove bracelets --- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index cee033e414..c74b1f0537 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -40,7 +40,7 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : public function get_button_options(string $kind = 'invoice') : array { if ($attachment = $this->get_attachment()) { - if ($this->invoice->sent && (!($kind == 'reminder'))) { + if ($this->invoice->sent && !($kind == 'reminder')) { $message = 'invoice has already been sent. should it be replaced?'; } // check if auto generated parameter is same as md5 in current-file From a2445c601bbdf7db9c2625d792795b6808450f92 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Wed, 3 Apr 2024 08:50:13 +0200 Subject: [PATCH 27/31] add reminder to l10n --- lib/org/openpsa/invoices/locale/default.de.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index aed122921f..1d00a69640 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -414,6 +414,10 @@ Die derzeitige PDF-Datei wurde manuell hochgeladen. Soll diese Datei wirklich er PDF erzeugen ---STRINGEND +---STRING reminder +Mahnung +---STRINGEND + ---STRING create_reminder Mahnung erzeugen ---STRINGEND From 630d85a077ac6e843d2d1c6731f0e3e0fdf5fe00 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Thu, 4 Apr 2024 14:56:31 +0200 Subject: [PATCH 28/31] change Mahnung to mahnung. --- lib/org/openpsa/invoices/locale/default.de.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index 1d00a69640..576fd91957 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -415,7 +415,7 @@ PDF erzeugen ---STRINGEND ---STRING reminder -Mahnung +mahnung ---STRINGEND ---STRING create_reminder From 764d7a942185dbd7c6e54ab2da80fc4ecde41b29 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 8 Apr 2024 10:50:57 +0200 Subject: [PATCH 29/31] change: title/spelling/logic --- lib/org/openpsa/invoices/config/schemadb_default.inc | 2 +- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- lib/org/openpsa/invoices/locale/default.de.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/org/openpsa/invoices/config/schemadb_default.inc b/lib/org/openpsa/invoices/config/schemadb_default.inc index 5d8456207a..6b24a39f95 100644 --- a/lib/org/openpsa/invoices/config/schemadb_default.inc +++ b/lib/org/openpsa/invoices/config/schemadb_default.inc @@ -164,7 +164,7 @@ 'hidden' => true, ], 'pdf_file_reminder' => [ - 'title' => 'pdf file', + 'title' => 'reminder', 'type' => 'blobs', 'widget' => 'downloads', 'type_config' => [ diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index c74b1f0537..fdbac2f1e3 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -40,7 +40,7 @@ public function get_attachment(bool $autocreate = false, string $kind = null) : public function get_button_options(string $kind = 'invoice') : array { if ($attachment = $this->get_attachment()) { - if ($this->invoice->sent && !($kind == 'reminder')) { + if ($this->invoice->sent && $kind != 'reminder') { $message = 'invoice has already been sent. should it be replaced?'; } // check if auto generated parameter is same as md5 in current-file diff --git a/lib/org/openpsa/invoices/locale/default.de.txt b/lib/org/openpsa/invoices/locale/default.de.txt index 576fd91957..1d00a69640 100644 --- a/lib/org/openpsa/invoices/locale/default.de.txt +++ b/lib/org/openpsa/invoices/locale/default.de.txt @@ -415,7 +415,7 @@ PDF erzeugen ---STRINGEND ---STRING reminder -mahnung +Mahnung ---STRINGEND ---STRING create_reminder From 428c1934fa898c3790f127b768e43b22a8223c25 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Mon, 8 Apr 2024 12:08:44 +0200 Subject: [PATCH 30/31] change mahnung lcfirst --- lib/org/openpsa/invoices/invoice/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org/openpsa/invoices/invoice/pdf.php b/lib/org/openpsa/invoices/invoice/pdf.php index fdbac2f1e3..9e7923e7e3 100644 --- a/lib/org/openpsa/invoices/invoice/pdf.php +++ b/lib/org/openpsa/invoices/invoice/pdf.php @@ -90,7 +90,7 @@ public function render_and_attach(string $kind = null) : midcom_db_attachment $l10n = midcom::get()->i18n->get_l10n('org.openpsa.invoices'); if ($kind == 'reminder') { $name = "guids_pdf_file_reminder"; - $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '_' . $l10n->get('reminder') . '.pdf'; + $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '_' . lcfirst($l10n->get('reminder')) . '.pdf'; } else { $name = "guids_pdf_file"; $filename = midcom_helper_misc::urlize($this->invoice->get_label()) . '.pdf'; From e7dab81a52df803ae9fb061001a381b28b3b5ff3 Mon Sep 17 00:00:00 2001 From: Simon Rautenberg Date: Tue, 9 Apr 2024 11:21:17 +0200 Subject: [PATCH 31/31] add test --- .../invoices/handler/invoice/actionTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/org/openpsa/invoices/handler/invoice/actionTest.php b/test/org/openpsa/invoices/handler/invoice/actionTest.php index 664be192d5..8eabd086fa 100644 --- a/test/org/openpsa/invoices/handler/invoice/actionTest.php +++ b/test/org/openpsa/invoices/handler/invoice/actionTest.php @@ -101,6 +101,23 @@ public function testHandler_create_pdf() midcom::get()->auth->drop_sudo(); } + public function testHandler_create_reminder() + { + midcom::get()->auth->request_sudo('org.openpsa.invoices'); + + $topic = $this->create_object(midcom_db_topic::class, ['component' => 'org.openpsa.invoices']); + $topic->set_parameter('org.openpsa.invoices', 'invoice_pdfbuilder_reminder_class', 'nonexistent'); + $_SERVER['REQUEST_METHOD'] = 'POST'; + $_POST = [ + 'id' => self::$_invoice->id, + 'relocate' => true + ]; + $url = $this->run_relocate_handler($topic, ['invoice', 'action', 'create_reminder']); + $this->assertEquals('invoice/' . self::$_invoice->guid . '/', $url); + + midcom::get()->auth->drop_sudo(); + } + public function testHandler_mark_sent() { midcom::get()->auth->request_sudo('org.openpsa.invoices');