Skip to content

hany202507/finance-ai-skills / skills/법인세-통합고용

법인세-통합고용

Verified

월별 급여대장과 사원명부로 통합고용세액공제(조세특례제한법 제29조의8)의 상시근로자 수를 사람별 · 달별로 세고, 단계별 검증 시트와 법정 서식(조특 별지 제10호의9서식 공제세액계산서 · 제10호의10서식 상시근로자 명세서)을 엑셀 수식으로 채운 워크북을 만든다. 엔진이 같은 값을 따로 계산해 수식 값과 대조한다. "통합고용세액공제", "통합고용", "상시근로자 수", "청년등 상시근로자", "고용 세액공제 계산", "조특 10호의9", "10호의10", "상시근로자 명세서", "급여대장으로 고용 공제", "고용 증가 인원", "청년 간주"가 나오거나 급여대장과 사원명부로 고용 공제를 계산해야 할 때 쓴다. 2025 과세연도까지 계산하고, 2026 과세연도의 기존공제 · 신규공제도 계산하고 서식(2)와 종전 서식(1)을 채운다.

scripts/ctax/formkit.py

View on GitHub
"""검증 워크북 · 법정서식 PDF 를 만드는 스킬(통합고용 · 창업감면 · 중소감면)이 함께 쓰는 두 가지.

- put: 법제처 서식 PDF 의 칸(box) 안에 글자를 넣는다
- recalc: 엑셀로 워크북을 한 번 계산해 수식 결과를 파일에 심는다(엑셀이 없으면 False)

스킬 꾸러미(pack.py)가 이 파일을 함께 담는다. 다른 ctax 모듈을 읽지 않는다.
"""
from __future__ import annotations

from pathlib import Path

import pymupdf as fitz

FONT = "korea"            # PyMuPDF 내장 CJK 글꼴(Droid Sans Fallback)
SIZE = 9.0

_FONT = None


def _font():
    global _FONT
    if _FONT is None:
        _FONT = fitz.Font(FONT)
    return _FONT


def put(page, box, text: str, align: str = "r", size: float = SIZE, pad: float = 1.6, min_sx: float = 0.55) -> None:
    """칸(box) 안에 글자를 넣는다. 넘치면 가로로 0.55 배까지 줄이고, 그래도 넘치면 글자 크기를 줄인다.
    폭을 잰 글꼴로 그대로 그린다(TextWriter). insert_text 의 내장 CJK 이름 글꼴은 숫자를 전각 폭으로 그려 칸을 넘친다."""
    if text in (None, ""):
        return
    font = _font()
    x0, y0, x1, y1 = box
    room = max(1.0, (x1 - x0) - 2 * pad)
    size = min(size, (y1 - y0) * 0.8)
    w = font.text_length(text, fontsize=size)
    sx = 1.0
    if w > room:
        sx = max(min_sx, room / w)
        if w * sx > room:
            size = size * room / (w * sx)
            w = font.text_length(text, fontsize=size)
    width = w * sx
    if align == "l":
        x = x0 + pad
    elif align == "c":
        x = (x0 + x1 - width) / 2
    else:
        x = x1 - pad - width
    y = (y0 + y1) / 2 + size * 0.36
    pt = fitz.Point(x, y)
    tw = fitz.TextWriter(page.rect)
    tw.append(pt, text, font=font, fontsize=size)
    tw.write_text(page, color=(0, 0, 0), morph=(pt, fitz.Matrix(sx, 1)) if sx < 1 else None)


def recalc(path: Path) -> bool:
    """엑셀로 한 번 계산해 수식 결과를 파일에 심는다. 엑셀이 없으면 False."""
    try:
        import pythoncom
        import win32com.client
    except ImportError:
        return False
    pythoncom.CoInitialize()
    try:
        xl = win32com.client.DispatchEx("Excel.Application")
    except Exception:                                        # noqa: BLE001  엑셀이 깔리지 않은 PC
        return False
    try:
        xl.Visible, xl.DisplayAlerts = False, False
        wb = xl.Workbooks.Open(str(path), UpdateLinks=0)
        xl.CalculateFull()
        wb.Save()
        wb.Close(False)
    finally:
        xl.Quit()
        pythoncom.CoUninitialize()
    return True
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall