1 /*************************************************************************** 2 fixcalcpart.cpp - 3 ------------------- 4 begin : Don Jan 1 2004 5 copyright : (C) 2004 by Klaas Freitag 6 email : freitag@kde.org 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #include "fixcalcpart.h" 19 FixCalcPart()20FixCalcPart::FixCalcPart() 21 :CalcPart(), 22 m_amount( 0 ) 23 { 24 25 } 26 FixCalcPart(QString name,Geld preis,int prozent)27FixCalcPart::FixCalcPart(QString name, Geld preis, int prozent ) 28 : CalcPart(name, prozent), 29 m_fixPreis(preis), 30 m_amount(1.0) 31 { 32 // setProzentPlus(prozent); 33 } 34 setMenge(double val)35void FixCalcPart::setMenge( double val ) 36 { 37 if( val != m_amount ) 38 { 39 m_amount = val; 40 setDirty(true); 41 } 42 } 43 getType() const44QString FixCalcPart::getType() const 45 { 46 return KALKPART_FIX; 47 } 48 unitPreis()49Geld FixCalcPart::unitPreis() 50 { 51 return m_fixPreis; 52 } 53 setUnitPreis(Geld g)54void FixCalcPart::setUnitPreis( Geld g ) 55 { 56 if( g != m_fixPreis ) 57 { 58 m_fixPreis = g; 59 setDirty(true); 60 } 61 } 62 ~FixCalcPart()63FixCalcPart::~FixCalcPart() 64 { 65 66 } 67 basisKosten()68Geld FixCalcPart::basisKosten() 69 { 70 Geld g = m_fixPreis; 71 g = (Geld) m_fixPreis*m_amount; 72 return g; 73 } 74