fix(cupang): 밀크런 출고리스트를 구글 드라이브 엑셀(.xlsx) 파일에 기록
- 출고리스트 문서(1J74op7lBZOgE27p4R28I3RWsv0EtXdii)는 구글 시트가 아니라 드라이브에 올린 .xlsx 라 Sheets API 로는 쓸 수 없었다 → app/integrations/drive_xlsx.py 추가: 내려받아 openpyxl 로 고친 뒤 같은 파일 id 에 다시 올림(GoogleSheetsWriter 와 같은 메서드, lock 블록 = 내려받기·올리기 1번씩) - 올리기 직전 파일 version 이 바뀌었으면 덮어쓰지 않고 처음부터 다시(최대 3번) - router._sheet_target: 드라이브에서 형식을 보고 xlsx/구글 시트 writer 선택, CUPANG_SHEET_ID 기본값 = 위 파일 (출고리스트 작성 팝업과 분배 확정·출고 삭제 동기화 모두 적용) - 팝업 문구 "구글 시트" → "출고리스트 엑셀", cupang-outbound.js 캐시 버전 올림 - 테스트: 가짜 Drive 에 진짜 xlsx 를 두고 덧붙이기·양식 생성·충돌 재시도·시트 삭제·범위 읽기·writer 선택 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* 쿠팡 밀크런 — 밀크런 출고리스트 작성 팝업(cupang/index.html).
|
||||
- 날짜 칸: 프로젝트 화면의 날짜 팝업(window.PJLib.enhanceDateInput)을 그대로 쓴다.
|
||||
- 입고센터: 출고리스트 구글 시트에 적힌 센터 + 설정에 등록된 센터(GET /cupang/api/outbound-sheet/centers).
|
||||
- 입고센터: 출고리스트 엑셀(구글 드라이브 .xlsx)에 적힌 센터 + 설정에 등록된 센터(GET /cupang/api/outbound-sheet/centers).
|
||||
- 제품: 코드표(itemcode_db) 전체 목록(GET /cupang/api/products/all)에서 코드·이름으로 찾아 추가.
|
||||
- [완료] → POST /cupang/api/outbound-sheet → 출고일 시트(YYYYMMDD(요일)) 맨 아래에 덧붙임. */
|
||||
(function () {
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
function updateTarget() {
|
||||
target.textContent = shipDate.value
|
||||
? "완료하면 구글 시트 '" + sheetTitle(shipDate.value) + "' 시트 맨 아래에 추가합니다. (시트가 없으면 양식째 새로 만듭니다)"
|
||||
? "완료하면 출고리스트 엑셀 '" + sheetTitle(shipDate.value) + "' 시트 맨 아래에 추가합니다. (시트가 없으면 양식째 새로 만듭니다)"
|
||||
: "출고일을 고르면 그 날짜 시트(YYYYMMDD(요일))에 추가합니다.";
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
})
|
||||
.then(function (res) {
|
||||
return res.json().catch(function () { return {}; }).then(function (data) {
|
||||
if (!res.ok) throw new Error(typeof data.detail === "string" ? data.detail : "구글 시트에 기록하지 못했습니다.");
|
||||
if (!res.ok) throw new Error(typeof data.detail === "string" ? data.detail : "출고리스트 파일에 기록하지 못했습니다.");
|
||||
return data;
|
||||
});
|
||||
})
|
||||
@@ -300,7 +300,7 @@
|
||||
var msg = "'" + data.title + "' 시트 " + data.first_row + "~" + data.last_row + "행에 " +
|
||||
data.line_count + "개 제품을 추가했습니다.";
|
||||
if (window.erpConfirm && data.url) {
|
||||
window.erpConfirm(msg + "\n구글 시트를 열어 볼까요?", { tone: "ok", okText: "시트 열기", cancelText: "닫기" })
|
||||
window.erpConfirm(msg + "\n출고리스트 엑셀을 열어 볼까요?", { tone: "ok", okText: "파일 열기", cancelText: "닫기" })
|
||||
.then(function (ok) { if (ok) window.open(data.url, "_blank", "noopener"); });
|
||||
} else {
|
||||
window.alert(msg);
|
||||
|
||||
Reference in New Issue
Block a user