Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GLITCH-hash01 committed Apr 7, 2023
0 parents commit f155458
Show file tree
Hide file tree
Showing 103 changed files with 7,309 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Bill.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
JIBIN MOTOR DRIVING SCHOOL
Kulanada P.O Ph:04734 261800,9947261800


Name:{name} Date:{date}
Ph :{phone}

Total amount paid:{tamnt}
Balance:{bal}
Binary file added Database/Fees.db
Binary file not shown.
Binary file added Icons/Logo.ico
Binary file not shown.
Binary file added Icons/account.ico
Binary file not shown.
Binary file added Icons/add.ico
Binary file not shown.
Binary file added Icons/attention.ico
Binary file not shown.
Binary file added Icons/close.ico
Binary file not shown.
Binary file added Icons/draw.ico
Binary file not shown.
Binary file added Icons/gear.ico
Binary file not shown.
557 changes: 557 additions & 0 deletions MainPage_v1.py

Large diffs are not rendered by default.

162 changes: 162 additions & 0 deletions Operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import sqlite3 as sq
from datetime import *
import os,time

Path="./Database/Fees.db"

def Add_customer(Name,Mobile_no,Paid_amnt,Tamount):

try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
return False
Pen=Feebook.cursor()

Pen.execute(f'''SELECT MAX(Regno) FROM FEE''')
Regno=0
for x in Pen:
if x[0]!=None:
Regno=x[0]+1
else:
Regno=0

try:
Pen.execute(f'''
INSERT INTO FEE VALUES({Regno},"{Name}",{Mobile_no},"{datetime.now()}",{Tamount},{Paid_amnt},{int(Tamount)-int(Paid_amnt)})
''')

except:
lst=[Name,type(Name),Mobile_no,type(Mobile_no),Paid_amnt,type(Paid_amnt),Tamount,type(Tamount)]
Crash_Report(f'Record Addition Failed Record:<{lst}>')
return False

Feebook.commit()
Feebook.close()
return True

def Get_Full_Data():
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
Pen=Feebook.cursor()
Pen.execute('''
SELECT * FROM FEE ORDER BY TIME DESC LIMIT 25
''')
value=Pen.fetchmany(25)
Feebook.close()

return value

def Get_Data(Regno):
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
Pen=Feebook.cursor()
Pen.execute(f"""
SELECT * FROM FEE WHERE RegNo={Regno}
""")
value=Pen.fetchall()
Feebook.close()
return value

def Search_Customer(Phno):
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
Pen=Feebook.cursor()
Pen.execute(f'''
SELECT Regno FROM FEE WHERE Mobileno={Phno}
''')
return Pen.fetchall()

def Max_Regno():
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
return False
Pen=Feebook.cursor()
Pen.execute(f'''SELECT MAX(Regno) FROM FEE''')
lst=Pen.fetchone()
if lst[0]==None:
return 0
else:
return lst

def update_db(Regno,column,new_value):
columnlst=["Regno","Name","Mobileno","Time","Totalamnt","Paidamnt"]
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
Pen=Feebook.cursor()
#try:
if column==1 or column==3:
Pen.execute(f'''
UPDATE FEE SET {columnlst[column]}="{new_value}" WHERE Regno={Regno}
''')
elif column==4 or column==5:
Pen.execute(f"""
UPDATE FEE SET {columnlst[column]}={new_value} WHERE Regno={Regno}
""")
Pen.execute(f'''
UPDATE FEE SET Bal=Totalamnt-Paidamnt WHERE Regno={Regno};
''')
else:
try:
Pen.execute(f'''
UPDATE FEE SET {columnlst[column]}={new_value} WHERE Regno={Regno}
''')

except:
Crash_Report(f"Record Update Error Regno={Regno} Column={column} New_value={new_value}")
Feebook.close()
return False
Feebook.commit()
Feebook.close()
return True

def Delete_customer(Regno):
try:
Feebook=sq.connect(Path)
except:
Crash_Report("Can't connect to Database")
Pen=Feebook.cursor()
try:
Pen.execute(f'''
DELETE FROM FEE WHERE Regno={Regno}
''')
except:
Crash_Report(f"Record Deletion Error {Regno}")
return False
Feebook.commit()
Feebook.close()
return True

def Crash_Report(Error):
try:
os.mkdir("CrashReports")
except:
pass
with open("./CrashReports.txt","a") as f:
f.writelines(f"[{datetime.now()}]{Error}\n")

def Print_page(name_cust,phone_cust,Tamnt_cust,Bal_cust):


with open("Bill.txt","r") as f:
lines=f.read()
newline=lines.format(name=f"{name_cust}",date=f"{date.today()}",phone=f"{phone_cust}",tamnt=f"{Tamnt_cust}",bal=f"{Bal_cust}")


