feat(inout): 물류센터 이메일 옵션 · 입고 저장 뒤 입고 요청 메일(Gmail, 본문 안 사진 600px)
- 옵션 → 물류센터 탭: 물류센터 담당자 이메일·입고 요청 메일 참조(기본 king@·bj@dbxcorp.co.kr) - 입고 저장 → 미리보기 팝업 바로 → [메일 발송](입고 담당 본인 Gmail), 입고 기록 줄 보내기/다시 보내기 - 제목 "[입고 요청] yyyy년 mm월 dd일(요일) 입고 요청 합니다.", 본문 = 전산 등록 부탁 + 상품 이름·코드·입고 수량·비고 표 - 입고증 사진은 첨부가 아니라 본문 안 이미지(CID multipart/related), 가로 최대 600px·비율 유지로 줄임 - Gmail 연결 권한을 발주 담당 → 발주·입고 담당으로 - 마이그레이션 inout_db 005(inout_settings·inout_receipt_mails), 초기화 SQL 에도 반영 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<button type="button" role="tab" class="is-active" aria-selected="true" data-pane="roles">담당자</button>
|
||||
<button type="button" role="tab" aria-selected="false" data-pane="factories" tabindex="-1">공장 <span class="io-dlg-count">{{ factories|length }}</span></button>
|
||||
<button type="button" role="tab" aria-selected="false" data-pane="products" tabindex="-1">상품 정보 <span class="io-dlg-count">{{ products|length }}</span></button>
|
||||
<button type="button" role="tab" aria-selected="false" data-pane="logistics" tabindex="-1">물류센터</button>
|
||||
</div>
|
||||
|
||||
<section class="io-dlg-pane" data-pane="roles" role="tabpanel">
|
||||
@@ -126,4 +127,23 @@
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="io-dlg-pane" data-pane="logistics" role="tabpanel" hidden>
|
||||
{% if not settings_ready %}
|
||||
<p class="io-error">DB 마이그레이션 inout_db 005(물류센터 이메일·입고 요청 메일)가 아직 적용되지 않았습니다 — 관리자에게 알려 주세요.</p>
|
||||
{% endif %}
|
||||
<p class="io-help">
|
||||
입고 담당이 <b>입고 저장</b>을 누르면 물류센터 입고 담당자에게 보낼 <b>입고 요청 메일</b>(전산 등록 부탁 · 입고 상품 표 · 입고증 사진)을
|
||||
미리 보여 주고, [메일 발송]을 눌러 입고 담당 본인 Gmail 로 보냅니다. 아래 주소가 받는 사람·참조 칸에 미리 들어갑니다(보낼 때 고칠 수 있음).
|
||||
</p>
|
||||
<form method="post" action="/inout/settings/logistics" class="io-dlg-form io-logi-form">
|
||||
<label class="io-logi-field"><span>물류센터 담당자 이메일 <small>(받는 사람 — 여러 개는 쉼표)</small></span>
|
||||
<input class="io-in" type="text" inputmode="email" name="logistics_emails" value="{{ settings.logistics_emails }}" maxlength="1000"
|
||||
placeholder="logistics@example.com" aria-label="물류센터 담당자 이메일" /></label>
|
||||
<label class="io-logi-field"><span>입고 요청 메일 참조 <small>(여러 개는 쉼표)</small></span>
|
||||
<input class="io-in" type="text" inputmode="email" name="receipt_mail_cc" value="{{ settings.receipt_mail_cc }}" maxlength="1000"
|
||||
aria-label="입고 요청 메일 참조" /></label>
|
||||
<div class="io-dlg-actions"><button type="submit" class="erp-btn erp-btn-primary"{% if not settings_ready %} disabled{% endif %}>물류센터 저장</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<p class="io-dlg-foot">코드표(단품) 연결: {{ items_status }}</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
{% from "inout/_macros.html" import order_badge, progress, due, n, ymd %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261017c" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261019a" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="io">
|
||||
@@ -68,4 +68,4 @@
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261017a" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261019a" defer></script>{% endblock %}
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
{% extends "erp_base.html" %}
|
||||
{% from "inout/_macros.html" import status_badge, order_badge, progress, due, n, ymd, ymdhm %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261017c" />{% endblock %}
|
||||
{#- 메일 창(발주 메일 · 입고 요청 메일 같은 모양) — 열면 미리보기 GET, [메일 발송]을 눌러야 보낸다(inout.js initMail) -#}
|
||||
{%- macro mail_dialog(id, title, open_url='', open_title='') -%}
|
||||
<dialog class="io-dlg io-mail-dlg" id="{{ id }}" aria-labelledby="{{ id }}-title" tabindex="-1"
|
||||
{%- if open_url %} data-open-url="{{ open_url }}" data-open-title="{{ open_title }}"{% endif %}>
|
||||
<header class="io-dlg-head">
|
||||
<h2 id="{{ id }}-title" data-mail-title>{{ title }}</h2>
|
||||
<button type="button" class="io-dlg-x" data-close aria-label="닫기" title="닫기">
|
||||
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
||||
</button>
|
||||
</header>
|
||||
<p class="io-dlg-msg" role="status" hidden></p>
|
||||
<div class="io-dlg-body" data-mail-body><p class="erp-muted">불러오는 중…</p></div>
|
||||
<footer class="io-dlg-footbar" data-mail-foot hidden>
|
||||
<button type="button" class="io-link-btn" data-gmail-disconnect>Gmail 연결 끊기</button>
|
||||
<span class="io-nav-gap"></span>
|
||||
<button type="button" class="erp-btn erp-btn-outline" data-close>취소</button>
|
||||
<button type="button" class="erp-btn erp-btn-primary" data-mail-send>메일 발송</button>
|
||||
</footer>
|
||||
</dialog>
|
||||
{%- endmacro -%}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261019a" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set active = order.status in ('open', 'partial') %}
|
||||
@@ -150,7 +170,7 @@
|
||||
{% if order.receipts %}
|
||||
<div class="erp-table-wrap">
|
||||
<table class="erp-table io-table">
|
||||
<thead><tr><th>입고일</th><th>품목별 수량</th><th class="io-num">합계</th><th>입고증</th><th>입력</th>{% if photo_admin %}<th></th>{% endif %}</tr></thead>
|
||||
<thead><tr><th>입고일</th><th>품목별 수량</th><th class="io-num">합계</th><th>입고증</th><th>입력</th><th>입고 요청 메일</th>{% if photo_admin %}<th></th>{% endif %}</tr></thead>
|
||||
<tbody>
|
||||
{% for r in order.receipts %}
|
||||
<tr>
|
||||
@@ -174,6 +194,14 @@
|
||||
{% elif not r.photos %}<span class="erp-muted">-</span>{% endif %}
|
||||
</td>
|
||||
<td class="erp-muted">{{ r.created_by }}<div class="erp-row-sub">{{ ymdhm(r.created_at) }}</div></td>
|
||||
<td class="io-rmail-cell">
|
||||
{% if r.mails %}{% set lm = r.mails[-1] %}<span class="io-mail-sent">보냄 {{ ymdhm(lm.sent_at) }}</span>
|
||||
<div class="erp-row-sub">{{ lm.sent_by }}{% if r.mails|length > 1 %} · 모두 {{ r.mails|length }}번{% endif %}</div>{% endif %}
|
||||
{% if perms.can_receive %}<button type="button" class="erp-btn erp-btn-outline erp-btn-sm io-rmail-btn" aria-haspopup="dialog"
|
||||
data-url="/inout/orders/{{ order.id }}/receipts/{{ r.id }}/mail" data-title="입고 요청 메일 · {{ ymd(r.receipt_date) }} 입고 {{ n(r.total) }}개">
|
||||
{% if r.mails %}다시 보내기{% else %}보내기{% endif %}</button>
|
||||
{% elif not r.mails %}<span class="erp-muted">-</span>{% endif %}
|
||||
</td>
|
||||
{% if photo_admin %}
|
||||
<td><form method="post" action="/inout/orders/{{ order.id }}/receipts/{{ r.id }}/delete"
|
||||
data-erp-confirm="{{ ymd(r.receipt_date) }} 입고 {{ n(r.total) }}개 기록을 지울까요? 그만큼 다시 미입고가 되고 입고증 사진도 지워집니다.">
|
||||
@@ -205,23 +233,16 @@
|
||||
|
||||
{% if perms.can_order and not order.cancelled_at %}
|
||||
{# 발주 메일 — 열면 GET /inout/orders/{id}/mail 로 미리보기, [메일 발송]을 눌러야 보낸다(발주 담당 본인 Gmail) #}
|
||||
<dialog class="io-dlg io-mail-dlg" id="io-mail" aria-labelledby="io-mail-title" tabindex="-1">
|
||||
<header class="io-dlg-head">
|
||||
<h2 id="io-mail-title">발주 메일 보내기 · {{ order.order_no }}</h2>
|
||||
<button type="button" class="io-dlg-x" data-close aria-label="닫기" title="닫기">
|
||||
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
||||
</button>
|
||||
</header>
|
||||
<p class="io-dlg-msg" role="status" hidden></p>
|
||||
<div class="io-dlg-body" id="io-mail-body"><p class="erp-muted">불러오는 중…</p></div>
|
||||
<footer class="io-dlg-footbar" id="io-mail-foot" hidden>
|
||||
<button type="button" class="io-link-btn" id="io-gmail-disconnect">Gmail 연결 끊기</button>
|
||||
<span class="io-nav-gap"></span>
|
||||
<button type="button" class="erp-btn erp-btn-outline" data-close>취소</button>
|
||||
<button type="button" class="erp-btn erp-btn-primary" id="io-mail-send">메일 발송</button>
|
||||
</footer>
|
||||
</dialog>
|
||||
{{ mail_dialog('io-mail', '발주 메일 보내기 · ' ~ order.order_no) }}
|
||||
{% endif %}
|
||||
{% if perms.can_receive and order.receipts %}
|
||||
{# 입고 요청 메일(005) — 물류센터 입고 담당자에게 전산 등록 부탁(입고 담당 본인 Gmail). 입고 저장 뒤 ?rmail={입고 id} 면 바로 연다 #}
|
||||
{% set open_r = order.receipts | selectattr('id', 'equalto', open_rmail) | list if open_rmail else [] %}
|
||||
{% if open_r %}
|
||||
{{ mail_dialog('io-rmail', '입고 요청 메일', '/inout/orders/' ~ order.id ~ '/receipts/' ~ open_r[0].id ~ '/mail',
|
||||
'입고 요청 메일 · ' ~ ymd(open_r[0].receipt_date) ~ ' 입고 ' ~ n(open_r[0].total) ~ '개') }}
|
||||
{% else %}{{ mail_dialog('io-rmail', '입고 요청 메일') }}{% endif %}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261017a" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261019a" defer></script>{% endblock %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% extends "erp_base.html" %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261017c" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261019a" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="io">
|
||||
@@ -80,4 +80,4 @@
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261017a" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261019a" defer></script>{% endblock %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
{% from "inout/_macros.html" import due, n, ymd %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261017c" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261019a" />{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="io">
|
||||
@@ -88,4 +88,4 @@
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261017a" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/inout.js?v=20261019a" defer></script>{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user