📊

Tạo báo giá tự động (Excel to Word)

Điền dữ liệu từ Excel vào mẫu báo giá Word để tạo ra hàng trăm file báo giá PDF gửi khách.

Excel ⭐⭐⭐ Advanced ⏱️ 10 phút

😫 Vấn đề (The Pain Point)

Khách hàng yêu cầu gửi báo giá. Bạn mở file Word mẫu, sửa tên khách, sửa ngày, sửa danh sách sản phẩm, tính tổng tiền… Làm thủ công rất dễ sai sót (quên sửa tên khách cũ), và rất lâu.

🚀 Giải pháp Agentic (The Solution)

Tool “Mail Merge” thế hệ mới: Dùng Template Word (Jinja2 tags) để sinh file cực đẹp và chuẩn xác.

Tính năng:

  • Dynamic Table: Tự động tạo bảng báo giá dài ngắn tùy theo số lượng sản phẩm khách mua.
  • Auto Format: Định dạng tiền tệ tự động (10.000.000 đ).

Quotation Gen Screenshot

🤖 Engineering Prompt (Copy & Paste)

**Role:** Python Automation Developer

**Task:** Create a "Bulk Quotation Generator" (Excel to Word).

**Requirements:**
1.  **Tech Stack:** Python, `tkinter`, `pandas`, `docxtpl` (Templating library).
2.  **Prerequisites:**
    *   `template.docx` with Jinja2 tags (e.g., `{{ customer_name }}`).
    *   `data.xlsx` with columns matching tags.
3.  **GUI:**
    *   Select Template Word File.
    *   Select Data Excel File.
    *   Select Output Folder.
    *   "Generate" button.
4.  **Logic:**
    *   Load Excel.
    *   For each row:
        *   Render Word template with row data.
        *   Save as `Quote_[CustomerName].docx`.
        *   (Optional) Convert to PDF using `docx2pdf`.
5.  **Deliverables:**
    *   `quote_gen.py`
    *   `template.docx` (Sample)
    *   `run.bat`
    *   `requirements.txt`

**Context:** Sales teams generating personalized contracts/quotes.

🧠 Giải mã Prompt

  • Docxtpl: Thư viện này mạnh hơn Mail Merge của Word vì nó hỗ trợ logic lập trình (If/Else, For Loop) ngay trong file Word. Bạn có thể làm báo giá thông minh: “Nếu mua nhiều thì hiện dòng giảm giá, nếu ít thì ẩn đi”.

🛠️ Hướng dẫn

  1. Chuẩn bị file Word mẫu có điền {{ ten_khach_hang }}.
  2. Copy Prompt -> Paste -> Chạy.
  3. Chọn Template + Data -> Generate.

Workflows liên quan

Khám phá danh mục khác

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.