mcpField
I
invoice-generation

invoice-generation

github.com/eachlabs文档处理44274 次安装今天更新
代码仓库

关于 invoice-generation

invoice-generation 是面向企业的 each::sense 技能,可生成发票及相关财务文档,并支持税费与币种信息、品牌样式和可复用模板。

主要功能

  1. 01生成发票、收据和报价单
  2. 02生成贷项通知单和采购订单
  3. 03支持多币种与税费计算
  4. 04自定义公司品牌与版式
  5. 05使用可复用的周期模板

适用场景

  1. 01制作含税明细发票
  2. 02为已完成付款出具收据
  3. 03创建售前估价和报价
  4. 04为采购流程生成采购订单

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/eachlabs/skills --skill invoice-generation

安装后在 Claude Code 中输入/invoice-generation确认已加载。

附带文件references/SSE-EVENTS.md

详细介绍

发票生成

使用 each::sense 生成专业的发票、收据、报价单和财务文件。此技能可创建美观、准确的商务文件,并针对打印和数字交付进行优化。

功能

  • 发票:包含明细项目、税费和总额的专业发票
  • 收据:已完成付款的交易收据
  • 报价单/估价单:包含有效期的售前报价
  • 贷项通知单:退款和调整文件
  • 采购订单:采购和订购文件
  • 多币种:支持多种货币和格式
  • 税费计算:自动处理增值税、商品及服务税和销售税
  • 公司品牌:自定义 Logo、颜色和版式
  • 周期性模板:用于重复计费的标准化模板

快速入门

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Generate a professional invoice for web development services, $2,500 total, due in 30 days"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

文件类型和使用场景

文件类型使用场景关键要素
发票商品/服务计费明细项目、税费、到期日、付款条款
收据付款确认交易 ID、付款方式、时间戳
报价单/估价单售前定价有效期、可选项目、条款
贷项通知单退款/调整对原发票的引用、原因
采购订单采购供应商详情、配送信息、审批
形式发票发货前与发票类似,标注为形式发票

使用示例

1. 生成基本发票
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a simple invoice: Invoice #INV-2024-001, From: Acme Corp (123 Business St, NY 10001), To: Client Inc (456 Customer Ave, LA 90001), Service: Consulting Services - $1,500. Due date: March 15, 2024. Clean, professional design."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
2. 生成包含明细项目的详细发票
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Generate a detailed invoice with multiple line items: Invoice #INV-2024-042 From: Digital Solutions LLC To: TechStart Inc Line items: 1) Website Development - 40 hours @ $150/hr = $6,000 2) UI/UX Design - 20 hours @ $125/hr = $2,500 3) SEO Setup - flat rate $800 4) Hosting (Annual) - $480 Subtotal, 8% tax, and grand total. Payment terms: Net 30. Include bank transfer details section."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
3. 生成带有公司品牌元素的发票
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a branded invoice for a creative agency. Company: Pixel Perfect Studios, use modern minimalist design with a navy blue and gold color scheme. Include space for logo at top left. Invoice #PP-2024-089 to MediaMax Corp. Services: Brand Identity Package $4,500, Social Media Templates $1,200, Brand Guidelines Document $800. Total $6,500. Due in 14 days. Include Pay Now button placeholder and QR code area for payment link."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/company-logo.png"]
  }'
