feat(est-test): 갑지 공사금액 자동변경
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -489,6 +489,8 @@ ative-standard.js에 표준시장단가 원천(SilJukDat)과 내역 행(EstMainD
|
||||
- 남음: 구성비·요율 전환(CalcBase), 약어 표시(SName), 제비율 기준 문서 보기(원본 한글 파일).
|
||||
- [x] 수량산출서 검색·전체보기(원본 TFRMMULLANG btnSerch·btnAllDisplay — 빈칸·|·괄호 무시 포함 검색) — 고르기 줄을 `native-quantity-sheets.js` 로 옮겨 700줄 제한 유지.
|
||||
- 검증완료: `test_est_quantity_sheets.py` 검색 시험 포함 수량 시험 22개 통과. ORCA 브라우저에서 「집수」 검색 → 항목에 집수정이 있는 「배수」만·선택 이동, 전체보기 → 3개 복귀, 샘플 복구.
|
||||
- [x] 갑지 공사금액 자동변경(원본 TFRMGABGI popupCostChange) — 「공사금액 자동변경」 체크 시 고른 원가 비목·방식을 기억해 인쇄 때마다 현재 원가 금액으로 공사금액 글을 다시 만듦(다시 열면 고른 비목·방식 그대로).
|
||||
- 검증완료: 문서 시험 3개 통과. ORCA 브라우저에서 도급액 고정 풀고 자동변경 저장 → 수량 2배 뒤 인쇄 금액 「칠천구백육십만삼천삼백이십사원」→「팔천이백칠만사천팔백구십일원」, 저장 글은 그대로, 샘플 복구.
|
||||
- [x] 선택 행 예정공정표에 표시(원본 mnuShowSchedule) — 내역서에서 고른 상세 행만 공정표에 넣음(이미 있는 행은 건너뜀).
|
||||
- 검증완료: 바인딩·공정표 시험 통과. ORCA 브라우저에서 3행 고름 → 공정 3개, 다시 눌러도 3개, 샘플 복구.
|
||||
- [x] 셀복사·셀붙여넣기(원본 ActionCellCopy·ActionCellPaste) — 마지막으로 누른 칸의 열을 고른 행들(없으면 그 행)만큼 복사(시스템 클립보드에도 글자로), 다른 칸을 누르고 붙이면 그 행부터 아래로 차례로 넣음(열 달라도 됨, 수치 칸은 수치만, 코드·결과비목 칸 거부).
|
||||
|
||||
@@ -33,6 +33,15 @@ const EstDocs = (() => {
|
||||
? `${name} : 금${comma(cost)}원(금${korean(cost)}원)`
|
||||
: `${name} : 금 ${korean(cost)}원(₩${comma(cost)})`;
|
||||
}
|
||||
// 공사금액 자동변경(popupCostChange): 저장한 비목·방식으로 인쇄 때마다 현재 원가 금액으로 다시 만듦
|
||||
function cost(project, g) {
|
||||
if (!g.CostAuto?.indices?.length) return g.Cost;
|
||||
try {
|
||||
return costText(project, g.CostAuto.indices, g.CostAuto.method || 1);
|
||||
} catch {
|
||||
return g.Cost;
|
||||
}
|
||||
}
|
||||
function costText(project, indices, method) {
|
||||
const rows = project.tables.Wonga || [];
|
||||
const picked = indices.map((i) => rows[i]).filter(Boolean);
|
||||
@@ -98,7 +107,7 @@ const EstDocs = (() => {
|
||||
const gulga = g.Gulga.length
|
||||
? `<table class="sheet" style="float:right;margin-bottom:20px"><tr>${g.Gulga.map((n) => `<th>${esc(n)}</th>`).join("")}</tr><tr>${g.Gulga.map(() => "<td style='height:48px;min-width:60px'></td>").join("")}</tr></table>`
|
||||
: "";
|
||||
return `<div class="document-gabgi">${gulga}<p style="clear:both">${esc(g.Date)}</p>${g.Position ? `<p>공사위치 : ${esc(g.Position)}</p>` : ""}<h1 style="font-size:26pt;text-align:center;margin:40px 0">${esc(g.Name)}</h1>${g.Explan ? `<p>공사개요 :</p><pre class="document-text">${esc(g.Explan)}</pre>` : ""}${g.Cost ? `<p>공사금액 :</p><pre class="document-text">${esc(g.Cost)}</pre>` : ""}<p style="margin-top:60px;text-align:${align(g.CompanyPos)}">${esc(g.CompanyName)}</p></div>`;
|
||||
return `<div class="document-gabgi">${gulga}<p style="clear:both">${esc(g.Date)}</p>${g.Position ? `<p>공사위치 : ${esc(g.Position)}</p>` : ""}<h1 style="font-size:26pt;text-align:center;margin:40px 0">${esc(g.Name)}</h1>${g.Explan ? `<p>공사개요 :</p><pre class="document-text">${esc(g.Explan)}</pre>` : ""}${cost(project, g) ? `<p>공사금액 :</p><pre class="document-text">${esc(cost(project, g))}</pre>` : ""}<p style="margin-top:60px;text-align:${align(g.CompanyPos)}">${esc(g.CompanyName)}</p></div>`;
|
||||
}
|
||||
if (form === 10 || form === 11) {
|
||||
const d = doc(project, form === 10 ? "sibang" : "explan");
|
||||
@@ -141,7 +150,7 @@ const EstDocs = (() => {
|
||||
pos(d.CompanyPos) +
|
||||
area("Explan", "공사개요", d.Explan) +
|
||||
area("Cost", "공사금액", d.Cost, 3) +
|
||||
`<p>공사금액 자동입력: <select name="doc-rows" multiple size="4">${rows.map(([r, i]) => `<option value="${i}" ${i === fixed ? "selected" : ""}>${esc(r.Name)} ${EstApp.number(r.Cost)}</option>`).join("")}</select> <select name="doc-method"><option value="1">금 일천…원(₩…)</option><option value="2">금…원(금 일천…원)</option></select> <button data-action="doc-cost">공사금액 만들기</button></p>` +
|
||||
`<p>공사금액 자동입력: <select name="doc-rows" multiple size="4">${rows.map(([r, i]) => `<option value="${i}" ${(d.CostAuto?.indices ?? [fixed]).includes(i) ? "selected" : ""}>${esc(r.Name)} ${EstApp.number(r.Cost)}</option>`).join("")}</select> <select name="doc-method"><option value="1">금 일천…원(₩…)</option><option value="2" ${d.CostAuto?.method === 2 ? "selected" : ""}>금…원(금 일천…원)</option></select> <button data-action="doc-cost">공사금액 만들기</button> <label><input type="checkbox" name="doc-CostAuto" ${d.CostAuto ? "checked" : ""}> 공사금액 자동변경(원가가 바뀌면 인쇄 때 다시 만듦)</label></p>` +
|
||||
area("Gulga", "결재란(한 줄에 하나)", d.Gulga.join("\n"), 4);
|
||||
} else
|
||||
body =
|
||||
@@ -183,6 +192,12 @@ const EstDocs = (() => {
|
||||
CompanyPos: Number(value("CompanyPos")),
|
||||
Explan: value("Explan"),
|
||||
Cost: value("Cost"),
|
||||
CostAuto: field("doc-CostAuto")?.checked
|
||||
? {
|
||||
indices: [...field("doc-rows").selectedOptions].map((o) => Number(o.value)),
|
||||
method: Number(value("method")),
|
||||
}
|
||||
: null,
|
||||
Gulga: value("Gulga")
|
||||
.split(/\r?\n/)
|
||||
.map((l) => l.trim())
|
||||
|
||||
Reference in New Issue
Block a user