Browse Source

Updates to expense request form and scripts.

tags/stw2018
Reinhard Müller 1 year ago
parent
commit
d4042f3794
2 changed files with 80 additions and 173 deletions
  1. 57
    103
      cgi-bin/expense-request.pl
  2. 23
    70
      internal/er.en.xhtml

+ 57
- 103
cgi-bin/expense-request.pl View File

@@ -25,16 +25,14 @@ use POSIX qw(strftime);
# -----------------------------------------------------------------------------

my %names = (
"fellowship" => "Local FSFE Group",
"albers" => "Erik Albers",
"oberg" => "Jonas Öberg",
"kirschner" => "Matthias Kirschner",
"mehl" => "Max Mehl",
"mueller" => "Reinhard Müller",
"rubini" => "Alessandro Rubini",
"lohmus" => "Heiki Lohmus",
"sliwinski" => "Ulrike Sliwinski",
"malaja" => "Polina Malaja",
"eal" => "Erik Albers",
"mk" => "Matthias Kirschner",
"repentinus" => "Heiki Lohmus",
"polina" => "Polina Malaja",
"max.mehl" => "Max Mehl",
"reinhard" => "Reinhard Müller",
"jonas" => "Jonas Öberg",
"usli" => "Ulrike Sliwinski",
);