4. 生成收据
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Generate a payment receipt: Receipt #REC-78432 From: Cloud Services Pro To: Johnson Enterprises Payment received: $3,250.00 Payment method: Credit Card (Visa ending 4242) Transaction ID: TXN-2024-02-15-98765 Date: February 15, 2024 at 2:34 PM For: Invoice #INV-2024-038 (Annual SaaS Subscription) Status: PAID in full. Include a thank you message and support contact."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
5. 生成报价单/估价单
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a project quote/estimate: Quote #QT-2024-015 From: BuildRight Construction To: Greenfield Properties Project: Office Renovation - 2nd Floor Line items: 1) Demolition and prep - $8,500 2) Electrical work - $12,000 3) Plumbing updates - $6,500 4) Flooring (800 sq ft) - $9,600 5) Painting and finishing - $4,200 6) Project management (10%) - $4,080 Total estimate: $44,880 Valid for 30 days. Include terms: 50% deposit required, final payment on completion. Add signature line for acceptance."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
6. 生成多币种发票
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Generate an international invoice in Euros: Invoice #EU-2024-0023 From: TechGlobal GmbH (Berlin, Germany, VAT: DE123456789) To: Societe Digitale SARL (Paris, France, VAT: FR987654321) Services: Software License (Enterprise) - 12 months @ 850 EUR/month = 10,200 EUR Implementation Services - 3,500 EUR Training (Remote) - 1,800 EUR Subtotal: 15,500 EUR VAT (19%): 2,945 EUR Total: 18,445 EUR Payment: SEPA transfer, IBAN: DE89 3704 0044 0532 0130 00, BIC: COBADEFFXXX Due: 30 days. Reverse charge note for intra-EU B2B."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
7. 生成含税费计算的发票
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create an invoice with complex tax breakdown: Invoice #TAX-2024-156 From: Retail Solutions Inc (GST: 12-3456789) To: Shop & Save Stores Line items with different tax rates: 1) POS Hardware (5 units @ $899) = $4,495 - Standard rate 10% GST 2) Software License = $2,400 - Standard rate 10% GST 3) Installation Services = $1,200 - Standard rate 10% GST 4) Training Materials (books) = $350 - Zero rated 5) Extended Warranty = $600 - Exempt Subtotal: $9,045 GST Summary: Standard rated (10%): $8,095 x 10% = $809.50 Zero rated: $350 x 0% = $0 Exempt: $600 Total GST: $809.50 Grand Total: $9,854.50 Include ABN and tax invoice statement."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
8. 周期性发票模板
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Design a recurring monthly invoice template: Invoice #[AUTO-NUMBER] From: CloudHost Pro Services To: [CLIENT NAME] Billing Period: [MONTH YEAR] Recurring Services: 1) Dedicated Server Hosting - $299/month 2) Managed Backup Service - $49/month 3) SSL Certificate - $9/month 4) Technical Support (Business) - $149/month Monthly Total: $506 Mark as RECURRING INVOICE. Show billing cycle: Monthly, auto-renews. Next billing date field. Include: Update payment method link, Cancel subscription link. Modern SaaS-style design with clean typography."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
9. 生成贷项通知单/退款文件
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Generate a credit note: Credit Note #CN-2024-008 From: Premium Supplies Co To: Office Depot Partners Original Invoice: #INV-2024-892 dated January 10, 2024 Reason for credit: Goods returned - defective items Credit items: 1) Ergonomic Chair Model X (2 units @ $450) = -$900 2) Return shipping covered = -$45 Total Credit: $945.00 Original invoice total: $2,340 Remaining balance due: $1,395 Note: Credit has been applied to your account. Future invoices will reflect this adjustment. Authorized by: [Signature line]. Use red accent color to indicate credit/refund."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
10. 生成采购订单
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a purchase order: PO #PO-2024-0456 From (Buyer): MegaCorp Industries, 789 Corporate Blvd, Chicago IL 60601, Purchasing Dept Contact: Jane Smith, [email protected] To (Vendor): Industrial Supplies Ltd, 321 Warehouse Way, Detroit MI 48201 Ship To: MegaCorp Warehouse B, 456 Distribution Dr, Chicago IL 60602 Order Items: 1) Steel Brackets SKU-SB100 - 500 units @ $2.50 = $1,250 2) Mounting Hardware Kit SKU-MH200 - 200 units @ $8.00 = $1,600 3) Safety Cables SKU-SC300 - 1000 units @ $1.25 = $1,250 4) Industrial Adhesive SKU-IA400 - 50 gallons @ $45 = $2,250 Subtotal: $6,350 Shipping: $285 Total: $6,635 Required delivery date: March 1, 2024 Payment terms: Net 45 Special instructions: Deliver to loading dock B, call 30 min before arrival. Include approval signature lines for Requester, Manager, and Purchasing."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

多轮发票迭代

使用 session_id 在多次请求中完善发票:

# Initial invoice creation
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create an invoice for marketing services, $5,000 total from Creative Agency to StartupXYZ"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "invoice-project-001"
  }'

# Add more line items
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Break that down into: Strategy $2,000, Content Creation $1,800, Ad Management $1,200. Add 7% sales tax."}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "invoice-project-001"
  }'

# Update styling
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Update the design to use a green and white color scheme, add payment instructions for Stripe."}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "invoice-project-001"
  }'

批量生成文件

生成多个相关文件:

# Generate invoice
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create invoice #INV-001 for Project Alpha, $10,000 consulting fee to Acme Corp"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "project-alpha-docs",
    "mode": "eco"
  }'

# Generate matching receipt after payment
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Now create a matching receipt for that invoice, payment received via wire transfer today"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "project-alpha-docs",
    "mode": "eco"
  }'

最佳实践

发票设计
  • 层次清晰:公司信息置于顶部,明细项目置于中部,总额突出显示
  • 字体易读:使用专业、清晰易读的字体
  • 留白充足:避免版面杂乱
  • 联系信息:务必注明有疑问时的联系方式
必填信息
  • 唯一发票编号:采用连续编号或编码系统
  • 开具日期和到期日:明确付款时间安排
  • 完整的企业信息:名称、地址、税号
  • 逐项列明费用:描述、数量、单价、金额
  • 付款说明:银行信息、接受的付款方式
法律合规
  • 在需要时填写税务登记号码
  • 使用适用于所在司法管辖区的正确税率
  • 正确标注文档类型(发票、报价单、形式发票)
  • 添加法律规定的免责声明

财务文件提示词建议

生成发票和财务文件时,请提供:

  1. 文件类型:发票、收据、报价单、贷项通知单、PO
  2. 交易双方:发送方和接收方的完整信息
  3. 商品/服务:描述、数量、单价
  4. 计算信息:税率、折扣、总额
  5. 条款:付款到期日、有效期
  6. 品牌元素:颜色、风格偏好、Logo
  7. 其他字段:PO 编号、项目参考信息、备注
提示词结构示例
"Create a [document type] #[number]
From: [company name and details]
To: [client name and details]
Items: [list with quantities and prices]
Tax: [rate and type]
Terms: [payment terms]
Style: [design preferences]"

模式选择

生成前请询问用户:

“您想要速度快、成本低,还是质量高?”

模式适用场景速度质量
max面向最终客户的发票、品牌化文件较慢最高
eco发票草稿、内部文件、批量生成较快良好

错误处理

错误原因解决方案
Failed to create prediction: HTTP 422余额不足在 eachlabs.ai 充值
内容策略违规内容违规调整提示词,使其符合相关策略
超时生成内容复杂将客户端超时时间设置为至少 10 分钟

相关技能

  • each-sense - 核心 API 文档
  • document-generation - 通用文档创建
  • business-card-generation - 名片设计
  • letterhead-generation - 公司信头设计

评论

支持 Markdown