#include <transactioneditor.h>
Public Slots | |
int | slotEditSplits (void) |
void | slotUpdateAmount (const QString &) |
Public Member Functions | |
StdTransactionEditor () | |
StdTransactionEditor (TransactionEditorContainer *regForm, KMyMoneyRegister::Transaction *item, const KMyMoneyRegister::SelectedTransactions &list, const QDate &lastPostDate) | |
~StdTransactionEditor () | |
bool | isComplete (QString &reason) const |
QWidget * | firstWidget (void) const |
bool | eventFilter (QObject *o, QEvent *e) |
bool | createTransaction (MyMoneyTransaction &t, const MyMoneyTransaction &torig, const MyMoneySplit &sorig, bool skipPriceDialog=false) |
Protected Slots | |
void | slotReloadEditWidgets (void) |
void | slotUpdatePayment (const QString &) |
void | slotUpdateDeposit (const QString &) |
void | slotUpdateCategory (const QString &) |
void | slotUpdatePayee (const QString &) |
void | slotUpdateCashFlow (KMyMoneyRegister::CashFlowDirection) |
void | slotCreateCategory (const QString &, QString &) |
void | slotUpdateAction (int action) |
void | slotUpdateAccount (const QString &id) |
Protected Member Functions | |
void | createEditWidgets (void) |
void | loadEditWidgets (KMyMoneyRegister::Action action=KMyMoneyRegister::ActionNone) |
void | setupCategoryWidget (QString &) |
void | updateAmount (const MyMoneyMoney &value) |
bool | isTransfer (const QString &accId1, const QString &accId2) const |
void | checkPayeeInSplit (MyMoneySplit &s, const QString &payeeId) |
void | autoFill (const QString &payeeId) |
MyMoneyMoney | amountFromWidget (bool *update=0) const |
void | updateVAT (bool amountChanged=true) |
MyMoneyMoney | removeVatSplit (void) |
bool | addVatSplit (MyMoneyTransaction &tr, const MyMoneyMoney &amount) |
void | setupFinalWidgets (void) |
MyMoneyMoney | shares (const MyMoneyTransaction &t) const |
Private Attributes | |
MyMoneyMoney | m_shares |
bool | m_inUpdateVat |
StdTransactionEditor::StdTransactionEditor | ( | ) |
StdTransactionEditor::StdTransactionEditor | ( | TransactionEditorContainer * | regForm, | |
KMyMoneyRegister::Transaction * | item, | |||
const KMyMoneyRegister::SelectedTransactions & | list, | |||
const QDate & | lastPostDate | |||
) |
StdTransactionEditor::~StdTransactionEditor | ( | ) |
bool StdTransactionEditor::isComplete | ( | QString & | reason | ) | const [virtual] |
This method returns information about the completeness of the data entered. This can be used to control the availability of the 'Enter transaction' action.
true | if entering the transaction into the engine | |
false | if not enough information is present to enter the transaction into the engine |
reason | will be filled with a string about the reason why the completeness is not reached. Empty if the return value is true . |
Implements TransactionEditor.
QWidget* StdTransactionEditor::firstWidget | ( | void | ) | const [virtual] |
Returns a pointer to the widget that should receive the focus after the editor has been started.
Implements TransactionEditor.
bool StdTransactionEditor::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) |
Reimplemented from TransactionEditor.
bool StdTransactionEditor::createTransaction | ( | MyMoneyTransaction & | t, | |
const MyMoneyTransaction & | torig, | |||
const MyMoneySplit & | sorig, | |||
bool | skipPriceDialog = false | |||
) | [virtual] |
This method creates a transaction based on the contents of the current widgets, the splits in m_split in single selection mode or an existing transaction/split and the contents of the widgets in multi selection mode.
The split referencing the current account is returned as the first split in the transaction's split list.
t | reference to created transaction | |
torig | the original transaction | |
sorig | the original split | |
skipPriceDialog | if true the user will not be requested for price information (defaults to false ) |
false
if aborted by user, true
otherwiseImplements TransactionEditor.
int StdTransactionEditor::slotEditSplits | ( | void | ) | [virtual, slot] |
The default implementation returns QDialog::Rejected
Reimplemented from TransactionEditor.
void StdTransactionEditor::slotUpdateAmount | ( | const QString & | ) | [slot] |
void StdTransactionEditor::slotReloadEditWidgets | ( | void | ) | [protected, slot] |
Reimplemented from TransactionEditor.
void StdTransactionEditor::slotUpdatePayment | ( | const QString & | ) | [protected, slot] |
void StdTransactionEditor::slotUpdateDeposit | ( | const QString & | ) | [protected, slot] |
void StdTransactionEditor::slotUpdateCategory | ( | const QString & | ) | [protected, slot] |
void StdTransactionEditor::slotUpdatePayee | ( | const QString & | ) | [protected, slot] |
void StdTransactionEditor::slotUpdateCashFlow | ( | KMyMoneyRegister::CashFlowDirection | ) | [protected, slot] |
void StdTransactionEditor::slotCreateCategory | ( | const QString & | , | |
QString & | ||||
) | [protected, slot] |
void StdTransactionEditor::slotUpdateAction | ( | int | action | ) | [protected, slot] |
void StdTransactionEditor::slotUpdateAccount | ( | const QString & | id | ) | [protected, slot] |
Modify the account which the transaction should be based on. The initial value for the account is passed during setup().
id | of the account to be used |
Reimplemented from TransactionEditor.
void StdTransactionEditor::createEditWidgets | ( | void | ) | [protected, virtual] |
This method creates all necessary widgets for this transaction editor. All signals will be connected to the relevant slots.
Implements TransactionEditor.
void StdTransactionEditor::loadEditWidgets | ( | KMyMoneyRegister::Action | action = KMyMoneyRegister::ActionNone |
) | [protected, virtual] |
This method (re-)loads the widgets with the transaction information contained in m_transaction and m_split.
action | preset the edit wigdets for action if no transaction is present |
Implements TransactionEditor.
void StdTransactionEditor::setupCategoryWidget | ( | QString & | ) | [protected] |
void StdTransactionEditor::updateAmount | ( | const MyMoneyMoney & | value | ) | [protected] |
bool StdTransactionEditor::isTransfer | ( | const QString & | accId1, | |
const QString & | accId2 | |||
) | const [protected] |
void StdTransactionEditor::checkPayeeInSplit | ( | MyMoneySplit & | s, | |
const QString & | payeeId | |||
) | [protected] |
void StdTransactionEditor::autoFill | ( | const QString & | payeeId | ) | [protected] |
This method fills the editor widgets with the last transaction that can be found for payee payeeId in the account m_account.
MyMoneyMoney StdTransactionEditor::amountFromWidget | ( | bool * | update = 0 |
) | const [protected] |
Extracts the amount of the transaction from the widgets depending if form or register based input method is used. Returns if an amount has been found in update.
update | pointer to update information flag |
void StdTransactionEditor::updateVAT | ( | bool | amountChanged = true |
) | [protected] |
Create or update a VAT split
MyMoneyMoney StdTransactionEditor::removeVatSplit | ( | void | ) | [protected] |
bool StdTransactionEditor::addVatSplit | ( | MyMoneyTransaction & | tr, | |
const MyMoneyMoney & | amount | |||
) | [protected] |
This method adds a VAT split to transaction tr if necessary.
tr | transaction that the split should be added to | |
amount | Amount to be used for the calculation. Depending upon the setting of the resp. category, this value is treated as either gross or net value. |
false | VAT split has not been added | |
true | VAT split has been added |
void StdTransactionEditor::setupFinalWidgets | ( | void | ) | [protected, virtual] |
Implements TransactionEditor.
MyMoneyMoney StdTransactionEditor::shares | ( | const MyMoneyTransaction & | t | ) | const [protected] |
This method returns the sum of all splits of transaction t that reference account m_account.
MyMoneyMoney StdTransactionEditor::m_shares [private] |
bool StdTransactionEditor::m_inUpdateVat [private] |