|
|
|
@ -1,10 +1,15 @@
|
|
|
|
|
#include "reportmodel.h" |
|
|
|
|
|
|
|
|
|
#include <QFont> |
|
|
|
|
#include <QSettings> |
|
|
|
|
|
|
|
|
|
ReportModel::ReportModel(Marketplace* market, QObject* parent) |
|
|
|
|
: QAbstractTableModel(parent), market_(market) |
|
|
|
|
{ |
|
|
|
|
QSettings settings; |
|
|
|
|
feeInPercent_ = settings.value("global/feeInPercent").toInt(); |
|
|
|
|
maxFeeInCent_ = settings.value("global/maxFeeInEuro").toInt() * 100; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int ReportModel::rowCount([[maybe_unused]] const QModelIndex& parent) const |
|
|
|
@ -67,7 +72,7 @@ QVariant ReportModel::data(const QModelIndex& index, int role) const
|
|
|
|
|
case 5: |
|
|
|
|
return seller->sumAsString().c_str(); |
|
|
|
|
case 6: |
|
|
|
|
return paymentAsString(seller->sumInCents(), 20).c_str(); |
|
|
|
|
return paymentAsString(seller->sumInCents(), feeInPercent_, maxFeeInCent_).c_str(); |
|
|
|
|
default: |
|
|
|
|
return "???"; |
|
|
|
|
} |
|
|
|
|