diff --git a/app/modules/inout/CLAUDE.md b/app/modules/inout/CLAUDE.md index cfd740f..4e15f1e 100644 --- a/app/modules/inout/CLAUDE.md +++ b/app/modules/inout/CLAUDE.md @@ -41,6 +41,7 @@ - 단가(원)·무게(개당 g = PP량)·은(Ag) 함유량(%) 수기 입력(은 g = 무게 × % 자동). - 한 번 불러오면 발주서 제품은 이 목록에서. 발주 품목에 그때 값 사본(`unit_price`·`weight_g`·`silver_pct`). - 발주서·메일에 금액(수량 × 단가)·PP·은 함유량과 합계. +- **발주 메일 표**(2026-10-19, `store.order_mail`): 전체 무게(kg) = 개당 g × 수량 · **PP 사용량(kg)** = 전체 무게 − 은 무게(은 함유량 왼쪽 열) · 은(Ag) 함유량 = `30% (76.5kg)`(괄호 = 전체 무게 × %, kg 소수 넷째). 합계 줄·요약(전체 무게·PP 사용량·은 총량)도 kg. 발주서 화면 표는 예전 그대로(PP g/개). ## 시각 / 날짜 diff --git a/app/modules/inout/store.py b/app/modules/inout/store.py index a627978..ef0af67 100644 --- a/app/modules/inout/store.py +++ b/app/modules/inout/store.py @@ -249,7 +249,8 @@ def parse_emails(raw: Any, *, label: str = "이메일", required: bool = False) def order_mail(order: dict[str, Any], *, sender_name: str, sender_email: str) -> dict[str, str]: """발주서 → 메일 제목·글 본문·HTML 본문(요약). order = db.get_order 결과. - 품목마다 단가·금액(수량 × 단가)·PP량(개당 g = 무게)·은 함유량(%·개당 g) — 발주 품목에 남긴 그때 값(004). 없으면 '-'.""" + 품목마다 단가·금액(수량 × 단가)·전체 무게(개당 g × 수량, kg)·PP 사용량(전체 무게 − 은 무게, kg)·은 함유량(%·전체 무게 × %, kg) + — 발주 품목에 남긴 그때 값(004). 없으면 '-'. (2026-10-19 — 예전엔 PP(g/개)·개당 은 g)""" lines = order["lines"] first = (lines[0]["item_name"] or lines[0]["item_code"]) if lines else "" more = f" 외 {len(lines) - 1}종" if len(lines) > 1 else "" @@ -264,29 +265,37 @@ def order_mail(order: dict[str, Any], *, sender_name: str, sender_email: str) -> if money["amount"] is not None: note = f" (단가 미입력 {money['missing_price']}종 제외)" if money["missing_price"] else "" facts.append(("발주 금액", f"{fmt_num(money['amount'])}원{note}")) + ag_kg = money["silver_g"] / Decimal(1000) if money["silver_g"] is not None else None if money["pp_kg"] is not None: - facts.append(("PP 총량", f"{fmt_num(money['pp_kg'], 2)} kg")) - if money["silver_g"] is not None: - facts.append(("은(Ag) 총량", f"{fmt_num(money['silver_g'], 2)} g")) + facts.append(("전체 무게", f"{fmt_num(money['pp_kg'], 3)} kg")) + if money["pp_use_kg"] is not None: + facts.append(("PP 사용량", f"{fmt_num(money['pp_use_kg'], 3)} kg")) + if ag_kg is not None: + facts.append(("은(Ag) 총량", f"{fmt_num(ag_kg, 4)} kg")) if order.get("memo"): facts.append(("요청 사항", order["memo"])) def cells(x: dict[str, Any]) -> dict[str, str]: price, w, pct = to_dec(x.get("unit_price")), to_dec(x.get("weight_g")), to_dec(x.get("silver_pct")) - amt = line_amount(int(x["qty"]), price) - ag = silver_g(w, pct) + q = int(x["qty"]) + amt = line_amount(q, price) + total_kg = w * q / Decimal(1000) if w is not None else None # 전체 무게 = 개당 g × 수량 + ag_kg = total_kg * pct / Decimal(100) if total_kg is not None and pct is not None else None return {"price": fmt_num(price) if price is not None else "-", "amount": fmt_num(amt) if amt is not None else "-", - "pp": fmt_num(w) if w is not None else "-", - "ag": (f"{fmt_num(pct, 4)}%" + (f" ({fmt_num(ag, 4)}g)" if ag is not None else "")) if pct is not None else "-"} + "weight": fmt_num(total_kg, 3) if total_kg is not None else "-", + "pp_use": fmt_num(total_kg - ag_kg, 3) if ag_kg is not None else "-", + "ag": (f"{fmt_num(pct, 4)}%" + (f" ({fmt_num(ag_kg, 4)}kg)" if ag_kg is not None else "")) if pct is not None else "-"} # 글 본문(HTML 을 못 보는 메일 프로그램용) text = [greet, "", "아래와 같이 제품 제작을 발주합니다.", ""] text += [f"- {k}: {v}" for k, v in facts] - text += ["", "[발주 품목] 수량 · 단가 · 금액 · PP(g/개) · 은 함유량"] + text += ["", "[발주 품목] 수량 · 단가 · 금액 · 전체 무게 · PP 사용량 · 은 함유량"] for i, x in enumerate(lines, start=1): c = cells(x) text.append(f"{i}. {x['item_code']} {x['item_name']} — {int(x['qty']):,}개 · 단가 {c['price']} · 금액 {c['amount']}" - f" · PP {c['pp'] + 'g' if c['pp'] != '-' else '-'} · 은 {c['ag']}" + (f" ({x['memo']})" if x.get("memo") else "")) + f" · 전체 무게 {c['weight'] + 'kg' if c['weight'] != '-' else '-'}" + f" · PP 사용량 {c['pp_use'] + 'kg' if c['pp_use'] != '-' else '-'} · 은 {c['ag']}" + + (f" ({x['memo']})" if x.get("memo") else "")) text += ["", "입고 예정일까지 물류로 입고 부탁드리며, 일정이 바뀌면 회신 부탁드립니다.", "", f"발주 담당: {who} ({sender_email})"] # HTML 본문 — 값은 모두 escape e = _html.escape @@ -301,11 +310,12 @@ def order_mail(order: dict[str, Any], *, sender_name: str, sender_email: str) -> f'{i}{e(x["item_code"])}' f'{e(x["item_name"])}{int(x["qty"]):,}' f'{e(c["price"])}{e(c["amount"])}' - f'{e(c["pp"])}{e(c["ag"])}' + f'{e(c["weight"])}{e(c["pp_use"])}{e(c["ag"])}' f'{e(x.get("memo") or "")}') foot_amount = fmt_num(money["amount"]) if money["amount"] is not None else "" - foot_pp = f'{fmt_num(money["pp_kg"], 2)} kg' if money["pp_kg"] is not None else "" - foot_ag = f'{fmt_num(money["silver_g"], 2)} g' if money["silver_g"] is not None else "" + foot_pp = fmt_num(money["pp_kg"], 3) if money["pp_kg"] is not None else "" + foot_use = fmt_num(money["pp_use_kg"], 3) if money["pp_use_kg"] is not None else "" + foot_ag = f'{fmt_num(ag_kg, 4)} kg' if ag_kg is not None else "" bg = "background:#f6f7f9;" html = ( '
' @@ -314,11 +324,13 @@ def order_mail(order: dict[str, Any], *, sender_name: str, sender_email: str) -> '' f'' f'' - f'' + f'' + f'' f'{"".join(rows)}' f'' f'' - f'
No제품 코드제품명수량단가(원)금액(원)PP(g/개)은(Ag) 함유량비고
전체 무게(kg)PP 사용량(kg)은(Ag) 함유량비고
합계{total:,}{e(foot_amount)}{e(foot_pp)}{e(foot_ag)}
' + f'{e(foot_pp)}{e(foot_use)}{e(foot_ag)}' + f'' "

