From 3f30621bae16448bfb8f8fc35e666e263c71418b Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:59:49 +0200 Subject: [PATCH] Further fix on invoices --- cp/app/Controllers/FinancialsController.php | 11 +++++++++++ cp/resources/views/admin/financials/viewInvoice.twig | 9 ++++----- database/registry.mariadb.sql | 7 ++++++- database/registry.postgres.sql | 7 ++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/cp/app/Controllers/FinancialsController.php b/cp/app/Controllers/FinancialsController.php index 31ba0ba..41c3a3a 100644 --- a/cp/app/Controllers/FinancialsController.php +++ b/cp/app/Controllers/FinancialsController.php @@ -43,6 +43,12 @@ class FinancialsController extends Controller $billing = $db->selectRow('SELECT * FROM registrar_contact WHERE id = ?', [ $invoice_details['billing_contact_id'] ] ); + $company_name = $db->selectValue("SELECT value FROM settings WHERE name = 'company_name'"); + $address = $db->selectValue("SELECT value FROM settings WHERE name = 'address'"); + $address2 = $db->selectValue("SELECT value FROM settings WHERE name = 'address2'"); + $phone = $db->selectValue("SELECT value FROM settings WHERE name = 'phone'"); + $email = $db->selectValue("SELECT value FROM settings WHERE name = 'email'"); + $issueDate = new \DateTime($invoice_details['issue_date']); $firstDayPrevMonth = (clone $issueDate)->modify('first day of last month')->format('Y-m-d'); $lastDayPrevMonth = (clone $issueDate)->modify('last day of last month')->format('Y-m-d'); @@ -54,6 +60,11 @@ class FinancialsController extends Controller 'invoice_details' => $invoice_details, 'billing' => $billing, 'statement' => $statement, + 'company_name' => $company_name, + 'address' => $address, + 'address2' => $address2, + 'phone' => $phone, + 'email' => $email, 'currentUri' => $uri ]); diff --git a/cp/resources/views/admin/financials/viewInvoice.twig b/cp/resources/views/admin/financials/viewInvoice.twig index 2f42022..553f339 100644 --- a/cp/resources/views/admin/financials/viewInvoice.twig +++ b/cp/resources/views/admin/financials/viewInvoice.twig @@ -33,16 +33,15 @@

Provider / Registry

- Street Address
- State, City
- Region, Postal Code
- ltd@example.com + {{ company_name }}
+ {{ address }}
+ {{ address2 }}
+ {{ email }}

Client / Registrar

- {{ billing.first_name }} {{ billing.last_name }}
{{ billing.org }}
{{ billing.street1 }}
{{ billing.city }}, {{ billing.sp }}
diff --git a/database/registry.mariadb.sql b/database/registry.mariadb.sql index 02f5d6b..868d31d 100644 --- a/database/registry.mariadb.sql +++ b/database/registry.mariadb.sql @@ -696,7 +696,12 @@ INSERT INTO `registry`.`settings` (`name`, `value`) VALUES ('dns-udp-queries-responded', '0'), ('searchable-whois-queries', '0'), ('web-whois-queries', '0'), -('whois-43-queries', '0'); +('whois-43-queries', '0'), +('company_name', 'Example Registry LLC'), +('address', '123 Example Street, Example City'), +('address2', '48000, Ukraine'), +('phone', '+123456789'), +('email', 'contact@example.com'); CREATE USER 'registry'@'localhost' IDENTIFIED BY 'EPPRegistry'; CREATE USER 'registry-select'@'localhost' IDENTIFIED BY 'EPPRegistrySELECT'; diff --git a/database/registry.postgres.sql b/database/registry.postgres.sql index 4e8fb1d..a22881b 100644 --- a/database/registry.postgres.sql +++ b/database/registry.postgres.sql @@ -673,7 +673,12 @@ INSERT INTO registry.settings (name, value) VALUES ('dns-udp-queries-responded', '0'), ('searchable-whois-queries', '0'), ('web-whois-queries', '0'), -('whois-43-queries', '0'); +('whois-43-queries', '0'), +('company_name', 'Example Registry LLC'), +('address', '123 Example Street, Example City'), +('address2', '48000, Ukraine'), +('phone', '+123456789'), +('email', 'contact@example.com'); ALTER TABLE registry.domain_price ADD FOREIGN KEY ("tldid") REFERENCES registry.domain_tld ("id"); ALTER TABLE registry.domain_restore_price ADD FOREIGN KEY ("tldid") REFERENCES registry.domain_tld ("id");