Making WordPress.org

Changeset 2974


Ignore:
Timestamp:
04/18/2016 12:43:31 PM (8 years ago)
Author:
kovshenin
Message:

WordCamp.org: Record the payment date for reimbursements and vendor payments from JPM imports.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/wordcamp-budgets-dashboard.php

    r2862 r2974  
    729729            'processed' => false,
    730730            'message' => null,
     731            'date' => null,
    731732
    732733            'edit_all_url' => null,
     
    742743                    $entry['amount'] = round( floatval( $line[13] ), 2 );
    743744                    $entry['currency'] = strtoupper( $line[14] );
     745
     746                    $date = date_create_from_format( 'm/d/y', $line[21] );
     747                    $entry['date'] = strtotime( $date->format( 'Y-m-d 00:00:00' ) );
    744748                }
    745749                break;
     
    751755                    $entry['amount'] = round( floatval( $line[13] ), 2 );
    752756                    $entry['currency'] = strtoupper( $line[14] );
     757
     758                    $date = date_create_from_format( 'm/d/y', $line[21] );
     759                    $entry['date'] = strtotime( $date->format( 'Y-m-d 00:00:00' ) );
    753760                }
    754761                break;
     
    801808
    802809    $currency = false;
    803     $amout = false;
     810    $amount = false;
     811    $date_key = '_wcbrr_date_paid';
    804812
    805813    if ( $post->post_type == 'wcb_reimbursement' ) {
     
    811819            }
    812820        }
     821
     822        $date_key = '_wcbrr_date_paid';
     823
    813824    } elseif ( $post->post_type == 'wcp_payment_request' ) {
    814825        $currency = get_post_meta( $post->ID, '_camppayments_currency', true );
    815826        $amount = floatval( get_post_meta( $post->ID, '_camppayments_payment_amount', true ) );
     827
     828        $date_key = '_camppayments_date_vendor_paid';
    816829    }
    817830    $amount = round( $amount, 2 );
     
    837850        }
    838851
     852        update_post_meta( $post->ID, $date_key, $entry['date'] );
     853
    839854        $post->post_status = 'wcb-paid';
    840855        wp_insert_post( $post );
     
    852867        }
    853868
     869        update_post_meta( $post->ID, $date_key, $entry['date'] );
     870
    854871        $post->post_status = 'wcb-paid';
    855872        wp_insert_post( $post );
Note: See TracChangeset for help on using the changeset viewer.