← Back to Skills Marketplace
loverun321

ERP Tax Filler

by loverun321 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
126
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install erptax
Description
Fill ERP financial data (资产负债表, 利润表, 现金流量表) into official tax bureau Excel templates (.xls/.xlsx) while preserving all formatting, formulas, styles, colors,...
README (SKILL.md)

Excel 财务报表模板填充

When to Use

Fill ERP financial data (资产负债表, 利润表, 现金流量表) into official tax bureau Excel templates (.xls/.xlsx) while preserving all formatting, formulas, colors, locked cells, and cell protection.

Triggered when user asks to:

  • Fill in financial statements from ERP export
  • Populate tax reporting templates
  • Transfer data from ERP to official forms
  • Fill Excel templates without breaking formulas or formatting

Core Workflow

Step 1 — Convert .xls to .xlsx first

If template is .xls (BIFF format), convert using Excel COM:

$excel = New-Object -ComObject Excel.Application
$excel.Visible = $false; $excel.DisplayAlerts = $false
$wb = $excel.Workbooks.Open("C:\path	o	emplate.xls")
$wb.SaveAs("C:\path	o	emplate.xlsx", 51)  # 51 = xlOpenXMLWorkbook
$wb.Close($false); $excel.Quit()

⚠️ Do NOT use xlutils for format-preserving operations on BIFF files.

Step 2 — Unpack xlsx

python scripts/xlsx_unpack.py input.xlsx /tmp/xlsx_work/

Step 3 — Read ERP data

Use xlrd to read ERP export files:

  • 资产负债表: left cols 0-3 (资产), right cols 4-7 (负债)
  • 利润表: col1=行次, col3=本期, col4=本年累计
  • 现金流量表: col0=名称, col3=本期, col4=本年累计

See references/erp-row-maps.md for ERP row → template row mapping.

Step 4 — Edit XML directly

Key principle: Only modify \x3Cv> values, never touch \x3Cf> (formulas) or s= (styles).

Pattern for numeric cells:

\x3C!-- Before -->
\x3Cc r="D7" s="34">
  \x3Cv>0\x3C/v>
\x3C/c>

\x3C!-- After (replace only \x3Cv>) -->
\x3Cc r="D7" s="34">
  \x3Cv>1638.81\x3C/v>
\x3C/c>

Pattern for formula cells (update cached value only):

\x3C!-- Before -->
\x3Cc r="D21" s="40">
  \x3Cf>ROUND(D7+D8+D9+D10+D11+D12+D13+D14+D15+D20,2)\x3C/f>
  \x3Cv>0\x3C/v>
\x3C/c>

\x3C!-- After (keep \x3Cf>, update \x3Cv>) -->
\x3Cc r="D21" s="40">
  \x3Cf>ROUND(D7+D8+D9+D10+D11+D12+D13+D14+D15+D20,2)\x3C/f>
  \x3Cv>5012140.22\x3C/v>
\x3C/c>

Step 5 — Remove calcChain and repack

Delete xl/calcChain.xml (forces Excel to recalculate all formulas on open):

rm /tmp/xlsx_work/xl/calcChain.xml
python scripts/xlsx_pack.py /tmp/xlsx_work/ output.xlsx

Key Rules

  1. Never use openpyxl load_workbook() + save() on existing files — it corrupts VBA, pivot tables, sparklines, and theme colors
  2. Always delete calcChain.xml after editing formulas or cached values
  3. Never change s= attribute (style index) or r= attribute (cell reference)
  4. Only modify \x3Cv> tags — everything else is untouched

References

  • ERP row mapping: references/erp-row-maps.md
  • XML edit patterns: references/xlsx-edit-guide.md
  • xlsx unpack/pack scripts: use from minimax-xlsx skill (copy to scripts/)

Source Scripts

