Changeset 3303
- Timestamp:
- 06/06/2016 08:43:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php
r3155 r3303 780 780 if ( ! empty( $expense['_wcbrr_amount'] ) ) { 781 781 $amount += floatval( $expense['_wcbrr_amount'] ); 782 }783 784 if ( ! empty( $expense['_wcbrr_category'] ) ) {785 $categories[] = $expense['_wcbrr_category'];786 782 } 787 783 } … … 811 807 fputcsv( $report, $row ); 812 808 } 809 810 // Break out expenses into individual line items 811 foreach ( $expenses as $expense ) { 812 fputcsv( $report, _generate_payment_report_default_line_items( $expense, $row ) ); 813 } 813 814 } 814 815 815 816 fclose( $report ); 816 817 return ob_get_clean(); 818 } 819 820 /** 821 * Generate a CSV row for an expense line item 822 * 823 * @param array $expense 824 * @param array $row 825 * 826 * @return array 827 */ 828 function _generate_payment_report_default_line_items( $expense, $row ) { 829 /* 830 * Empty out fields we're not going to re-use for the line-item 831 * 832 * The ID field is left in, so it can be used to keep line-item fields grouped with their parent when the rows 833 * are sorted. 834 */ 835 $empty_fields = array( 0, 3, 4, 7, 9, 10, 11, 12 ); 836 foreach ( $empty_fields as $index ) { 837 $row[ $index ] = ''; 838 } 839 840 // Fill in line-item fields 841 $row[2] = $expense['_wcbrr_vendor_name'] .' - '. $expense['_wcbrr_description']; 842 $row[5] = $expense['_wcbrr_date']; 843 $row[6] = $expense['_wcbrr_amount']; 844 $row[8] = $expense['_wcbrr_category']; 845 846 return $row; 817 847 } 818 848
Note: See TracChangeset
for help on using the changeset viewer.