summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qashmoney/newtransaction.h
blob: db3a5ad9fdc7e6f3bd2c9611c304bffb687c8e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef NEWTRANSACTION_H
#define NEWTRANSACTION_H

#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qcheckbox.h>
#include <qdialog.h>
#include <qlabel.h>
#include <qstringlist.h>
#include <qhbox.h>
#include <qcombobox.h>

#include "transaction.h"
#include "preferences.h"

class NewTransaction : public QDialog
{
    Q_OBJECT

  public:

    int year, month, day;

    NewTransaction ( QWidget* parent );
    ~NewTransaction();

    QLabel *namelabel;
    QHBox *transactionnamebox;
    QComboBox* transactionname;
    QPushButton* descriptionbutton;

    QLabel *amountlabel;
    QHBox *transactionamountbox;
    QLineEdit* transactionamount;
    QPushButton* calculatorbutton;

    QLabel *datelabel;
    QHBox *transactiondatebox;
    QLineEdit* transactiondate;
    QPushButton* datebutton;

    QCheckBox *clearedcheckbox;

    QLabel *numberlabel;
    QLineEdit *transactionnumber;

    QLabel *budgetlabel;
    QComboBox *budgetbox;

    QLabel *lineitemlabel;
    QComboBox *lineitembox;

    QCheckBox *depositbox;

    QGridLayout *layout;

    int getDay ();
    int getMonth ();
    int getYear ();
    QString getDescription ();
    void setDescription ( QString );
    void setComboBoxes ( int, int );

    // When a user edits an transaction and edits the date, this flag
    // is set to TRUE adding the new date to the transaction.  Otherwise,
    // the old date is used for the edited transaction.  This prevents a date
    // from reverting to 0/0/0 if the date is not edited
    bool getDateEdited ();

  public slots:

    void showCalculator();
    void showCalendar ();
    void addTransactionDescription ();
    int getNameIndex ( QString name );
    int getCurrentBudget ();
    int getCurrentLineItem ();
    int getBudgetIndex ( int budgetid );
    int getLineItemIndex ( int lineitemid );
    void setLineItems ();

  private slots:
    void setCurrentBudget ( int index );
    void setCurrentLineItem ( int index );

  private:
    bool dateedited;
    int index, currentbudget, currentlineitem;
    QString transactiondescription;
    QStringList *budgetnameslist, *budgetidslist;
    QStringList lineitemslist, lineitemidslist;

};

#endif