bool mmFilterTransactionsDialog::somethingSelected() { return getAccountCheckBox() || getDateRangeCheckBox() || payeeCheckBox_->IsChecked() || getCategoryCheckBox() || getStatusCheckBox() || getTypeCheckBox() || getAmountRangeCheckBoxMin() || getAmountRangeCheckBoxMax() || getNumberCheckBox() || getNotesCheckBox(); }
bool mmFilterTransactionsDialog::checkAll(const Model_Billsdeposits::Data &tran, const std::map<int, Model_Budgetsplittransaction::Data_Set>& splits) { bool ok = true; if (getAccountCheckBox() && (getAccountID() != tran.ACCOUNTID && getAccountID() != tran.TOACCOUNTID)) ok = false; else if (getDateRangeCheckBox() && !Model_Billsdeposits::TRANSDATE(tran) .IsBetween(getFromDateCtrl().GetDateOnly() , getToDateControl().GetDateOnly() ) ) ok = false; else if (!checkPayee<Model_Billsdeposits>(tran)) ok = false; else if (!checkCategory<Model_Billsdeposits>(tran, splits)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, true)) ok = false; else if (getAmountRangeCheckBoxMin() && getAmountMin() > tran.TRANSAMOUNT) ok = false; else if (getAmountRangeCheckBoxMax() && getAmountMax() < tran.TRANSAMOUNT) ok = false; else if (getNumberCheckBox() && getNumber() != tran.TRANSACTIONNUMBER) ok = false; else if (getNotesCheckBox() && !tran.NOTES.Lower().Contains(getNotes().Lower())) ok = false; return ok; }
bool mmFilterTransactionsDialog::checkAll(const Model_Checking::Data &tran, const int accountID, const std::map<int, Model_Splittransaction::Data_Set>& split) { bool ok = true; //wxLogDebug("Check date? %i trx date:%s %s %s", getDateRangeCheckBox(), tran.TRANSDATE, getFromDateCtrl().GetDateOnly().FormatISODate(), getToDateControl().GetDateOnly().FormatISODate()); if (getAccountCheckBox() && (getAccountID() != tran.ACCOUNTID && getAccountID() != tran.TOACCOUNTID)) ok = false; else if ( getDateRangeCheckBox() && !Model_Checking::TRANSDATE(tran).IsBetween( getFromDateCtrl().GetDateOnly(), getToDateControl().GetDateOnly()) ) ok = false; else if (getPayeeCheckBox() && !checkPayee<Model_Checking>(tran)) ok = false; else if (getCategoryCheckBox() && !checkCategory<Model_Checking>(tran, split)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, accountID == tran.ACCOUNTID)) ok = false; else if (getAmountRangeCheckBoxMin() && getAmountMin() > tran.TRANSAMOUNT) ok = false; else if (getAmountRangeCheckBoxMax() && getAmountMax() < tran.TRANSAMOUNT) ok = false; else if (getNumberCheckBox() && getNumber() != tran.TRANSACTIONNUMBER) ok = false; else if (getNotesCheckBox() && !tran.NOTES.Lower().Contains(getNotes().Lower())) ok = false; return ok; }