diff --git a/cp/app/Controllers/FinancialsController.php b/cp/app/Controllers/FinancialsController.php index dccd1a6..390bbc6 100644 --- a/cp/app/Controllers/FinancialsController.php +++ b/cp/app/Controllers/FinancialsController.php @@ -18,9 +18,9 @@ class FinancialsController extends Controller return view($response,'admin/financials/overview.twig'); } - public function pricing(Request $request, Response $response) + public function invoices(Request $request, Response $response) { - return view($response,'admin/financials/pricing.twig'); + return view($response,'admin/financials/invoices.twig'); } public function deposit(Request $request, Response $response) diff --git a/cp/resources/views/admin/financials/invoices.twig b/cp/resources/views/admin/financials/invoices.twig new file mode 100644 index 0000000..c50f41a --- /dev/null +++ b/cp/resources/views/admin/financials/invoices.twig @@ -0,0 +1,65 @@ +{% extends "layouts/app.twig" %} + +{% block title %}{{ __('Invoices') }}{% endblock %} + +{% block content %} +
+ + + +
+
+
+
+
+
+
+ + + + +
+
+ Search: +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + +{% endblock %} \ No newline at end of file diff --git a/cp/resources/views/admin/financials/pricing.twig b/cp/resources/views/admin/financials/pricing.twig deleted file mode 100644 index e238ee0..0000000 --- a/cp/resources/views/admin/financials/pricing.twig +++ /dev/null @@ -1,124 +0,0 @@ -{% extends "layouts/app.twig" %} - -{% block title %}{{ __('Price Management') }}{% endblock %} - -{% block content %} -
- - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TLD IDCommandInitial1 Year2 Years3 Years4 Years5 Years6 Years7 Years8 Years9 Years10 YearsActions
1Create$10$10$10$10$10$10$10$10$10$10$100
1Renew$10$10$10$10$10$10$10$10$10$10$100
-
-
-
-
-
-
- - -{% endblock %} \ No newline at end of file diff --git a/cp/resources/views/layouts/app.twig b/cp/resources/views/layouts/app.twig index 2549bdd..ab44b99 100644 --- a/cp/resources/views/layouts/app.twig +++ b/cp/resources/views/layouts/app.twig @@ -6,7 +6,7 @@ {% block title %}{% endblock %} | Namingo - {% if route_is('domains') or route_is('contacts') or route_is('hosts') or route_is('epphistory') or route_is('registrars') or route_is('transactions') or route_is('overview') or route_is('reports') or route_is('transfers') or route_is('users') or route_is('support') or route_is('poll') or route_is('log') %} + {% if route_is('domains') or route_is('contacts') or route_is('hosts') or route_is('epphistory') or route_is('registrars') or route_is('transactions') or route_is('overview') or route_is('reports') or route_is('transfers') or route_is('users') or route_is('support') or route_is('poll') or route_is('log') or route_is('invoices') %} {% include 'partials/css-tables.twig' %} {% else %} {% include 'partials/css.twig' %} @@ -172,7 +172,7 @@ -
  • +
  • {{ __('Transactions') }} - + {{ __('Invoices') }} @@ -385,6 +385,8 @@ {% include 'partials/js-poll.twig' %} {% elseif route_is('log') %} {% include 'partials/js-log.twig' %} +{% elseif route_is('invoices') %} + {% include 'partials/js-invoices.twig' %} {% else %} {% include 'partials/js.twig' %} {% endif %} diff --git a/cp/resources/views/partials/js-invoices.twig b/cp/resources/views/partials/js-invoices.twig new file mode 100644 index 0000000..545a397 --- /dev/null +++ b/cp/resources/views/partials/js-invoices.twig @@ -0,0 +1,75 @@ + + + + + + \ No newline at end of file diff --git a/cp/routes/web.php b/cp/routes/web.php index f2676b6..949e989 100644 --- a/cp/routes/web.php +++ b/cp/routes/web.php @@ -67,7 +67,7 @@ $app->group('', function ($route) { $route->get('/log', LogsController::class .':log')->setName('log'); $route->get('/reports', ReportsController::class .':view')->setName('reports'); - $route->get('/pricing', FinancialsController::class .':pricing')->setName('pricing'); + $route->get('/invoices', FinancialsController::class .':invoices')->setName('invoices'); $route->map(['GET', 'POST'], '/deposit', FinancialsController::class .':deposit')->setName('deposit'); $route->get('/transactions', FinancialsController::class .':transactions')->setName('transactions'); $route->get('/overview', FinancialsController::class .':overview')->setName('overview'); diff --git a/database/registry.mariadb.sql b/database/registry.mariadb.sql index b637a4c..115df9b 100644 --- a/database/registry.mariadb.sql +++ b/database/registry.mariadb.sql @@ -173,6 +173,22 @@ CREATE TABLE IF NOT EXISTS `registry`.`statement` ( CONSTRAINT `statement_ibfk_1` FOREIGN KEY (`registrar_id`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='financial statement'; +CREATE TABLE IF NOT EXISTS `registry`.`invoices` ( + id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + invoice_number VARCHAR(20), + registrar_id INT(10) UNSIGNED, + billing_contact_id INT(10) UNSIGNED, + issue_date DATETIME(3), + due_date DATETIME(3) default NULL, + total_amount DECIMAL(10,2), + payment_status ENUM('unpaid', 'paid', 'overdue', 'cancelled') DEFAULT 'unpaid', + notes TEXT default NULL, + created_at DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3), + updated_at DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), + FOREIGN KEY (registrar_id) REFERENCES registrar(id), + FOREIGN KEY (billing_contact_id) REFERENCES registrar_contact(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='invoices'; + CREATE TABLE IF NOT EXISTS `registry`.`contact` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `identifier` varchar(255) NOT NULL, diff --git a/database/registry.postgres.sql b/database/registry.postgres.sql index ff63277..8b1f8ec 100644 --- a/database/registry.postgres.sql +++ b/database/registry.postgres.sql @@ -178,6 +178,23 @@ CREATE TABLE registry.statement ( primary key ("id") ); +CREATE TABLE registry.invoices ( + id SERIAL PRIMARY KEY, + invoice_number VARCHAR(20), + registrar_id INT, + billing_contact_id INT, + issue_date TIMESTAMP(3), + due_date TIMESTAMP(3) DEFAULT NULL, + total_amount NUMERIC(10,2), + payment_status VARCHAR(10) DEFAULT 'unpaid' CHECK (payment_status IN ('unpaid', 'paid', 'overdue', 'cancelled')), + notes TEXT DEFAULT NULL, + created_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, + + FOREIGN KEY (registrar_id) REFERENCES registrar(id), + FOREIGN KEY (billing_contact_id) REFERENCES registrar_contact(id) +); + CREATE TABLE registry.contact ( "id" serial8, "identifier" varchar(255) NOT NULL,