From 104fbeb69b4ef3d77090a403b1a6d3c2681c578c Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 19 Apr 2008 20:16:58 +0000 Subject: [PATCH] Tracking dues policy changes --- money.mlt | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 5 deletions(-) diff --git a/money.mlt b/money.mlt index 331c079..4654b06 100644 --- a/money.mlt +++ b/money.mlt @@ -29,7 +29,29 @@ if $"hist" <> "" then | _ => %>multi<% end; if admin then - %>[Hosting] [Payment] [Other] + %>[Bill] [Payment] [Other] + [Delete]<% +end +%><% +end %> + + +<% elseif $"cmd" = "primary" then + val admin = Group.inGroupName "money"; + showNormal := false %> + +

Primary Transactions

+ + + +<% foreach (amt, trn) in Money.listUserTransactions (valOf (Init.userNameToId "hcoop")) do %> + +<% switch Money.listChargesWithNames (#id trn) of + [(name, cha)] => %><% + | _ => %><% +end; +if admin then + %><% end %><% @@ -47,7 +69,7 @@ end %> <% switch Balance.listBalanceUsers (#id bal) of [] => | (user :: users) => - %><% Web.html (#name user) %><% + %><% Web.html (#name user) %>[History]<% foreach user in users do %>, <% Web.html (#name user) %><% end @@ -153,6 +175,58 @@ end %> %>

Hosting transaction modified.

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

New bill for the co-op

+ + + +
Date Description Amount Last modified Participants
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %> <% #stamp trn %><% name %>multi[Bill] [Payment] [Other] [Delete]
+ + + + +
Description:
Date:
Amount:
+ +<% elseif $"cmd" = "bill2" then + Group.requireGroupName "money"; + val id = Money.addTransaction ($"descr", Util.neg (Web.stor ($"amount")), $"d"); + Money.addCharge {trn = id, usr = valOf (Init.userNameToId "hcoop"), amount = Util.neg (Web.stor ($"amount"))}; + Money.applyCharges id; + + %>

Bill added.

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

Modify bill

+ + + + + + + + +
Description:
Date:
Amount:
+ +<% elseif $"saveBill" <> "" then + Group.requireGroupName "money"; + val id = Web.stoi ($"saveBill"); + val trn = Money.lookupTransaction id; + + Money.clearCharges id; + Money.modTransaction {trn with descr = $"descr", d = $"d", amount = Util.neg (Web.stor ($"amount"))}; + Money.addCharge {trn = id, usr = valOf (Init.userNameToId "hcoop"), amount = Util.neg (Web.stor ($"amount"))}; + Money.applyCharges id; + + %>

Bill modified.

+ <% elseif $"cmd" = "evenForm" then Group.requireGroupName "money"; showNormal := false %> @@ -504,13 +578,15 @@ elseif $"cmd" = "freezeworthy" then val deposit = Balance.depositAmount (#id bal) %>

Your balance: $<% Util.sub (#amount bal, deposit) %>
-Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)

+Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)
+Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToId "hcoop"))) %> <% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") then %>

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

<% end %> List all transactions
+List primary transactions
List active balances
List negative active balances
List members who deserve account freezing
@@ -523,7 +599,7 @@ Deposit: $<% deposit %> (3 months of dues at the minimal pl Switch to regular member view

New transaction:
-Hosting bill
+Bill for the co-op
Payment from member
Generic/even

@@ -554,7 +630,7 @@ Deposit: $<% deposit %> (3 months of dues at the minimal pl [(name, cha)] => %><% name %><% | _ => %>multi<% end %> -[Hosting] [Payment] [Other] +[Bill] [Payment] [Other] [Delete] <% end %> -- 2.20.1