diff --git a/.gitignore b/.gitignore index 911ea7f9a1..4d47e72baa 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ global/data/topbanner/.topbanner.??.xml fsfe.org/search/index.js fsfe.org/tags/tagged-*.en.xhtml fsfe.org/tags/.tags.??.xml +global/data/modules/fsfe-activities-options.en.xml # Local build stuff output diff --git a/fsfe.org/cgi-bin/perdiem.php b/fsfe.org/cgi-bin/perdiem.php index a935f48458..ccbb4777b4 100755 --- a/fsfe.org/cgi-bin/perdiem.php +++ b/fsfe.org/cgi-bin/perdiem.php @@ -22,14 +22,18 @@ require 'PHPMailer/PHPMailer.php'; require 'PHPMailer/SMTP.php'; $html = ''; // create empty variable -$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "ER number", "Catchphrase", "Receipt number", "Remarks")); // create array for CSV +$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "Activity Tag", "Activity Text", "Category ID", "Category Text", "Description", "Receipt number", "Remarks")); // create array for CSV $csvfile = tmpfile(); $csvfile_path = stream_get_meta_data($csvfile)['uri']; $reimb_total = 0; // total reimbursement for early calculation $who = isset($_POST["who"]) ? $_POST["who"] : false; -$er = isset($_POST["er"]) ? $_POST["er"] : false; -$catch = isset($_POST["catch"]) ? $_POST["catch"] : false; +$activity = isset($_POST["activity"]) ? $_POST["activity"] : false; +$activity_tag = explode(":", $activity)[0]; +$activity_text = explode(":", $activity)[1]; +$category_id = "6664"; +$category_text = "Per diem"; +$description = isset($_POST["description"]) ? $_POST["description"] : false; $extra = isset($_POST["extra"]) ? $_POST["extra"] : false; $mailopt = isset($_POST["mailopt"]) ? $_POST["mailopt"] : false; $defaults = isset($_POST["defaults"]) ? $_POST["defaults"] : false; @@ -135,8 +139,11 @@ $html .= "

This per diem statement is made by $who_verbose.Date Amount Recipient - ER number - Catchphrase + Activity Tag + Activity Text + Category Id + Category Text + Description Receipt Name Remarks "; @@ -155,7 +162,8 @@ $email->Port = 25; //$email->Password = 'fsfe_pass'; //$email->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $email->SetFrom($who . "@fsfe.org", $who_verbose); -$email->Subject = "per diem statement by $who_verbose for $catch"; +$email->CharSet = "UTF-8"; +$email->Subject = "=?UTF-8?B?" . base64_encode("per diem statement by $who_verbose for $activity_text") . "?="; if ($mailopt === "normal") { $email->addAddress("finance@lists.fsfe.org"); } @@ -240,15 +248,18 @@ foreach ($use as $d => $day) { // calculate for each day $date[$d] $reimb_day[$d] + $who_verbose + $activity_tag + $activity_text + $category_id + $category_text + $description - $er - $catch - per diem $remarks[$d] "; // CSV for this receipt - $csv[$key] = array($who_verbose, $date[$d], $reimb_day[$d], "", $er, $catch, "per diem", $remarks[$d]); + $csv[$key] = array($who_verbose, $date[$d], $reimb_day[$d], $who_verbose, $activity_tag, $activity_text, $category_id, $category_text, $description, "", $remarks[$d]); } // if day is used } // foreach @@ -257,13 +268,13 @@ foreach ($use as $d => $day) { // calculate for each day foreach ($csv as $fields) { fputcsv($csvfile, $fields, ';', '"', '"'); } -$email->addAttachment($csvfile_path, filter_filename("perdiem" ."-". $who ."-". $er ."-". $catch . ".csv")); +$email->addAttachment($csvfile_path, filter_filename("perdiem" ."-". $who ."-". $activity_tag ."-". $description . ".csv")); // Prepare email body $email_body = "Hi, This is a per diem statement by $who_verbose for -$catch (ER: $er), +$activity_tag ($activity_text), sent via . Please find the expenses attached."; @@ -273,7 +284,7 @@ $reimb_total = number_format($reimb_total, 2, ',', ''); // Finalise output table $html .= "Total:$reimb_total $currency"; -$html .= ""; +$html .= ""; $html .= ""; if ($extra) { $html .= "

