File indexing completed on 2024-05-12 16:42:42

0001 /*
0002     SPDX-FileCopyrightText: 2000-2002 Michael Edwardes <mte@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2001-2017 Thomas Baumgart <tbaumgart@kde.org>
0004     SPDX-FileCopyrightText: 2001 Felix Rodriguez <frodriguez@users.sourceforge.net>
0005     SPDX-FileCopyrightText: 2003 Kevin Tambascio <ktambascio@users.sourceforge.net>
0006     SPDX-FileCopyrightText: 2004-2005 Ace Jones <acejones@users.sourceforge.net>
0007     SPDX-FileCopyrightText: 2006 Darren Gould <darren_gould@gmx.de>
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef MYMONEYTRANSACTION_P_H
0012 #define MYMONEYTRANSACTION_P_H
0013 
0014 // ----------------------------------------------------------------------------
0015 // QT Includes
0016 
0017 #include <QString>
0018 #include <QList>
0019 #include <QDate>
0020 #include <QHash>
0021 
0022 // ----------------------------------------------------------------------------
0023 // Project Includes
0024 
0025 #include "mymoneyobject_p.h"
0026 #include "mymoneysplit.h"
0027 
0028 using namespace eMyMoney;
0029 
0030 class MyMoneyTransactionPrivate : public MyMoneyObjectPrivate
0031 {
0032 public:
0033     /**
0034       * This method returns the next id to be used for a split
0035       */
0036     QString nextSplitID()
0037     {
0038         QString id;
0039         id = 'S' + id.setNum(m_nextSplitID++).rightJustified(SPLIT_ID_SIZE, '0');
0040         return id;
0041     }
0042 
0043     static const int SPLIT_ID_SIZE = 4;
0044     /** constants for unique sort key */
0045     static const int YEAR_SIZE = 4;
0046     static const int MONTH_SIZE = 2;
0047     static const int DAY_SIZE = 2;
0048 
0049     /**
0050       * This member contains the date when the transaction was entered
0051       * into the engine
0052       */
0053     QDate m_entryDate;
0054 
0055     /**
0056       * This member contains the date the transaction was posted
0057       */
0058     QDate m_postDate;
0059 
0060     /**
0061       * This member keeps the memo text associated with this transaction
0062       */
0063     QString m_memo;
0064 
0065     /**
0066       * This member contains the splits for this transaction
0067       */
0068     QList<MyMoneySplit> m_splits;
0069 
0070     /**
0071       * This member keeps the unique numbers of splits within this
0072       * transaction. Upon creation of a MyMoneyTransaction object this
0073       * value will be set to 1.
0074       */
0075     uint m_nextSplitID;
0076 
0077     /**
0078       * This member keeps the base commodity (e.g. currency) for this transaction
0079       */
0080     QString  m_commodity;
0081 
0082     /**
0083       * This member keeps the bank's unique ID for the transaction, so we can
0084       * avoid duplicates.  This is only used for electronic statement downloads.
0085       *
0086       * Note this is now deprecated!  Bank ID's should be set on splits, not transactions.
0087       */
0088     QString m_bankID;
0089 
0090 };
0091 
0092 #endif