eventsmanager

Admin-Bookings summary page - Amount Paid

Jun 18th, 2015
595
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. This snippet will get the amount paid when you edit the bookings in the admin-dashboard and use Offline payment "Add Offline Payment"
  3. */
  4.  
  5. function my_em_bookings_table_cols_template_amtpaid($template, $EM_Bookings_Table){
  6. $template['amt_paid'] = 'Amount Paid';
  7. return $template;
  8. }
  9. add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_amtpaid',10,2);
  10.  
  11. function my_em_custom_booking_form_cols_amtpaid($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
  12. global $wpdb;
  13.  
  14. $paid_amount = $wpdb->get_var('SELECT sum(transaction_total_amount) FROM wp_em_transactions WHERE booking_id = '.$EM_Booking->booking_id);
  15.  
  16. $val = em_get_currency_formatted($paid_amount);
  17.  
  18. return $val;
  19. }
  20. add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_amtpaid', 10, 5);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×