Untitled

 avatar
unknown
plain_text
10 days ago
1.9 kB
3
Indexable
from docx import Document



# Create a new Word document
doc = Document()

# Title of the Bill
doc.add_heading('Bill for Drone Spraying Service', level=1)

# Farmer and Service Provider Details
doc.add_paragraph("**Farmer Name:** Karn Dalve")
doc.add_paragraph("**Village:** Babhulgaon, Parbhani District")
doc.add_paragraph("**Date:** January 28, 2025")
doc.add_paragraph("**Drone Service Provider:** [Your Service Name]")
doc.add_paragraph("**Contact Number:** [Your Contact Number]")

doc.add_paragraph("\n")

# Create the Bill Table
table = doc.add_table(rows=1, cols=3)
table.style = 'Table Grid'

# Add Table Headers
hdr_cells = table.rows[0].cells
hdr_cells[0].text = "Particulars"
hdr_cells[1].text = "Details"
hdr_cells[2].text = "Amount (₹)"

# Add Table Rows
data = [
    ["Drone Spraying Service", "Spraying on 1 acre", "₹1,000"],
    ["Pesticide/Fertilizer Cost", "10 liters @ ₹25 per liter", "₹250"],
    ["Battery Usage", "Electricity cost for 1 acre", "₹25"],
    ["Maintenance Fee", "Drone wear and tear", "₹75"],
    ["Labor Charge", "Operator fee (if applicable)", "₹150"],
    ["Total Cost", "-", "₹1,500"]
]

for item in data:
    row_cells = table.add_row().cells
    row_cells[0].text = item[0]
    row_cells[1].text = item[1]
    row_cells[2].text = item[2]

doc.add_paragraph("\n")

# Notes Section
doc.add_paragraph("**Notes:**")
doc.add_paragraph("- The service includes the cost of pesticides and drone operation.")
doc.add_paragraph("- Payment can be made in cash or via online transfer.")

doc.add_paragraph("\n")

# Authorized Signature
doc.add_paragraph("**Authorized Signature**")
doc.add_paragraph("[Your Name/Business Name]")

# Save the document
file_path = "/mnt/data/Farmer_Bill_Drone_Spraying_Service.docx"
doc.save(file_path)

file_pa
th
Leave a Comment