# -----------------------------------------------------------------------------
@@ -42,64 +40,59 @@ my %names = (
# -----------------------------------------------------------------------------

my %responsible = (
"ADMIN-COORD" => "kirschner",
"ADMIN-GA" => "kirschner",
"ADMIN-TECH" => "kirschner",
"ADMIN-FUNDRAISING" => "kirschner",
"GR-TRAINING" => "kirschner",
"GR-LOCAL" => "kirschner",
"PA-OUTREACH" => "kirschner",
"PA-MATERIAL" => "kirschner",
"PA-CAMPAIGN" => "kirschner",
"NET-ORG" => "kirschner",
"NET-TRAVEL" => "kirschner",
"POLICY-TRAVEL" => "kirschner",
"POLICY-DEV" => "kirschner",
"POLICY-CAMPAIGN" => "kirschner",
"MERCHANDISE-PURCHASE" => "sliwinski",
"MERCHANDISE-OTHER" => "sliwinski",
"REUSE-OTHER" => "kirschner",
"REUSE-TRAVEL" => "kirschner",
"REUSE-MATERIAL" => "kirschner",
"PERSONELL-INTERN" => "kirschner",
"PERSONELL-KIRSCHNER" => "kirschner",
"PERSONELL-ALBERS" => "kirschner",
"PERSONELL-SLIWINSKI" => "kirschner",
"PERSONELL-MEHL" => "kirschner",
"PERSONELL-OBERG" => "kirschner",
"PERSONELL-MALAJA" => "kirschner",
"INTERNAL-COORD" => "mk",
"INTERNAL-GA" => "mk",
"INTERNAL-TECH" => "mk",
"INTERNAL-FUNDRAISING" => "mk",
"PA-OUTREACH" => "mk",
"PA-MATERIAL" => "mk",
"PA-CAMPAIGN" => "mk",
"LEGAL-TRAVEL" => "mk",
"LEGAL-ORG" => "mk",
"POLICY-TRAVEL" => "mk",
"POLICY-CAMPAIGN" => "mk",
"POLICY-DEV" => "mk",
"REUSE-TRAVEL" => "mk",
"REUSE-MATERIAL" => "mk",
"REUSE-OTHER" => "mk",
"MERCHANDISE-PURCHASE" => "usli",
"MERCHANDISE-OTHER" => "usli",
"PERSONELL-INTERN" => "mk",
"PERSONELL-KIRSCHNER" => "mk",
"PERSONELL-ALBERS" => "mk",
"PERSONELL-SLIWINSKI" => "mk",
"PERSONELL-MALAJA" => "mk",
"PERSONELL-MEHL" => "mk",
"PERSONELL-OBERG" => "mk",
"OFFICE-BERLIN" => "sliwinski",
);

my %account = (
"ADMIN-COORD" => "2504",
"ADMIN-GA" => "2505",
"ADMIN-TECH" => "2506",
"ADMIN-FUNDRAISING" => "2509",
"GR-TRAINING" => "2527",
"GR-LOCAL" => "2526",
"INTERNAL-COORD" => "2504",
"INTERNAL-GA" => "2505",
"INTERNAL-TECH" => "2506",
"INTERNAL-FUNDRAISING" => "2509",
"PA-OUTREACH" => "2513",
"PA-MATERIAL" => "2514",
"PA-CAMPAIGN" => "2515",
"NET-TRAVEL" => "2533",
"NET-ORG" => "2535",
"POLICY-TRAVEL" => "2543",
"POLICY-DEV" => "2546",
"POLICY-CAMPAIGN" => "2545",
"MERCHANDISE-PURCHASE" => "8154",
"MERCHANDISE-OTHER" => "8159",
"REUSE-OTHER" => "6110",
"POLICY-DEV" => "2546",
"REUSE-TRAVEL" => "6113",
"REUSE-MATERIAL" => "6114",
"REUSE-OTHER" => "6110",
"MERCHANDISE-PURCHASE" => "8154",
"MERCHANDISE-OTHER" => "8159",
"PERSONELL-INTERN" => "81000",
"PERSONELL-KIRSCHNER" => "81012",
"PERSONELL-ALBERS" => "81021",
"PERSONELL-SLIWINSKI" => "81036",
"PERSONELL-MALAJA" => "81040",
"PERSONELL-MEHL" => "81042",
"PERSONELL-OBERG" => "81201",
"PERSONELL-MALAJA" => "81040",
"OFFICE-BERLIN" => "82001",
"OFFICE-DUSSELDORF" => "82002",
);

# -----------------------------------------------------------------------------
@@ -108,42 +101,22 @@ my %account = (

my $query = new CGI;

my $catch_phrase = $query->param("catch_phrase");
my $who = $query->param("who");
my $what = $query->param("what");
my $when = $query->param("when");
my $why = $query->param("why");
my $estimate = $query->param("estimate");
my $budget1 = $query->param("budget1");
my $percent1 = $query->param("percent1");
my $budget2 = "NONE"; # $query->param("budget2");
my $percent2 = $query->param("percent2");
my $budget = $query->param("budget");
my $refund = $query->param("refund");
my $catch_phrase = $query->param("catch_phrase");

my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
my $account1 = $account{$budget1};
my $account2 = "";
if ($budget2 ne "NONE") {
$account2 = $account{$budget2};
}
my $reference = "er.$date." . substr $time, -3;
$reference .= ".$account1";
if ($budget2 ne "NONE") {
$reference .= "+$account2";
}

my $to1 = $responsible{$budget1};
my $to2 = "";
if ($budget2 ne "NONE") {
$to2 = $responsible{$budget2};
}

my $subject = "Expense Request $reference $catch_phrase ($budget1";
if ($budget2 ne "NONE") {
$subject .= "+$budget2";
}
$subject .= ")";
my $date = strftime("%Y-%m-%d", localtime);
my $time = strftime("%s", localtime);
my $account = $account{$budget};
my $reference = "er.$date." . substr($time, -3) . ".$account";

my $to = $responsible{$budget};
my $subject = "Expense Request $reference $catch_phrase ($budget)";

# -----------------------------------------------------------------------------
# Generate mail to responsible person
@@ -151,25 +124,14 @@ $subject .= ")";

my $boundary = "NextPart$reference";

my $replyto = "finance\@fsfeurope.org, $to1\@fsfeurope.org";
if ($who ne "fellowship") {
$replyto .= ", $who\@fsfeurope.org";
}

if ($budget2 ne "NONE") {
$replyto .= ", $to2\@fsfeurope.org";
}
my $replyto = "finance\@fsfe.org, $to\@fsfe.org, $who\@fsfe.org";

open(MAIL, "|/usr/lib/sendmail -t -f $who\@fsfeurope.org");
print MAIL "From: $who\@fsfeurope.org\n";
open(MAIL, "|/usr/lib/sendmail -t -f $who\@fsfe.org");
print MAIL "From: $who\@fsfe.org\n";
print MAIL "Reply-To: $replyto\n";
print MAIL "Mail-Followup-To: $replyto\n";
if ($budget2 ne "NONE") {
print MAIL "To: $to1\@fsfeurope.org, $to2\@fsfeurope.org\n";
} else {
print MAIL "To: $to1\@fsfeurope.org\n";
}
print MAIL "CC: $who\@fsfeurope.org\n";
print MAIL "To: $to\@fsfe.org\n";
print MAIL "CC: $who\@fsfe.org\n";
print MAIL "BCC: auto-er\@fsfeurope.org\n";
print MAIL "Subject: $subject\n";
print MAIL "Mime-Version: 1.0\n";
@@ -185,11 +147,7 @@ print MAIL "WHAT: $what\n\n";
print MAIL "WHEN: $when\n\n";
print MAIL "WHY: $why\n\n";
print MAIL "ESTIMATE: $estimate\n\n";
if ($budget2 ne "NONE") {
print MAIL "BUDGET: $budget1 ($account1) $percent1\% $budget2 ($account2) $percent2\%\n\n";
} else {
print MAIL "BUDGET: $budget1 ($account1)\n\n";
}
print MAIL "BUDGET: $budget ($account)\n\n";
print MAIL "REFUND CONTACT: $refund\n\n";
print MAIL "AUTHORISED:\n\n";
print MAIL "BY:\n\n";
@@ -209,9 +167,5 @@ print "WHAT: $what<br />\n\n";
print "WHEN: $when<br />\n\n";
print "WHY: $why<br />\n\n";
print "ESTIMATE: $estimate<br />\n\n";
if ($budget2 ne "NONE") {
print "BUDGET: $budget1 $percent1\% $budget2 $percent2\%<br />\n\n";
} else {
print "BUDGET: $budget1<br />\n\n";
}
print "BUDGET: $budget<br />\n\n";
print "REFUND CONTACT: $refund<br />\n\n";

+ 23
- 70
internal/er.en.xhtml View File

@@ -10,18 +10,24 @@

<form action="/cgi-bin/expense-request.pl" method="post">
<table>
<tr>
<td><p>Catch phrase:</p></td>
<td>
<input type="text" size="80" style="width:500px" name="catch_phrase"/>
</td>
</tr>
<tr>
<td><p>Who:</p></td>
<td>
<select name="who" size="1">
<option value="albers">Erik Albers</option>
<option value="oberg">Jonas Öberg</option>
<option value="kirschner">Matthias Kirschner</option>
<option value="mehl">Max Mehl</option>
<option value="mueller">Reinhard Müller</option>
<option value="lohmus">Heiki Lohmus</option>
<option value="sliwinski">Ulrike Sliwinski</option>
<option value="malaja">Polina Malaja</option>
<option value="eal">Erik Albers</option>
<option value="mk">Matthias Kirschner</option>
<option value="repentinus">Heiki Lohmus</option>
<option value="polina">Polina Malaja</option>
<option value="max.mehl">Max Mehl</option>
<option value="reinhard">Reinhard Müller</option>
<option value="jonas">Jonas Öberg</option>
<option value="usli">Ulrike Sliwinski</option>
</select>
</td>
</tr>
@@ -52,93 +58,41 @@
<tr>
<td><p>Budget:</p></td>
<td>
<select name="budget1" size="1">
<option value="ADMIN-COORD">ADMIN Coordination</option>
<option value="ADMIN-GA">ADMIN General Assembly</option>
<option value="ADMIN-TECH">ADMIN technical infrastructure</option>
<option value="ADMIN-FUNDRAISING">ADMIN fundraising</option>
<option value="GR-TRAINING">GROWING training activists</option>
<option value="GR-LOCAL">GROWING local activities incl travel</option>
<select name="budget" size="1">
<option value="INTERNAL-COORD">INTERNAL Coordination</option>
<option value="INTERNAL-GA">INTERNAL General Assembly</option>
<option value="INTERNAL-TECH">INTERNAL technical infrastructure</option>
<option value="INTERNAL-FUNDRAISING">INTERNAL fundraising</option>
<option value="PA-OUTREACH">PA outreach (events)</option>
<option value="PA-MATERIAL">PA information material</option>
<option value="PA-CAMPAIGN">PA specific campaigns</option>
<option value="NET-TRAVEL">NETWORK travel costs</option>
<option value="NET-ORG">NETWORK workshops/conferences</option>
<option value="LEGAL-TRAVEL">LEGAL travel costs</option>
<option value="LEGAL-ORG">LEGAL workshop</option>
<option value="POLICY-TRAVEL">POLICY travel costs</option>
<option value="POLICY-CAMPAIGN">POLICY campaigns</option>
<option value="POLICY-DEV">POLICY development</option>
<option value="MERCHANDISE-PURCHASE">MERCHANDISE purchase of goods</option>
<option value="MERCHANDISE-OTHER">MERCHANDISE packing, shipping, and other costs</option>
<option value="REUSE-TRAVEL">REUSE travel costs</option>
<option value="REUSE-MATERIAL">REUSE information material</option>
<option value="REUSE-OTHER">REUSE other costs</option>
<option value="PERSONELL-INTERN">PERSONELL Interns</option>
<option value="PERSONELL-KIRSCHNER">PERSONELL Matthias Kirschner</option>
<option value="PERSONELL-ALBERS">PERSONELL Erik Albers</option>
<option value="PERSONELL-SLIWINSKI">PERSONELL Ulrike Sliwinski</option>
<option value="PERSONELL-MALAJA">PERSONELL Polina Malaja</option>
<option value="PERSONELL-MEHL">PERSONELL Max Mehl</option>
<option value="PERSONELL-OBERG">PERSONELL Jonas Öberg (includes homeoffice)</option>
<option value="OFFICE-BERLIN">OFFICE Berlin</option>
</select>
</td>
</tr>
<!-- tr>
<td><p>Percentage 1:</p></td>
<td>
<input type="text" size="80" style="width:500px" name="percent1"/>
</td>
</tr>
<tr>
<td><p>Budget 2:</p></td>
<td>
<select name="budget2" size="1">
<option value="NONE">No second budget</option>
<option value="ADMIN-COORD">ADMIN coordination</option>
<option value="ADMIN-GA">ADMIN General Assembly</option>
<option value="ADMIN-TECH">ADMIN technical infrastructure</option>
<option value="ADMIN-FUNDRAISING">ADMIN fundraising</option>
<option value="GR-TRAINING">GROWING training activists incl travel</option>
<option value="GR-LOCAL">GROWING local activities</option>
<option value="PA-OUTREACH">PA outreach (events)</option>
<option value="PA-MATERIAL">PA information material</option>
<option value="PA-CAMPAIGN">PA campaigns</option>
<option value="NET-TRAVEL">NETWORK travel costs</option>
<option value="NET-ORG">NETWORK workshops/conferences</option>
<option value="POLICY-TRAVEL">POLICY travel costs</option>
<option value="POLICY-CAMPAIGN">POLICY campaigns</option>
<option value="POLICY-DEV">POLICY development</option>
<option value="MERCHANDISE-PURCHASE">MERCHANDISE purchase of goods</option>
<option value="MERCHANDISE-SHIPPING">MERCHANDISE shipping costs</option>
<option value="MERCHANDISE-OTHER">MERCHANDISE packing, shipping, and other costs</option>
<option value="PERSONELL-INTERN">PERSONELL Interns</option>
<option value="PERSONELL-KIRSCHNER">PERSONELL Matthias Kirschner</option>
<option value="PERSONELL-ALBERS">PERSONELL Erik Albers</option>
<option value="PERSONELL-SLIWINSKI">PERSONELL Ulrike Sliwinski</option>
<option value="PERSONELL-MEHL">PERSONELL Max Mehl</option>
<option value="PERSONELL-MALAJA">PERSONELL Polina Malaja</option>
<option value="PERSONELL-MEHL">PERSONELL Max Mehl</option>
<option value="PERSONELL-OBERG">PERSONELL Jonas Öberg (includes homeoffice)</option>
<option value="OFFICE-BERLIN">OFFICE Berlin</option>
</select>
</td>
</tr>
<tr>
<td><p>Percentage 2:</p></td>
<td>
<input type="text" size="80" style="width:500px" name="percent2"/>
</td>
</tr -->
<tr>
<td><p>Refund Contact:</p></td>
<td>
<input type="text" size="80" style="width:500px" name="refund"/>
</td>
</tr>
<tr>
<td><p>Catch phrase:</p></td>
<td>
<input type="text" size="80" style="width:500px" name="catch_phrase"/>
</td>
</tr>
</table>

<center>
@@ -147,7 +101,6 @@
</form>
</body>


<timestamp>$Date$ $Author$</timestamp>
</html>
<!--

Loading…
Cancel
Save