/[lohnrechner]/trunk/lohnrechner2006.py
ViewVC logotype

Diff of /trunk/lohnrechner2006.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by wilde, Thu Jan 13 10:01:01 2005 UTC revision 12 by wilde, Thu Jan 13 11:39:49 2005 UTC
# Line 30  class Lohnrechner(LST2005.LStRechner2005 Line 30  class Lohnrechner(LST2005.LStRechner2005
30    
31          Label(root, text="Lohn:").grid(row=0, sticky=E)          Label(root, text="Lohn:").grid(row=0, sticky=E)
32          self.lohn = Entry(root)          self.lohn = Entry(root)
33            self.lohn.bind("<Return>", self.NewInput)
34          self.lohn.grid(row=0, column=1, sticky=W)          self.lohn.grid(row=0, column=1, sticky=W)
35    
36          Label(root, text="Steuerklasse:").grid(row=1, sticky=E)          Label(root, text="Steuerklasse:").grid(row=1, sticky=E)
# Line 43  class Lohnrechner(LST2005.LStRechner2005 Line 44  class Lohnrechner(LST2005.LStRechner2005
44                            ("V", "5"),                            ("V", "5"),
45                            ("VI", "6")]:                            ("VI", "6")]:
46              stklradio = Radiobutton(stklframe, text=text, value=val,              stklradio = Radiobutton(stklframe, text=text, value=val,
47                                      indicatoron=0,                                      indicatoron=0, command=self.CalcOutput,
48                                      variable=self.stkl)                                      variable=self.stkl)
49              if text == "I":              if text == "I":
50                  stklradio.select()                  stklradio.select()
51              stklradio.pack(side=LEFT)              stklradio.pack(side=LEFT)
52    
53            Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)
54            self.kirche = Entry(root)
55            self.kirche.bind("<Return>", self.NewInput)
56            self.kirche.grid(row=2, column=1, sticky=W)
57    
58          self.ResetInput()          self.ResetInput()
59    
60          Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)          Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
61          self.lst = Entry(root)          self.lst = Entry(root)
62          self.lst.grid(row=0, column=3, sticky=W)          self.lst.grid(row=0, column=3, sticky=W)
63    
64          Label(root, text="Lolidarit�tszuschlag:").grid(row=1, column=2, sticky=E)          Label(root, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E)
65          self.soli = Entry(root)          self.soli = Entry(root)
66          self.soli.grid(row=1, column=3, sticky=W)          self.soli.grid(row=1, column=3, sticky=W)
67    
68            Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
69            self.kirchest = Entry(root)
70            self.kirchest.grid(row=2, column=3, sticky=W)
71    
72          self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)          self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)
73          self.calcbutton.grid(row=3, columnspan=4)          self.calcbutton.grid(row=3, columnspan=4)
74                    
75          self.CalcOutput()          self.CalcOutput()
76            
77        def NewInput(self, event):
78            self.CalcOutput()
79    
80      def ResetInput(self):      def ResetInput(self):
81            self.ResetInputLohn()
82            self.ResetInputKirche()
83    
84        def ResetInputLohn(self):
85            self.lohn.delete(0, END)
86          self.lohn.insert(0, "0")          self.lohn.insert(0, "0")
87    
88        def ResetInputKirche(self):
89            self.kirche.delete(0, END)
90            self.kirche.insert(0, "0")
91    
92      def InitCalc(self):      def InitCalc(self):
93          self.SetLohn(float(self.lohn.get()))          try:
94                self.SetLohn(float(self.lohn.get()))
95            except:
96                self.ResetInputLohn()
97    
98            try:
99                self.SetKirchensteuer(float(self.kirche.get()))
100            except:
101                self.ResetInputKirche()
102                
103          self.SetSteuerklasse(int(self.stkl.get()))          self.SetSteuerklasse(int(self.stkl.get()))
104    
105      def CalcOutput(self):      def CalcOutput(self):
# Line 78  class Lohnrechner(LST2005.LStRechner2005 Line 109  class Lohnrechner(LST2005.LStRechner2005
109          self.lst.insert(0, "%.2f" % self.GetLohnsteuer())                  self.lst.insert(0, "%.2f" % self.GetLohnsteuer())        
110          self.soli.delete(0, END)          self.soli.delete(0, END)
111          self.soli.insert(0, "%.2f" % self.GetSoli())                  self.soli.insert(0, "%.2f" % self.GetSoli())        
112            self.kirchest.delete(0, END)
113            self.kirchest.insert(0, "%.2f" % self.GetKirchensteuer())        
114    
115    
116  if __name__ == "__main__":  if __name__ == "__main__":

Legend:
Removed from v.7  
changed lines
  Added in v.12

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26