- inout_db 003: 공장 이메일, 사람별 Gmail 연결(갱신 토큰 암호문만), 발주 메일 기록, 입고증 사진(bytea). init 에도 같게.
- 발주 메일: 새 발주서 저장 → 미리보기 팝업(받는 사람 = 공장 이메일, 요약 표 HTML + 글 본문) → 사람이 [메일 발송]을
눌러야 Gmail API(gmail.send)로 본인 Gmail 에서 발송. [Gmail 연결]은 사람마다 1회 — 고른 구글 계정 = ERP 계정 확인,
APP_ENCRYPTION_KEY(AES-GCM, AAD inout:gmail:{email})로 암호화 저장. 보낸 기록, 재발송은 확인 후(resend),
연결 끊김(invalid_grant)은 토큰 삭제 후 재연결 안내.
- 입고증 사진: 입고 저장 때 첨부(브라우저가 긴 변 2000px JPEG 로 줄임 — 7.9MB → 0.8MB), 10장·10MB, 파일 머리로 형식 검사,
입고와 한 트랜잭션. 썸네일·크게 보기(←/→)·나중에 더하기·지우기, 보기는 nosniff·CSP sandbox. 초과 확인은 브라우저가 먼저(사진 유지).
- 테스트: 메일 본문·escape·받는 주소·Gmail 연결 검사·토큰 갱신/발송(가짜 구글)·암호화, 사진 검사, 실제 PostgreSQL 저장,
실제 앱 흐름(사진 업로드·보기 헤더·권한, 메일 미리보기·연결·발송·재발송·끊김). 실제 브라우저로 팝업·사진·축소 확인.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
<pclass="io-help">발주서에서 고르는 공장(발주처)입니다. 발주 기록이 있는 공장은 지우지 말고 <b>사용</b>을 끄면 목록에서 숨겨집니다.</p>
<pclass="io-help">발주서에서 고르는 공장(발주처)입니다.<b>이메일</b>은 발주 메일을 받을 주소(여러 개는 쉼표). 발주 기록이 있는 공장은 지우지 말고 <b>사용</b>을 끄면 목록에서 숨겨집니다.</p>
{% for f in factories %}<formmethod="post"action="/inout/settings/factories"id="io-f{{ f.id }}"class="io-dlg-form"><inputtype="hidden"name="id"value="{{ f.id }}"/></form>{% endfor %}
<thead><tr><th>공장 이름</th><th>담당자</th><th>연락처</th><thtitle="발주 메일을 받을 주소 — 여러 개는 쉼표로">이메일</th><th>메모</th><thclass="io-c">순서</th><thclass="io-c">사용</th><thclass="io-c">발주</th><th></th></tr></thead>
{% if receiving %}<spanclass="erp-muted">물류에 들어온 수량을 [이번 입고]에 넣고 저장 — 여러 번 나눠 넣어도 됩니다</span>
@@ -64,9 +71,12 @@
<divclass="io-over-box"role="alert">
<b>발주보다 많이 입고하려고 합니다.</b> 맞으면 [초과 입고로 저장]을 누르세요.
<ul>{% for o in over %}<li><spanclass="io-code">{{ o.item_code }}</span> {{ o.item_name }} — 발주 {{ n(o.ordered) }}개, 입고 후 {{ n(o.after) }}개 (<b>+{{ n(o.over) }}</b>)</li>{% endfor %}</ul>
{% if photos_lost %}<pclass="io-photo-lost">고른 입고증 사진은 다시 첨부해야 합니다(화면이 다시 열리면서 빠졌습니다).</p>{% endif %}
<spanclass="erp-muted">숫자를 고치려면 아래 칸을 고친 뒤 [입고 저장]</span>
</div>
{% elif photos_lost %}
<pclass="io-error">고른 입고증 사진은 다시 첨부해야 합니다(화면이 다시 열리면서 빠졌습니다).</p>
{% endif %}
<divclass="erp-table-wrap">
@@ -84,7 +94,8 @@
<tdclass="io-num{% if ln.remaining and active %} io-remaining{% endif %}">{{ n(ln.remaining) }}{% if ln.over %}<divclass="io-over-sub">초과 +{{ n(ln.over) }}</div>{% endif %}</td>
<thead><tr><th>입고일</th><th>품목별 수량</th><thclass="io-num">합계</th><th>입력</th>{% if perms.can_receive and not order.cancelled_at %}<th></th>{% endif %}</tr></thead>
<thead><tr><th>입고일</th><th>품목별 수량</th><thclass="io-num">합계</th><th>입고증</th><th>입력</th>{% if photo_admin %}<th></th>{% endif %}</tr></thead>
<tbody>
{% for r in order.receipts %}
<tr>
<td>{{ r.receipt_date.strftime('%Y-%m-%d') }}{% if r.memo %}<divclass="erp-row-sub">{{ r.memo }}</div>{% endif %}</td>
<td>{% for x in r.lines %}<spanclass="io-chip"><spanclass="io-code">{{ x.item_code }}</span> {{ n(x.qty) }}</span>{% endfor %}</td>
{% if photo_admin %}<formmethod="post"id="io-viewer-del"data-erp-confirm="이 입고증 사진을 지울까요?"><buttontype="submit"class="io-viewer-btn">지우기</button></form>{% endif %}
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.