Go to most recent revision | Blame | Last modification | View Log | RSS feed
/***************************************************************************
* Copyright (C) 2007 by Andreas Theofilu *
* andreas@TheoSys.at *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _tprech_h
#define _tprech_h
#ifndef _RAIFFEISEN
#define _RAIFFEISEN
#endif
#ifndef BOOL
typedef unsigned char BOOL;
#endif
typedef struct TpParameter
{
int tageb; /* Tageberechnung */
int verzart; /* Verzinsungsart */
int ratenart; /* Ratenart */
int valuta; /* Valuta Rückzahlung */
double zssoll; /* %-Satz Zinsen Soll */
double zuschfix; /* Zuschuß fix */
double zuschprz; /* Zuschuß %-Satz */
double zuschannu; /* Annuitätenzuschuß */
long ragab; /* Rahmen gültig ab (Zuzählungsdatum) */
long abschl; /* Abschluß (Datum) */
BOOL ultimo; /* Berechnung auf Ultimo */
int abschlry; /* Abschlußrythmus */
int zuschver; /* Zuschuß Verrechnung */
double spesen; /* Fixspesen */
double rahmen; /* Ursprüngliche Rahmen */
double kapital; /* Endkapital */
int raplan[12]; /* Ratenplan */
double rate; /* Rate (Ratenvorgabe) */
long dvon; /* Erste Einschränkung */
long dbis; /* Letzte Einschränkung */
long endfaell; /* Endfälligkeit */
BOOL runden; /* Runden (J/N) */
BOOL mehrfach; /* Mehrfachtilgungsplan (J/N) */
BOOL laufstop; /* Laufzeitunterbrechnung (J/N) */
BOOL ziaend; /* Zinssatzänderung (J/N) */
BOOL effekt; /* Effektivzinssatz (J/N) */
BOOL fixrate; /* Fixraten (J/N) */
/* Ergebnisse */
double gesamt; /* Gesamtbelastung */
double ergrate; /* Rate */
double lrate; /* Letzte Rate */
double ezins; /* Zinsen */
double zuschuss; /* Zinsenzuschuß */
double effformel; /* Effektivzinssatz nach Formel */
double gewicht; /* Effektivzinssatz gewichtet */
double anzuschuss; /* Annuitätenzuschuß */
double antotal; /* Gesamter Annuitätenzuschuß */
int anzraten; /* Anzahl Raten */
}TPPARS;
typedef struct DateTable
{
long datum; /* Raten/ Abschlußdatum */
char kz; /* Kennzeichen (A/R) */
double kapital; /* Kapital */
double tilg; /* Tilgung */
double rate; /* Annuität */
double zinsen;
double rkapi; /* Restkapital */
}DTABLE;
struct ZIAEND
{
long Datum;
double Zins;
double NewRate;
BOOL FixRate;
BOOL Rate;
};
extern char sTable1[];
extern char sTable2[];
//------------ Klassendefinition des Tilgungsplans (Groß) -------------
class TRech
{
public:
TRech (TPPARS *pPars) { TpPars = pPars; rund_fakt = (pPars->runden) ? 0 : 2; };
int tilgpl (void); // Plausibilitätsprüfung, Steuerung
#ifdef _RAIFFEISEN
int GetZiaend (void);
#endif
protected:
double GetRate (double rahmen, long ragab, long dvon);
int DekursivTable (void); // Dekursive Datumstabelle
int AntizipativTable (void); // Antizipative Datumstabelle
int Ratenplan (); // Erstellung eines Tilgungsplans
int DekursivPlan ();
#ifdef _RAIFFEISEN
void DekZiAend (int fdZins, long *zoff, long size, ZIAEND *Zi);
#endif
int AntizipativPlan ();
double runden (double zahl, int komma);
private:
BOOL test_abschl (int am);
long tageber (long date);
void vorrech ();
void einschr ();
void abschlus ();
void init_global_vars ();
int gesamt1 ();
private:
TPPARS *TpPars;
DTABLE DTable;
int rund_fakt;
int verzinsung;
int reh;
double divisor;
int a_ind;
int r_ind;
int max_abs, max_rat;
long pos;
long a_dat;
long tg_par, tg_alt;
long ab_dat[1200];
long rat_dat[1200];
int rat_anz[1200];
char AbschlPlan[12];
long ab_tag;
long dat_par;
long r_dat;
long ldat;
double zi_rat, zi_kap, rat, kap;
};
#endif // _tprech_h