{"type":"doc","content":[{"type":"paragraph","attrs":{"id":"a0c5112e-4f9a-4e13-a960-800abe2ecb12","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"问题"},{"type":"hardBreak","attrs":{"id":"b79642dc-9588-4fb3-9f35-6fe23113031c"}},{"type":"text","text":"年报审计最后要编报表附注,每个项目要写“期末余额、期初余额、构成说明、坏账/折旧政策”。手工 word 排版费时。用 Python 读审定表数据,自动生成每个项目的注释文字与表格,直接落 Excel/Word。"}]},{"type":"paragraph","attrs":{"id":"5eedfd44-8ef6-486f-8517-bb82def4ce0b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"示例代码"}]},{"type":"paragraph","attrs":{"id":"47b77c1d-745b-4f82-b75c-4a1fdb610577","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"plaintext"}]},{"type":"codeBlock","attrs":{"id":"c41abc30-ee81-4e59-be9a-3f98c891514d","language":"javascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"javascript"},"content":[{"type":"text","text":"import openpyxl\n\ndef build_note(ws, project, cur, prev, composition, policy):\n ws.append([project, \"\"])\n ws.append([\"期末余额\", cur])\n ws.append([\"期初余额\", prev])\n ws.append([\"项目构成\", composition])\n ws.append([\"会计政策\", policy])\n return ws\n\ndef export_notes(path, items):\n wb = openpyxl.Workbook()\n ws = wb.active\n ws.title = \"附注\"\n ws.append([\"报表项目\", \"内容\"])\n for it in items:\n build_note(ws, it[\"name\"], it[\"cur\"], it[\"prev\"], it[\"comp\"], it[\"policy\"])\n wb.save(path)\n\nitems = [\n {\"name\": \"应收账款\", \"cur\": 1200000, \"prev\": 980000,\n \"comp\": \"1年以内占85%\", \"policy\": \"预期信用损失模型\"},\n {\"name\": \"存货\", \"cur\": 5400000, \"prev\": 5100000,\n \"comp\": \"原材料占40%\", \"policy\": \"成本与可变现净值孰低\"},\n]\nexport_notes(\"notes.xlsx\", items)\n"}]},{"type":"paragraph","attrs":{"id":"87a52cce-484d-4e41-bac3-0fd6e5d8cb6a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"关键点"}]},{"type":"bulletList","attrs":{"id":"3a03dfab-fed4-4714-bb5e-d26f473ac564","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"d551d4ce-8e0e-4a42-9fcc-c9f74a610b49"},"content":[{"type":"paragraph","attrs":{"id":"597455f3-7d30-4571-bfa5-0dddf0deb9ea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"数据驱动:把每个报表项目的“期末/期初/构成/政策”做成 dict 列表,循环生成,改数不动结构。"}]}]},{"type":"listItem","attrs":{"id":"19f7531a-38d7-40c3-9864-12156b7b469a"},"content":[{"type":"paragraph","attrs":{"id":"b2db9d87-610d-4f15-ac3e-a5d54d1f16fb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"输出落 Excel 易复核;若要 Word,把 build_note 换成 python-docx 的 add_paragraph 即可,骨架不变。"}]}]},{"type":"listItem","attrs":{"id":"89855d18-c6c8-47a3-8a4a-9a067362e6de"},"content":[{"type":"paragraph","attrs":{"id":"4db061a6-cf1f-4c97-b635-2df79d197a9a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"注释文字模板化(如“账面原值 X,累计折旧 Y,减值准备 Z”),避免每人写一份不同表述。"}]}]}]},{"type":"paragraph","attrs":{"id":"eec9d8c1-bb34-4804-a046-8d1414490ae8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"小结"},{"type":"hardBreak","attrs":{"id":"652ef939-1c19-48a9-a43f-24ed1f60e81d"}},{"type":"text","text":"附注 = 结构化数据 + 模板文字。Python 把审定数填进模板,出稿从半天降到十分钟。"}]},{"type":"horizontalRule","attrs":{"id":"4ef1080f-f327-4a4d-a759-a2dbb6424b4d","isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"7ae048d6-6206-447e-b453-a287f7200f94","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你做附注时最烦的是“政策描述”还是“数字勾稽”?评论区说说。"}]},{"type":"paragraph","attrs":{"id":"16856c97-ca1f-4925-badb-d4f2bfa4062b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"如果这篇对你有用,欢迎点赞、收藏、关注,并留下审计难题。下期预告:审计底稿自动排版(页眉页脚页码一键设)。"}]},{"type":"paragraph","attrs":{"id":"d2e6b4b4-575f-416a-bf23-4f9689ed9b3c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"会计师事务所的一名注册会计师"}]}]}