File indexing completed on 2024-05-19 05:07:14
0001 /* 0002 SPDX-FileCopyrightText: 2001-2002 Michael Edwardes <mte@users.sourceforge.net> 0003 SPDX-FileCopyrightText: 2001 Felix Rodriguez <frodriguez@users.sourceforge.net> 0004 SPDX-FileCopyrightText: 2002-2003 Kevin Tambascio <ktambascio@users.sourceforge.net> 0005 SPDX-FileCopyrightText: 2006-2019 Thomas Baumgart <tbaumgart@kde.org> 0006 SPDX-FileCopyrightText: 2006 Ace Jones <acejones@users.sourceforge.net> 0007 SPDX-FileCopyrightText: 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #ifndef MYMONEYACCOUNTLOAN_H 0012 #define MYMONEYACCOUNTLOAN_H 0013 0014 // ---------------------------------------------------------------------------- 0015 // QT Includes 0016 0017 // ---------------------------------------------------------------------------- 0018 // Project Includes 0019 0020 #include "mymoneyaccount.h" 0021 0022 /** 0023 * This class is a convenience class to access data for loan accounts. 0024 * It does contain the same member variables as a MyMoneyAccount object, 0025 * but serves a set of getter/setter methods to ease the access to 0026 * laon relevant data stored in the key value container of the MyMoneyAccount 0027 * object. 0028 */ 0029 class MyMoneyMoney; 0030 class MyMoneyAccountLoanPrivate; 0031 class KMM_MYMONEY_EXPORT MyMoneyAccountLoan : public MyMoneyAccount 0032 { 0033 Q_DECLARE_PRIVATE_D(MyMoneyObject::d_ptr, MyMoneyAccountLoan) 0034 0035 public: 0036 enum interestDueE { 0037 paymentDue = 0, 0038 paymentReceived, 0039 }; 0040 0041 enum interestChangeUnitE { 0042 changeDaily = 0, 0043 changeWeekly, 0044 changeMonthly, 0045 changeYearly, 0046 }; 0047 0048 MyMoneyAccountLoan() {} 0049 MyMoneyAccountLoan(const MyMoneyAccount&); // krazy:exclude=explicit 0050 ~MyMoneyAccountLoan() {} 0051 0052 const MyMoneyMoney loanAmount() const; 0053 void setLoanAmount(const MyMoneyMoney& amount); 0054 const MyMoneyMoney interestRate(const QDate& date) const; 0055 void setInterestRate(const QDate& date, const MyMoneyMoney& rate); 0056 interestDueE interestCalculation() const; 0057 void setInterestCalculation(const interestDueE onReception); 0058 const QDate nextInterestChange() const; 0059 void setNextInterestChange(const QDate& date); 0060 const QString schedule() const; 0061 void setSchedule(const QString& sched); 0062 bool fixedInterestRate() const; 0063 void setFixedInterestRate(const bool fixed); 0064 const MyMoneyMoney finalPayment() const; 0065 void setFinalPayment(const MyMoneyMoney& finalPayment); 0066 unsigned int term() const; 0067 void setTerm(const unsigned int payments); 0068 int interestChangeFrequency(int* unit = 0) const; 0069 void setInterestChangeFrequency(const int amount, const int unit); 0070 const MyMoneyMoney periodicPayment() const; 0071 void setPeriodicPayment(const MyMoneyMoney& payment); 0072 int interestCompounding() const; 0073 void setInterestCompounding(int frequency); 0074 const QString payee() const; 0075 void setPayee(const QString& payee); 0076 const QString interestAccountId() const; 0077 void setInterestAccountId(const QString& id); 0078 }; 0079 0080 #endif