Browse Source

revert hiding of zero perdiem days

svn path=/trunk/; revision=35257
tags/stw2018
Max Mehl 2 years ago
parent
commit
a293352139
1 changed files with 46 additions and 47 deletions
  1. 46
    47
      cgi-bin/perdiem.php

+ 46
- 47
cgi-bin/perdiem.php View File

@@ -183,54 +183,53 @@ foreach ($days as &$d) { // calculate for each day
if ($rc_er === '') { $rc_er = "ER-NUMBER"; }
if ($rc_catch === '') { $rc_catch = "CATCHPHRASE"; }
if ($r_day[$d] !== 0) {
$output .= "<tr>";
// 1. Name
$output .= "<td>" . $rc_name . "</td>";
// 2. Date
$output .= "<td>" . $date[$d] . "</td>";
// 3. Amount
$r_day[$d] = preg_replace("/\./", ",", $r_day[$d]); // replace . by , in amount to make it compatible with the used spreadsheet template
$output .= "<td>" . $r_day[$d] . "</td>";
// 4. Recipient Name (empty)
$output .= "<td></td>";
// 5. ER number
$output .= "<td>" . $rc_er . "</td>";
// 6. Catchphrase
$output .= "<td>" . $rc_catch . "</td>";
// 7. Receipt/per diem
$output .= "<td>per diem</td>";
// 8. Remarks
if ($break[$d] === "yes") {
$remark[$d] = "breakfast+";
}
if ($lunch[$d] === "yes") {
$remark[$d] .= "lunch+";
}
if ($dinner[$d] === "yes") {
$remark[$d] .= "dinner";
}
if ($break[$d] != "yes" && $lunch[$d] != "yes" && $dinner[$d] != "yes") {
$remark[$d] = "nothing";
}
if ($break[$d] === "yes" && $lunch[$d] === "yes" && $dinner[$d] === "yes") {
$remark[$d] = "everything";
}
$remark[$d] = preg_replace("/\+$/", "", $remark[$d]);
$remark[$d] .= " self-paid";
$output .= "<td>" . $remark[$d] . "</td>";
$output .= "</tr>";
$output .= "<tr>";
// 1. Name
$output .= "<td>" . $rc_name . "</td>";
// 2. Date
$output .= "<td>" . $date[$d] . "</td>";
// 3. Amount
$r_day[$d] = preg_replace("/\./", ",", $r_day[$d]); // replace . by , in amount to make it compatible with the used spreadsheet template
$output .= "<td>" . $r_day[$d] . "</td>";
// 4. Recipient Name (empty)
$output .= "<td></td>";
// 5. ER number
$output .= "<td>" . $rc_er . "</td>";
// 6. Catchphrase
$output .= "<td>" . $rc_catch . "</td>";
// 7. Receipt/per diem
$output .= "<td>per diem</td>";
// 8. Remarks
if ($break[$d] === "yes") {
$remark[$d] = "breakfast+";
}
if ($lunch[$d] === "yes") {
$remark[$d] .= "lunch+";
}
if ($dinner[$d] === "yes") {
$remark[$d] .= "dinner";
}
if ($break[$d] != "yes" && $lunch[$d] != "yes" && $dinner[$d] != "yes") {
$remark[$d] = "nothing";
}
if ($break[$d] === "yes" && $lunch[$d] === "yes" && $dinner[$d] === "yes") {
$remark[$d] = "everything";
}
$remark[$d] = preg_replace("/\+$/", "", $remark[$d]);
$remark[$d] .= " self-paid";
$output .= "<td>" . $remark[$d] . "</td>";
$output .= "</tr>";
}

}

Loading…
Cancel
Save