Script Purpose
scripts/erp_fill.py Main orchestrator: reads ERP + edits XML + repacks
scripts/xlsx_unpack.py Unzip and pretty-print xlsx XML
scripts/xlsx_pack.py Repack edited XML into valid xlsx
Usage Guidance
This skill appears to do what it claims (XML-editing of .xlsx to preserve formulas/styles), but take these precautions before using it or installing it into an agent: - Do not run it on production/original templates — always test on copies and keep backups. - The SKILL.md recommends converting .xls via Excel COM. Opening files in Excel via COM can execute macros (Workbook_Open, Auto_Open). If you need to use Excel automation, ensure macros are disabled (e.g., set Application.AutomationSecurity = msoAutomationSecurityForceDisable) or otherwise ensure templates are trusted and free of malicious VBA. - The unpack/pack/edit flow will remove xl/calcChain.xml and repack the archive; if the workbook contains VBA (vbaProject.bin) or is macro-enabled (.xlsm), converting/saving as .xlsx or repacking may strip or break macros. The unpacker warns about vbaProject.bin — heed that. - The scripts assume presence of Python packages (xlrd, xlutils). The bundle includes no installer; confirm these dependencies and test in a controlled environment. - There are hardcoded fallback numeric values in the profit-table mapping — if ERP data for those lines is missing the script will insert those defaults; review and adjust if that is unacceptable. - Minor doc/code mismatch: SKILL.md strongly warns against using xlutils/openpyxl in some places but erp_fill.py imports xlutils.copy (though it doesn't appear to actually use it). Treat this as a small maintainability/quality issue and review the code before running. If you intend to use this in an automated/agent context, require user confirmation before running and ensure the environment disallows unintended macro execution. If you cannot review the templates and code yourself, consider this skill suspicious and avoid running it on sensitive data.
Capability Analysis
Type: OpenClaw Skill Name: erptax Version: 1.0.0 The skill bundle is a legitimate tool for automating the population of financial tax templates from ERP data. It uses a specialized workflow involving direct XML manipulation to preserve Excel formatting and formulas, supported by scripts like erp_fill.py, xlsx_unpack.py, and xlsx_pack.py. While it employs PowerShell COM objects for legacy file conversion and performs file system operations, these are aligned with the stated purpose; notably, xlsx_unpack.py even includes security checks to prevent Zip-Slip path traversal attacks.
Capability Assessment
Purpose & Capability
Name/description align with the included scripts: the code reads ERP .xls exports, unpacks .xlsx to XML, updates cached cell <v> values, removes calcChain, and repacks — all coherent with 'preserve formulas/styles while filling templates'. There are no unrelated network calls, credentials, or unrelated binaries requested.
Instruction Scope
SKILL.md instructs use of Excel COM (PowerShell) to convert .xls → .xlsx. Opening workbooks via COM can run Workbook_Open/Auto_Open macros: the instructions do not advise disabling macros or setting AutomationSecurity, which is a real code-execution risk if templates or ERP exports contain macros. The rest of the runtime instructions (unpack, edit only <v>, delete calcChain, repack) match the scripts, but the docs also warn against openpyxl while the code imports xlutils.copy (docstring mentions it) — a minor inconsistency. Also the script contains hardcoded fallback numeric values for some profit rows (could insert unexpected defaults when ERP data is missing).
Install Mechanism
No install spec or external downloads; all code files are included in the skill bundle. That reduces supply-chain risk. The scripts depend on Python packages (xlrd, xlutils) that must be present in the runtime environment but there is no installer here.
Credentials
The skill requests no environment variables, no credentials, and accesses only local files supplied by the user. There is no evidence of credential exfiltration or unrelated secret access in the code.
Persistence & Privilege
always:false and user-invocable; the skill does not request persistent or system-wide changes and does not modify other skills or global agent settings. It runs only when invoked.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install erptax
  3. After installation, invoke the skill by name or use /erptax
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of erptax skill for format-preserving ERP-to-tax Excel transfers. - Automates filling ERP financial data into official tax bureau Excel templates (.xls/.xlsx), fully preserving formatting, formulas, colors, cell locks, and protection. - Converts legacy .xls files to .xlsx via Excel COM to ensure compatibility and reliability. - Reads ERP export files (资产负债表, 利润表, 现金流量表) and maps their rows to official template layouts. - Edits Excel XML directly, modifying only cell values without touching formulas or styles. - Removes Excel calcChain to trigger formula recalculation on open, avoiding file corruption or calculation errors. - Provides detailed step-by-step guidance and robust scripting for safe, accurate data population.
Metadata
Slug erptax
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ERP Tax Filler?

Fill ERP financial data (资产负债表, 利润表, 现金流量表) into official tax bureau Excel templates (.xls/.xlsx) while preserving all formatting, formulas, styles, colors,... It is an AI Agent Skill for Claude Code / OpenClaw, with 126 downloads so far.

How do I install ERP Tax Filler?

Run "/install erptax" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ERP Tax Filler free?

Yes, ERP Tax Filler is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ERP Tax Filler support?

ERP Tax Filler is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ERP Tax Filler?

It is built and maintained by loverun321 (@loverun321); the current version is v1.0.0.

💬 Comments