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

Diff of /trunk/lohnrechner2006.py

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

revision 24 by wilde, Mon Jan 17 14:30:00 2005 UTC revision 25 by wilde, Thu Jan 27 10:08:27 2005 UTC
# Line 69  class Lohnrechner(LST2005.LStRechner2005 Line 69  class Lohnrechner(LST2005.LStRechner2005
69                            ("V", 5),                            ("V", 5),
70                            ("VI", 6)]:                            ("VI", 6)]:
71              stklradio = Radiobutton(stklframe, text=text, value=val,              stklradio = Radiobutton(stklframe, text=text, value=val,
72                                      indicatoron=0, command=self.CalcOutput,                                      indicatoron=0, command=self.NewInput,
73                                      variable=self.stkl)                                      variable=self.stkl)
74              if text == "I":              if text == "I":
75                  stklradio.select()                  stklradio.select()
# Line 78  class Lohnrechner(LST2005.LStRechner2005 Line 78  class Lohnrechner(LST2005.LStRechner2005
78          Label(frame, text="Kirchensteuer:").grid(row=2, sticky=E)          Label(frame, text="Kirchensteuer:").grid(row=2, sticky=E)
79          self.kirche = IntVar()          self.kirche = IntVar()
80          kircheradio = Checkbutton(frame, onvalue=1, offvalue=0,          kircheradio = Checkbutton(frame, onvalue=1, offvalue=0,
81                                    command=self.CalcOutput,                                    command=self.NewInput,
82                                    variable=self.kirche).grid(row=2, column=1, sticky=W)                                    variable=self.kirche).grid(row=2, column=1, sticky=W)
83    
84          Label(frame, text="Kinderfreibetrag:").grid(row=3, sticky=E)          Label(frame, text="Kinderfreibetrag:").grid(row=3, sticky=E)
# Line 93  class Lohnrechner(LST2005.LStRechner2005 Line 93  class Lohnrechner(LST2005.LStRechner2005
93                                 yscrollcommand=scrollbar.set)                                 yscrollcommand=scrollbar.set)
94          for land in self.laender:          for land in self.laender:
95              self.landbox.insert(END, land[0])              self.landbox.insert(END, land[0])
         self.landbox.bind("<<ListboxSelect>>", self.NewLandSel)  
96          self.landbox.select_set(0)          self.landbox.select_set(0)
97            self.landbox.bind("<<ListboxSelect>>", self.NewLandSel)
98          self.landbox.pack(side=RIGHT, fill=Y)          self.landbox.pack(side=RIGHT, fill=Y)
99          scrollbar.config(command=self.landbox.yview)          scrollbar.config(command=self.landbox.yview)
100          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)
101          landframe.grid(row=4, column=1, sticky=W)          landframe.grid(row=4, column=1, sticky=W)
102          self.NewLandSel()          self.UpdateLand()
103                    
104          self.ResetInput()          self.ResetInput()
105    
# Line 115  class Lohnrechner(LST2005.LStRechner2005 Line 115  class Lohnrechner(LST2005.LStRechner2005
115          self.kist = Entry(frame)          self.kist = Entry(frame)
116          self.kist.grid(row=2, column=3, sticky=W)          self.kist.grid(row=2, column=3, sticky=W)
117    
118            Label(frame, text="Lohn nach Steuern:").grid(row=3, column=2, sticky=E)
119            self.netto = Entry(frame)
120            self.netto.grid(row=3, column=3, sticky=W)
121    
122          buttons = Frame(frame)          buttons = Frame(frame)
123          buttons.grid(row=4, column=2, columnspan=2)          buttons.grid(row=4, column=2, columnspan=2)
124          Button(buttons, text="Quit", command=root.quit).pack(side=LEFT)          Button(buttons, text="Quit", command=root.quit).pack(side=LEFT)
125          Button(buttons, text="Info", command=self.Info).pack(side=LEFT)          Button(buttons, text="Info", command=self.Info).pack(side=LEFT)
126          Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)          Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)
127                    
128          self.CalcOutput()          self.NewInput()
129    
130      def NewInput(self, event):      def NewInput(self, event=0):
131          # Es ist m�glich alle Eintr�ge in der Listbox zu deselektieren,          # Es ist m�glich alle Eintr�ge in der Listbox zu deselektieren,
132          # es ist aber immer genau ein Eintrag aktuell, darum wird er ggf.          # es ist aber immer genau ein Eintrag aktuell, darum wird er ggf.
133          # zwangsselektiert:          # zwangsselektiert:
# Line 132  class Lohnrechner(LST2005.LStRechner2005 Line 136  class Lohnrechner(LST2005.LStRechner2005
136              self.landbox.select_set(self.land)                          self.landbox.select_set(self.land)            
137          self.CalcOutput()          self.CalcOutput()
138    
139      def NewLandSel(self, event=0):      def UpdateLand(self):
140          self.land = int(self.landbox.curselection()[0])          self.land = int(self.landbox.curselection()[0])
141    
142        def NewLandSel(self, event=0):
143            self.UpdateLand()
144            self.CalcOutput()
145    
146      def ResetInput(self):      def ResetInput(self):
147          self.ResetInputLohn()          self.ResetInputLohn()
148          self.ResetInputKfb()          self.ResetInputKfb()
# Line 159  class Lohnrechner(LST2005.LStRechner2005 Line 167  class Lohnrechner(LST2005.LStRechner2005
167              self.ResetInputKfb()              self.ResetInputKfb()
168    
169          self.SetSteuerklasse(self.stkl.get())          self.SetSteuerklasse(self.stkl.get())
170          self.SetKirchensteuer(self.kirche.get() *          self.SetKirchensteuerProzent(self.kirche.get() *
171                                self.laender[self.land][1])                                       self.laender[self.land][1])
172    
173      def CalcOutput(self):      def CalcOutput(self):
174          self.InitCalc()          self.InitCalc()
175          self.Calc()          self.Calc()
176          self.lst.delete(0, END)          self.lst.delete(0, END)
177          self.lst.insert(0, "%.2f" % self.GetLohnsteuer())                  self.lst.insert(0, "%.2f" % self.GetLohnsteuer())
178          self.soli.delete(0, END)          self.soli.delete(0, END)
179          self.soli.insert(0, "%.2f" % self.GetSoli())                  self.soli.insert(0, "%.2f" % self.GetSoli())
180          self.kist.delete(0, END)          self.kist.delete(0, END)
181          self.kist.insert(0, "%.2f" % self.GetKirchensteuer())                  self.kist.insert(0, "%.2f" % self.GetKirchensteuer())
182            self.netto.delete(0, END)
183            self.netto.insert(0, "%.2f" %
184                              (self.GetLohn() - self.GetLohnsteuer()
185                               - self.GetSoli() - self.GetKirchensteuer()))
186    
187      def Info(self):      def Info(self):
188          infowin = Toplevel(self.root)          infowin = Toplevel(self.root)

Legend:
Removed from v.24  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26