Python Invoice Generator tutorial for beginners - Python GUI Automation project [resume project]

  Рет қаралды 65,851

Code First with Hala

Code First with Hala

Күн бұрын

Пікірлер: 72
@samfritkin
@samfritkin Жыл бұрын
Amazing, thanks a ton! Your videos are incredibly helpful. For anyone that's interested, I found a way to edit the tree: def delete_item(): selected_item = tree.selection()[0] tree.delete(selected_item) Put this command in for a delete button you create and you should be able to select items from the tree and delete them without having to reset your entire invoice.
@mohdsarim4671
@mohdsarim4671 11 ай бұрын
def Remove_items(): for i in table.selection(): id = i idx = table.index(id) table.delete(id) del invoice_list[idx] i made somethig like this to delete multiple items and also fron the invoice_list too
@thedebapriyakar
@thedebapriyakar 8 ай бұрын
I've been binging several of your tkinter videos since I found your channel this morning. Insanely good content, thank you SO MUCH for your efforts.
@arielspalter7425
@arielspalter7425 Жыл бұрын
This is absolutely amazing tutorial! I started binge watching your channel, you’ve uploaded so much great stuff.
@bentsionben-david2769
@bentsionben-david2769 Жыл бұрын
Wow you are genious.. i searched this more than half a year 🙏🏻🙏🏻🙏🏻
@pwhv
@pwhv 5 күн бұрын
same hahaha
@pingmetal
@pingmetal 3 ай бұрын
Thank you for the great tutorial. By the way, just note that when you used the module datetime and made it add time to the filename, the last digits were not just seconds. The first digits indicated the hours however using the 24-hour clock format, so as it was 8 PM on your PC, that became the number 20.
@anigarzat7
@anigarzat7 12 күн бұрын
wow! excelente explanation
@JorgeEscobarMX
@JorgeEscobarMX Жыл бұрын
I actually didn't knew treeview was supposed to be used as a table render widget. I figure it was for showing up file system stuff like files and directories. Thanks for this tkinter tutorial
@morohicham2579
@morohicham2579 10 күн бұрын
this is what i'm looking for , the loop did the trick :) thanks
@yahia_nali
@yahia_nali 11 ай бұрын
Macha Allah, you are the best Hala in the world! I mean it.
@matthewdamolaojelere6553
@matthewdamolaojelere6553 9 ай бұрын
Every bit of your tutorial is very understable and good, you are good in explaning code
@رادیندولتی
@رادیندولتی Жыл бұрын
This channel will reach 1 million subscribed, I promise 💙
@alananalyst7795
@alananalyst7795 Жыл бұрын
Hey Hala, I just wanted to thank you for this kind of videos, I am really enjoying them
@ntutfitness
@ntutfitness Жыл бұрын
Ilove the all series of template projects. Thanks
@bentsionben-david2769
@bentsionben-david2769 Жыл бұрын
Hi hala its realy amazing this video.. can you please add to it CRUD method like create, search, update, save, delete and print on hard copy? Pleasee, i tried for months and i failed, i think thousands of people want and need it.. please consider it.. thanks 🙏🏻🙏🏻🙏🏻
@thomashart5081
@thomashart5081 9 ай бұрын
Great tutorial. Can you make a video on how to create also a record of the invoices as well as means to conclude which have been payed or not along with the saved invoice. Maybe a database SQLite and have the means to switch between displayed pages depending on which is wanted for viewing at the time.
@familiezink9098
@familiezink9098 6 ай бұрын
Very nice. Thank you so much for your videos. Greetings from Germany
@leekumkitv3826
@leekumkitv3826 2 жыл бұрын
BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!
@IbrahimDar-nu5tz
@IbrahimDar-nu5tz Жыл бұрын
The stuff which i was looking for.......thanks for sharing!
@ahmedsaliem7041
@ahmedsaliem7041 2 ай бұрын
Thanks a lot. And about if I need to save each invoice as an archive and see the number of each invoice and make next and previous buttons to enable update for each invoice. How could I make this if possible. And thank you again.
@khushbukumari6000
@khushbukumari6000 Жыл бұрын
Thank u so much mam 100% working
@raminentezar-e9k
@raminentezar-e9k 15 күн бұрын
tanx for good teaching
@LEON-zo7ce
@LEON-zo7ce Жыл бұрын
what a life saver ....... ......thank you🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
@gauravmankoo4743
@gauravmankoo4743 2 жыл бұрын
Hi, Hala I love ❤❤your videos. I have one request can you please make a video where you use a pdf file instead of a word document. thank you so much this really helped
@walitouseef549
@walitouseef549 Жыл бұрын
Just conevert using doxc2pdf
@migue29movi64
@migue29movi64 Жыл бұрын
You're the best Nala!!!
@IbrahimAbuJamous-f4u
@IbrahimAbuJamous-f4u 6 ай бұрын
Thank you so much for this helpful video, but I have a question as I have tried so much to show for example this word file in the frame in Tkinter, could you please help me with that?
@fabriciocarranza7044
@fabriciocarranza7044 Жыл бұрын
Great video. I am Learning a lot
@sandrogirolamo
@sandrogirolamo Жыл бұрын
Very good Hala! Your explanation is structured, clear, you have a wonderful voice, your speak is clear like water, have a good pace to understand every word. This reports example is very good. Have you made some report example using sqlite data?
@mohdsarim4671
@mohdsarim4671 11 ай бұрын
thanks you so much your videos are amazing i only saw the part of docTemplate working and intro of the video and Tried to made this myself here is the version i made i added 2 extra features like removing the items , saving as a new file to a directory the code is this from customtkinter import * import tkinter.ttk as ttk import tkinter as tk from docxtpl import DocxTemplate import tkinter.filedialog as fd import tkinter.messagebox as tmsg import os root = CTk() set_appearance_mode('dark') root.title("Invoice Generator") root.geometry("800x580") # creating widgets cfont = CTkFont(family="Sans Serif",size=20,weight="bold",) head = CTkLabel(root,text="Invoice Generator",font=cfont) head.place(relx = 0.5,rely =0,anchor = "n") EntriesFrame = CTkFrame(root) EntriesFrame.place(relx = 0,rely = 0.07,relwidth = 1) l1 = CTkLabel(EntriesFrame,text="First Name") l2 = CTkLabel(EntriesFrame,text="Last Name") l3 = CTkLabel(EntriesFrame,text="Phone Number") l4 = CTkLabel(EntriesFrame,text="Qty") l5 = CTkLabel(EntriesFrame,text="Description ") l6 = CTkLabel(EntriesFrame,text="Unit Price") e1 = CTkEntry(EntriesFrame) e2 = CTkEntry(EntriesFrame) e3 = CTkEntry(EntriesFrame) e5 = CTkEntry(EntriesFrame) style = ttk.Style() print(style.theme_names()) style.theme_use("default") style.configure('C.TSpinbox', background ='gray14', arrowcolor ="gray84", foreground="gray84", fieldbackground = "#343638", bordercolor ="yellow", padding = (5,5), arrowsize = 12, selectbackground ="#1f538d", insertwidth = 10 ) qtyvar = IntVar(value=0) spb4 = ttk.Spinbox(EntriesFrame,from_=0,to=100,textvariable=qtyvar,style='C.TSpinbox') unitpricevar = DoubleVar(value=0.00) spb6= ttk.Spinbox(EntriesFrame,from_=0.00,to=5000.00,increment=0.5,textvariable=unitpricevar,style='C.TSpinbox') invoice_list = [] i =0 # function to get the final cost of each item , qty*unitproce def Add_lnTotal(x): linetotal = x[0]*x[2] x.insert(3,linetotal) return x # to Sum the list Elements def sumlist(x): sum = 0 for i in x: sum+=i return sum def calc_subtotal(): global subtotal linetotal = [x[3] for x in invoice_list] subtotal = sum(linetotal) return subtotal # functio to Calculate Tax from String def total_with_tax(t,s): tax_dig = int(t.split('%')[0][:1]) tax = float(f"0.{tax_dig}") return s*tax+s def Calc_Total(): global total total = total_with_tax("10%",calc_subtotal()) def Add_items(): global fname,lname,phone,Desc,i global Qty,UnitPrice,items,invoice_list,linetotal,subtotal,total fname = e1.get() lname = e2.get() phone = e3.get() Desc = e5.get() Qty = qtyvar.get() UnitPrice = unitpricevar.get() # MAKING A 2D INVOICE LIST items = [Qty,Desc,UnitPrice] invoice_list.append(Add_lnTotal(items)) # counting Subtotal & # Caluting Total after including Tax # with one function call Calc_Total() tempdata = Add_lnTotal(items) tempdata.pop() data=tuple(tempdata) table.insert(parent = '',index=i,values=data) i+=1 print(data) print(invoice_list) # print(f"First Name:{fname}, Last Name : {lname}, " # f"Phone Number :{phone}, Description :{Desc}" # f"Qty : {Qty}, Unit Price : {UnitPrice}" # ) def Remove_items(): for i in table.selection(): id = i idx = table.index(id) table.delete(id) del invoice_list[idx] Calc_Total() print(subtotal) print(invoice_list) addbtn = CTkButton(EntriesFrame,text="Add Item",command=Add_items) Removebtn = CTkButton(EntriesFrame,text="Remove Item",command=Remove_items) # making Grids EntriesFrame.columnconfigure((0,1,2),weight=1) EntriesFrame.rowconfigure((0,1,2,3,4),weight=1) # placing widgets l1.grid(row = 0,column = 0) e1.grid(row = 1,column = 0) l2.grid(row = 0,column = 1) e2.grid(row = 1,column = 1) l3.grid(row = 0,column = 2) e3.grid(row = 1,column = 2) l4.grid(row = 2,column = 0) spb4.grid(row =3 ,column = 0) l5.grid(row = 2,column = 1) e5.grid(row = 3,column = 1) l6.grid(row = 2,column = 2) spb6.grid(row = 3,column = 2) addbtn.grid(row= 4 ,column = 1,sticky = "news",padx = 60,pady = 20) Removebtn.grid(row= 4 ,column = 2,sticky = "news",padx = 60,pady = 20) infoFrame = CTkFrame(root,fg_color="gray14",corner_radius=0) style.configure("table.Treeview",fieldbackground = "gray17",foregorund = "white") style.configure("table.Treeview.Heading") table = ttk.Treeview(infoFrame,style = 'table.Treeview',columns=(0,1,2,4),show='headings') table.heading(0,text="QTY") table.heading(1,text="Description") table.heading(2,text="Unit Price") table.heading(3,text="Total") table.place(relx = 0.072,rely = 0.04,relwidth=0.86,relheight = 0.96) infoFrame.place(relx = 0 ,rely = 0.38,relwidth = 1,relheight=0.46) global generate_invoice def generate_invoice(): def write_data(x): doc = DocxTemplate("invoice_template.docx") doc.render({ "name":f"{fname}{lname}", "phone" : phone, "invoice_list":invoice_list, "subtotal":subtotal, "salestax":"10%", "total":total }) doc.save(x) flag = tmsg.askyesno("Create File","Want To Create a New File ?") if flag : fdir = fd.askdirectory( title="Save file To" ) inpd =CTkInputDialog(title="Enter Name",text="Enter The the name of the File") filename = f"{inpd.get_input()}" file_path = f"{fdir}/{filename}.docx" write_data(file_path) tmsg.showinfo("Success",f"Generated At {file_path}") else: file_path = "Records.docx" write_data(file_path) tmsg.showinfo("Success","Your Invoice hava Been Generated Succesfully in Default Directory") frameBtn =CTkFrame(root,fg_color="gray18") btn1 = CTkButton(frameBtn,text="Generate Invoice",command=generate_invoice) btn1.pack(fill=X,pady = 5,padx = 60) btn2 = CTkButton(frameBtn,text="New Invoice") btn2.pack(fill=X,padx = 60,pady =5) frameBtn.place(relx = 0,rely = 0.853,relwidth = 1) root.mainloop()
@dilshanchrishantha6548
@dilshanchrishantha6548 Жыл бұрын
excellent tutorial, well explained, keep moving !!!!
@DoctorLyrics97
@DoctorLyrics97 Жыл бұрын
You explained it well. Can you do a video how to save data in to excel file to a format , I created a recipe saving app but I cannot figure out how to save the recipe in to a format. My current version it just saves in to pdf without template , as a chef I am very happy that I was able to created the gui app to that far 😂
@TheRealWattsie
@TheRealWattsie 2 жыл бұрын
Minor point, your Total should be the SubTotal plus the tax percentage of SubTotal... ie SubTotal $33.5, Tax 10% therefore: Total === $36.85 not $30.12... Unless you were thinking a discount, however a discount should be applied per item not just on total invoice. Cheers.
@abuloly2690
@abuloly2690 Жыл бұрын
Nice work girl , amazing project 🎉
@rzvn111
@rzvn111 Жыл бұрын
You are great! Thanks!
@Harambe_
@Harambe_ 11 ай бұрын
Very helpful, thank you!
@anassportal
@anassportal 10 ай бұрын
Awesome tutorial
@ShadowMindInsights-qk4vc
@ShadowMindInsights-qk4vc 9 ай бұрын
Thank you God bless you mam
@nassimelmasri6515
@nassimelmasri6515 Жыл бұрын
Super Tutorial Thank you Hala
@sauer7592
@sauer7592 Жыл бұрын
Hi Hala can you show it with pyside6
@logunscott
@logunscott Жыл бұрын
Amazing tutorail Thank you. please is there a way to edit or delete an item in the list?
@bigrevkev55
@bigrevkev55 11 ай бұрын
Thank you again!!!
@digitalmachine0101
@digitalmachine0101 7 ай бұрын
Good information
@solomonezra1253
@solomonezra1253 Жыл бұрын
Hello Hala.. How are you? I have written same line of codes and it’s not updating the values in the.docx file. What might be the problem please and what can I do? Thank you
@contra_plano
@contra_plano Жыл бұрын
I prefer PysimpleGui, for this one will be easy make the interface
@pwhv
@pwhv 5 күн бұрын
amazing!
@lstephen
@lstephen Жыл бұрын
Do you think I can use python to pull data from Google docs once created and then put them into Google sheets of invoice template? and then have it covert to pdf and email to be send? Is this automation process possible?
@surendarsingh6228
@surendarsingh6228 Жыл бұрын
where the additem function is add the previous list of invoice_item since we are not using the append ??? please let me know.
@kksfervajali6602
@kksfervajali6602 Жыл бұрын
So Helpful
@kapibara2440
@kapibara2440 7 ай бұрын
Brilliant tutorial ❤❤❤thank you.
@samokoth1014
@samokoth1014 6 ай бұрын
Great
@mukeshkumars9887
@mukeshkumars9887 2 жыл бұрын
HI HALA THANK YOU FOR YOUR EFFECT ON THIS VIDEO
@MirzaAbubakar-l6b
@MirzaAbubakar-l6b Жыл бұрын
I want to save the generated invoice in pdf form ,What should I do for that?
@feras5834
@feras5834 Жыл бұрын
Great video.. thank you 🙂
@KeKuHauPiOx
@KeKuHauPiOx Жыл бұрын
Awesome tutorial! Is there a way to put a business logo on this?
@vdeoracle
@vdeoracle Жыл бұрын
Yes. You can customize the docx template to suit your need.
@kangdesain3922
@kangdesain3922 11 ай бұрын
hi great tutorial, how to make all of this into exe format?
@fabriciocarranza7044
@fabriciocarranza7044 Жыл бұрын
Thank you.
@Noopdoom
@Noopdoom Жыл бұрын
Can you make one more video this. How to create exe file
@contra_plano
@contra_plano Жыл бұрын
why they do not use the open document format?
@BelalAhamdNasery
@BelalAhamdNasery Жыл бұрын
Hi Hala can make Django videos 🙏🏻
@Podalls
@Podalls 2 ай бұрын
Can pyside6 use this?
@lynn7140
@lynn7140 2 жыл бұрын
Thanks.❤
@its_code
@its_code 2 жыл бұрын
😍💗😍💗😍💗😍🤩🤩🤩🤩
@kelechikk-xr7xh
@kelechikk-xr7xh 6 ай бұрын
Hi this video tutorial is not bright
@destinbrav4903
@destinbrav4903 Жыл бұрын
please guys i'm getting an error at 8minute of the video please help me !!! here is the error : raise PackageNotFoundError( docx.opc.exceptions.PackageNotFoundError: Package not found at 'template.docx' that is the last line of the error
@iioru1829
@iioru1829 11 ай бұрын
did you have the Word template downloaded in your programs files?
@familiezink9098
@familiezink9098 5 ай бұрын
pip install docxtpl
@enesk3474
@enesk3474 Жыл бұрын
Hi Hala can you show it with pyside6 ? thanks
@MirzaAbubakar-l6b
@MirzaAbubakar-l6b Жыл бұрын
I want to save the generated invoice in pdf form ,What should I do for that?
Python Tkinter Load Excel Data tutorial [openpyxl, tkinter]
14:22
Code First with Hala
Рет қаралды 20 М.
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 539 М.
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 23 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 59 МЛН
I tricked MrBeast into giving me his channel
00:58
Jesser
Рет қаралды 27 МЛН
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 1 МЛН
Tkinter Login Form tutorial for COMPLETE beginners [responsive layout]
33:12
Code First with Hala
Рет қаралды 124 М.
I use Drag and Drop to build modern Python Apps
14:08
Softlinks
Рет қаралды 82 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 86 М.
Convert Tkinter Python App to Executable (.Exe) File [pyinstaller]
9:11
Code First with Hala
Рет қаралды 156 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,6 МЛН
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 23 МЛН