Beispiel #1
0
void mmTransDialog::OnCategs(wxCommandEvent& /*event*/)
{
    if (cSplit_->IsChecked())
    {
        activateSplitTransactionsDlg();
    }
    else
    {
        mmCategDialog dlg(this, true, false);
        dlg.setTreeSelection(m_trx_data.CATEGID, m_trx_data.SUBCATEGID);
        if (dlg.ShowModal() == wxID_OK)
        {
            m_trx_data.CATEGID = dlg.getCategId();
            m_trx_data.SUBCATEGID = dlg.getSubCategId();
            bCategory_->SetLabelText(dlg.getFullCategName());
            categUpdated_ = true;
        }
    }
    skip_amount_init_ = false;
    skip_tooltips_init_ = false;
    dataToControls();
}
Beispiel #2
0
void mmTransDialog::OnSplitChecked(wxCommandEvent& /*event*/)
{
    if (cSplit_->IsChecked())
    {
        activateSplitTransactionsDlg();
    }
    else
    {
        if (local_splits.size() > 1)
        {
            //Delete split items first (data protection)
            cSplit_->SetValue(true);
        }
        else
        {
            if (local_splits.size() == 1)
            {
                m_trx_data.CATEGID = local_splits.begin()->CATEGID;
                m_trx_data.SUBCATEGID = local_splits.begin()->SUBCATEGID;
                m_trx_data.TRANSAMOUNT = local_splits.begin()->SPLITTRANSAMOUNT;

                if (m_trx_data.TRANSAMOUNT < 0)
                {
                    m_trx_data.TRANSAMOUNT = -m_trx_data.TRANSAMOUNT;
                    transaction_type_->SetSelection(Model_Checking::WITHDRAWAL);
                }
            }
            else
            {
                m_trx_data.TRANSAMOUNT = 0;
            }
            local_splits.clear();
        }
    }
    skip_category_init_ = false;
    skip_tooltips_init_ = false;
    dataToControls();
}