Extra remarks:
$extra

"; diff --git a/fsfe.org/cgi-bin/reimbursement.php b/fsfe.org/cgi-bin/reimbursement.php index b78b953402..cfcdff85b8 100755 --- a/fsfe.org/cgi-bin/reimbursement.php +++ b/fsfe.org/cgi-bin/reimbursement.php @@ -9,7 +9,7 @@ require 'PHPMailer/PHPMailer.php'; require 'PHPMailer/SMTP.php'; $html = ''; // create empty variable -$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "ER number", "Catchphrase", "Receipt number", "Remarks")); // create array for CSV +$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "Activity Tag", "Activity Text", "Category ID", "Category Text", "Description", "", "Receipt number", "Remarks")); // create array for CSV $csvfile = tmpfile(); $csvfile_path = stream_get_meta_data($csvfile)['uri']; @@ -22,10 +22,10 @@ $cc_year = isset($_POST["cc_year"]) ? $_POST["cc_year"] : false; $entry = isset($_POST["entry"]) ? $_POST["entry"] : false; // will become $date in loop $amount = isset($_POST["amount"]) ? $_POST["amount"] : false; $recipient = isset($_POST["recipient"]) ? $_POST["recipient"] : false; -$er = isset($_POST["er"]) ? $_POST["er"] : false; -$catch = isset($_POST["catch"]) ? $_POST["catch"] : false; +$activity = isset($_POST["activity"]) ? $_POST["activity"] : false; +$category = isset($_POST["category"]) ? $_POST["category"] : false; $receipt = isset($_POST["receipt"]) ? $_POST["receipt"] : false; -$remarks = isset($_POST["remarks"]) ? $_POST["remarks"] : false; +$description = isset($_POST["description"]) ? $_POST["description"] : false; $extra = isset($_POST["extra"]) ? $_POST["extra"] : false; $mailopt = isset($_POST["mailopt"]) ? $_POST["mailopt"] : false; @@ -123,10 +123,14 @@ $html .= "

This $type_verbose is made by $who_verbose Date Amount Recipient - ER number - Catchphrase + Activity Tag + Activity Text + Category ID + Category Text + Description + Receipt Name - Remarks + "; // Prepare email @@ -143,7 +147,8 @@ $email->Port = 25; //$email->Password = 'fsfe_pass'; //$email->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $email->SetFrom($who . "@fsfe.org", $who_verbose); -$email->Subject = "$type_verbose for $type_date by $who_verbose"; +$email->CharSet = "UTF-8"; +$email->Subject = "=?UTF-8?B?" . base64_encode("$type_verbose for $type_date by $who_verbose") . "?="; if ($mailopt === "normal") { $email->addAddress("finance@lists.fsfe.org"); } @@ -165,6 +170,10 @@ foreach ($entry as $key => $date) { // run over each row $receipt_size = $_FILES["receipt"]["size"][$key]; $key1 = $key + 1; $receipt_no = sprintf('%02d', $key1); + $activity_tag[$key] = explode(":", $activity)[0]; + $activity_text[$key] = explode(":", $activity)[1]; + $category_id[$key] = explode(":", $category)[0]; + $category_text[$key] = explode(":", $category)[1]; // Sanity checks for receipt: upload, size, mime type if (! $receipt_tmp) { @@ -180,7 +189,7 @@ foreach ($entry as $key => $date) { // run over each row // Set name and temporary destination for attached receipt $receipt_ext = pathinfo($receipt_name)['extension']; - $receipt_rename = filter_filename($type_date ."-". $type ."-". $who ."-receipt-". $receipt_no ."-". $er[$key] .".". "$receipt_ext"); + $receipt_rename = filter_filename($type_date ."-". $type ."-". $who ."-receipt-". $receipt_no ."-". $activity_tag .".". "$receipt_ext"); $receipt_dest[$key] = "/tmp/" . $receipt_rename; // Try to move file to temporary destination @@ -193,8 +202,8 @@ foreach ($entry as $key => $date) { // run over each row } // Remove "-" when remark empty - if ($remarks[$key] === "-") { - $remarks[$key] = ""; + if ($description[$key] === "-") { + $description[$key] = ""; } // HTML output for this receipt @@ -203,14 +212,19 @@ foreach ($entry as $key => $date) { // run over each row $date $amount[$key] $recipient[$key] - $er[$key] - $catch[$key] + $activity_tag[$key] + $activity_text[$key] + $category_id[$key] + $category_text[$key] + $description[$key] $receipt_name - $remarks[$key] + + "; + // CSV for this receipt - $csv[$receipt_no] = array($who_verbose, $date, $amount[$key], $recipient[$key], $er[$key], $catch[$key], $receipt_no, $remarks[$key]); + $csv[$receipt_no] = array($who_verbose, $date, $amount[$key], $recipient[$key], $activity_tag[$key], $activity_text[$key], $category_id[$key], $category_text[$key], $description[$key], "", $receipt_no, ""); // Add receipt as email attachment $email->addAttachment($receipt_dest[$key], basename($receipt_dest[$key])); diff --git a/fsfe.org/internal/internal.css b/fsfe.org/internal/internal.css index 74972b40b5..cfe48c88f9 100644 --- a/fsfe.org/internal/internal.css +++ b/fsfe.org/internal/internal.css @@ -38,3 +38,18 @@ input[type="file"] { label { font-weight: normal; } + +#category { + width: auto !important; + padding: inherit !important; + background: none !important; + margin-top: 0px !important; +} +#content input[type="radio"] { + margin: 0 0 0 -20px; +} + +#description-help { + font-size: 0.8em; + color: #616161be; +} diff --git a/fsfe.org/internal/pd.en.xhtml b/fsfe.org/internal/pd.en.xhtml index 386a756196..04b1a51f11 100644 --- a/fsfe.org/internal/pd.en.xhtml +++ b/fsfe.org/internal/pd.en.xhtml @@ -1,6 +1,6 @@ - 1 + 2 Per Diem / VKP statement @@ -40,7 +40,7 @@ know whether a certain day counts as half/travel or full day.

-
+ @@ -48,43 +48,33 @@
- -
- -
- -
- -
-
- (Enter ? if you do not have it) +
+
- -
- + +
+ +
+
+ +
+ +
+ +
+
+ Leave blank for activities with only one trip (e.g. FOSDEM, SFSCON). + For activities involving more than one trip (e.g. multiple meetings), + please describe the trip in detail.
diff --git a/fsfe.org/internal/rc.en.xhtml b/fsfe.org/internal/rc.en.xhtml index 167517ede7..54f8a634bc 100644 --- a/fsfe.org/internal/rc.en.xhtml +++ b/fsfe.org/internal/rc.en.xhtml @@ -1,6 +1,6 @@ - 1 + 2 Reimbursement Claim / Credit Card statement @@ -22,32 +22,14 @@ selecting the correct type (Reimbursement Claim or Credit Card).

- +

1. Set general options

@@ -75,10 +57,9 @@
@@ -88,19 +69,26 @@
@@ -113,8 +101,8 @@ Date Amount Recipient - ER number - Catchphrase + Activity + Category Description Receipt Scan Rows @@ -124,9 +112,9 @@ "Belegdatum" for credit card statements In EUR. Format: 123,00 - Valid ER number - Catch phrase for the ER - What specifically was paid for. - if equal to catchphrase + What activity was this part of + What category is the expense + What specifically was paid for. Upload receipt as PDF, max. 2MB each Add a new row, or delete one @@ -135,8 +123,8 @@ Example 1: 16.04.2021 12,34 Berlin Bus Company - er.2021-04-16.123.4567 - Cool Conference + Select the activity + Select fitting category or "other" Bus ticket from Berlin to New York e.g. busticket.pdf @@ -146,8 +134,8 @@ Example 2: 17.04.2021 67,89 ACME - er.2021-04-17.890.1234 - New laptop for Jane Doe + + USB adapter for external keyboard e.g. acme-adapter.pdf @@ -157,9 +145,18 @@ - - - + + + @@ -199,5 +196,4 @@ - diff --git a/global/data/modules/fsfe-employee-options.en.xml b/global/data/modules/fsfe-employee-options.en.xml new file mode 100644 index 0000000000..0e5a9470fb --- /dev/null +++ b/global/data/modules/fsfe-employee-options.en.xml @@ -0,0 +1,27 @@ + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file