Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-707 Naprawić nieprawidłowo zliczające się statystyki w zakładce Ra… #32

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions includes/payments/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function edd_delete_purchase( $payment_id = 0, $update_customer = true, $delete_

$customer = new EDD_Customer( $customer_id );

if( $status == 'revoked' || $status == 'publish' ) {
if( $status == 'publish' ) {
// Only decrease earnings if they haven't already been decreased (or were never increased for this payment)
edd_decrease_total_earnings( $amount );
// Clear the This Month earnings (this_monththis_month is NOT a typo)
Expand Down Expand Up @@ -701,7 +701,7 @@ function edd_get_earnings_by_date( $day, $month_num, $year = null, $hour = null,
'nopaging' => true,
'year' => $year,
'monthnum' => $month_num,
'post_status' => array( 'publish', 'revoked' ),
'post_status' => array( 'publish' ),
'fields' => 'ids',
'update_post_term_cache' => false,
'include_taxes' => $include_taxes,
Expand Down Expand Up @@ -758,7 +758,7 @@ function edd_get_sales_by_date( $day = null, $month_num = null, $year = null, $h
'nopaging' => true,
'year' => $year,
'fields' => 'ids',
'post_status' => array( 'publish', 'revoked' ),
'post_status' => array( 'publish' ),
'update_post_meta_cache' => false,
'update_post_term_cache' => false
);
Expand Down Expand Up @@ -831,7 +831,7 @@ function edd_is_payment_complete( $payment_id = 0 ) {
*/
function edd_get_total_sales() {
$payments = edd_count_payments();
return $payments->revoked + $payments->publish;
return $payments->publish;
}

/**
Expand Down