Subversion Repositories public

Rev

Rev 46 | Rev 60 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46 Rev 52
Line 1... Line 1...
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2007 by Andreas Theofilu   *
2
 *   Copyright (C) 2007 by Andreas Theofilu                                *
3
 *   andreas@TheoSys.at   *
3
 *   andreas@TheoSys.at                                                    *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License, or     *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *   (at your option) any later version.                                   *
-
 
9
 *                                                                         *
8
 *                                                                         *
10
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
Line 16... Line 15...
16
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
17
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 ***************************************************************************/
18
 ***************************************************************************/
20
 
19
 
-
 
20
#ifndef _ZINSAENDERUNG
-
 
21
   #define _ZINSAENDERUNG
-
 
22
#endif
-
 
23
 
21
#include <klineedit.h>
24
#include <klineedit.h>
22
#include <kmessagebox.h>
25
#include <kmessagebox.h>
23
#include <klocale.h>
26
#include <klocale.h>
24
#include <kdatewidget.h>
27
#include <kdatewidget.h>
25
#include <kcombobox.h>
28
#include <kcombobox.h>
26
#include <knuminput.h>
29
#include <knuminput.h>
27
#include <qcheckbox.h>
30
#include <qcheckbox.h>
-
 
31
#include <qradiobutton.h>
28
 
32
 
29
#include <stdlib.h>
33
#include <stdlib.h>
30
#include <iostream.h>
34
#include <iostream.h>
31
#include "helper.h"
35
#include "helper.h"
32
#include "tilgungsplanwidget.h"
36
#include "tilgungsplanwidget.h"
Line 62... Line 66...
62
	checkBox_RaAug->setChecked(TRUE);
66
	checkBox_RaAug->setChecked(TRUE);
63
	checkBox_RaSep->setChecked(TRUE);
67
	checkBox_RaSep->setChecked(TRUE);
64
	checkBox_RaOkt->setChecked(TRUE);
68
	checkBox_RaOkt->setChecked(TRUE);
65
	checkBox_RaNov->setChecked(TRUE);
69
	checkBox_RaNov->setChecked(TRUE);
66
	checkBox_RaDez->setChecked(TRUE);
70
	checkBox_RaDez->setChecked(TRUE);
-
 
71
#ifndef _ZINSAENDERUNG
-
 
72
	checkBox_ZiChange->setProperty("enabled", QVariant("FALSE"));
-
 
73
#endif
67
}
74
}
68
 
75
 
69
tilgungsplanWidget::~tilgungsplanWidget()
76
tilgungsplanWidget::~tilgungsplanWidget()
70
{}
77
{}
71
 
78
 
Line 79... Line 86...
79
char hv0[255];
86
char hv0[255];
80
 
87
 
81
	// Zuweisen der Inhalte der Widgets zur internen Parameterstruktur.
88
	// Zuweisen der Inhalte der Widgets zur internen Parameterstruktur.
82
	TpPars.effformel = 0.0;
89
	TpPars.effformel = 0.0;
83
	TpPars.gewicht = 0.0;
90
	TpPars.gewicht = 0.0;
84
	TpPars.tageb = comboBox_tageber->currentItem();
91
	TpPars.tageb = comboBox_tageber->currentItem() + 1;
-
 
92
 
85
	TpPars.verzart = comboBox_verzart->currentItem();
93
	switch (comboBox_verzart->currentItem())
-
 
94
	{
-
 
95
	   case 0: TpPars.verzart = 0; break;	// Dekursiv
-
 
96
	   case 1: TpPars.verzart = 3; break;	// Antizipativ
-
 
97
	   case 2: TpPars.verzart = 7; break;	// Dekursiv; Zinsen am Beg.d. Absclussp.
-
 
98
	   case 3: TpPars.verzart = 4; break;	// Unverzinst
-
 
99
	}
-
 
100
 
86
	TpPars.ratenart = comboBox_Ratart->currentItem();
101
	TpPars.ratenart = comboBox_Ratart->currentItem();
87
	TpPars.valuta = comboBox_valuta->currentItem();
102
	TpPars.valuta = comboBox_valuta->currentItem();
88
	TpPars.zssoll = kDoubleNumInput_Zinssatz->value();
103
	TpPars.zssoll = kDoubleNumInput_Zinssatz->value();
89
	TpPars.zuschfix = kDoubleNumInput_ZuschFix->value();
104
	TpPars.zuschfix = kDoubleNumInput_ZuschFix->value();
90
	TpPars.zuschprz = kDoubleNumInput_ZiZuschuss->value();
105
	TpPars.zuschprz = kDoubleNumInput_ZiZuschuss->value();
Line 136... Line 151...
136
	dt = kDateWidget_Endfael->date();
151
	dt = kDateWidget_Endfael->date();
137
	TpPars.endfaell = make_date(dt.day(), dt.month(), dt.year());
152
	TpPars.endfaell = make_date(dt.day(), dt.month(), dt.year());
138
	TpPars.runden = checkBox_Runden->isChecked();
153
	TpPars.runden = checkBox_Runden->isChecked();
139
	TpPars.mehrfach = FALSE;
154
	TpPars.mehrfach = FALSE;
140
	TpPars.laufstop = FALSE;
155
	TpPars.laufstop = FALSE;
-
 
156
#ifdef _ZINSAENDERUNG
-
 
157
	TpPars.ziaend = checkBox_ZiChange->isChecked();
-
 
