Skip to content

Commit

Permalink
Removes failed contributions from monthly reports
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Mar 27, 2020
1 parent 832bba5 commit b142a11
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ void DatabaseContributionInfo::GetContributionReport(
"SELECT ci.contribution_id, ci.amount, ci.type, ci.created_at "
"FROM %s as ci "
"WHERE strftime('%%m', datetime(ci.created_at, 'unixepoch')) = ? AND "
"strftime('%%Y', datetime(ci.created_at, 'unixepoch')) = ?",
"strftime('%%Y', datetime(ci.created_at, 'unixepoch')) = ? AND step = ?",
table_name_);

auto command = ledger::DBCommand::New();
Expand All @@ -665,6 +665,8 @@ void DatabaseContributionInfo::GetContributionReport(

BindString(command.get(), 0, formatted_month);
BindString(command.get(), 1, std::to_string(year));
BindInt(command.get(), 2,
static_cast<int>(ledger::ContributionStep::STEP_COMPLETED));

command->record_bindings = {
ledger::DBCommand::RecordBindingType::STRING_TYPE,
Expand Down

0 comments on commit b142a11

Please sign in to comment.