입고 예정일까지 물류로 입고 부탁드리며, 일정이 바뀌면 회신 부탁드립니다.

" f'

발주 담당: {e(who)} ({e(sender_email)})

' ) @@ -365,8 +377,9 @@ def line_amount(qty: int, unit_price: Any) -> Decimal | None: def order_totals(lines: list[dict[str, Any]]) -> dict[str, Any]: - """발주 금액 합(단가 있는 줄만, 없으면 None)·단가 없는 줄 수·PP 총량(kg)·은 총량(g).""" - amount = pp = ag = None + """발주 금액 합(단가 있는 줄만, 없으면 None)·단가 없는 줄 수·PP 총량(= 전체 무게, kg)·은 총량(g)· + PP 사용량(kg, 무게·은 함유량이 다 있는 줄의 전체 무게 − 은 무게 — 메일 표, 2026-10-19).""" + amount = pp = ag = use = None missing = 0 for x in lines: q = int(x["qty"]) @@ -381,7 +394,9 @@ def order_totals(lines: list[dict[str, Any]]) -> dict[str, Any]: p = to_dec(x.get("silver_pct")) if w is not None and p is not None: # 개당 은 g 를 반올림하기 전 값으로 곱한다(합계 오차 방지) ag = (ag or Decimal(0)) + w * p / Decimal(100) * q - return {"amount": amount, "missing_price": missing if amount is not None else len(lines), "pp_kg": pp, "silver_g": ag} + use = (use or Decimal(0)) + w * q * (Decimal(100) - p) / Decimal(100000) + return {"amount": amount, "missing_price": missing if amount is not None else len(lines), "pp_kg": pp, "silver_g": ag, + "pp_use_kg": use} def parse_decimal(raw: Any, *, key: str) -> Decimal | None: diff --git a/app/modules/notice/templates/notice/admin.html b/app/modules/notice/templates/notice/admin.html index 14f4544..bb2d7d9 100644 --- a/app/modules/notice/templates/notice/admin.html +++ b/app/modules/notice/templates/notice/admin.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + {% endblock %} @@ -64,7 +64,7 @@ - + {% endif %} {% endblock %} diff --git a/app/modules/project/CLAUDE.md b/app/modules/project/CLAUDE.md index 35341a8..299fef4 100644 --- a/app/modules/project/CLAUDE.md +++ b/app/modules/project/CLAUDE.md @@ -123,4 +123,4 @@ - 회의록 줄 작업은 새로고침 없이 제자리 다시 그리기(`refreshMeeting`) + 애니메이션. - 구분(구역) 칸 우클릭·⋯ = 구역 통째로 위/아래(`move-section`). - 항목 칸 끌어 옮기기(2026-10-19) — 마우스로 항목 칸을 5px 이상 끌면 묶음(label_cont 줄 + 걸친 세로 병합)이 같은 구역 안에서 실시간 이동(칸 단위 FLIP, 구분 칸은 늘 첫 줄), 놓으면 `POST meeting-items/{id}/move-to {before_item_id|null}`(`db.move_meeting_group`, 묶음 사이·다른 구역은 거절) → `refreshMeeting`. Esc 취소, 짧게 누르기는 이름 수정. -- 회의록 표(`.pj-meet-table`) 테두리는 모두 검정 `#000`(2026-10-19, 바깥 아래선은 마지막 줄 칸 아래선이 대신). +- 회의록 표(`.pj-meet-table`) 테두리는 검정 `#000`, 구역(구분) 처음·끝 가로선은 굵게 2px, 구역 안 줄 사이 가로선은 회색 `#bfc3c9`(2026-10-19). 구역 끝에 닿는 칸(병합 포함)은 JS `markMeetSecEnds` 가 `.is-sec-end`(아래선 없음 — 다음 구역 굵은 선이 대신), 표 다시 그리기·끌기 뒤에도 다시 계산. diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index 98f92fc..2cc6ad3 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -298,5 +298,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 9ac7aac..0722501 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -207,5 +207,5 @@ {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 2b5a2b9..040890d 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 03c2eb2..1926403 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -106,5 +106,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index 903ebfe..ccb8fe5 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/notifier.html b/app/modules/project/templates/project/notifier.html index ebed856..6c06198 100644 --- a/app/modules/project/templates/project/notifier.html +++ b/app/modules/project/templates/project/notifier.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -108,5 +108,5 @@ }); })(); - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 8a81eb8..cabd30d 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -472,5 +472,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 02e938b..0190b14 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/project.css b/app/static/project.css index b26969a..f439ad3 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -2921,8 +2921,8 @@ a.pj-meet-quick-done:hover { background: #e8f5ee; } .pj-meet-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--pj-text-size); - /* 테두리는 모두 검정(2026-10-19) — 바깥 아래선은 마지막 줄 칸 아래선이 대신한다(겹쳐 두꺼워지지 않게) */ - background: #fff; border: 1px solid #000; border-bottom: none; border-radius: 0; color: var(--pj-ink); line-height: var(--pj-text-leading); + /* 테두리는 검정(2026-10-19) — 구역(구분) 처음·끝 가로선은 굵게(2px), 구역 안 줄 사이 가로선은 회색. 바깥 아래선 = 마지막 구역 끝 굵은 선 */ + background: #fff; border: 1px solid #000; border-bottom: 2px solid #000; border-radius: 0; color: var(--pj-ink); line-height: var(--pj-text-leading); } .pj-meet-table th, .pj-meet-table td { box-sizing: border-box; border-right: 1px solid #000; border-bottom: 1px solid #000; padding: 0; vertical-align: top; @@ -2951,6 +2951,12 @@ a.pj-meet-quick-done:hover { background: #e8f5ee; } .pj-meet-w-amt { width: 122px; } .pj-meet-sec > tr > th, .pj-meet-sec > tr > td:not(.is-prev) { background: var(--goal-bg, #fff); } .pj-meet-sec > tr > td.is-prev { background: #fafbfc; } +/* 구역 안 줄을 나누는 가로선 = 회색, 구역 첫 줄 위 = 굵은 검정(표 머리 바로 아래는 머리 아래선 1px + 1px), + 구역 끝에 닿는 칸(.is-sec-end — 병합 칸 포함, JS markMeetSecEnds)은 아래선 없음 → 다음 구역 굵은 선·표 바깥 굵은 선이 대신 */ +.pj-meet-sec > tr > * { border-bottom-color: #bfc3c9; } +.pj-meet-sec > tr:first-child > * { border-top: 2px solid #000; } +.pj-meet-table thead + .pj-meet-sec > tr:first-child > * { border-top-width: 1px; } +.pj-meet-sec > tr > .is-sec-end { border-bottom: none; } /* 항목 칸 끌어 옮기기 — 잡은 칸은 grab, 끄는 묶음은 연보라 + 왼쪽 보라 선, 끄는 동안 글자 선택 없음 */ .pj-meet-sec th.pj-meet-c-label:has([data-meet-edit]) { cursor: grab; } html.pj-meet-row-dragging, html.pj-meet-row-dragging * { cursor: grabbing !important; user-select: none !important; } diff --git a/app/static/project.js b/app/static/project.js index c23e012..1730fc0 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -12536,6 +12536,17 @@ // ── 항목 칸 끌어 옮기기(2026-10-19) — 항목 칸을 잡고 위아래로 끌면 그 묶음(같은 항목 칸으로 이어 붙은 줄 + 걸친 세로 병합)이 // 마우스를 따라 같은 구역의 묶음 사이로 실시간으로 옮겨 가고, 다른 줄은 미끄러지듯 비켜난다. 놓으면 move-to 저장 후 // 표를 다시 그린다(실패하면 서버 순서로 되돌림). Esc = 취소. 살짝 누르기만 하면(5px 미만) 예전처럼 이름 수정. + // 구역 끝에 닿는 칸(마지막 줄 칸 + 거기까지 내려오는 병합 칸)에 .is-sec-end — 그 칸은 아래 회색선 대신 구역 경계 굵은 선(CSS) + function markMeetSecEnds() { + table.querySelectorAll("tbody.pj-meet-sec").forEach(function (tbody) { + const rows = Array.from(tbody.rows), n = rows.length; + rows.forEach(function (tr, k) { + Array.prototype.forEach.call(tr.cells, function (c) { c.classList.toggle("is-sec-end", k + (c.rowSpan || 1) >= n); }); + }); + }); + } + markMeetSecEnds(); + table.addEventListener("pj-meet-rows", markMeetSecEnds); // refreshMeeting 이 표를 다시 그린 뒤 if (canEdit) { let press = null, rowDrag = null, noClickUntil = 0; const meetUnits = function (tbody) { // 묶음 = 항목 칸 첫 줄부터(이어 붙은 줄·병합에 가려진 줄은 앞 묶음에) @@ -12560,6 +12571,7 @@ const first = d.tbody.rows[0]; if (d.secTh && d.secTh.parentElement !== first) first.insertBefore(d.secTh, first.firstChild); d.units = order; + markMeetSecEnds(); if (!Element.prototype.animate) return; cells.forEach(function (p) { const dy = p[1] - p[0].getBoundingClientRect().top; diff --git a/docs/INOUT_MODULE.md b/docs/INOUT_MODULE.md index 48c1b35..e90bb74 100644 --- a/docs/INOUT_MODULE.md +++ b/docs/INOUT_MODULE.md @@ -149,7 +149,10 @@ cupang·malaysia 와 같은 DSN). 화면에서 코드·이름으로 검색(`GET 고치기에서 새로 넣은 줄만 지금 값, 원래 있던 줄은 사본 유지. 004 전 발주서는 단가 칸이 "-". - **금액** = 수량 × 단가(`store.line_amount`), 합계는 단가 있는 줄만(없는 줄 수 표시), PP 총량(kg) = Σ 무게 × 수량, 은 총량(g) = Σ 무게 × % × 수량 (`store.order_totals`, 개당 은 g 를 반올림하기 전 값으로 곱함). -- **발주 메일 본문**(6-1)에 발주 금액·PP 총량·은(Ag) 총량 줄과 품목 표 **단가(원)·금액(원)·PP(g/개)·은(Ag) 함유량(% (g))**, 합계 줄. +- **발주 메일 본문**(6-1)에 발주 금액·전체 무게·PP 사용량·은(Ag) 총량 줄과 품목 표 **단가(원)·금액(원)·전체 무게(kg)·PP 사용량(kg)·은(Ag) 함유량(% (kg))**, 합계 줄. + - 2026-10-19 사용자 요청으로 바꿈(예전 = PP(g/개)·개당 은 g): **전체 무게** = 개당 무게 × 수량(kg) · **PP 사용량** = 전체 무게 − 은 무게(은 함유량 바로 왼쪽 열) · + **은 함유량** 괄호 = 전체 무게 × %(kg, 소수 넷째까지). 예: 5,000개 × 51g = 255kg, 은 30% (76.5kg), PP 사용량 178.5kg. + 합계 줄 PP 사용량 = 무게·은 함유량이 다 있는 줄만(`order_totals` `pp_use_kg`). 글 본문(HTML 못 보는 메일 프로그램용)도 같은 값. 발주서 화면 표는 그대로. - 004 미적용이면 탭에 "마이그레이션 004 필요" 안내, 발주서는 예전처럼 코드표에서(`products_ready`). ## 7. 테스트 diff --git a/docs/PROJECT_MODULE.md b/docs/PROJECT_MODULE.md index e500ff5..322b61c 100644 --- a/docs/PROJECT_MODULE.md +++ b/docs/PROJECT_MODULE.md @@ -1400,7 +1400,9 @@ Windows 트레이 프로그램 **DBX 알림**(`desktop/notifier/`, C# .NET Frame - 끄는 동안 그 묶음 tr 을 다른 묶음 중간선 기준으로 바로 옮겨 끼우고(구분 칸 `th.pj-meet-c-sec` 은 늘 구역 첫 줄로 옮김), 칸 단위 FLIP(`Element.animate` .17s). 끄는 줄은 연보라 + 왼쪽 보라 선. - 놓으면 `POST /api/goals/meeting-items/{id}/move-to {before_item_id: 다음 묶음 첫 줄 | null = 구역 맨 끝}` → `refreshMeeting`. 실패하면 안내 후 서버 순서로 다시 그림. Esc = 원래 순서로. - `db.move_meeting_group`: 같은 주 잠금(`_locked_meeting_items`, 회의 완료면 409)·묶음째·같은 구역만(다른 구역 400)·묶음 사이 자리(`before` 가 묶음 첫 줄이 아님) 409·제자리면 그대로. 권한은 줄 순서와 같음(누구나, 완료 전). -- **회의록 표 테두리** — `.pj-meet-table` 바깥·칸 테두리 모두 `#000`(예전 연회색). 칸은 오른쪽·아래 선만 그리므로 표 바깥 아래선은 없애(마지막 줄 아래선이 대신) 두 줄로 겹치지 않게, 모서리 둥글림 0. 구역 첫 줄 위 진한 선은 없앰(검정 1px 로 통일). +- **회의록 표 테두리** — `.pj-meet-table` 바깥·칸 테두리 `#000`(예전 연회색), 모서리 둥글림 0. 같은 날 추가 요청으로 **구역(구분) 처음·끝 가로선 = 굵은 검정 2px**(표 폭 전체 — 구역 첫 줄 칸 `border-top`, 표 바깥 아래선 2px), + **구역 안 줄을 나누는 가로선 = 회색 `#bfc3c9`**(세로선은 검정 그대로). 칸은 오른쪽·아래 선만 그리므로 구역 끝에 닿는 칸(마지막 줄 + 거기까지 내려오는 구분·항목·병합 칸)은 + `markMeetSecEnds`(초기·`pj-meet-rows`·끌기 중 순서 바뀔 때)가 `.is-sec-end` 를 달아 아래선을 지운다 — 회색선과 굵은 선이 겹치지 않게. 표 머리 바로 아래 첫 구역은 머리 아래선 1px + 1px. ## 7. 추후 단계 diff --git a/tests/test_inout_mail_photo.py b/tests/test_inout_mail_photo.py index 2b95105..d1b7fb3 100644 --- a/tests/test_inout_mail_photo.py +++ b/tests/test_inout_mail_photo.py @@ -155,22 +155,27 @@ class GmailTests(unittest.TestCase): class MailPriceTests(unittest.TestCase): - """004 — 메일 본문에 금액(수량 × 단가)·PP(g/개)·은(Ag) 함유량(%·g)과 합계.""" + """004 — 메일 본문에 금액(수량 × 단가)·전체 무게(kg)·PP 사용량(kg)·은(Ag) 함유량(%·kg)과 합계(2026-10-19).""" def test_order_mail_prices(self): from decimal import Decimal as D o = _order() o["lines"][0].update(unit_price=D("85.5"), weight_g=D("24.5"), silver_pct=D("0.5")) m = s.order_mail(o, sender_name="K", sender_email="k@x.com") - for part in ("발주 금액: 427,500원 (단가 미입력 1종 제외)", "PP 총량: 122.5 kg", "은(Ag) 총량: 612.5 g", - "단가 85.5 · 금액 427,500 · PP 24.5g · 은 0.5% (0.1225g)", "단가 - · 금액 - · PP - · 은 -"): + # 5,000개 × 24.5g = 122.5kg, 은 = 122.5kg × 0.5% = 0.6125kg, PP 사용량 = 122.5 − 0.6125 = 121.8875 → 121.888 + for part in ("발주 금액: 427,500원 (단가 미입력 1종 제외)", "전체 무게: 122.5 kg", "PP 사용량: 121.888 kg", "은(Ag) 총량: 0.6125 kg", + "단가 85.5 · 금액 427,500 · 전체 무게 122.5kg · PP 사용량 121.888kg · 은 0.5% (0.6125kg)", + "단가 - · 금액 - · 전체 무게 - · PP 사용량 - · 은 -"): self.assertIn(part, m["text"]) h = m["html"] - for part in ("단가(원)", "금액(원)", "PP(g/개)", "은(Ag) 함유량", "427,500", "0.5% (0.1225g)", "122.5 kg", "612.5 g"): + for part in ("단가(원)", "금액(원)", "전체 무게(kg)", "PP 사용량(kg)", "은(Ag) 함유량", "427,500", "0.5% (0.6125kg)", + ">122.5<", ">121.888<", "0.6125 kg"): self.assertIn(part, h) + self.assertNotIn("PP(g/개)", h) + self.assertLess(h.index("PP 사용량(kg)"), h.index("은(Ag) 함유량")) # PP 사용량 열은 은 함유량 왼쪽 o2 = _order() # 단가가 하나도 없으면 금액 줄은 "-" t2 = s.order_mail(o2, sender_name="K", sender_email="k@x.com")["text"] - self.assertNotIn("PP 총량", t2) + self.assertNotIn("전체 무게:", t2) if __name__ == "__main__": diff --git a/tests/test_inout_web.py b/tests/test_inout_web.py index 56983cd..6fc0d8b 100644 --- a/tests/test_inout_web.py +++ b/tests/test_inout_web.py @@ -375,7 +375,8 @@ def body(c): assert "200,000" not in detail assert 'data-price="1500"' in c.get("/inout/orders/%d/edit" % oid).text or "1,500" in c.get("/inout/orders/%d/edit" % oid).text pv = c.get("/inout/orders/%d/mail" % oid).json() - for part in ("150,000", "PP(g/개)", "은(Ag) 함유량", "0.5% (0.1225g)", "2.48 kg", "12.25 g"): + # 메일 표(2026-10-19) — 전체 무게 = 개당 g × 수량(kg), PP 사용량 = 전체 − 은, 은 괄호 = 전체 무게 × %(kg) + for part in ("150,000", "전체 무게(kg)", "PP 사용량(kg)", "은(Ag) 함유량", "0.5% (0.0123kg)", ">2.48<", ">2.438<", "0.0123 kg"): assert part in pv["html"], part # ── 입고 담당: 품목은 제품 이름·발주 수량(+ 이번 입고)만 ──