| @@ 90-104 (lines=15) @@ | ||
| 87 | $payments = $payments->get_payments(); |
|
| 88 | ||
| 89 | if ( $payments ) { |
|
| 90 | foreach ( $payments as $payment ) { |
|
| 91 | //Ensure acceptible status only |
|
| 92 | if ( ! in_array( $payment->post_status, $accepted_statuses ) ) { |
|
| 93 | continue; |
|
| 94 | } |
|
| 95 | ||
| 96 | //Ensure only payments for this form are counted |
|
| 97 | if ( $payment->form_id != $this->form_id ) { |
|
| 98 | continue; |
|
| 99 | } |
|
| 100 | ||
| 101 | $totals['sales'] ++; |
|
| 102 | $totals['earnings'] += $payment->total; |
|
| 103 | ||
| 104 | } |
|
| 105 | ||
| 106 | $this->store_data( 'give_temp_recount_form_stats', $totals ); |
|
| 107 | ||
| @@ 1576-1590 (lines=15) @@ | ||
| 1573 | $payments = $payments->get_payments(); |
|
| 1574 | ||
| 1575 | if ( $payments ) { |
|
| 1576 | foreach ( $payments as $payment ) { |
|
| 1577 | //Ensure acceptible status only |
|
| 1578 | if ( ! in_array( $payment->post_status, $accepted_statuses ) ) { |
|
| 1579 | continue; |
|
| 1580 | } |
|
| 1581 | ||
| 1582 | //Ensure only payments for this form are counted |
|
| 1583 | if ( $payment->form_id != $form_id ) { |
|
| 1584 | continue; |
|
| 1585 | } |
|
| 1586 | ||
| 1587 | $totals['sales'] ++; |
|
| 1588 | $totals['earnings'] += $payment->total; |
|
| 1589 | ||
| 1590 | } |
|
| 1591 | } |
|
| 1592 | give_update_meta( $form_id, '_give_form_sales', $totals['sales'] ); |
|
| 1593 | give_update_meta( $form_id, '_give_form_earnings', give_sanitize_amount_for_db( $totals['earnings'] ) ); |
|