# Etsy Expenses.py
import tkinter as tk
from tkinter import *
from tkinter.ttk import *
# create basic window
window = Tk()
window.title("Etsy Expenses")
window.geometry('500x600')
initemtype=StringVar()
initemtype.set("")
#########################################################
###
# Input Expenses to Excel
###
def setTextInput():
import openpyxl
from datetime import datetime as dt
from openpyxl import Workbook
from openpyxl.styles import Alignment
from openpyxl.styles import Font
from openpyxl import load_workbook
import tkinter as tk
from tkinter import ttk
expense=initemtype.get()
##################################################
print('39')
print(expense) # from initemtype.get()
##################################################
expenses_match = 0
###################################################################
###
# Expenses
###
if expenses_match == 1:
######################################
#
# Do processing
#
######################################
######################################
#
# Clear date entry fields
#
######################################
initemtype.set("")
##########################################################
####
# No Match Expense
####
if expenses_match != 1:
print('74')
print(expense)
######################################
#
# Do processing
#
######################################
######################################
#
# Clear date entry fields
#
######################################
initemtype.set("")
##########################################################
###
# Input Data using Tkinter
###
def data_in():
import tkinter as tk
expenses = [
"Other Expense", # G
"Delivery to UK", # H
"UK Postage", # I
"Envelopes", # J
"Cards", # K
"Design", # L
"Etsy Listing Fee", # M
"Etsy Processing Fee", # 4% of order total + 20p N
"Etsy Transaction Fee", # 5% of item total O
"Etsy Postage Transaction Fee", # 5% of postage total P
"Etsy Regulatory Operating Fee", # 0.25% of total order ex VAT Q
"UK VAT", # R
"Sales Tax", # S
"Refund", # T
"Drawings", # U
"Payment Received", # W
"Etsy VAT Listing Fee", # V
"Etsy VAT Auto Renew", # X
"Etsy VAT Processing Fee", # Y
"Etsy VAT Transaction Fee", # Z
"Etsy VAT Shipping Trans Fee", # AA
"Etsy VAT Reg Op Fee" # AB
]
Label(window, text="Etsy Expenses", font=("calibri", 14)).pack() # label centre top
ent4val = expenses
lab4=Label(window, text="Expense Type")
lab4.place(x=60, y=140)
ent4=Combobox(window, value = ent4val, textvariable=initemtype)
ent4.place(x=60, y=160, width = 160)
ent4.bind("<<ComboboxSelected>>")
test_button=Button(window, text='Submit', command=lambda:setTextInput())
test_button.place(x=100, y=500)
end_button=Button(window, text=' Exit ', command=quit)
end_button.place(x=315, y=500)
##############################################################
###
# Programme Flow
###
data_in()