Menu

Post image 1
Post image 2
1 / 2
0

Automate Your Freelance Business: Invoice Generation, Payment Reminders & Expense Tracking in Python

DEV Community·Brad·20 days ago
#WBoAzu8z
Reading 0:00
15s threshold

Running a freelance or small business means constant repetitive work: invoices, payment follow-ups, expense tracking. I automated all of it with Python. Here's the exact code. 1. Generate Professional PDF Invoices Automatically from reportlab.lib.pagesizes import letter from reportlab.pdfgen import canvas from datetime import datetime , timedelta def generate_invoice ( client_name , client_email , services , invoice_num = None ): if invoice_num is None : invoice_num = f " INV- { datetime . now (). strftime ( ' %Y%m%d%H%M ' ) } " total = sum ( item [ ' amount ' ] for item in services ) due_date = datetime . now () + timedelta ( days = 30 ) filename = f " invoice_ { invoice_num } .pdf " c = canvas . Canvas ( filename , pagesize = letter ) width , height = letter c . setFont ( " Helvetica-Bold " , 24 ) c . drawString ( 50 , height - 60 , " INVOICE " ) c . setFont ( " Helvetica " , 10 ) c . drawString ( 50 , height - 80 , f " Invoice #: { invoice_num } " ) c .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More