KTagListItem::KTagListItem(QListWidget *parent, const MyMoneyTag& tag) : QListWidgetItem(parent, QListWidgetItem::UserType), m_tag(tag) { setText(tag.name()); // allow in column rename setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); }
void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) { s << " ID = " << it_t.id() << "\n"; s << " Postdate = " << it_t.postDate().toString(Qt::ISODate) << "\n"; s << " EntryDate = " << it_t.entryDate().toString(Qt::ISODate) << "\n"; s << " Commodity = [" << it_t.commodity() << "]\n"; s << " Memo = " << it_t.memo() << "\n"; s << " BankID = " << it_t.bankID() << "\n"; dumpKVP("KVP:", s, it_t, 2); s << " Splits\n"; s << " ------\n"; QList<MyMoneySplit>::ConstIterator it_s; for (it_s = it_t.splits().constBegin(); it_s != it_t.splits().constEnd(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Transaction = " << (*it_s).transactionId() << "\n"; s << " Payee = " << (*it_s).payeeId(); if (!(*it_s).payeeId().isEmpty()) { MyMoneyPayee p = storage->payee((*it_s).payeeId()); s << " (" << p.name() << ")" << "\n"; } else s << " ()\n"; for (int i = 0; i < (*it_s).tagIdList().size(); i++) { s << " Tag = " << (*it_s).tagIdList()[i]; if (!(*it_s).tagIdList()[i].isEmpty()) { MyMoneyTag ta = storage->tag((*it_s).tagIdList()[i]); s << " (" << ta.name() << ")" << "\n"; } else s << " ()\n"; } s << " Account = " << (*it_s).accountId(); MyMoneyAccount acc; try { acc = storage->account((*it_s).accountId()); s << " (" << acc.name() << ") [" << acc.currencyId() << "]\n"; } catch (const MyMoneyException &) { s << " (---) [---]\n"; } s << " Memo = " << (*it_s).memo() << "\n"; if ((*it_s).value() == MyMoneyMoney::autoCalc) s << " Value = will be calculated" << "\n"; else s << " Value = " << (*it_s).value().formatMoney("", 2) << " (" << (*it_s).value().toString() << ")\n"; s << " Shares = " << (*it_s).shares().formatMoney("", 2) << " (" << (*it_s).shares().toString() << ")\n"; s << " Action = '" << (*it_s).action() << "'\n"; s << " Nr = '" << (*it_s).number() << "'\n"; s << " ReconcileFlag = '" << reconcileToString((*it_s).reconcileFlag()) << "'\n"; if ((*it_s).reconcileFlag() != MyMoneySplit::NotReconciled) { s << " ReconcileDate = " << (*it_s).reconcileDate().toString(Qt::ISODate) << "\n"; } s << " BankID = " << (*it_s).bankID() << "\n"; dumpKVP("KVP:", s, (*it_s), 4); s << "\n"; } s << "\n"; }
bool MyMoneyTag::operator < (const MyMoneyTag& right) const { return m_name < right.name(); }