/login?token=".$random_string."\n\n";
+ $user->password($random_string);
+}
+
+$user->update(\%OPTS);
+
+print "User data:\n",
+ "----------\n",
+ "ID: ", $user->user_id, "\n",
+ "Grade: ", [
+ "0 - can read main accounts, or his own only when its ID equals his",
+ "1 - can read all accounts and bank statement, but cannot add or change data",
+ "2 - can read and update the database"
+ ]->[ $OPTS{grade} // $user->grade ]."\n" // die "Unsupported level: $OPTS{grade}",
+ "E-Mail: ", $OPTS{email} // $user->email // "(none)",
+ "Name: ", $OPTS{username} // $user->username // "(none)"
+ ;
+
diff --git a/schema/triggers/enforceImmutableTransfer.sql b/schema/triggers/enforceImmutableTransfer.sql
index 1fbe5de..ac2cebf 100644
--- a/schema/triggers/enforceImmutableTransfer.sql
+++ b/schema/triggers/enforceImmutableTransfer.sql
@@ -1,5 +1,5 @@
CREATE TRIGGER enforceImmutableTransfer
- BEFORE UPDATE ON Transfer
+ BEFORE UPDATE OF timestamp, credId, billId, amount ON Transfer -- Allow update of note
WHEN OLD.amount IS NOT NULL
AND NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK)
BEGIN
diff --git a/server b/server
new file mode 100755
index 0000000..263fcf2
--- /dev/null
+++ b/server
@@ -0,0 +1,12 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin";
+
+$ENV{MOJO_LISTEN} //= "http://127.0.0.1:3000";
+
+# Start command line interface for application
+require Mojolicious::Commands;
+my $app = Mojolicious::Commands->start_app("TrsrDB::HTTP");
diff --git a/site/add-credit.svg b/site/add-credit.svg
new file mode 100644
index 0000000..d1f1ad0
--- /dev/null
+++ b/site/add-credit.svg
@@ -0,0 +1,187 @@
+
+
+
+
\ No newline at end of file
diff --git a/site/add-debit.svg b/site/add-debit.svg
new file mode 100644
index 0000000..c4f1ffd
--- /dev/null
+++ b/site/add-debit.svg
@@ -0,0 +1,101 @@
+
+
+
+
diff --git a/site/even.svg b/site/even.svg
new file mode 100644
index 0000000..287b11e
--- /dev/null
+++ b/site/even.svg
@@ -0,0 +1,63 @@
+
+
+
diff --git a/site/list.svg b/site/list.svg
new file mode 100644
index 0000000..5e3f3e4
--- /dev/null
+++ b/site/list.svg
@@ -0,0 +1,68 @@
+
+
+
+
diff --git a/site/style.css b/site/style.css
index 504c1d3..16accc3 100644
--- a/site/style.css
+++ b/site/style.css
@@ -13,6 +13,14 @@ h1 {
border-bottom: 5px double grey;
}
+table {
+ border-collapse: collapse;
+}
+
+table td, table th {
+ border: 1px solid darkgrey;
+}
+
table tr:nth-child(even) {
background-color: #eee;
}
@@ -68,3 +76,24 @@ select {
color: lightgrey;
font-size: .8em;
}
+
+img.icon {
+ vertical-align:middle;
+ height: 1.2em;
+}
+
+.targettable { display:none }
+.targettable:target { display: block; }
+
+#bottommenu {
+ font-size:smaller;
+ background-color: #eee;
+ border-top: 5px double grey;
+ text-align:center;
+}
+
+#footer {
+ font-size:smaller;
+ color: darkgrey;
+ text-align: center;
+}
diff --git a/site/transfer.svg b/site/transfer.svg
new file mode 100644
index 0000000..f605247
--- /dev/null
+++ b/site/transfer.svg
@@ -0,0 +1,665 @@
+
+
+
+
diff --git a/site/wait.svg b/site/wait.svg
new file mode 100644
index 0000000..ae5059b
--- /dev/null
+++ b/site/wait.svg
@@ -0,0 +1,66 @@
+
+
+
diff --git a/templates/account/list.html.ep b/templates/account/list.html.ep
index 01e5cc9..b51eaa1 100644
--- a/templates/account/list.html.ep
+++ b/templates/account/list.html.ep
@@ -7,7 +7,7 @@
% my $inter_header = begin
% my $group = shift;
<%= $group || 'Club management accounts' %> |
-Charge'm all |
+all |
% end
% while ( my $account = $accounts->next ) {
% my $bal = $account->balance;
@@ -18,24 +18,26 @@
% }
% my $u = $account->ID;
<%= $u %> |
- <%= $bal->even_until // "never" %> | <%== money $bal->arrears %> | list | Charge |
+ <%= $bal->even_until // "never" %> | <%== money $bal->arrears %> | | |
% my $which = ($bal->arrears && 1) + ($bal->available && 1);
% if ( $which == 2 ) {
- C⇔D!
+ › ‹
% }
% elsif ( $which ) {
- N/A
+ <%== $bal->arrears ? q{›} : q{ } %>
+
+ <%== $bal->available ? q{‹} : q{ } %>
% }
% else {
- N/A
+
% }
- | <%== money $bal->available %> | list | Credit | <%== money $bal->earned %> | <%== money $bal->promised %> | History | Report |
+ <%== money $bal->available %> | | | <%== money $bal->earned %> | <%== money $bal->promised %> | History | Report |
% } # while
-Create account ⋅ Reconstructed bank statement
-
+% stash links => [ '/account' => "Create account", '/bankStatement' => "Reconstructed bank statement" ];
+% my $help = begin
Column explanation
- Even till:
@@ -51,4 +53,5 @@
- Promised:
Unpaid or not fully paid debits targetting credits of that account.
-
+% end
+% stash help => $help;
diff --git a/templates/account/upsert.html.ep b/templates/account/upsert.html.ep
new file mode 100644
index 0000000..9a2cd0c
--- /dev/null
+++ b/templates/account/upsert.html.ep
@@ -0,0 +1,35 @@
+% title $name ? "Account $name" : "Create account";
+
+% my %r;
+% $r{ID} = begin
+
+% end
+% $r{type} = begin
+ (<%= join(", ", @$types) %> or a new?)
+% end
+% $r{altId} = begin
+
+% end
+% $r{IBAN} = begin
+
+% end
+
+
+
+
diff --git a/templates/debit/upsert.html.ep b/templates/debit/upsert.html.ep
index 1858466..78096bd 100644
--- a/templates/debit/upsert.html.ep
+++ b/templates/debit/upsert.html.ep
@@ -90,12 +90,13 @@ oops
% if ( $credits->count() ) {
Check credits you want to pay this debit with.
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 0f133c9..019d218 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -17,6 +17,33 @@
% }
<%= content %>
-">Back home – Account List
-