退货换货单据 PDF 生成
slip-pdf-generator
生成一份可打印的 BlastBox 退货 / RMA / 换货单据(PDF 格式),供店员交给顾客。在退货、保修换货、会员取消或升级流程结束且所有金额最终确认后使用。该技能运行内置的 Python 脚本,将确认后的单据数据渲染为真实的 PDF 文件。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- slip-pdf-generator
- description
- Generate a printable BlastBox return / RMA / exchange slip as a PDF for the associate to hand to the customer. Use at the end of a return, warranty swap, membership cancellation, or upgrade once all amounts are final. The skill runs a bundled Python script that renders the confirmed slip values into a real PDF file.
03 SKILL.md 正文
Return / RMA Slip PDF Generator
This skill produces the printable slip that closes out a transaction at the
returns desk. You collect the final, already-confirmed values, then run the
bundled slip_pdf.py script to render the slip to a PDF using reportlab.
Do not hand-draw the PDF, write your own rendering code, or invent amounts — every
value comes from earlier steps (Policy Agent ruling, Membership MCP, Warehouse MCP,
and the prorated-refund-calculator skill).
When to use
Use this skill last, after every amount is final:
- the eligibility / warranty ruling is decided (Store Policy Agent),
- any membership refund is computed (
prorated-refund-calculator), - any upgrade settlement / net-due is computed (
prorated-refund-calculator), - the customer has agreed to the outcome.
Do not use it to decide anything — it only renders the agreed result.
Slip types
Set slip_type to the right label:
WARRANTY SWAP— defective item replaced under warranty.RETURN / REFUND— item returned for a refund.EXCHANGE / UPGRADE— item swapped for a different model with a price difference.MEMBERSHIP CANCELLATION— BlastPass cancelled (often combined with the above).
Workflow
1. Assemble the confirmed values
Build a JSON object with the final values. Every field is optional except those
that apply to this transaction. Keep amounts formatted to 2 decimals with a $
prefix.
| Field | Meaning |
|---|---|
slip_type |
one of the labels above |
rma_ref |
RMA / reference number |
date |
YYYY-MM-DD |
store / associate |
store name/number and associate/desk |
customer_name |
customer name |
member_id / member_tier |
BlastPass id and tier |
items |
list of [item, sku, disposition, amount] rows |
settlement |
list of [label, amount] rows (upgrade difference, refund applied as credit, etc.) |
net_label / net_amount |
e.g. NET DUE FROM CUSTOMER / $23.34, or REFUND TO CUSTOMER / $76.66 |
notes |
free-text notes |
2. Run the bundled script
Pass the JSON to slip_pdf.py:
python3 slip_pdf.py --slip-json '<json>' --output blastbox_slip.pdf
For the upgrade-settlement example (defective base console → MEGA edition, with a BlastPass refund applied as store credit):
python3 slip_pdf.py --output blastbox_slip.pdf --slip-json '{
"slip_type": "EXCHANGE / UPGRADE",
"rma_ref": "RMA-OMEGA-1024",
"date": "2026-06-07",
"store": "BlastBox #214 - Seattle",
"associate": "Associate Desk",
"customer_name": "Jordan Pixel",
"member_id": "MEGA-BLAST-1024",
"member_tier": "BlastPass Plus Extra",
"items": [
["BlastBox Omega (defective)", "SKU-OMEGA", "Warranty credit", "$399.99"],
["BlastBox Omega MEGA Edition", "SKU-OMEGA-MEGA", "Upgrade (new)", "$499.99"]
],
"settlement": [
["Upgrade difference ($499.99 - $399.99)", "$100.00"],
["BlastPass Plus Extra refund applied as store credit", "-$76.66"]
],
"net_label": "NET DUE FROM CUSTOMER",
"net_amount": "$23.34",
"notes": "Manufacturing defect confirmed within 30 days - no restocking fee. BlastPass Plus Extra (MEGA-BLAST-1024) cancelled; 8 unused months prorated."
}'
The script writes the PDF and prints WROTE blastbox_slip.pdf. If the JSON is
long, you may write it to a file and pass --slip-file slip.json instead.
3. Report
- Confirm the PDF was written and give its filename.
- Restate the net amount (due or refunded) and the slip type.
- Offer to email or reprint the slip if needed.
Notes
- The script uses
reportlab(the available PDF library). No network calls. - The layout fits a single page for a normal transaction.
- Pass plain text in the values; the script escapes
&for you.
04 同仓库更多 Skills
会员积分对账与兑换
points-reconciliation
在复杂的消费流程(购买、退货、促销倍数、过期)之后,核对客户的 BlastPoints 会员积分余额,并将净余额转换为门店购物金(store credit)。当店员询问会员积分时,或在退货后需要追回此前已发放的积分时使用。该技能运行内置的 Python 脚本,应用基础积分获取率、促销倍数、等级奖励、积分追回和过期规则,然后输出积分台账和可兑换的门店购物金金额。
会员退款与换购结算计算
prorated-refund-calculator
计算顾客取消 BlastPass 会员时的精确按比例退款,以及将有缺陷设备换购更高价机型时的净结算金额。在门店政策智能体(Store Policy Agent)确认退款规则、Membership MCP 返回会员详情后使用。该技能运行内置的 Python 脚本以确保计算精确无误。
会员卡 PNG 图片生成
membership-card-png
通过运行内置的 card_png.py 脚本,生成 BlastPass 电子会员卡的 PNG 图片。适用于会员自助补办丢失 / 被盗 / 损坏的卡,或任何需要在屏幕上展示卡(而非打印)的场景。该技能接收 Membership MCP(get_membership)返回的会员详情,以及 reissue_card 返回的新卡序列号 new_card_serial,将它们作为命令行参数传给内置的 Python(matplotlib)脚本,渲染出 CR80 尺寸的会员卡并生成真实 PNG。它仅根据已获取的值渲染卡面——绝不自行查询或虚构数据。
会员卡 PNG 图片生成
membership-card-png
通过运行内置的 card_png.py 脚本,生成 BlastPass 电子会员卡的 PNG 图片。适用于会员自助补办丢失 / 被盗 / 损坏的卡,或任何需要在屏幕上展示卡(而非打印)的场景。该技能接收 Membership MCP(get_membership)返回的会员详情,以及 reissue_card 返回的新卡序列号 new_card_serial,将它们作为命令行参数传给内置的 Python(matplotlib)脚本,渲染出 CR80 尺寸的会员卡并生成真实 PNG。它仅根据已获取的值渲染卡面——绝不自行查询或虚构数据。
退货换货单据 PDF 生成
slip-pdf-generator
生成可供打印的 BlastBox 退货 / RMA / 换货单据 PDF,供店员交给顾客。在退货、保修换货、会员取消或升级流程结束、所有金额最终确认后使用。该技能运行内置的 Python 脚本,将确认后的单据数据渲染为真实的 PDF 文件。
销售数据分析与滞销品识别
sales-analysis
通过运行捆绑的 sales_analysis.py 脚本,将来自 Sales & Performance MCP 的原始每周销售数据和商品目录事实转化为商品分析。在季度末降价复盘中作为第一步使用,适用于经理想了解某段时期内的畅销商品和滞销/呆滞库存的情况。该 MCP 仅返回原始数据,因此脚本会计算销售速度、库存覆盖周数和利润率,然后以结构化 JSON 形式打印畅销商品和滞销商品。它不渲染任何图表(所有可视化由 merch-report-html 技能负责),也不决定折扣(将滞销商品交给 markdown-optimizer 处理)。