X-Git-Url: https://git.hcoop.net/hcoop/zz_old/portal.git/blobdiff_plain/f1ea3762bc9df26700bba252f9491087211ebad1..b49e2370e6f535c8bbfe1c87da105f5554669d86:/money.mlt diff --git a/money.mlt b/money.mlt index b16b14a..bd532be 100644 --- a/money.mlt +++ b/money.mlt @@ -2,36 +2,71 @@ ref showNormal = true; -if $"cmd" = "list" then +if $"hist" <> "" then + showNormal := false; + val id = Web.stoi ($"hist") %> + + +<% foreach (amount, trn) in Money.listUserTransactions id do %> + +<% end %> +
Date Description Amount
<% #d trn %> <% Web.html (#descr trn) %> <% amount %>/<% #amount trn %>
+ +<% elseif $"cmd" = "list" then + val admin = Group.inGroupName "money"; showNormal := false %> -

Transactions

+

Transactions

<% foreach trn in Money.listTransactions () do %> <% switch Money.listChargesWithNames (#id trn) of - [(name, cha)] => %><% - | _ => %><% + [(name, cha)] => %><% + | _ => %><% +end; +if admin then + %> + <% end +%><% end %>
Date Description Amount Last modified Participants
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %> <% #stamp trn %><% name %>
multi
<% name %>multi[Hosting] [Payment] [Other][Delete]
<% elseif $"cmd" = "bals" then showNormal := false %> -

Balances

+

Active Balances

-<% foreach bal in Balance.listBalances () do %> +<% foreach bal in Balance.listOwnedBalances () do %> +<% end %> +
<% #name bal %> <% #amount bal %> <% switch Balance.listBalanceUsers (#id bal) of [] => | (user :: users) => - %><% Web.html (#name user) %><% + %><% Web.html (#name user) %><% foreach user in users do - %>, <% Web.html (#name user) %><% + %>, <% Web.html (#name user) %><% + end +end %>
+ +<% elseif $"cmd" = "deadbals" then + showNormal := false %> + +

Retired Balances

+ + +<% foreach bal in Balance.listUnownedBalances () do %> + <% end %> @@ -41,17 +76,17 @@ end %> Group.requireGroupName "money"; showNormal := false %> -

New hosting bill

+

New hosting bill

- + -
<% #name bal %> <% #amount bal %> +<% switch Balance.listBalanceUsers (#id bal) of + [] => + | (user :: users) => + %><% Web.html (#name user) %><% + foreach user in users do + %>, <% Web.html (#name user) %><% end end %>
- - - - - - +
Description:
Date:
Amount:
Free bandwidth cutoff (MB):
Cost/GB:
Member usage:
+ + + + + +
Description:
Date:
Amount:
Free bandwidth cutoff (MB):
Cost/GB:
Member usage:
@@ -60,7 +95,7 @@ end %> val id = Money.addTransaction ($"descr", Util.neg (Web.stor ($"amount")), $"d"); Money.addHostingCharges {trn = id, cutoff = 1000 * Web.stoi ($"cutoff"), cost = Web.stor ($"cost"), usage = $"usage"}; - %>

Hosting transaction added.

+ %>

Hosting transaction added.

<% elseif $"modHosting" <> "" then Group.requireGroupName "money"; @@ -68,17 +103,20 @@ end %> val id = Web.stoi ($"modHosting"); val trn = Money.lookupTransaction id %> -

Modify hosting bill

+

Modify hosting bill

- + - - - - - - - +
Description:
Date:
Amount:
Free bandwidth cutoff (MB):
Cost/GB:
Member usage:
+ + + + + +
Description:
Date:
Amount:
Free bandwidth cutoff (MB):
Cost/GB:
Member usage:
@@ -91,19 +129,19 @@ end %> Money.modTransaction {trn with descr = $"descr", d = $"d", amount = Util.neg (Web.stor ($"amount"))}; Money.addHostingCharges {trn = id, cutoff = 1000 * Web.stoi ($"cutoff"), cost = Web.stor ($"cost"), usage = $"usage"}; - %>

Hosting transaction modified.

+ %>

Hosting transaction modified.

<% elseif $"cmd" = "evenForm" then Group.requireGroupName "money"; showNormal := false %> -

New generic/even transaction

- +

New generic/even transaction

+ - - - - -
Description:
Date:
Amount:
Members: + + + + Group.requireGroupName "money"; showNormal := false %> -

New member payment

+

New member payment

- + -
Description:
Date:
Amount:
Members:
- - - -
Description:
Date:
Amount:
Member: + + + + <% elseif $"cmd" = "pay2" then Group.requireGroupName "money"; val amount = Web.stor ($"amount"); + val descr = $"descr"; + val descr = iff descr = "" then $"descr2" else descr; val id = Money.addTransaction ($"descr", amount, $"d"); Money.addCharge {trn = id, usr = Web.stoi ($"usr"), amount = amount}; Money.applyCharges id; - %>

Payment transaction added.

+ %>

Payment transaction added.

<% elseif $"modPay" <> "" then Group.requireGroupName "money"; @@ -148,15 +194,15 @@ end %> val id = Web.stoi ($"modPay"); val trn = Money.lookupTransaction id %> -

Modify member payment

+

Modify member payment

- + -
Description:
Date:
Amount:
Member:
- - - -
Description:
Date:
Amount:
Member: + + + + Money.addCharge {trn = id, usr = Web.stoi ($"usr"), amount = amount}; Money.applyCharges id; - %>

Member payment modified.

+ %>

Member payment modified.

<% elseif $"cmd" = "evenForm" then Group.requireGroupName "money"; showNormal := false %> -

New generic/even transaction

- +

New generic/even transaction

+ -
Description:
Date:
Amount:
Member:
- - - -
Description:
Date:
Amount:
Members: + + + + val id = Money.addTransaction ($"descr", Web.stor ($"amount"), $"d"); Money.addEvenCharges (id, map Web.stoi (Web.getMultiParam "usrs")) - %>

Even transaction added.

+ %>

Even transaction added.

<% elseif $"modEven" <> "" then Group.requireGroupName "money"; showNormal := false; val trn = Money.lookupTransaction (Web.stoi ($"modEven")) %> -

Modify even transaction

+

Modify even transaction

- +"> -
Description:
Date:
Amount:
Members:
- - - -
Description:
Date:
Amount:
Members: + + + + Money.modTransaction {trn with descr = $"descr", d = $"d", amount = Web.stor ($"amount")}; Money.addEvenCharges (id, map Web.stoi (Web.getMultiParam "usrs")) - %>

Even transaction modified

+ %>

Even transaction modified

<% elseif $"del" <> "" then Group.requireGroupName "money"; showNormal := false; val trn = Money.lookupTransaction (Web.stoi ($"del")) %> -

Are you sure you want to delete transaction <% Web.html (#descr trn) %>?

+

Are you sure you want to delete transaction <% Web.html (#descr trn) %>?

">Yes, delete <% Web.html (#descr trn) %>! <% elseif $"del2" <> "" then @@ -247,18 +293,23 @@ end %> val trn = Money.lookupTransaction id; Money.clearCharges id; Money.deleteTransaction id %> -

<% Web.html (#descr trn) %> deleted!

+

<% Web.html (#descr trn) %> deleted!

+ +<% elseif $"cmd" = "equalize" then + Group.requireGroupName "money"; + Money.equalizeBalances (); + %>

Balances equalized

<% elseif $"trn" <> "" then showNormal := false; val id = Web.stoi ($"trn"); val trn = Money.lookupTransaction id %> -
Description:
Date:
Amount:
Members:
- - - - - +
TRN#: <% id %>
Description: <% Web.html (#descr trn) %>
Date: <% #d trn %>
Amount: $<% #amount trn %>
Distribution:
+ + + + + <% ref first = true; foreach (name, cha) in Money.listChargesWithNames id do @@ -275,8 +326,12 @@ end %> <% if showNormal then %> +

Your balance: $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %>

+<% if Group.inGroupName "money" then %>

Sum of all active balances: $<% Balance.sumOwnedBalances () %>

<% end %> + List all transactions
-List all balances
+List active balances
+List retired balances
<% if Group.inGroupName "money" then %> @@ -284,8 +339,10 @@ end %> Hosting bill
Payment from member
Generic/even
+
+Equalize balances
-

Most recent transactions

+

Most recent transactions

TRN#: <% id %>
Description: <% Web.html (#descr trn) %>
Date: <% #d trn %>
Amount: $<% #amount trn %>
Distribution:
@@ -302,7 +359,9 @@ end %> <% else %> -

Your recent account activity

+

Add to your balance with PayPal

+ +

Your recent account activity

Date Description Amount Participants Replace Delete
Date Description Amount