Skip to content

Commit

Permalink
Merge branch 'aa5sh_588' into testing_0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed Feb 2, 2025
2 parents 183d2e0 + 873d44f commit 7e054ac
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ui/AwardsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,17 @@ void AwardsDialog::refreshTable(int)

addlCTEs.append(sourceContactsTable);

QString totalTable;

if (awardSelected == "dxcc")
{
totalTable = "dxcc_entities d LEFT OUTER JOIN source_contacts c ON d.id = c.dxcc";
}
else
{
totalTable = "source_contacts c";
}

QString finalSQL(QString(
"WITH "
" %1, "
Expand All @@ -352,12 +363,12 @@ void AwardsDialog::refreshTable(int)
" GROUP BY 1,2) "
"SELECT * FROM ( "
" SELECT 0 column_idx, '%6', COUNT(DISTINCT %7), %8"
" FROM source_contacts c INNER JOIN modes m ON c.mode = m.name"
" FROM %23 INNER JOIN modes m ON c.mode = m.name"
" WHERE m.dxcc IN (%9)"
" %10"
" UNION ALL "
" SELECT 0 column_idx, '%11', COUNT(DISTINCT %12), %13"
" FROM source_contacts c INNER JOIN modes m ON c.mode = m.name "
" FROM %23 INNER JOIN modes m ON c.mode = m.name "
" WHERE (%14)"
" AND m.dxcc IN (%15)"
" %16"
Expand Down Expand Up @@ -406,7 +417,7 @@ void AwardsDialog::refreshTable(int)
tr("Worked")).arg(
stmt_sum_worked.join(","),
stmt_sum_total.join(","),
ui->notWorkedCheckBox->isChecked() ? QString("HAVING %1").arg(stmt_having.join(" AND ")) : QString() ));
ui->notWorkedCheckBox->isChecked() ? QString("HAVING %1").arg(stmt_having.join(" AND ")) : QString(),totalTable ));
qDebug(runtime) << finalSQL;

detailedViewModel->setQuery(finalSQL);
Expand Down

0 comments on commit 7e054ac

Please sign in to comment.