158
#else
141
	TpPars.ziaend = FALSE;
159
	TpPars.ziaend = FALSE;
-
 
160
#endif
142
	TpPars.effekt = TRUE;
161
	TpPars.effekt = TRUE;
143
	TpPars.fixrate = checkBox_Rate->isChecked();
162
	TpPars.fixrate = checkBox_Rate->isChecked();
144
 
163
 
145
	if (TpPars.dbis > TpPars.endfaell)
164
	if (TpPars.dbis > TpPars.endfaell)
146
	   TpPars.endfaell = TpPars.dbis;
165
	   TpPars.endfaell = TpPars.dbis;
Line 210... Line 229...
210
	   lineEdit_ErgZiZusch->clear();
229
	   lineEdit_ErgZiZusch->clear();
211
	   lineEdit_ErgAnnZusch->clear();
230
	   lineEdit_ErgAnnZusch->clear();
212
	   lineEdit_ErgSumAnnZusch->clear();
231
	   lineEdit_ErgSumAnnZusch->clear();
213
	   return;
232
	   return;
214
	}
233
	}
-
 
234
 
-
 
235
	if (TpPars.effformel > 0.0)
215
// cout << "Effektivzinssätze: " << TpPars.effformel << ", " << TpPars.gewicht << endl;
236
	   PointNumber(TpPars.effformel, 3, &hv0[0]);
-
 
237
	else
216
	PointNumber(TpPars.effformel, 3, &hv0[0]);
238
	   PointNumber(TpPars.gewicht, 3, &hv0[0]);
-
 
239
 
217
	lineEdit_EffZi->clear();
240
	lineEdit_EffZi->clear();
218
	lineEdit_EffZi->insert(hv0);
241
	lineEdit_EffZi->insert(hv0);
219
 
242
 
220
	PointNumber(TpPars.gesamt, 2, &hv0[0]);
243
	PointNumber(TpPars.gesamt, 2, &hv0[0]);
221
	lineEdit_GesBelast->clear();
244
	lineEdit_GesBelast->clear();
Line 339... Line 362...
339
{}
362
{}
340
 
363
 
341
void tilgungsplanWidget::mnInputZiSlot()
364
void tilgungsplanWidget::mnInputZiSlot()
342
{
365
{
343
ziaendWidget *dlg = new ziaendWidget(this, "ziaendWidgetBase", TRUE, 0);
366
ziaendWidget *dlg = new ziaendWidget(this, "ziaendWidgetBase", TRUE, 0);
344
QString zia;
-
 
345
 
-
 
346
	if (dlg->exec() == QDialog::Accepted)
-
 
347
	   zia = QString::fromUtf8(".zinstbl.dat");
-
 
348
	else
-
 
349
	   zia = QString::fromUtf8("");
-
 
350
 
367
 
-
 
368
	dlg->exec();
351
	delete dlg;
369
	delete dlg;
352
}
370
}
353
 
371
 
354
void tilgungsplanWidget::lbVerzartSlot()
372
void tilgungsplanWidget::lbVerzartSlot()
355
{}
373
{}
Line 373... Line 391...
373
{}
391
{}
374
 
392
 
375
void tilgungsplanWidget::numFixspesenSlot()
393
void tilgungsplanWidget::numFixspesenSlot()
376
{}
394
{}
377
 
395
 
-
 
396
void tilgungsplanWidget::rbZuschPSlot()
-
 
397
{
-
 
398
	if (radioButton_ZuschP->isChecked())
-
 
399
	{
-
 
400
	   kDoubleNumInput_ZiZuschuss->setProperty("enabled", QVariant("TRUE"));
-
 
401
	   kDoubleNumInput_ZuschFix->setProperty("enabled", QVariant("FALSE"));
-
 
402
	   radioButton_ZuschF->setChecked(FALSE);
-
 
403
	}
-
 
404
	else
-
 
405
	{
-
 
406
	   kDoubleNumInput_ZiZuschuss->setProperty("enabled", QVariant("FALSE"));
-
 
407
	   kDoubleNumInput_ZuschFix->setProperty("enabled", QVariant("TRUE"));
-
 
408
	   radioButton_ZuschF->setChecked(TRUE);
-
 
409
	}
-
 
410
}
-
 
411
 
-
 
412
void tilgungsplanWidget::rbZuschFSlot()
-
 
413
{
-
 
414
	if (radioButton_ZuschF->isChecked())
-
 
415
	{
-
 
416
	   kDoubleNumInput_ZiZuschuss->setProperty("enabled", QVariant("FALSE"));
-
 
417
	   kDoubleNumInput_ZuschFix->setProperty("enabled", QVariant("TRUE"));
-
 
418
	   radioButton_ZuschP->setChecked(FALSE);
-
 
419
	}
-
 
420
	else
-
 
421
	{
-
 
422
	   kDoubleNumInput_ZiZuschuss->setProperty("enabled", QVariant("TRUE"));
-
 
423
	   kDoubleNumInput_ZuschFix->setProperty("enabled", QVariant("FALSE"));
-
 
424
	   radioButton_ZuschP->setChecked(TRUE);
-
 
425
	}
-
 
426
}
-
 
427
 
378
void tilgungsplanWidget::cbRundenSlot()
428
void tilgungsplanWidget::cbRundenSlot()
379
{}
429
{}
380
 
430
 
381
void tilgungsplanWidget::numBetragSlot()
431
void tilgungsplanWidget::numBetragSlot()
382
{}
432
{}