with open("Bill_temp.txt","w") as f:
f.write(newline)

os.startfile("Bill_temp.txt","print")

time.sleep(5)
os.remove("Bill_temp.txt")
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Accounting Software
109 changes: 109 additions & 0 deletions customtkinter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
__version__ = "4.5.10"

import os
import sys
from tkinter.constants import *
from tkinter import StringVar, IntVar, DoubleVar, BooleanVar

# import manager classes
from .settings import Settings
from .appearance_mode_tracker import AppearanceModeTracker
from .theme_manager import ThemeManager
from .scaling_tracker import ScalingTracker
from .font_manager import FontManager
from .draw_engine import DrawEngine

AppearanceModeTracker.init_appearance_mode()

# load default blue theme
try:
ThemeManager.load_theme("blue")
except FileNotFoundError as err:
raise FileNotFoundError(f"{err}\n\nThe .json theme file for CustomTkinter could not be found.\n" +
f"If packaging with pyinstaller was used, have a look at the wiki:\n" +
f"https://github.com/TomSchimansky/CustomTkinter/wiki/Packaging#windows-pyinstaller-auto-py-to-exe")

FontManager.init_font_manager()

# determine draw method based on current platform
if sys.platform == "darwin":
DrawEngine.preferred_drawing_method = "polygon_shapes"
else:
DrawEngine.preferred_drawing_method = "font_shapes"

if sys.platform.startswith("win") and sys.getwindowsversion().build < 9000: # No automatic scaling on Windows < 8.1
ScalingTracker.deactivate_automatic_dpi_awareness = True

# load Roboto fonts (used on Windows/Linux)
script_directory = os.path.dirname(os.path.abspath(__file__))
FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "Roboto", "Roboto-Regular.ttf"))
FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "Roboto", "Roboto-Medium.ttf"))

# load font necessary for rendering the widgets (used on Windows/Linux)
if FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "CustomTkinter_shapes_font.otf")) is False:
# change draw method if font loading failed
if DrawEngine.preferred_drawing_method == "font_shapes":
sys.stderr.write("customtkinter.__init__ warning: " +
"Preferred drawing method 'font_shapes' can not be used because the font file could not be loaded.\n" +
"Using 'circle_shapes' instead. The rendering quality will be bad!")
DrawEngine.preferred_drawing_method = "circle_shapes"

# import widgets
from .widgets.widget_base_class import CTkBaseClass
from .widgets.ctk_button import CTkButton
from .widgets.ctk_checkbox import CTkCheckBox
from .widgets.ctk_entry import CTkEntry
from .widgets.ctk_slider import CTkSlider
from .widgets.ctk_frame import CTkFrame
from .widgets.ctk_progressbar import CTkProgressBar
from .widgets.ctk_label import CTkLabel
from .widgets.ctk_radiobutton import CTkRadioButton
from .widgets.ctk_canvas import CTkCanvas
from .widgets.ctk_switch import CTkSwitch
from .widgets.ctk_optionmenu import CTkOptionMenu
from .widgets.ctk_combobox import CTkComboBox
from .widgets.ctk_scrollbar import CTkScrollbar
from .widgets.ctk_textbox import CTkTextbox

# import windows
from .windows.ctk_tk import CTk
from .windows.ctk_toplevel import CTkToplevel
from .windows.ctk_input_dialog import CTkInputDialog


def set_appearance_mode(mode_string: str):
""" possible values: light, dark, system """
AppearanceModeTracker.set_appearance_mode(mode_string)


def get_appearance_mode() -> str:
""" get current state of the appearance mode (light or dark) """
if AppearanceModeTracker.appearance_mode == 0:
return "Light"
elif AppearanceModeTracker.appearance_mode == 1:
return "Dark"


def set_default_color_theme(color_string: str):
""" set color theme or load custom theme file by passing the path """
ThemeManager.load_theme(color_string)


def set_widget_scaling(scaling_value: float):
""" set scaling for the widget dimensions """
ScalingTracker.set_widget_scaling(scaling_value)


def set_spacing_scaling(scaling_value: float):
""" set scaling for geometry manager calls (place, pack, grid)"""
ScalingTracker.set_spacing_scaling(scaling_value)


def set_window_scaling(scaling_value: float):
""" set scaling for window dimensions """
ScalingTracker.set_window_scaling(scaling_value)


def deactivate_automatic_dpi_awareness():
""" deactivate DPI awareness of current process (windll.shcore.SetProcessDpiAwareness(0)) """
ScalingTracker.deactivate_automatic_dpi_awareness = False
Binary file not shown.
Binary file added customtkinter/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added customtkinter/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file added customtkinter/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f155458

Please sign in to comment.