feat(inout,project): 발주 메일 전체 무게·PP 사용량(kg) · 회의록 구역 굵은 선·줄 사이 회색 선
[입출고] - 발주 메일 표: PP(g/개) → 전체 무게(kg) = 개당 무게 × 수량 - PP 사용량(kg) 열 추가(은 함유량 왼쪽) = 전체 무게 − 은 무게 - 은 함유량 괄호 = 전체 무게 × %(kg), 합계·요약·글 본문도 kg [프로젝트] - 주간 회의록 표: 구역(구분) 처음·끝 가로선 굵은 검정, 구역 안 줄 사이 가로선 회색 - 구역 끝에 닿는 칸(병합 포함)은 markMeetSecEnds 로 아래선 정리 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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/개).
|
||||
|
||||
## 시각 / 날짜
|
||||
|
||||
|
||||
+33
-18
@@ -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'<tr><td style="{td}text-align:center">{i}</td><td style="{td}font-family:Consolas,monospace">{e(x["item_code"])}</td>'
|
||||
f'<td style="{td}">{e(x["item_name"])}</td><td style="{td}{r}">{int(x["qty"]):,}</td>'
|
||||
f'<td style="{td}{r}">{e(c["price"])}</td><td style="{td}{r}">{e(c["amount"])}</td>'
|
||||
f'<td style="{td}{r}">{e(c["pp"])}</td><td style="{td}{r}">{e(c["ag"])}</td>'
|
||||
f'<td style="{td}{r}">{e(c["weight"])}</td><td style="{td}{r}">{e(c["pp_use"])}</td><td style="{td}{r}">{e(c["ag"])}</td>'
|
||||
f'<td style="{td}">{e(x.get("memo") or "")}</td></tr>')
|
||||
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 = (
|
||||
'<div style="font-family:\'Malgun Gothic\',\'Apple SD Gothic Neo\',sans-serif;font-size:14px;color:#1d1d1f;line-height:1.6">'
|
||||
@@ -314,11 +324,13 @@ def order_mail(order: dict[str, Any], *, sender_name: str, sender_email: str) ->
|
||||
'<table style="border-collapse:collapse;min-width:640px">'
|
||||
f'<thead><tr style="{bg}"><th style="{td}">No</th><th style="{td}">제품 코드</th><th style="{td}">제품명</th>'
|
||||
f'<th style="{td}">수량</th><th style="{td}">단가(원)</th><th style="{td}">금액(원)</th>'
|
||||
f'<th style="{td}">PP(g/개)</th><th style="{td}">은(Ag) 함유량</th><th style="{td}">비고</th></tr></thead>'
|
||||
f'<th style="{td}">전체 무게(kg)</th><th style="{td}">PP 사용량(kg)</th><th style="{td}">은(Ag) 함유량</th>'
|
||||
f'<th style="{td}">비고</th></tr></thead>'
|
||||
f'<tbody>{"".join(rows)}</tbody>'
|
||||
f'<tfoot><tr><th colspan="3" style="{td}{bg}text-align:right">합계</th>'
|
||||
f'<th style="{td}{bg}{r}">{total:,}</th><th style="{td}{bg}"></th><th style="{td}{bg}{r}">{e(foot_amount)}</th>'
|
||||
f'<th style="{td}{bg}{r}">{e(foot_pp)}</th><th style="{td}{bg}{r}">{e(foot_ag)}</th><th style="{td}{bg}"></th></tr></tfoot></table>'
|
||||
f'<th style="{td}{bg}{r}">{e(foot_pp)}</th><th style="{td}{bg}{r}">{e(foot_use)}</th><th style="{td}{bg}{r}">{e(foot_ag)}</th>'
|
||||
f'<th style="{td}{bg}"></th></tr></tfoot></table>'
|
||||
"<p>입고 예정일까지 물류로 입고 부탁드리며, 일정이 바뀌면 회신 부탁드립니다.</p>"
|
||||
f'<p style="color:#555">발주 담당: {e(who)} (<a href="mailto:{e(sender_email)}">{e(sender_email)}</a>)</p></div>'
|
||||
)
|
||||
@@ -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:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block head_extra %}
|
||||
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
|
||||
{% endblock %}
|
||||
@@ -64,7 +64,7 @@
|
||||
</section>
|
||||
</div>
|
||||
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -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`(아래선 없음 — 다음 구역 굵은 선이 대신), 표 다시 그리기·끌기 뒤에도 다시 계산.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -298,5 +298,5 @@
|
||||
|
||||
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
|
||||
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -207,5 +207,5 @@
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -106,5 +106,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -100,5 +100,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -108,5 +108,5 @@
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -472,5 +472,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261019b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -70,5 +70,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261019a" defer></script>
|
||||
<script src="/static/project.js?v=20261019b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user