Excel-Export
[memberdb.git] / include / fees.php
index 581686b..c168a66 100644 (file)
@@ -401,7 +401,7 @@ function render_next_direct_debit() {/*{{{*/
 }
 
 function render_fees_for_member($member_id) {/*{{{*/
-    global $MEMBER_TYPES, $EARNING_TYPES;
+    global $MEMBER_TYPES, $EARNING_TYPES, $EXPENSE_TYPES;
 
     $member      = db_get_member_with_id($member_id);
     if (!isset($member)) redirect(link_to('fees'));
@@ -409,7 +409,7 @@ function render_fees_for_member($member_id) {/*{{{*/
     $membership_info = fees_get_list_for_member($member_id, time());
     $membership_info = array_reverse($membership_info, true);
 
-    $paid_fees = array_reverse(finance_list_paid_fees_for_member($member_id, time(), true));
+    $paid_fees = finance_list_paid_fees_for_member($member_id, time(), true);
 
     $sum_new_paid = finance_get_paid_fees_for_member($member_id);
     $sum_old_paid = finance_get_paid_fees_for_member($member_id, true);
@@ -507,7 +507,7 @@ function render_fees_for_member($member_id) {/*{{{*/
 <?php foreach ($paid_fees as $payment) : ?>
     <tr>
         <td><?=html_escape(format_date(db_date2unixtime($payment['date'])))?></td>
-        <td><?=$EARNING_TYPES[$payment['type']]?></td>
+        <td><?=($payment['value'] < 0) ? $EXPENSE_TYPES[$payment['type']]: $EARNING_TYPES[$payment['type']]?></td>
         <td style="text-align: right;"><?=format_money($payment['value'])?></td>
     </tr>
 <?php endforeach ?>