From: <vo...@us...> - 2013-06-25 06:50:47
|
Revision: 4175 http://sourceforge.net/p/moneymanagerex/code/4175 Author: vomikan Date: 2013-06-25 06:50:43 +0000 (Tue, 25 Jun 2013) Log Message: ----------- Fix for payee name Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-06-25 06:42:47 UTC (rev 4174) +++ trunk/src/transdialog.cpp 2013-06-25 06:50:43 UTC (rev 4175) @@ -137,7 +137,7 @@ payeeID_ = pBankTransaction_->payeeID_; if (payeeID_ > -1) // !bTransfer payeeUnknown_ = false; - payee_name_ = pBankTransaction_->payeeStr_; + payee_name_ = core_->payeeList_.GetPayeeName(pBankTransaction_->payeeID_); textNotes_->SetValue(pBankTransaction_->notes_); textNumber_->SetValue(pBankTransaction_->transNum_); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-02 17:27:14
|
Revision: 4236 http://sourceforge.net/p/moneymanagerex/code/4236 Author: vomikan Date: 2013-07-02 17:27:10 +0000 (Tue, 02 Jul 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-07-02 13:10:16 UTC (rev 4235) +++ trunk/src/transdialog.cpp 2013-07-02 17:27:10 UTC (rev 4236) @@ -234,7 +234,12 @@ void mmTransDialog::SetTransferControls(bool transfer) { - cbPayee_ -> SetEvtHandlerEnabled(false); + textAmount_->UnsetToolTip(); + toTextAmount_->UnsetToolTip(); + cbPayee_->UnsetToolTip(); + cbAccount_->UnsetToolTip(); + + cbPayee_->SetEvtHandlerEnabled(false); bPayee_->Enable(!transfer); cAdvanced_->SetValue(advancedToTransAmountSet_); @@ -244,16 +249,15 @@ cbPayee_->Clear(); payee_name_.Clear(); payeeID_ = -1; - wxArrayString data; + wxSortedArrayString data; int type_num = transaction_type_->GetSelection(); newAccountID_ = accountID_; cbAccount_->Clear(); data = core_->accountList_.getAccountsName(); - for (size_t i = 0; i < data.Count(); ++i) - { - cbAccount_ ->Append(data[i]); - } + for (const auto &entry : data) + cbAccount_ ->Append(entry); + cbAccount_->SetStringSelection(core_->accountList_.GetAccountName(accountID_)); cbAccount_->AutoComplete(data); @@ -269,33 +273,24 @@ toTextAmount_->Enable(cAdvanced_->GetValue()); - if (toID_ > 0) dataStr = (core_->accountList_.GetAccountName(toID_)); + if (toID_ > 0) dataStr = core_->accountList_.GetAccountName(toID_); data = core_->accountList_.getAccountsName(); payee_label_->SetLabel(_("To")); - cbPayee_->UnsetToolTip(); cbPayee_->SetToolTip(_("Specify which account the transfer is going to")); - cbAccount_->UnsetToolTip(); cbAccount_->SetToolTip(_("Specify which account the transfer is going from")); account_label_->SetLabel(_("From")); } else { textAmount_->SetToolTip(amountNormalTip_); - toTextAmount_->UnsetToolTip(); if (type_num == DEF_WITHDRAWAL) - { - cbPayee_->UnsetToolTip(); cbPayee_->SetToolTip(_("Specify to whom the transaction is going to")); - payee_label_->SetLabel(_("Payee")); - } else - { - cbPayee_->UnsetToolTip(); cbPayee_->SetToolTip(_("Specify where the transaction is coming from")); - payee_label_->SetLabel(_("From")); - } - cbAccount_->UnsetToolTip(); + + payee_label_->SetLabel((type_num == DEF_WITHDRAWAL) ? _("Payee") : _("From")); + cbAccount_->SetToolTip(_("Specify account for the transaction")); account_label_->SetLabel(_("Account")); @@ -309,10 +304,8 @@ dataStr = payee_name_; } - for (size_t i = 0; i < data.Count(); ++i) - { - cbPayee_ ->Append(data[i]); - } + for (const auto & entry : data) + cbPayee_ ->Append(entry); cbPayee_->AutoComplete(data); if (!cbPayee_ -> SetStringSelection(dataStr)) @@ -611,7 +604,7 @@ wxDateTime transaction_date = dpc_->GetValue(); wxArrayString number_strings = core_->bTransactionList_.getTransactionNumber(accountID_, transaction_date); int i = number_strings.GetCount(); - int s =0; + int s = 0; if (number_strings.Index(current_number) != wxNOT_FOUND) s = number_strings.Index(current_number); i = (s+1)%i; @@ -659,7 +652,7 @@ textAmount_->SetValue(amountStr); } - CurrencyFormatter::formatCurrencyToDouble(amountStr, transAmount_); + CurrencyFormatter::formatCurrencyToDouble(amountStr, transAmount_); if (toID_ > 0) { double rateFrom = core_->accountList_.getAccountBaseCurrencyConvRate(accountID_); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-02 17:59:30
|
Revision: 4237 http://sourceforge.net/p/moneymanagerex/code/4237 Author: vomikan Date: 2013-07-02 17:59:28 +0000 (Tue, 02 Jul 2013) Log Message: ----------- fix for category selector Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-07-02 17:27:10 UTC (rev 4236) +++ trunk/src/transdialog.cpp 2013-07-02 17:59:28 UTC (rev 4237) @@ -679,24 +679,27 @@ void mmTransDialog::OnCategoryKey(wxKeyEvent& event) { + bool skip = false; if ( !event.HasModifiers() ) { //TODO: Get national (non Latin) keys - categStrykes_ << event.GetUnicodeKey(); - wxString test = wxString()<<event.GetUnicodeKey(); + wxString key = wxString() << event.GetUnicodeKey(); + categStrykes_ << key; + if (key <= " ") skip = true; if (!timer_->IsRunning ()) timer_->Start(INTERVAL, true); core_->categoryList_.GetCategoryLikeString(categStrykes_, categID_, subcategID_); - wxLogDebug(categStrykes_ + " | " + core_->categoryList_.GetFullCategoryString(categID_, subcategID_)); - wxLogDebug(test); + //wxLogDebug(key + " | " + categStrykes_ + " | " + core_->categoryList_.GetFullCategoryString(categID_, subcategID_)); bCategory_->SetLabel(core_->categoryList_.GetFullCategoryString(categID_, subcategID_)); + categoryName_ = core_->categoryList_.GetCategoryName(categID_); + subCategoryName_ = core_->categoryList_.GetSubCategoryName(categID_, subcategID_); } else - { - event.Skip(); - } + skip = true; + + if (skip) event.Skip(); } void mmTransDialog::ResetKeyStrikes(wxTimerEvent& /*event*/) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-26 16:28:32
|
Revision: 4424 http://sourceforge.net/p/moneymanagerex/code/4424 Author: vomikan Date: 2013-07-26 16:28:28 +0000 (Fri, 26 Jul 2013) Log Message: ----------- Fix for payee chooser Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-07-26 15:46:17 UTC (rev 4423) +++ trunk/src/transdialog.cpp 2013-07-26 16:28:28 UTC (rev 4424) @@ -771,7 +771,7 @@ } } - if (payeeID_ == -1 && !bTransfer) + if (!bTransfer) { wxString payee_name = cbPayee_->GetValue(); if (payee_name.IsEmpty()) @@ -779,16 +779,18 @@ mmShowErrorMessageInvalid(this, _("Payee")); return; } - else if (core_->payeeList_.FilterPayees("").IsEmpty()) - { - payeeID_ = core_->payeeList_.AddPayee(payee_name); - } + + if (payeeID_ > -1) + payee_name = core_->payeeList_.GetPayeeName(payeeID_); else + payeeID_ = core_->payeeList_.GetPayeeId(payee_name); + + if (payeeID_ < 0) { wxMessageDialog msgDlg( this , wxString::Format(_("Do you want to add new payee: \n%s?"), payee_name) , _("Confirm to add new payee") - , wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION); + , wxYES_NO | wxYES_DEFAULT | wxICON_WARNING); if (msgDlg.ShowModal() == wxID_YES) { payeeID_ = core_->payeeList_.AddPayee(payee_name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-08 09:42:54
|
Revision: 4456 http://sourceforge.net/p/moneymanagerex/code/4456 Author: vomikan Date: 2013-09-08 09:42:51 +0000 (Sun, 08 Sep 2013) Log Message: ----------- fix for payee combo box Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-08 09:18:44 UTC (rev 4455) +++ trunk/src/transdialog.cpp 2013-09-08 09:42:51 UTC (rev 4456) @@ -796,10 +796,7 @@ return; } - if (payeeID_ > -1) - payee_name = core_->payeeList_.GetPayeeName(payeeID_); - else - payeeID_ = core_->payeeList_.GetPayeeId(payee_name); + payeeID_ = core_->payeeList_.GetPayeeId(payee_name); if (payeeID_ < 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-09 09:42:13
|
Revision: 4462 http://sourceforge.net/p/moneymanagerex/code/4462 Author: vomikan Date: 2013-09-09 09:42:05 +0000 (Mon, 09 Sep 2013) Log Message: ----------- wxLogDebug added to monitoring auto payee category Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-09 07:13:07 UTC (rev 4461) +++ trunk/src/transdialog.cpp 2013-09-09 09:42:05 UTC (rev 4462) @@ -415,6 +415,8 @@ cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); + cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_COMBOBOX_CLOSEUP, + wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); cbPayee_ -> SetEvtHandlerEnabled(!edit_); @@ -531,10 +533,12 @@ if (!transfer_transaction) { payeeID_ = core_->payeeList_.GetPayeeId(payee_name_); + wxLogDebug("Payee: %s id: %i", payee_name_, payeeID_); // Only for new transactions: if user want to autofill last category used for payee. // If this is a Split Transaction, ignore displaying last category for payee - if (payeeID_ != -1 && mmIniOptions::instance().transCategorySelectionNone_ == 1 && !edit_ && !categUpdated_ && split_->numEntries() == 0) + if (payeeID_ != -1 && mmIniOptions::instance().transCategorySelectionNone_ == 1 + && !edit_ && !categUpdated_ && split_->numEntries() == 0) { mmPayee* pPayee = core_->payeeList_.GetPayeeSharedPtr(payeeID_); // if payee has memory of last category used then display last category for payee @@ -543,6 +547,7 @@ categID_ = pPayee->categoryId_; subcategID_ = pPayee->subcategoryId_; bCategory_->SetLabel(core_->categoryList_.GetFullCategoryString(categID_, subcategID_)); + wxLogDebug("Category: %s", core_->categoryList_.GetFullCategoryString(categID_, subcategID_)); categoryName_ = core_->categoryList_.GetCategoryName(categID_); subCategoryName_ = core_->categoryList_.GetSubCategoryName(categID_, subcategID_); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-09-16 10:10:50
|
Revision: 4488 http://sourceforge.net/p/moneymanagerex/code/4488 Author: guanlisheng Date: 2013-09-16 10:10:48 +0000 (Mon, 16 Sep 2013) Log Message: ----------- more Model_Payee Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-16 10:08:54 UTC (rev 4487) +++ trunk/src/transdialog.cpp 2013-09-16 10:10:48 UTC (rev 4488) @@ -839,13 +839,6 @@ } else { - // save the category used for this payee to allow automatic category fill at user request. - mmPayee* pPayee = core_->payeeList_.GetPayeeSharedPtr(payeeID_); - pPayee->categoryId_ = categID_; - pPayee->subcategoryId_ = subcategID_; - core_->payeeList_.UpdatePayee(payeeID_, ""); - - // use model to save Model_Payee::Data* payee = Model_Payee::instance().get(payeeID_); payee->CATEGID = categID_; payee->SUBCATEGID = subcategID_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-09-16 16:05:30
|
Revision: 4498 http://sourceforge.net/p/moneymanagerex/code/4498 Author: guanlisheng Date: 2013-09-16 16:05:27 +0000 (Mon, 16 Sep 2013) Log Message: ----------- more Model_Payee Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-16 15:50:19 UTC (rev 4497) +++ trunk/src/transdialog.cpp 2013-09-16 16:05:27 UTC (rev 4498) @@ -134,7 +134,8 @@ toID_ = pBankTransaction_->toAccountID_; payeeID_ = pBankTransaction_->payeeID_; - payee_name_ = core_->payeeList_.GetPayeeName(pBankTransaction_->payeeID_); + Model_Payee::Data* payee = Model_Payee::instance().get(payeeID_); + if (payee) payee_name_ = payee->PAYEENAME; textNotes_->SetValue(pBankTransaction_->notes_); textNumber_->SetValue(pBankTransaction_->transNum_); @@ -210,7 +211,9 @@ { payeeID_ = core_->bTransactionList_.getLastUsedPayeeID(accountID_ , sTransaction_type_, categID_, subcategID_); - payee_name_ = core_->payeeList_.GetPayeeName(payeeID_); + + Model_Payee::Data *payee = Model_Payee::instance().get(payeeID_); + if (payee) payee_name_ = payee->PAYEENAME; } wxString categString = resetCategoryString(); @@ -537,7 +540,8 @@ bool transfer_transaction = transaction_type_->GetStringSelection() == wxGetTranslation(TRANS_TYPE_TRANSFER_STR); if (!transfer_transaction) { - payeeID_ = core_->payeeList_.GetPayeeId(payee_name_); + const Model_Payee::Data *payee = Model_Payee::instance().get(payee_name_); + if (payee) payeeID_ = payee->PAYEEID; wxLogDebug("Payee: %s id: %i", payee_name_, payeeID_); // Only for new transactions: if user want to autofill last category used for payee. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-23 06:59:44
|
Revision: 4554 http://sourceforge.net/p/moneymanagerex/code/4554 Author: vomikan Date: 2013-09-23 06:59:42 +0000 (Mon, 23 Sep 2013) Log Message: ----------- workaround for date picker for gtk Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-23 06:32:27 UTC (rev 4553) +++ trunk/src/transdialog.cpp 2013-09-23 06:59:42 UTC (rev 4554) @@ -978,11 +978,23 @@ // Workaround for bug http://trac.wxwidgets.org/ticket/11630 void mmTransDialog::OnDpcKillFocus(wxFocusEvent& event) { - if (wxGetKeyState(WXK_SHIFT)) + if (wxGetKeyState(WXK_TAB) && wxGetKeyState(WXK_SHIFT)) itemButtonCancel_->SetFocus(); + else if (wxGetKeyState(WXK_TAB)) + choiceStatus_->SetFocus(); + else if (wxGetKeyState(WXK_UP)) + { + wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + this->GetEventHandler()->AddPendingEvent(evt); + } + else if (wxGetKeyState(WXK_DOWN)) + { + wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + this->GetEventHandler()->AddPendingEvent(evt); + } else - choiceStatus_->SetFocus(); - event.Skip(); + event.Skip(); + } void mmTransDialog::changeFocus(wxChildFocusEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-23 07:47:39
|
Revision: 4555 http://sourceforge.net/p/moneymanagerex/code/4555 Author: vomikan Date: 2013-09-23 07:47:35 +0000 (Mon, 23 Sep 2013) Log Message: ----------- GTK workaround for wxDatePickerCtrl Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-09-23 06:59:42 UTC (rev 4554) +++ trunk/src/transdialog.cpp 2013-09-23 07:47:35 UTC (rev 4555) @@ -985,11 +985,13 @@ else if (wxGetKeyState(WXK_UP)) { wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + evt.SetInt(1); this->GetEventHandler()->AddPendingEvent(evt); } else if (wxGetKeyState(WXK_DOWN)) { wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + evt.SetInt(-1); this->GetEventHandler()->AddPendingEvent(evt); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-05 13:29:29
|
Revision: 4710 http://sourceforge.net/p/moneymanagerex/code/4710 Author: vomikan Date: 2013-10-05 13:29:27 +0000 (Sat, 05 Oct 2013) Log Message: ----------- fix for event handler Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-05 13:25:21 UTC (rev 4709) +++ trunk/src/transdialog.cpp 2013-10-05 13:29:27 UTC (rev 4710) @@ -165,6 +165,25 @@ SetSplitState(); + cbAccount_->Connect(wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, + wxCommandEventHandler(mmTransDialog::OnAccountUpdated), NULL, this); + cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_TEXT_UPDATED, + wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); + cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_COMBOBOX_CLOSEUP, + wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); + textAmount_->Connect(ID_DIALOG_TRANS_TEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, + wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); + toTextAmount_->Connect(ID_DIALOG_TRANS_TOTEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, + wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); + textNumber_->Connect(ID_DIALOG_TRANS_TEXTNUMBER, wxEVT_COMMAND_TEXT_ENTER + , wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); + +#ifdef __WXGTK__ // Workaround for bug http://trac.wxwidgets.org/ticket/11630 + dpc_->Connect(ID_DIALOG_TRANS_BUTTONDATE, wxEVT_KILL_FOCUS + , wxFocusEventHandler(mmTransDialog::OnDpcKillFocus), NULL, this); +#endif + + } void mmTransDialog::OnTransTypeChanged(wxCommandEvent& /*event*/) @@ -215,6 +234,7 @@ cbAccount_->UnsetToolTip(); cbPayee_->SetEvtHandlerEnabled(false); + cbAccount_->SetEvtHandlerEnabled(false); cAdvanced_->SetValue(advancedToTransAmountSet_); cAdvanced_->Enable(transfer); @@ -300,6 +320,7 @@ cbPayee_ -> SetValue(dataStr); SetSplitState(); cbPayee_ -> SetEvtHandlerEnabled(true); + cbAccount_ -> SetEvtHandlerEnabled(true); } void mmTransDialog::CreateControls() @@ -325,10 +346,6 @@ dpc_ = new wxDatePickerCtrl( this, ID_DIALOG_TRANS_BUTTONDATE, wxDateTime::Now() , wxDefaultPosition, wxSize(110, -1), date_style); -#ifdef __WXGTK__ // Workaround for bug http://trac.wxwidgets.org/ticket/11630 - dpc_->Connect(ID_DIALOG_TRANS_BUTTONDATE, wxEVT_KILL_FOCUS - , wxFocusEventHandler(mmTransDialog::OnDpcKillFocus), NULL, this); -#endif //Text field for day of the week itemStaticTextWeek_ = new wxStaticText(this, wxID_STATIC, ""); @@ -375,14 +392,10 @@ textAmount_ = new mmTextCtrl( this, ID_DIALOG_TRANS_TEXTAMOUNT, "", wxDefaultPosition, wxSize(110, -1), wxALIGN_RIGHT|wxTE_PROCESS_ENTER, mmCalcValidator()); - textAmount_->Connect(ID_DIALOG_TRANS_TEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, - wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); toTextAmount_ = new mmTextCtrl( this, ID_DIALOG_TRANS_TOTEXTAMOUNT, "", wxDefaultPosition, wxSize(110, -1), wxALIGN_RIGHT|wxTE_PROCESS_ENTER, mmCalcValidator()); - toTextAmount_->Connect(ID_DIALOG_TRANS_TOTEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, - wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); wxBoxSizer* amountSizer = new wxBoxSizer(wxHORIZONTAL); amountSizer->Add(textAmount_, flags); @@ -394,8 +407,6 @@ // Account --------------------------------------------- cbAccount_ = new wxComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(230, -1)); - cbAccount_->Connect(wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(mmTransDialog::OnAccountUpdated), NULL, this); account_label_ = new wxStaticText(this, wxID_STATIC, _("Account")); flex_sizer->Add(account_label_, flags); @@ -410,11 +421,6 @@ cbPayee_ = new wxComboBox(this, ID_DIALOG_TRANS_PAYEECOMBO, "", wxDefaultPosition, wxSize(230, -1)); - cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); - cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_COMBOBOX_CLOSEUP, - wxCommandEventHandler(mmTransDialog::OnPayeeUpdated), NULL, this); - cbPayee_ -> SetEvtHandlerEnabled(!edit_); flex_sizer->Add(payee_label_, flags); @@ -439,8 +445,6 @@ textNumber_ = new mmTextCtrl(this , ID_DIALOG_TRANS_TEXTNUMBER, "", wxDefaultPosition , wxDefaultSize, wxTE_PROCESS_ENTER); - textNumber_->Connect(ID_DIALOG_TRANS_TEXTNUMBER, wxEVT_COMMAND_TEXT_ENTER - , wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); bAuto_ = new wxButton(this , ID_DIALOG_TRANS_BUTTONTRANSNUM, "...", wxDefaultPosition This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-06 05:48:05
|
Revision: 4739 http://sourceforge.net/p/moneymanagerex/code/4739 Author: guanlisheng Date: 2013-10-06 05:47:58 +0000 (Sun, 06 Oct 2013) Log Message: ----------- cleanup categoryList_ Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-06 05:47:56 UTC (rev 4738) +++ trunk/src/transdialog.cpp 2013-10-06 05:47:58 UTC (rev 4739) @@ -219,7 +219,9 @@ { transaction_->CATEGID = core_->bTransactionList_.getLastUsedCategoryID(accountID_ , transaction_->PAYEEID, transaction_->TRANSCODE, transaction_->SUBCATEGID); - categString = core_->categoryList_.GetFullCategoryString(transaction_->CATEGID, transaction_->SUBCATEGID); + const Model_Category::Data* category = Model_Category::instance().get(transaction_->CATEGID); + const Model_Subcategory::Data* sub_category = Model_Subcategory::instance().get(transaction_->SUBCATEGID); + categString = Model_Category::full_name(category, sub_category); } bCategory_->SetLabel(categString); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-10-06 22:36:25
|
Revision: 4766 http://sourceforge.net/p/moneymanagerex/code/4766 Author: siena123 Date: 2013-10-06 22:36:22 +0000 (Sun, 06 Oct 2013) Log Message: ----------- Fix: Category = -1 Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-06 22:02:28 UTC (rev 4765) +++ trunk/src/transdialog.cpp 2013-10-06 22:36:22 UTC (rev 4766) @@ -96,6 +96,11 @@ mmSplitTransactionEntries* split(new mmSplitTransactionEntries()); split_ = split; + if (edit_) + { + *split_ = *core_->bTransactionList_ + .getBankTransactionPtr(transaction_->TRANSID)->splitEntries_; + } dataToControls(); @@ -157,12 +162,6 @@ wxString categString = _("Select Category"); updateControlsForTransType(); - if (edit_) - { - *split_ = *core_->bTransactionList_ - .getBankTransactionPtr(transaction_->TRANSID)->splitEntries_; - } - SetSplitState(); cbAccount_->Connect(wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-18 13:40:51
|
Revision: 4908 http://sourceforge.net/p/moneymanagerex/code/4908 Author: guanlisheng Date: 2013-10-18 13:40:49 +0000 (Fri, 18 Oct 2013) Log Message: ----------- format Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-18 07:11:27 UTC (rev 4907) +++ trunk/src/transdialog.cpp 2013-10-18 13:40:49 UTC (rev 4908) @@ -725,7 +725,7 @@ } Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); - bool ok = category; + bool ok = (category!=0); Model_Subcategory::Data *subcategory = Model_Subcategory::instance().get(transaction_->SUBCATEGID); ok = ok && (subcategory || transaction_->SUBCATEGID < 0); if (!ok) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-18 19:12:32
|
Revision: 4911 http://sourceforge.net/p/moneymanagerex/code/4911 Author: vomikan Date: 2013-10-18 19:12:28 +0000 (Fri, 18 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-18 14:39:36 UTC (rev 4910) +++ trunk/src/transdialog.cpp 2013-10-18 19:12:28 UTC (rev 4911) @@ -208,22 +208,28 @@ bool transfer = Model_Checking::type(transaction_) == Model_Checking::TRANSFER; if (!edit_) { + wxString categString = resetCategoryString(); if (mmIniOptions::instance().transPayeeSelectionNone_ > 0) { - transaction_->PAYEEID = core_->bTransactionList_.getLastUsedPayeeID(accountID_ - , transaction_->TRANSCODE, transaction_->CATEGID, transaction_->SUBCATEGID); + Model_Checking::Data_Set transactions = Model_Checking::instance().all(Model_Checking::COL_TRANSDATE, false); + for (const auto &trx : transactions) + { + if (trx.ACCOUNTID != transaction_->ACCOUNTID) continue; + if (Model_Checking::type(trx) == Model_Checking::TRANSFER) continue; + transaction_->PAYEEID = trx.PAYEEID; + Model_Payee::Data * payee = Model_Payee::instance().get(trx.PAYEEID); + if (payee) + { + transaction_->CATEGID = payee->CATEGID; + transaction_->SUBCATEGID = payee->SUBCATEGID; + } + break; + } } - - wxString categString = resetCategoryString(); - if (mmIniOptions::instance().transCategorySelectionNone_ != 0) - { - transaction_->CATEGID = core_->bTransactionList_.getLastUsedCategoryID(accountID_ - , transaction_->PAYEEID, transaction_->TRANSCODE, transaction_->SUBCATEGID); - const Model_Category::Data* category = Model_Category::instance().get(transaction_->CATEGID); - const Model_Subcategory::Data* sub_category = (transaction_->SUBCATEGID != -1 ? Model_Subcategory::instance().get(transaction_->SUBCATEGID) : 0); - categString = Model_Category::full_name(category, sub_category); - } - bCategory_->SetLabel(categString); + if (mmIniOptions::instance().transCategorySelectionNone_ != 0) + bCategory_->SetLabel(Model_Category::full_name(transaction_->CATEGID, transaction_->SUBCATEGID)); + else + bCategory_->SetLabel(resetCategoryString()); } SetTransferControls(transfer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-19 07:56:53
|
Revision: 4912 http://sourceforge.net/p/moneymanagerex/code/4912 Author: vomikan Date: 2013-10-19 07:56:49 +0000 (Sat, 19 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-18 19:12:28 UTC (rev 4911) +++ trunk/src/transdialog.cpp 2013-10-19 07:56:49 UTC (rev 4912) @@ -556,16 +556,17 @@ void mmTransDialog::OnAutoTransNum(wxCommandEvent& /*event*/) { - wxString current_number = textNumber_->GetValue(); - wxDateTime transaction_date = dpc_->GetValue(); - wxArrayString number_strings = core_->bTransactionList_.getTransactionNumber(accountID_, transaction_date); - int i = number_strings.GetCount(); - int s = 0; - if (number_strings.Index(current_number) != wxNOT_FOUND) - s = number_strings.Index(current_number); - i = (s+1)%i; + //TODO: + wxString number = textNumber_->GetValue(); + double next_number = 1; + if (number.ToDouble(&next_number)) + { + next_number++; + number = wxString::Format("%i", static_cast<int>(next_number)); + } - textNumber_->SetValue( number_strings[i] ); + if (number.IsEmpty()) number = "1"; + textNumber_->SetValue(number); } void mmTransDialog::OnSpin(wxSpinEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-19 08:21:28
|
Revision: 4913 http://sourceforge.net/p/moneymanagerex/code/4913 Author: vomikan Date: 2013-10-19 08:21:23 +0000 (Sat, 19 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-19 07:56:49 UTC (rev 4912) +++ trunk/src/transdialog.cpp 2013-10-19 08:21:23 UTC (rev 4913) @@ -732,10 +732,8 @@ } Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); - bool ok = (category!=0); Model_Subcategory::Data *subcategory = Model_Subcategory::instance().get(transaction_->SUBCATEGID); - ok = ok && (subcategory || transaction_->SUBCATEGID < 0); - if (!ok) + if (!category || !(subcategory || transaction_->SUBCATEGID < 0)) { mmShowErrorMessageInvalid(this, _("Category")); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-19 13:28:21
|
Revision: 4915 http://sourceforge.net/p/moneymanagerex/code/4915 Author: vomikan Date: 2013-10-19 13:28:17 +0000 (Sat, 19 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-19 10:12:32 UTC (rev 4914) +++ trunk/src/transdialog.cpp 2013-10-19 13:28:17 UTC (rev 4915) @@ -113,55 +113,65 @@ void mmTransDialog::dataToControls() { - // Use last date used as per user option. + //Date wxDateTime trx_date = mmGetStorageStringAsDate(transaction_->TRANSDATE); - dpc_->SetValue(trx_date); //process date change event for set weekday name wxDateEvent dateEvent(dpc_, trx_date, wxEVT_DATE_CHANGED); GetEventHandler()->ProcessEvent(dateEvent); dpc_->SetFocus(); + //Status + wxString statusString = transaction_->STATUS; + if (mmIniOptions::instance().transStatusReconciled_ == 1 && !edit_) statusString = "R"; + transaction_->TRANSCODE = TRANS_TYPE_WITHDRAWAL_STR; + if (statusString == "") statusString = "N"; + choiceStatus_->SetSelection(wxString("NRVFD").Find(statusString)); + + //Type + for (const auto& i : Model_Checking::all_type()) + transaction_type_->Append(wxGetTranslation(i), new wxStringClientData(i)); + transaction_type_->SetStringSelection(wxGetTranslation(transaction_->TRANSCODE)); + + //Amounts wxString dispAmount; if (edit_) { - wxString statusString = transaction_->STATUS; - if (statusString == "") statusString = "N"; - choiceStatus_->SetSelection(wxString("NRVFD").Find(statusString)); - - accountID_ = transaction_->ACCOUNTID; //pBankTransaction_->accountID_; - - textNotes_->SetValue(transaction_->NOTES); - textNumber_->SetValue(transaction_->TRANSACTIONNUMBER); - - advancedToTransAmountSet_ = (transaction_->TRANSAMOUNT != transaction_->TOTRANSAMOUNT); - dispAmount = CurrencyFormatter::float2String(transaction_->TRANSAMOUNT); textAmount_->SetValue(dispAmount); dispAmount = CurrencyFormatter::float2String(transaction_->TOTRANSAMOUNT); toTextAmount_->SetValue(dispAmount); } - else + + //Account + Model_Account::Data_Set accounts = Model_Account::instance().all(); + for (const auto &account : accounts) { - choiceStatus_->SetSelection(mmIniOptions::instance().transStatusReconciled_); - transaction_->TRANSCODE = TRANS_TYPE_WITHDRAWAL_STR; + cbAccount_->Append(account.ACCOUNTNAME); + if (account.ACCOUNTID == accountID_) cbAccount_->SetValue(account.ACCOUNTNAME); + } + //cbAccount_->AutoComplete(Model_Account::all_account_names()); //TODO: + accountID_ = transaction_->ACCOUNTID; + // backup the original currency rate first + if (transaction_->TRANSAMOUNT > 0.0) + edit_currency_rate = transaction_->TOTRANSAMOUNT / transaction_->TRANSAMOUNT; + + wxString categString = _("Select Category"); + + //Notes + textNumber_->SetValue(transaction_->TRANSACTIONNUMBER); + + textNotes_->SetValue(transaction_->NOTES); + if (!edit_) + { notesColour_ = textNotes_->GetForegroundColour(); textNotes_->SetForegroundColour(wxColour("GREY")); textNotes_->SetValue(notesTip_); int font_size = textNotes_->GetFont().GetPointSize(); textNotes_->SetFont(wxFont(font_size, wxSWISS, wxNORMAL, wxNORMAL, FALSE, "")); } - // backup the original currency rate first - if (transaction_->TRANSAMOUNT > 0.0) - edit_currency_rate = transaction_->TOTRANSAMOUNT / transaction_->TRANSAMOUNT; - for(const auto& i : Model_Checking::all_type()) - transaction_type_->Append(wxGetTranslation(i), new wxStringClientData(i)); - transaction_type_->SetStringSelection(wxGetTranslation(transaction_->TRANSCODE)); - - wxString categString = _("Select Category"); - updateControlsForTransType(); SetSplitState(); @@ -186,29 +196,21 @@ } -void mmTransDialog::OnTransTypeChanged(wxCommandEvent& /*event*/) +void mmTransDialog::updateControlsForTransType() { - wxString sType = transaction_->TRANSCODE; - transaction_->TRANSCODE = TRANS_TYPE_WITHDRAWAL_STR; - wxStringClientData* type_obj = (wxStringClientData *)transaction_type_->GetClientObject( - transaction_type_->GetSelection()); - if (type_obj) transaction_->TRANSCODE = type_obj->GetData(); - if (sType != TRANS_TYPE_TRANSFER_STR && Model_Checking::type(transaction_) == Model_Checking::TRANSFER) - { - resetPayeeString(); - transaction_->CATEGID = -1; - transaction_->SUBCATEGID = -1; - } + bool transfer = Model_Checking::type(transaction_) == Model_Checking::TRANSFER; - updateControlsForTransType(); -} + textAmount_->UnsetToolTip(); + toTextAmount_->UnsetToolTip(); + cbAccount_->UnsetToolTip(); -void mmTransDialog::updateControlsForTransType() -{ - bool transfer = Model_Checking::type(transaction_) == Model_Checking::TRANSFER; - if (!edit_) + cbPayee_->SetEvtHandlerEnabled(false); + cbAccount_->SetEvtHandlerEnabled(false); + + if (!transfer) { - wxString categString = resetCategoryString(); + cbPayee_->Clear(); + if (mmIniOptions::instance().transPayeeSelectionNone_ > 0) { Model_Checking::Data_Set transactions = Model_Checking::instance().all(Model_Checking::COL_TRANSDATE, false); @@ -218,7 +220,7 @@ if (Model_Checking::type(trx) == Model_Checking::TRANSFER) continue; transaction_->PAYEEID = trx.PAYEEID; Model_Payee::Data * payee = Model_Payee::instance().get(trx.PAYEEID); - if (payee) + if (payee && !edit_) { transaction_->CATEGID = payee->CATEGID; transaction_->SUBCATEGID = payee->SUBCATEGID; @@ -226,9 +228,9 @@ break; } } - if (mmIniOptions::instance().transCategorySelectionNone_ != 0) + if (mmIniOptions::instance().transCategorySelectionNone_ != 0 || edit_) bCategory_->SetLabel(Model_Category::full_name(transaction_->CATEGID, transaction_->SUBCATEGID)); - else + else bCategory_->SetLabel(resetCategoryString()); } @@ -237,32 +239,18 @@ void mmTransDialog::SetTransferControls(bool transfer) { - textAmount_->UnsetToolTip(); - toTextAmount_->UnsetToolTip(); - cbAccount_->UnsetToolTip(); - cbPayee_->SetEvtHandlerEnabled(false); - cbAccount_->SetEvtHandlerEnabled(false); - + //Advanced + advancedToTransAmountSet_ = (transaction_->TRANSAMOUNT != transaction_->TOTRANSAMOUNT); cAdvanced_->SetValue(advancedToTransAmountSet_); cAdvanced_->Enable(transfer); wxString dataStr = ""; - cbPayee_->Clear(); wxSortedArrayString data; int type_num = transaction_type_->GetSelection(); newAccountID_ = accountID_; - cbAccount_->Clear(); - Model_Account::Data_Set accounts = Model_Account::instance().all(); - for (const auto &account : accounts) - { - data.Add(account.ACCOUNTNAME); - cbAccount_ ->Append(account.ACCOUNTNAME); - } - cbAccount_->AutoComplete(data); - Model_Account::Data *account = Model_Account::instance().get(accountID_); if (account) cbAccount_->SetStringSelection(account->ACCOUNTNAME); @@ -304,7 +292,7 @@ cbAccount_->SetToolTip(_("Specify account for the transaction")); account_label_->SetLabel(_("Account")); - cbAccount_->Enable(!accounts.empty()); + //cbAccount_->Enable(!accounts.empty()); transaction_->TOACCOUNTID = -1; toTextAmount_->Enable(false); @@ -508,6 +496,42 @@ this->SetSizer(box_sizer1); } +//** --------------=Event handlers=----------------- **// +void mmTransDialog::OnDateChanged(wxDateEvent& event) +{ + //get weekday name + wxDateTime date = dpc_->GetValue(); + if (event.GetDate().IsValid()) + itemStaticTextWeek_->SetLabel(wxGetTranslation(date.GetWeekDayName(date.GetWeekDay()))); + event.Skip(); +} + +void mmTransDialog::OnSpin(wxSpinEvent& event) +{ + wxDateTime date = dpc_->GetValue(); + int value = event.GetPosition(); + + date = date.Add(wxDateSpan::Days(value)); + dpc_->SetValue(date); + spinCtrl_->SetValue(0); + + //process date change event for set weekday name + wxDateEvent dateEvent(dpc_, date, wxEVT_DATE_CHANGED); + GetEventHandler()->ProcessEvent(dateEvent); + + event.Skip(); +} + +void mmTransDialog::OnTransTypeChanged(wxCommandEvent& event) +{ + wxString old_type = transaction_->TRANSCODE; + wxStringClientData *client_obj = (wxStringClientData *) event.GetClientObject(); + if (client_obj) transaction_->TRANSCODE = client_obj->GetData(); + if (old_type != transaction_->TRANSCODE) + updateControlsForTransType(); +} + + void mmTransDialog::OnAccountUpdated(wxCommandEvent& /*event*/) { wxString sAccountName = cbAccount_->GetValue(); @@ -569,31 +593,6 @@ textNumber_->SetValue(number); } -void mmTransDialog::OnSpin(wxSpinEvent& event) -{ - wxDateTime date = dpc_->GetValue(); - int value = event.GetPosition(); - - date = date.Add(wxDateSpan::Days(value)); - dpc_->SetValue (date); - spinCtrl_->SetValue(0); - - //process date change event for set weekday name - wxDateEvent dateEvent(dpc_, date, wxEVT_DATE_CHANGED); - GetEventHandler()->ProcessEvent(dateEvent); - - event.Skip(); -} - -void mmTransDialog::OnDateChanged(wxDateEvent& event) -{ - //get weekday name - wxDateTime date = dpc_->GetValue(); - if (event.GetDate().IsValid()) - itemStaticTextWeek_->SetLabel(wxGetTranslation(date.GetWeekDayName(date.GetWeekDay()))); - event.Skip(); -} - void mmTransDialog::OnAdvanceChecked(wxCommandEvent& /*event*/) { advancedToTransAmountSet_ = cAdvanced_->IsChecked(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-19 14:05:10
|
Revision: 4916 http://sourceforge.net/p/moneymanagerex/code/4916 Author: vomikan Date: 2013-10-19 14:05:06 +0000 (Sat, 19 Oct 2013) Log Message: ----------- code reorganization. no real changes. Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-19 13:28:17 UTC (rev 4915) +++ trunk/src/transdialog.cpp 2013-10-19 14:05:06 UTC (rev 4916) @@ -193,7 +193,6 @@ , wxFocusEventHandler(mmTransDialog::OnDpcKillFocus), NULL, this); #endif - } void mmTransDialog::updateControlsForTransType() @@ -496,6 +495,248 @@ this->SetSizer(box_sizer1); } +wxString mmTransDialog::resetPayeeString(/*bool normal*/) //normal is deposits or withdrawls +{ + wxString payeeStr = ""; + + transaction_->PAYEEID = -1; + Model_Payee::Data_Set filtd = Model_Payee::instance().FilterPayees(""); + if (filtd.size() == 1) + { + //only one payee present. Choose it + payeeStr = filtd[0].PAYEENAME; + transaction_->PAYEEID = filtd[0].PAYEEID; + } + + return payeeStr; +} + +wxString mmTransDialog::resetCategoryString() +{ + transaction_->CATEGID = -1; + transaction_->SUBCATEGID = -1; + + return _("Select Category"); +} + +bool mmTransDialog::validateData() +{ + Model_Account::Data* account = Model_Account::instance().get(cbAccount_->GetValue()); + if (account) + newAccountID_ = account->ACCOUNTID; + else + { + mmShowErrorMessageInvalid(this, _("Account")); + return false; + } + + bool bTransfer = (Model_Checking::type(transaction_) == Model_Checking::TRANSFER); + advancedToTransAmountSet_ = cAdvanced_->IsChecked(); + + if (cSplit_->IsChecked()) + { + transaction_->TRANSAMOUNT = split_->getTotalSplits(); + if (transaction_->TRANSAMOUNT < 0.0) + { + if (bTransfer) { + if (transaction_->TRANSAMOUNT < 0) + transaction_->TRANSAMOUNT = - transaction_->TRANSAMOUNT; + } else { + mmShowErrorMessageInvalid(parent_, _("Amount")); + return false; + } + } + + if (split_->numEntries() == 0) + { + mmShowErrorMessageInvalid(this, _("Category")); + return false; + } + } + else + { + wxString amountStr = textAmount_->GetValue().Trim(); + if (! CurrencyFormatter::formatCurrencyToDouble(amountStr, transaction_->TRANSAMOUNT) || (transaction_->TRANSAMOUNT < 0.0)) + { + textAmount_->SetBackgroundColour("RED"); + mmShowErrorMessageInvalid(parent_, _("Amount")); + textAmount_->SetBackgroundColour(wxNullColour); + textAmount_->SetFocus(); + return false; + } + + Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); + Model_Subcategory::Data *subcategory = Model_Subcategory::instance().get(transaction_->SUBCATEGID); + if (!category || !(subcategory || transaction_->SUBCATEGID < 0)) + { + mmShowErrorMessageInvalid(this, _("Category")); + return false; + } + } + + transaction_->TOTRANSAMOUNT = transaction_->TRANSAMOUNT; + if (bTransfer) + { + if (advancedToTransAmountSet_) + { + wxString amountStr = toTextAmount_->GetValue().Trim(); + if (amountStr.IsEmpty() + || ! CurrencyFormatter::formatCurrencyToDouble(amountStr, transaction_->TOTRANSAMOUNT) + || (transaction_->TOTRANSAMOUNT < 0.0) + ) + { + toTextAmount_->SetBackgroundColour("RED"); + mmShowErrorMessageInvalid(parent_, _("Advanced Amount")); + toTextAmount_->SetBackgroundColour(wxNullColour); + toTextAmount_->SetFocus(); + return false; + } + } + } + + if (!bTransfer) + { + wxString payee_name = cbPayee_->GetValue(); + if (payee_name.IsEmpty()) + { + mmShowErrorMessageInvalid(this, _("Payee")); + return false; + } + + Model_Payee::Data* payee = Model_Payee::instance().get(payee_name); + if (!payee) + { + wxMessageDialog msgDlg( this + , wxString::Format(_("Do you want to add new payee: \n%s?"), payee_name) + , _("Confirm to add new payee") + , wxYES_NO | wxYES_DEFAULT | wxICON_WARNING); + if (msgDlg.ShowModal() == wxID_YES) + { + payee = Model_Payee::instance().create(); + payee->PAYEENAME = payee_name; + transaction_->PAYEEID = Model_Payee::instance().save(payee); + } + else + return false; + } + } + + transaction_->TOACCOUNTID; + + if (bTransfer) + { + if (transaction_->TOACCOUNTID < 1 || transaction_->TOACCOUNTID == newAccountID_) + { + mmShowErrorMessageInvalid(this, _("To Account")); + cbPayee_->SetFocus(); + return false; + } + + transaction_->PAYEEID = -1; + } + else + { + Model_Payee::Data* payee = Model_Payee::instance().get(transaction_->PAYEEID); + payee->CATEGID = transaction_->CATEGID; + payee->SUBCATEGID = transaction_->SUBCATEGID; + Model_Payee::instance().save(payee); + } + return true; +} + +void mmTransDialog::SetSplitState() +{ + int entries = split_->numEntries(); + wxString fullCategoryName; + if (split_->numEntries() > 0) + fullCategoryName = _("Split Category"); + else + { + Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); + Model_Subcategory::Data *subcategory = (transaction_->SUBCATEGID != -1 ? Model_Subcategory::instance().get(transaction_->SUBCATEGID) : 0); + fullCategoryName = Model_Category::full_name(category, subcategory); + if (fullCategoryName.IsEmpty()) fullCategoryName = _("Select Category"); + } + + bCategory_->SetLabel(fullCategoryName); + cSplit_->SetValue(entries > 0); + cSplit_->Enable(Model_Checking::type(transaction_) != Model_Checking::TRANSFER); + + textAmount_->Enable(entries < 1); +} + +//---------------------------------------------------------------------------- +// Workaround for bug http://trac.wxwidgets.org/ticket/11630 +void mmTransDialog::OnDpcKillFocus(wxFocusEvent& event) +{ + if (wxGetKeyState(WXK_TAB) && wxGetKeyState(WXK_SHIFT)) + itemButtonCancel_->SetFocus(); + else if (wxGetKeyState(WXK_TAB)) + choiceStatus_->SetFocus(); + else if (wxGetKeyState(WXK_UP)) + { + wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + evt.SetInt(1); + this->GetEventHandler()->AddPendingEvent(evt); + } + else if (wxGetKeyState(WXK_DOWN)) + { + wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); + evt.SetInt(-1); + this->GetEventHandler()->AddPendingEvent(evt); + } + else + event.Skip(); + +} + +void mmTransDialog::changeFocus(wxChildFocusEvent& event) +{ + wxWindow *w = event.GetWindow(); + if ( w ) + object_in_focus_ = w->GetId(); + + if (!edit_ && textNotes_->GetValue() == notesTip_ && object_in_focus_ == ID_DIALOG_TRANS_TEXTNOTES) + { + textNotes_->SetValue(""); + textNotes_->SetForegroundColour(notesColour_); + } + event.Skip(); +} + +void mmTransDialog::activateSplitTransactionsDlg() +{ + bool bDeposit = transaction_->TRANSCODE == TRANS_TYPE_DEPOSIT_STR; + mmSplitTransactionEntry* pSplitEntry(new mmSplitTransactionEntry); + if (transaction_->CATEGID > -1) + { + wxString sAmount = textAmount_->GetValue(); + if (! CurrencyFormatter::formatCurrencyToDouble(sAmount, transaction_->TRANSAMOUNT)) + transaction_->TRANSAMOUNT = 0; + pSplitEntry->splitAmount_ = bDeposit ? transaction_->TRANSAMOUNT : transaction_->TRANSAMOUNT; + pSplitEntry->categID_ = transaction_->CATEGID; + pSplitEntry->subCategID_ = transaction_->SUBCATEGID; + split_->addSplit(pSplitEntry); + } + transaction_->CATEGID = -1; + transaction_->SUBCATEGID = -1; + + SplitTransactionDialog dlg(splt_, this, transaction_type_->GetSelection(), core_, split_); + if (dlg.ShowModal() == wxID_OK) + { + double amount = split_->getTotalSplits(); + if (transaction_type_->GetSelection() == DEF_TRANSFER && amount < 0) + amount = - amount; + wxString dispAmount = CurrencyFormatter::float2String(amount); + textAmount_->SetValue(dispAmount); + } +} + +void mmTransDialog::SetDialogTitle(const wxString& title) +{ + this->SetTitle(title); +} + //** --------------=Event handlers=----------------- **// void mmTransDialog::OnDateChanged(wxDateEvent& event) { @@ -578,6 +819,39 @@ event.Skip(); } +void mmTransDialog::OnSplitChecked(wxCommandEvent& /*event*/) +{ + /* Reset Category */ + //split_ = wxSharedPtr<mmSplitTransactionEntries>(new mmSplitTransactionEntries()); + if (cSplit_->IsChecked()) + { + activateSplitTransactionsDlg(); + } + else + { + if (split_->numEntries() != 1) + { + transaction_->TRANSAMOUNT = 0; + } + else + { + transaction_->CATEGID = split_->entries_[0]->categID_; + transaction_->SUBCATEGID = split_->entries_[0]->subCategID_; + transaction_->TRANSAMOUNT = split_->entries_[0]->splitAmount_; + + if (transaction_->TRANSAMOUNT < 0) + { + transaction_->TRANSAMOUNT = -transaction_->TRANSAMOUNT; + transaction_type_->SetStringSelection(wxGetTranslation(TRANS_TYPE_WITHDRAWAL_STR)); + } + split_->removeSplitByIndex(0); + } + wxString dispAmount = CurrencyFormatter::float2String(transaction_->TRANSAMOUNT); + textAmount_->SetValue(dispAmount); + } + SetSplitState(); +} + void mmTransDialog::OnAutoTransNum(wxCommandEvent& /*event*/) { //TODO: @@ -610,7 +884,7 @@ CurrencyFormatter::formatCurrencyToDouble(amountStr, transaction_->TRANSAMOUNT); - if (transaction_->TOACCOUNTID > 0) + if (transaction_->TOACCOUNTID > 0) { const Model_Account::Data* from_account = Model_Account::instance().get(accountID_); const Model_Account::Data* to_account = Model_Account::instance().get(transaction_->TOACCOUNTID); @@ -650,7 +924,7 @@ { mmCategDialog dlg(parent_, true, false); dlg.setTreeSelection(transaction_->CATEGID, transaction_->SUBCATEGID); - if ( dlg.ShowModal() == wxID_OK ) + if (dlg.ShowModal() == wxID_OK) { transaction_->CATEGID = dlg.getCategId(); transaction_->SUBCATEGID = dlg.getSubCategId(); @@ -660,154 +934,31 @@ } } -wxString mmTransDialog::resetPayeeString(/*bool normal*/) //normal is deposits or withdrawls +void mmTransDialog::onTextEntered(wxCommandEvent& event) { - wxString payeeStr = ""; + wxString sAmount = ""; - transaction_->PAYEEID = -1; - Model_Payee::Data_Set filtd = Model_Payee::instance().FilterPayees(""); - if (filtd.size() == 1) + mmCalculator calc; + if (object_in_focus_ == textAmount_->GetId()) { - //only one payee present. Choose it - payeeStr = filtd[0].PAYEENAME; - transaction_->PAYEEID = filtd[0].PAYEEID; + if (calc.is_ok(textAmount_->GetValue())) + textAmount_->SetValue(calc.get_result()); + textAmount_->SetInsertionPoint(textAmount_->GetValue().Len()); } - - return payeeStr; -} - -wxString mmTransDialog::resetCategoryString() -{ - transaction_->CATEGID = -1; - transaction_->SUBCATEGID = -1; - - return _("Select Category"); -} - -bool mmTransDialog::validateData() -{ - Model_Account::Data* account = Model_Account::instance().get(cbAccount_->GetValue()); - if (account) - newAccountID_ = account->ACCOUNTID; - else + else if (object_in_focus_ == toTextAmount_->GetId()) { - mmShowErrorMessageInvalid(this, _("Account")); - return false; + if (calc.is_ok(toTextAmount_->GetValue())) + toTextAmount_->SetValue(calc.get_result()); + toTextAmount_->SetInsertionPoint(toTextAmount_->GetValue().Len()); } - - bool bTransfer = (Model_Checking::type(transaction_) == Model_Checking::TRANSFER); - advancedToTransAmountSet_ = cAdvanced_->IsChecked(); - - if (cSplit_->IsChecked()) + else if (object_in_focus_ == textNumber_->GetId()) { - transaction_->TRANSAMOUNT = split_->getTotalSplits(); - if (transaction_->TRANSAMOUNT < 0.0) - { - if (bTransfer) { - if (transaction_->TRANSAMOUNT < 0) - transaction_->TRANSAMOUNT = - transaction_->TRANSAMOUNT; - } else { - mmShowErrorMessageInvalid(parent_, _("Amount")); - return false; - } - } - - if (split_->numEntries() == 0) - { - mmShowErrorMessageInvalid(this, _("Category")); - return false; - } + textNotes_->SetFocus(); } - else - { - wxString amountStr = textAmount_->GetValue().Trim(); - if (! CurrencyFormatter::formatCurrencyToDouble(amountStr, transaction_->TRANSAMOUNT) || (transaction_->TRANSAMOUNT < 0.0)) - { - textAmount_->SetBackgroundColour("RED"); - mmShowErrorMessageInvalid(parent_, _("Amount")); - textAmount_->SetBackgroundColour(wxNullColour); - textAmount_->SetFocus(); - return false; - } - Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); - Model_Subcategory::Data *subcategory = Model_Subcategory::instance().get(transaction_->SUBCATEGID); - if (!category || !(subcategory || transaction_->SUBCATEGID < 0)) - { - mmShowErrorMessageInvalid(this, _("Category")); - return false; - } - } + event.Skip(); +} - transaction_->TOTRANSAMOUNT = transaction_->TRANSAMOUNT; - if (bTransfer) - { - if (advancedToTransAmountSet_) - { - wxString amountStr = toTextAmount_->GetValue().Trim(); - if (amountStr.IsEmpty() - || ! CurrencyFormatter::formatCurrencyToDouble(amountStr, transaction_->TOTRANSAMOUNT) - || (transaction_->TOTRANSAMOUNT < 0.0) - ) - { - toTextAmount_->SetBackgroundColour("RED"); - mmShowErrorMessageInvalid(parent_, _("Advanced Amount")); - toTextAmount_->SetBackgroundColour(wxNullColour); - toTextAmount_->SetFocus(); - return false; - } - } - } - - if (!bTransfer) - { - wxString payee_name = cbPayee_->GetValue(); - if (payee_name.IsEmpty()) - { - mmShowErrorMessageInvalid(this, _("Payee")); - return false; - } - - Model_Payee::Data* payee = Model_Payee::instance().get(payee_name); - if (!payee) - { - wxMessageDialog msgDlg( this - , wxString::Format(_("Do you want to add new payee: \n%s?"), payee_name) - , _("Confirm to add new payee") - , wxYES_NO | wxYES_DEFAULT | wxICON_WARNING); - if (msgDlg.ShowModal() == wxID_YES) - { - payee = Model_Payee::instance().create(); - payee->PAYEENAME = payee_name; - transaction_->PAYEEID = Model_Payee::instance().save(payee); - } - else - return false; - } - } - - transaction_->TOACCOUNTID; - - if (bTransfer) - { - if (transaction_->TOACCOUNTID < 1 || transaction_->TOACCOUNTID == newAccountID_) - { - mmShowErrorMessageInvalid(this, _("To Account")); - cbPayee_->SetFocus(); - return false; - } - - transaction_->PAYEEID = -1; - } - else - { - Model_Payee::Data* payee = Model_Payee::instance().get(transaction_->PAYEEID); - payee->CATEGID = transaction_->CATEGID; - payee->SUBCATEGID = transaction_->SUBCATEGID; - Model_Payee::instance().save(payee); - } - return true; -} void mmTransDialog::OnOk(wxCommandEvent& /*event*/) { if (!validateData()) return; @@ -815,7 +966,7 @@ textNotes_->SetFocus(); transaction_->NOTES = textNotes_->GetValue(); - wxStringClientData* status_obj = (wxStringClientData *)choiceStatus_->GetClientObject(choiceStatus_->GetSelection()); + wxStringClientData* status_obj = (wxStringClientData *) choiceStatus_->GetClientObject(choiceStatus_->GetSelection()); if (status_obj) transaction_->STATUS = status_obj->GetData().Left(1); transaction_->STATUS.Replace("N", ""); @@ -865,99 +1016,6 @@ EndModal(wxID_OK); } -void mmTransDialog::SetSplitState() -{ - int entries = split_->numEntries(); - wxString fullCategoryName; - if (split_->numEntries() > 0) - fullCategoryName = _("Split Category"); - else - { - Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); - Model_Subcategory::Data *subcategory = (transaction_->SUBCATEGID != -1 ? Model_Subcategory::instance().get(transaction_->SUBCATEGID) : 0); - fullCategoryName = Model_Category::full_name(category, subcategory); - if (fullCategoryName.IsEmpty()) fullCategoryName = _("Select Category"); - } - - bCategory_->SetLabel(fullCategoryName); - cSplit_->SetValue(entries > 0); - cSplit_->Enable(Model_Checking::type(transaction_) != Model_Checking::TRANSFER); - - textAmount_->Enable(entries < 1); -} - -void mmTransDialog::OnSplitChecked(wxCommandEvent& /*event*/) -{ - /* Reset Category */ - //split_ = wxSharedPtr<mmSplitTransactionEntries>(new mmSplitTransactionEntries()); - if (cSplit_->IsChecked()) - { - activateSplitTransactionsDlg(); - } - else - { - if (split_->numEntries() != 1) - { - transaction_->TRANSAMOUNT = 0; - } - else - { - transaction_->CATEGID = split_->entries_[0]->categID_; - transaction_->SUBCATEGID = split_->entries_[0]->subCategID_; - transaction_->TRANSAMOUNT = split_->entries_[0]->splitAmount_; - - if (transaction_->TRANSAMOUNT < 0 ) - { - transaction_->TRANSAMOUNT = - transaction_->TRANSAMOUNT; - transaction_type_->SetStringSelection(wxGetTranslation(TRANS_TYPE_WITHDRAWAL_STR)); - } - split_->removeSplitByIndex(0); - } - wxString dispAmount = CurrencyFormatter::float2String(transaction_->TRANSAMOUNT); - textAmount_->SetValue(dispAmount); - } - SetSplitState(); -} - -//---------------------------------------------------------------------------- -// Workaround for bug http://trac.wxwidgets.org/ticket/11630 -void mmTransDialog::OnDpcKillFocus(wxFocusEvent& event) -{ - if (wxGetKeyState(WXK_TAB) && wxGetKeyState(WXK_SHIFT)) - itemButtonCancel_->SetFocus(); - else if (wxGetKeyState(WXK_TAB)) - choiceStatus_->SetFocus(); - else if (wxGetKeyState(WXK_UP)) - { - wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); - evt.SetInt(1); - this->GetEventHandler()->AddPendingEvent(evt); - } - else if (wxGetKeyState(WXK_DOWN)) - { - wxCommandEvent evt(wxEVT_SPIN, wxID_ANY); - evt.SetInt(-1); - this->GetEventHandler()->AddPendingEvent(evt); - } - else - event.Skip(); - -} - -void mmTransDialog::changeFocus(wxChildFocusEvent& event) -{ - wxWindow *w = event.GetWindow(); - if ( w ) - object_in_focus_ = w->GetId(); - - if (!edit_ && textNotes_->GetValue() == notesTip_ && object_in_focus_ == ID_DIALOG_TRANS_TEXTNOTES) - { - textNotes_->SetValue(""); - textNotes_->SetForegroundColour(notesColour_); - } - event.Skip(); -} - void mmTransDialog::OnCancel(wxCommandEvent& /*event*/) { if (object_in_focus_ == bCategory_->GetId()) return; @@ -987,7 +1045,7 @@ } } - if ((int)object_in_focus_ == (int)toTextAmount_->GetId()) + if ((int) object_in_focus_ == (int) toTextAmount_->GetId()) { if (!toTextAmount_->IsEmpty()) { toTextAmount_->SetValue(""); @@ -999,7 +1057,7 @@ } } - if ((int)object_in_focus_ == (int)textNumber_->GetId()) + if ((int) object_in_focus_ == (int) textNumber_->GetId()) { if (!textNumber_->IsEmpty()) { @@ -1020,61 +1078,3 @@ { EndModal(wxID_CANCEL); } - -void mmTransDialog::onTextEntered(wxCommandEvent& event) -{ - wxString sAmount = ""; - - mmCalculator calc; - if (object_in_focus_ == textAmount_->GetId()) - { - if (calc.is_ok(textAmount_->GetValue())) - textAmount_->SetValue(calc.get_result()); - textAmount_->SetInsertionPoint(textAmount_->GetValue().Len()); - } - else if (object_in_focus_ == toTextAmount_->GetId()) - { - if (calc.is_ok(toTextAmount_->GetValue())) - toTextAmount_->SetValue(calc.get_result()); - toTextAmount_->SetInsertionPoint(toTextAmount_->GetValue().Len()); - } - else if (object_in_focus_ == textNumber_->GetId()) - { - textNotes_->SetFocus(); - } - - event.Skip(); -} - -void mmTransDialog::activateSplitTransactionsDlg() -{ - bool bDeposit = transaction_->TRANSCODE == TRANS_TYPE_DEPOSIT_STR; - mmSplitTransactionEntry* pSplitEntry(new mmSplitTransactionEntry); - if (transaction_->CATEGID > -1) - { - wxString sAmount = textAmount_->GetValue(); - if (! CurrencyFormatter::formatCurrencyToDouble(sAmount, transaction_->TRANSAMOUNT)) - transaction_->TRANSAMOUNT = 0; - pSplitEntry->splitAmount_ = bDeposit ? transaction_->TRANSAMOUNT : transaction_->TRANSAMOUNT; - pSplitEntry->categID_ = transaction_->CATEGID; - pSplitEntry->subCategID_ = transaction_->SUBCATEGID; - split_->addSplit(pSplitEntry); - } - transaction_->CATEGID = -1; - transaction_->SUBCATEGID = -1; - - SplitTransactionDialog dlg(splt_, this, transaction_type_->GetSelection(), core_, split_); - if (dlg.ShowModal() == wxID_OK) - { - double amount = split_->getTotalSplits(); - if (transaction_type_->GetSelection() == DEF_TRANSFER && amount < 0) - amount = - amount; - wxString dispAmount = CurrencyFormatter::float2String(amount); - textAmount_->SetValue(dispAmount); - } -} - -void mmTransDialog::SetDialogTitle(const wxString& title) -{ - this->SetTitle(title); -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-19 15:40:40
|
Revision: 4918 http://sourceforge.net/p/moneymanagerex/code/4918 Author: vomikan Date: 2013-10-19 15:40:35 +0000 (Sat, 19 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-19 15:27:25 UTC (rev 4917) +++ trunk/src/transdialog.cpp 2013-10-19 15:40:35 UTC (rev 4918) @@ -765,7 +765,7 @@ void mmTransDialog::OnTransTypeChanged(wxCommandEvent& event) { - wxString old_type = transaction_->TRANSCODE; + const wxString old_type = transaction_->TRANSCODE; wxStringClientData *client_obj = (wxStringClientData *) event.GetClientObject(); if (client_obj) transaction_->TRANSCODE = client_obj->GetData(); if (old_type != transaction_->TRANSCODE) @@ -775,8 +775,7 @@ void mmTransDialog::OnAccountUpdated(wxCommandEvent& /*event*/) { - wxString sAccountName = cbAccount_->GetValue(); - const Model_Account::Data* account = Model_Account::instance().get(sAccountName); + const Model_Account::Data* account = Model_Account::instance().get(cbAccount_->GetValue()); newAccountID_ = account->ACCOUNTID; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-26 09:52:32
|
Revision: 4978 http://sourceforge.net/p/moneymanagerex/code/4978 Author: vomikan Date: 2013-10-26 09:52:29 +0000 (Sat, 26 Oct 2013) Log Message: ----------- fix for split entries Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-26 09:09:37 UTC (rev 4977) +++ trunk/src/transdialog.cpp 2013-10-26 09:52:29 UTC (rev 4978) @@ -64,7 +64,6 @@ if (transaction_id_) { transaction_ = Model_Checking::instance().get(transaction_id_); - //TODO: m_splits = Model_Checking::splittransaction(transaction_); for (const auto& item : Model_Checking::splittransaction(transaction_)) m_local_splits.push_back(item); } else @@ -80,8 +79,7 @@ SetDialogTitle(_("New Transaction")); } - //std::copy(this->m_splits->begin(), this->m_splits->end(), this->m_local_splits.begin()); - //for (const auto& item : *m_splits) m_local_splits.push_back(item); + long style = wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX; Create(parent_ @@ -147,15 +145,13 @@ cbAccount_->Append(account.ACCOUNTNAME); if (account.ACCOUNTID == accountID_) cbAccount_->SetValue(account.ACCOUNTNAME); } - //cbAccount_->AutoComplete(Model_Account::all_account_names()); //TODO: + cbAccount_->AutoComplete(Model_Account::instance().all_account_names()); accountID_ = transaction_->ACCOUNTID; // backup the original currency rate first if (transaction_->TRANSAMOUNT > 0.0) edit_currency_rate = transaction_->TOTRANSAMOUNT / transaction_->TRANSAMOUNT; - wxString categString = _("Select Category"); - //Notes textNumber_->SetValue(transaction_->TRANSACTIONNUMBER); @@ -647,16 +643,19 @@ fullCategoryName = _("Split Category"); double total = Model_Splittransaction::instance().get_total(m_local_splits); textAmount_->SetValue(total); + transaction_->CATEGID = -1; + transaction_->SUBCATEGID = -1; } else { Model_Category::Data *category = Model_Category::instance().get(transaction_->CATEGID); - Model_Subcategory::Data *subcategory = (transaction_->SUBCATEGID != -1 ? Model_Subcategory::instance().get(transaction_->SUBCATEGID) : 0); + Model_Subcategory::Data *subcategory = (Model_Subcategory::instance().get(transaction_->SUBCATEGID)); fullCategoryName = Model_Category::full_name(category, subcategory); if (fullCategoryName.IsEmpty()) fullCategoryName = _("Select Category"); } bCategory_->SetLabel(fullCategoryName); + textAmount_->Enable(!has_split); cSplit_->SetValue(has_split); cSplit_->Enable(Model_Checking::type(transaction_) != Model_Checking::TRANSFER); } @@ -703,7 +702,6 @@ void mmTransDialog::activateSplitTransactionsDlg() { bool bDeposit = transaction_->TRANSCODE == Model_Checking::all_type()[Model_Checking::DEPOSIT]; - //mmSplitTransactionEntry* pSplitEntry(new mmSplitTransactionEntry); if (transaction_->CATEGID > -1) { @@ -727,6 +725,7 @@ amount = - amount; wxString dispAmount = CurrencyFormatter::float2String(amount); textAmount_->SetValue(dispAmount); + textAmount_->Enable(false); } } @@ -817,8 +816,6 @@ void mmTransDialog::OnSplitChecked(wxCommandEvent& /*event*/) { - /* Reset Category */ - //split_ = wxSharedPtr<mmSplitTransactionEntries>(new mmSplitTransactionEntries()); if (cSplit_->IsChecked()) { activateSplitTransactionsDlg(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-27 21:02:13
|
Revision: 5022 http://sourceforge.net/p/moneymanagerex/code/5022 Author: vomikan Date: 2013-10-27 21:02:09 +0000 (Sun, 27 Oct 2013) Log Message: ----------- fix for transfer transactions Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-27 20:26:31 UTC (rev 5021) +++ trunk/src/transdialog.cpp 2013-10-27 21:02:09 UTC (rev 5022) @@ -161,8 +161,7 @@ for (const auto &account : accounts) { cbAccount_->Append(account.ACCOUNTNAME); - //if (account.ACCOUNTID == accountID_) cbAccount_->SetValue(account.ACCOUNTNAME); - if (account.ACCOUNTID == accountID_) cbAccount_->SetStringSelection(account.ACCOUNTNAME); + if (account.ACCOUNTID == transaction_->ACCOUNTID) cbAccount_->SetStringSelection(account.ACCOUNTNAME); } cbAccount_->AutoComplete(Model_Account::instance().all_account_names()); cbAccount_->UnsetToolTip(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-30 07:44:12
|
Revision: 5041 http://sourceforge.net/p/moneymanagerex/code/5041 Author: guanlisheng Date: 2013-10-30 07:44:06 +0000 (Wed, 30 Oct 2013) Log Message: ----------- unify new created payee & existent payee when create checking transaction Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-30 02:21:29 UTC (rev 5040) +++ trunk/src/transdialog.cpp 2013-10-30 07:44:06 UTC (rev 5041) @@ -604,14 +604,13 @@ { payee = Model_Payee::instance().create(); payee->PAYEENAME = payee_name; - transaction_->PAYEEID = Model_Payee::instance().save(payee); } else return false; } + transaction_->PAYEEID = payee->PAYEEID; transaction_->TOACCOUNTID = -1; - payee = Model_Payee::instance().get(transaction_->PAYEEID); payee->CATEGID = transaction_->CATEGID; payee->SUBCATEGID = transaction_->SUBCATEGID; Model_Payee::instance().save(payee); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-30 11:55:07
|
Revision: 5049 http://sourceforge.net/p/moneymanagerex/code/5049 Author: vomikan Date: 2013-10-30 11:55:03 +0000 (Wed, 30 Oct 2013) Log Message: ----------- save a payee if just created Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-30 11:54:01 UTC (rev 5048) +++ trunk/src/transdialog.cpp 2013-10-30 11:55:03 UTC (rev 5049) @@ -604,6 +604,9 @@ { payee = Model_Payee::instance().create(); payee->PAYEENAME = payee_name; + payee->CATEGID = transaction_->CATEGID; + payee->SUBCATEGID = transaction_->SUBCATEGID; + Model_Payee::instance().save(payee); } else return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-11-03 17:24:08
|
Revision: 5093 http://sourceforge.net/p/moneymanagerex/code/5093 Author: vomikan Date: 2013-11-03 17:24:05 +0000 (Sun, 03 Nov 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/src/transdialog.cpp Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-11-03 14:14:09 UTC (rev 5092) +++ trunk/src/transdialog.cpp 2013-11-03 17:24:05 UTC (rev 5093) @@ -156,8 +156,10 @@ edit_currency_rate = transaction_->TOTRANSAMOUNT / transaction_->TRANSAMOUNT; //Account + cbAccount_->SetEvtHandlerEnabled(false); + cbAccount_->Clear(); newAccountID_ = accountID_; - Model_Account::Data_Set accounts = Model_Account::instance().all(); + Model_Account::Data_Set accounts = Model_Account::instance().all(Model_Account::COL_ACCOUNTNAME); for (const auto &account : accounts) { cbAccount_->Append(account.ACCOUNTNAME); @@ -166,7 +168,7 @@ cbAccount_->AutoComplete(Model_Account::instance().all_account_names()); cbAccount_->UnsetToolTip(); accountID_ = transaction_->ACCOUNTID; - cbAccount_->SetEvtHandlerEnabled(false); + cbAccount_->SetEvtHandlerEnabled(true); //Payee or To Account cbPayee_->SetEvtHandlerEnabled(false); @@ -211,7 +213,6 @@ cbAccount_->SetToolTip(_("Specify account for the transaction")); account_label_->SetLabel(_("Account")); - //cbAccount_->Enable(!accounts.empty()); transaction_->TOACCOUNTID = -1; for (const auto & entry : Model_Payee::instance().all_payee_names()) @@ -261,7 +262,6 @@ } cbPayee_->SetEvtHandlerEnabled(true); - cbAccount_->SetEvtHandlerEnabled(true); //SetSplitState(); bool has_split = !this->m_local_splits.empty(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |