Advertisement
ALEXANDAR_GEORGIEV

main_file

Oct 29th, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.07 KB | Source Code | 0 0
  1. from trial_balance_import import *
  2. from new_company import *
  3. from accountant import *
  4. from trial_balance import *
  5.  
  6. class Main:
  7.     def __init__(self):
  8.         pass
  9.  
  10.     # Top level
  11.     def passport_com(self):
  12.         imp_win = InputCompany()
  13.         imp_win.open_comp()
  14.  
  15.     def accountancy(self):
  16.         inp_acc = AccountCompany()
  17.         inp_acc.open_acc()
  18.  
  19.     def type_acc(self):     # TODO Treeview_acc
  20.         trial_balance = TrialBalance()
  21.         trial_balance.main()
  22.  
  23.     def import_trial(self):
  24.         open_trial_balance()
  25.  
  26.     def import_dna(self):
  27.         pass
  28.  
  29.     def main(self):
  30.         parent = tk.Tk()
  31.         parent.title('ИЗГОТВЯНЕ НА ФИНАНСОВИ ОТЧЕТИ')
  32.  
  33.         # get the screen dimension
  34.         screen_width = parent.winfo_screenwidth()
  35.         screen_height = parent.winfo_screenheight()
  36.         h = 150
  37.         # parent.geometry(f'{screen_width}x{h}+-10+0')  # Беше !
  38.         parent.geometry(f'{screen_width}x{h}+0+0')
  39.         parent.resizable(True, False)
  40.         parent.attributes('-topmost', 'true')
  41.  
  42.         # Calculator
  43.         photo1 = PhotoImage(file=r"32x32.png")
  44.         bt1 = Button(parent, image=photo1, relief='raised', height=30, width=30, highlightthickness=4, activebackground='red')
  45.         bt1.place(x=screen_width-80, y=0)
  46.         bt1.bind('<ButtonRelease-1>',)
  47.  
  48.         # -----------------------Buttons
  49.         # Buttons - referenceс
  50.         butt_balance = tk.Button(parent, text='БАЛАНС', font=('Bookman Old Style Bold', 8), fg='green', width=10)
  51.         butt_balance.place(x=350 , y=0)
  52.         butt_balance.bind('<ButtonRelease-1>', None)
  53.         butt_income = tk.Button(parent, text='ОПР', font=('Bookman Old Style Bold', 8), fg='darkred', width=10)
  54.         butt_income.place(x=470 , y=0)
  55.         butt_income.bind('<ButtonRelease-1>', None)
  56.         butt_income = tk.Button(parent, text='КАПИТАЛ', font=('Bookman Old Style Bold', 8), fg='blue', width=10)
  57.         butt_income.place(x=590 , y=0)
  58.         butt_income.bind('<ButtonRelease-1>', None)
  59.         butt_income = tk.Button(parent, text='ОПП', font=('Bookman Old Style Bold', 8), fg='darkblue', width=10)
  60.         butt_income.place(x=710 , y=0)
  61.         butt_income.bind('<ButtonRelease-1>', None)
  62.         butt_income = tk.Button(parent, text='ДА', font=('Bookman Old Style Bold', 8), fg='black', width=10)
  63.         butt_income.place(x=830 , y=0)
  64.         butt_income.bind('<ButtonRelease-1>', None)
  65.  
  66.         #---------------------------------------------------
  67.         butt_pict = tk.Button(parent, text='Снимка на\nактивния\nпрозорец', font=('Bookman Old Style Bold', 8), fg='green')
  68.         butt_pict.place(x=screen_width-200, y=0)
  69.         butt_pict.bind('<ButtonRelease-1>',  self.passport_com)
  70.  
  71.         # -----LABELS
  72.         label_sk = tk.Label(parent, text='Собствен капитал: ', font=('Times', 8, 'italic'), fg='green', width=16, anchor='w')
  73.         label_sk.place(x=350 , y=30)
  74.         label_sk_sum = tk.Label(parent, text='5 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  75.         label_sk_sum.place(x=350 , y=45)
  76.         label_a = tk.Label(parent, text='Балансово число: ', font=('Times', 8, 'italic'), fg='green', width=16, anchor='w')
  77.         label_a.place(x=350 , y=60)
  78.         label_a_sum = tk.Label(parent, text='10 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  79.         label_a_sum.place(x=350 , y=75)
  80.  
  81.         label_inc = tk.Label(parent, text='Приходи: ', font=('Times', 8, 'italic'), fg='darkred', width=16, anchor='w')
  82.         label_inc.place(x=470 , y=30)
  83.         label_inc_sum = tk.Label(parent, text='19 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  84.         label_inc_sum.place(x=470 , y=45)
  85.  
  86.         label_cap = tk.Label(parent, text='Дивиденти: ', font=('Times', 8, 'italic'), fg='blue', width=16, anchor='w')
  87.         label_cap.place(x=590 , y=30)
  88.         label_cap_sum = tk.Label(parent, text='1 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  89.         label_cap_sum.place(x=590 , y=45)
  90.  
  91.         label_money = tk.Label(parent, text='Налични пари: ', font=('Times', 8, 'italic'), fg='darkblue', width=16, anchor='w')
  92.         label_money.place(x=710 , y=30)
  93.         label_money_sum = tk.Label(parent, text='1 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  94.         label_money_sum.place(x=710 , y=45)
  95.  
  96.         label_long_assets = tk.Label(parent, text='Нетекущи активи: ', font=('Times', 8, 'italic'), fg='black', width=16, anchor='w')
  97.         label_long_assets.place(x=830 , y=30)
  98.         label_long_assets_sum = tk.Label(parent, text='10 000 999.00 ', font=('Times', 8, 'italic'), fg='black', width=14, anchor='e')
  99.         label_long_assets_sum.place(x=830 , y=45)
  100.  
  101.         # ----- MENU
  102.         menubar = tk.Menu(parent, background='yellow', foreground='black', activebackground='green', activeforeground='black')
  103.         parent.config(menu=menubar)
  104.  
  105.         # Create a File menu
  106.         file_menu = tk.Menu(menubar, tearoff=0, background='white', foreground='blue', font='Times, 12')    # tearoff - маха прекъснатата линия
  107.         # add menu item to menubar
  108.         file_menu.add_command(label="Отвори")
  109.         file_menu.add_command(label="Item1")
  110.         file_menu.add_command(label="Item2")
  111.         file_menu.add_command(label="Изход", command=parent.destroy)
  112.         menubar.add_cascade(label="Файл", menu=file_menu)   # add the File_menu to the menubar
  113.         # Import menu
  114.         import_menu = tk.Menu(menubar, tearoff=0)
  115.         import_menu.add_command(label="Оборотна ведомост", command=lambda: None)
  116.         import_menu.add_command(label="Парични средтсва")
  117.         import_menu.add_command(label="Приходни сметки")
  118.         menubar.add_cascade(label="Импорт", menu=import_menu)  # add the File_menu to the menubar
  119.         # Ръчно въвеждане
  120.         # ДНА
  121.         act_menu = tk.Menu(menubar, tearoff=0)
  122.         act_menu.add_command(label="I. Нематериални активи", command=self.import_dna)
  123.         act_menu.add_command(label="II. Дълготрайни материални активи")
  124.         act_menu.add_command(label="III. Дългосрочни финансови активи")
  125.         act_menu.add_command(label="IV. Отсрочени данъци")
  126.         act_menu.add_command(label="- Платени аванси на доставчици")
  127.         act_menu.add_command(label="- Активи в процес на придобиване")
  128.         act_menu.add_command(label="- Преоценени активи")
  129.         menubar.add_cascade(label="Въвеждане", menu=act_menu)  # add the File_menu to the menubar
  130.         # Нова фирма
  131.         new_company = tk.Menu(menubar, tearoff=0)
  132.         # new_company.add_command(label='Ново предприятие', command=lambda: self.passport_com())
  133.         # new_company.add_command(label='Съставител на ФО', command=lambda: self.accountancy())
  134.         new_company.add_command(label='Начални салда', command=lambda: None)
  135.         new_company.add_command(label='Видове сметки', command=lambda: self.type_acc())
  136.         menubar.add_cascade(label='Нови данни', menu=new_company)
  137.         # Справки
  138.         reference = tk.Menu(menubar, tearoff=0)
  139.         reference.add_command(label='Оборотна ведомост', command=lambda: None)
  140.         reference.add_command(label='Кореспонденция на приходите', command=lambda: None)
  141.         reference.add_command(label='Сметки за нетекущи активи', command=lambda: None)
  142.         reference.add_command(label='Движение на парични средства', command=lambda: None)
  143.         menubar.add_cascade(label='Справки', menu=reference)
  144.  
  145.  
  146.  
  147.         parent.mainloop()
  148.  
  149.  
  150. if __name__ == '__main__':
  151.  
  152.     test = Main()
  153.     test.main()
  154.  
  155.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement