Browse Source

Add possibility to split expense requests to 2 different budgets.

svn path=/trunk/; revision=13128
tags/stw2018
Reinhard Müller 10 years ago
parent
commit
205540d7a0
2 changed files with 64 additions and 14 deletions
  1. 24
    11
      cgi-bin/expense-request.pl
  2. 40
    3
      internal/er.en.xhtml

+ 24
- 11
cgi-bin/expense-request.pl View File

@@ -64,17 +64,21 @@ my $what = $query->param("what");
my $when = $query->param("when");
my $why = $query->param("why");
my $estimate = $query->param("estimate");
my $budget = $query->param("budget");
my $budget1 = $query->param("budget1");
my $percent1 = $query->param("percent1");
my $budget2 = $query->param("budget2");
my $percent2 = $query->param("percent2");
my $refund = $query->param("refund");

my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
my $reference = "$who.$date." . substr $time, -3;

my $to = $responsible{$budget};
# if ($to eq $who) {
# $to = "council";
# }
my $to1 = $responsible{$budget1};
my $to2 = "";
if ($budget2 ne "NONE") {
$to2 = $responsible{$budget2};
}

# -----------------------------------------------------------------------------
# Generate mail to responsible person
@@ -82,16 +86,21 @@ my $to = $responsible{$budget};

my $boundary = "NextPart$reference";

my $replyto = "dus\@office.fsfeurope.org, $who\@fsfeurope.org, $to\@fsfeurope.org";
if ($to ne "council") {
$replyto .= ", council\@fsfeurope.org";
my $replyto = "dus\@office.fsfeurope.org, $who\@fsfeurope.org, $to1\@fsfeurope.org";
if ($budget2 ne "NONE") {
$replyto .= ", $to2\@fsfeurope.org";
}
$replyto .= ", council\@fsfeurope.org";

open(MAIL, "|/usr/lib/sendmail -t -f $to\@fsfeurope.org");
open(MAIL, "|/usr/lib/sendmail -t -f $who\@fsfeurope.org");
print MAIL "From: $who\@fsfeurope.org\n";
print MAIL "Reply-To: $replyto\n";
print MAIL "Mail-Followup-To: $replyto\n";
print MAIL "To: $to\@fsfeurope.org\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: director\@fsfeurope.org\n";
print MAIL "Subject: Expense Request\n";
print MAIL "Mime-Version: 1.0\n";
@@ -115,7 +124,11 @@ print MAIL "WHAT: $what\n\n";
print MAIL "WHEN: $when\n\n";
print MAIL "WHY: $why\n\n";
print MAIL "ESTIMATE: $estimate\n\n";
print MAIL "BUDGET: $budget\n\n";
if ($budget2 ne "NONE") {
print MAIL "BUDGET: $budget1 $percentage1\% $budget2 $percentage2\%\n\n";
} else {
print MAIL "BUDGET: $budget1\n\n";
}
print MAIL "REFUND CONTACT: $refund\n\n";
print MAIL "AUTHORISED:\n\n";
print MAIL "BY:\n\n";

+ 40
- 3
internal/er.en.xhtml View File

@@ -60,15 +60,16 @@
</td>
</tr>
<tr>
<td><p>Budget:</p></td>
<td><p>Budget 1:</p></td>
<td>
<select name="budget" size="1">
<select name="budget1" size="1">
<option value="ADMIN-DUS">ADMIN office Düsseldorf</option>
<option value="ADMIN-TECH">ADMIN technical infrastructure</option>
<option value="ADMIN-GA">ADMIN General Assembly</option>
<option value="PA-MATERIAL">PA material</option>
<option value="PA-TRAVEL">PA travel costs to events</option>
<option value="PA-GNUVOX">PA GNUvox</option>
<option value="FELLOWSHIP-OFFICE">FELLOWSHIP office</option>
<option value="FELLOWSHIP-MATERIAL">FELLOWSHIP material</option>
<option value="FELLOWSHIP-CONF">FELLOWSHIP conferences</option>
<option value="FELLOWSHIP-LOCAL">FELLOWSHIP local activities</option>
@@ -79,10 +80,46 @@
<option value="FTF-ECONOMIC">FTF economic activities</option>
<option value="POLICY-TRAVEL">POLICY travel costs</option>
<option value="MERCHANDISE">MERCHANDISE purchase of goods</option>
<option value="FELLOWSHIP-OFFICE">FELLOWSHIP office</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-DUS">ADMIN office Düsseldorf</option>
<option value="ADMIN-TECH">ADMIN technical infrastructure</option>
<option value="ADMIN-GA">ADMIN General Assembly</option>
<option value="PA-MATERIAL">PA material</option>
<option value="PA-TRAVEL">PA travel costs to events</option>
<option value="PA-GNUVOX">PA GNUvox</option>
<option value="FELLOWSHIP-OFFICE">FELLOWSHIP office</option>
<option value="FELLOWSHIP-MATERIAL">FELLOWSHIP material</option>
<option value="FELLOWSHIP-CONF">FELLOWSHIP conferences</option>
<option value="FELLOWSHIP-LOCAL">FELLOWSHIP local activities</option>
<option value="FTF-ZRH">FTF office Zürich</option>
<option value="FTF-TRAVEL">FTF travel costs</option>
<option value="FTF-CONF">FTF conferences</option>
<option value="FTF-TRANS">FTF translation costs</option>
<option value="FTF-ECONOMIC">FTF economic activities</option>
<option value="POLICY-TRAVEL">POLICY travel costs</option>
<option value="MERCHANDISE">MERCHANDISE purchase of goods</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>

Loading…
Cancel
Save