V20260210 #153

Merged
hjjeong merged 3 commits from V20260210 into main 2026-02-26 09:01:40 +00:00
5 changed files with 80 additions and 40 deletions

View File

@@ -500,7 +500,7 @@ function fn_Supply_save(){
}
}
// 구매요청서 확정 처리
// 구매요청서 확정 처리 (저장 후 확정)
function fn_confirm(){
var masterObjId = $("#SALES_REQUEST_MASTER_OBJID").val();
@@ -509,15 +509,28 @@ function fn_confirm(){
return;
}
// 품목이 있는지 확인
if($("#partListArea tr").length < 1){
Swal.fire("품목이 없습니다. 먼저 품목을 추가하고 저장해주세요.");
return;
}
if(!fnc_validate("form1")){
return;
}
var zeroQty = false;
$("input[name*=QTY]").each(function(){
if ($(this).val() == 0){
Swal.fire('수량이 0 입니다.');
zeroQty = true;
return false;
}
});
if(zeroQty) return;
Swal.fire({
title: '확정',
text: '확정하시겠습니까? 확정 후에는 수정이 불가능합니다.',
text: '현재 내용을 저장하고 확정하시겠습니까? 확정 후에는 수정이 불가능합니다.',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#5cb85c',
@@ -526,29 +539,46 @@ function fn_confirm(){
cancelButtonText: '취소'
}).then((result) => {
if (result.isConfirmed) {
// 폼 데이터를 먼저 저장
$.ajax({
type: "POST",
url: "/salesMng/confirmSalesRequest.do",
data: { "SALES_REQUEST_MASTER_OBJID": masterObjId },
url: "/salesMng/saveSalesRequestInfo.do",
data: $("#form1").serialize(),
dataType: "json",
success: function(data){
if(data.result){
Swal.fire({
title: '완료',
text: '확정되었습니다.',
icon: 'success'
}).then(() => {
if(typeof opener.fn_search == "function"){
opener.fn_search();
success: function(saveData){
if(saveData.result !== false){
// 저장 성공 → 확정 처리
$.ajax({
type: "POST",
url: "/salesMng/confirmSalesRequest.do",
data: { "SALES_REQUEST_MASTER_OBJID": masterObjId },
dataType: "json",
success: function(data){
if(data.result){
Swal.fire({
title: '완료',
text: '저장 및 확정되었습니다.',
icon: 'success'
}).then(() => {
if(typeof opener.fn_search == "function"){
opener.fn_search();
}
self.close();
});
} else {
Swal.fire('오류', data.msg || '확정 처리 중 오류가 발생했습니다.', 'error');
}
},
error: function(jqxhr, status, error){
Swal.fire('오류', '확정 처리 중 오류가 발생했습니다.', 'error');
}
self.close();
});
} else {
Swal.fire('오류', data.msg || '확정 처리 중 오류가 발생했습니다.', 'error');
Swal.fire('오류', saveData.msg || '저장 중 오류가 발생했습니다.', 'error');
}
},
error: function(jqxhr, status, error){
Swal.fire('오류', '서버 통신 중 오류가 발생했습니다.', 'error');
Swal.fire('오류', '저장 중 오류가 발생했습니다.', 'error');
}
});
}

View File

@@ -3476,7 +3476,7 @@ WHERE 1=1
</choose>
</if>
ORDER BY POM.REGDATE DESC
ORDER BY POM.REGDATE DESC, SPLIT_PART( PURCHASE_ORDER_NO, '-', 3)::NUMERIC DESC
</select>
<select id="purchaseOrderMasterList_new_old" parameterType="map" resultType="map">

View File

@@ -684,7 +684,7 @@ VALUES
WHEN CM.CUSTOMER_OBJID LIKE 'C_%' THEN (SELECT CLIENT_NM FROM CLIENT_MNG WHERE 'C_' || OBJID::VARCHAR = CM.CUSTOMER_OBJID)
ELSE SM.SUPPLY_NAME
END AS CUSTOMER_NAME,
COALESCE(SM.OBJID::VARCHAR, CM.CUSTOMER_OBJID) AS CUSTOMER_OBJID, -- 고객사 OBJID (드롭다운 선택용)
COALESCE(SM.OBJID::VARCHAR, CM.CUSTOMER_OBJID) AS CONTRACT_CUSTOMER_OBJID, -- 계약서 기반 고객사 (참고용)
PM.MECHANICAL_TYPE,
SRM.RELEASE_DATE,
SRM.REQUEST_REASONS,

View File

@@ -374,8 +374,12 @@ public class SalesMngController {
code_map.put("order_type",commonService.bizMakeOptionList("0001406", (String)resultMap.get("ORDER_TYPE"),"common.getCodeselect"));
//제품구분 (PRODUCT_NAME) - 0000001 사용
code_map.put("product_name",commonService.bizMakeOptionList("0000001", (String)resultMap.get("PRODUCT_NAME"),"common.getCodeselect"));
//제품유형 (CATEGORY_CD) - 0000167 사용
code_map.put("category_cd",commonService.bizMakeOptionList("0000167", (String)resultMap.get("CATEGORY_CD"),"common.getCodeselect"));
//주문유형 (CATEGORY_CD) - 0000167 사용, 저장된 ORDER_TYPE 값을 우선 사용
String orderTypeForSelect = CommonUtils.checkNull((String)resultMap.get("ORDER_TYPE"));
if("".equals(orderTypeForSelect)){
orderTypeForSelect = (String)resultMap.get("CATEGORY_CD");
}
code_map.put("category_cd",commonService.bizMakeOptionList("0000167", orderTypeForSelect,"common.getCodeselect"));
//유/무상 (PAID_TYPE) - COMM_CODE에서 조회 시도, 없으면 하드코딩
String paidTypeOptions = "";
try {

View File

@@ -2276,12 +2276,17 @@ public class ApprovalService {
// 비고(합계 요약)
html.append("<table style='width:100%; border-collapse:collapse;'>");
html.append("<tr><td rowspan='3' " + TH + " style='width:30px; writing-mode:vertical-rl;'>비고</td>");
html.append("<td " + TH + ">공급가액 합계</td><td " + TD_R + " style='width:150px;'>").append(formatNumber(supplyPrice)).append("</td>");
html.append("<td rowspan='3' " + TD_C + ">").append(vatNote).append("</td></tr>");
html.append("<tr><td " + TH + ">부가가치세</td><td " + TD_R + ">").append(formatNumber(vat)).append("</td></tr>");
html.append("<tr><td " + TH + ">총 계</td><td " + TD_R + " style='font-weight:bold;'>").append(formatNumber(totalAmount)).append("</td></tr>");
html.append("<tr><td rowspan='3' " + TH + " style='width:40px; writing-mode:vertical-rl; letter-spacing:8px; font-size:13px;'>비 고</td>");
html.append("<td rowspan='3' " + TD + "></td>");
html.append("<td " + TH + " style='width:120px; letter-spacing:2px;'>공 급 가 액 합 계</td><td " + TD_R + " style='width:150px;'>").append(formatNumber(supplyPrice)).append("</td></tr>");
html.append("<tr><td " + TH + " style='letter-spacing:2px;'>부 가 가 치 세</td><td " + TD_R + ">").append(formatNumber(vat)).append("</td></tr>");
html.append("<tr><td " + TH + " style='letter-spacing:5px;'>총 계</td><td " + TD_R + " style='font-weight:bold;'>").append(formatNumber(totalAmount)).append("</td></tr>");
html.append("</table>");
// 하단 부가세 구분 + 날짜
html.append("<div style='display:flex; justify-content:space-between; padding:3px 5px; font-size:11px; border:1px solid #999; border-top:none;'>");
html.append("<span>").append(vatNote).append("</span>");
html.append("<span>").append(escapeHtml(CommonUtils.checkNull(orderInfo.get("REG_DATETIME")))).append("</span>");
html.append("</div>");
html.append("</div>");
@@ -2393,13 +2398,17 @@ public class ApprovalService {
// 비고
html.append("<table>");
html.append("<tr><td class='vl' rowspan='3'>비<br/>고</td>");
html.append("<th style='width:100px;'>공급가액 합계</th><td class='right' style='width:140px;'>").append(formatNumber(supplyPrice)).append("</td>");
html.append("<td rowspan='3' class='center'>").append(vatNote).append("</td>");
html.append("<td rowspan='3' style='text-align:right; vertical-align:bottom; font-size:10px;'>").append(regDatetime).append("</td></tr>");
html.append("<tr><th>부 가 가 치 세</th><td class='right'>").append(formatNumber(vat)).append("</td></tr>");
html.append("<tr><th>총 계</th><td class='right' style='font-weight:bold;'>").append(formatNumber(totalAmount)).append("</td></tr>");
html.append("<tr><td class='vl' rowspan='3' style='letter-spacing:8px; font-size:13px;'>비 고</td>");
html.append("<td rowspan='3'></td>");
html.append("<th style='width:120px; letter-spacing:2px;'>공 급 가 액 합 계</th><td class='right' style='width:150px;'>").append(formatNumber(supplyPrice)).append("</td></tr>");
html.append("<tr><th style='letter-spacing:2px;'>부 가 가 치 세</th><td class='right'>").append(formatNumber(vat)).append("</td></tr>");
html.append("<tr><th style='letter-spacing:5px;'>총 계</th><td class='right' style='font-weight:bold;'>").append(formatNumber(totalAmount)).append("</td></tr>");
html.append("</table>");
// 하단 부가세 구분 + 날짜
html.append("<div style='display:flex; justify-content:space-between; padding:3px 5px; font-size:11px; border:1px solid #000; border-top:none;'>");
html.append("<span>").append(vatNote).append("</span>");
html.append("<span>").append(regDatetime).append("</span>");
html.append("</div>");
html.append("</body></html>");
@@ -2562,10 +2571,9 @@ public class ApprovalService {
html.append("<table class='info-table' style='margin-bottom:15px;'>");
html.append("<tr><th style='width:15%'>견적번호</th><td style='width:35%'>").append(estimateNo).append("</td>");
html.append("<th style='width:15%'>영업번호</th><td style='width:35%'>").append(contractNo).append("</td></tr>");
html.append("<tr><th>고객사</th><td>").append(customerName).append("</td>");
html.append("<tr><th>수신처</th><td>").append(customerName).append("</td>");
html.append("<th>작성일</th><td>").append(regdate).append("</td></tr>");
html.append("<tr><th>수신</th><td>").append(recipient).append("</td>");
html.append("<th>담당자</th><td>").append(contactPerson).append("</td></tr>");
html.append("<tr><th>담당자</th><td>").append(contactPerson).append("</td>");
html.append("<tr><th>작성자</th><td>").append(writerName).append("</td>");
html.append("<th>모델명</th><td>").append(modelName).append("</td></tr>");
@@ -2682,15 +2690,13 @@ public class ApprovalService {
html.append("<td ").append(TD_HEADER).append(" width='15%'>영업번호</td>");
html.append("<td ").append(TD_VALUE).append(" width='35%'>").append(escapeHtml(contractNo)).append("</td></tr>");
html.append("<tr><td ").append(TD_HEADER).append(">고객사</td>");
html.append("<tr><td ").append(TD_HEADER).append(">수신처</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(customerName)).append("</td>");
html.append("<td ").append(TD_HEADER).append(">작성일</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(regdate)).append("</td></tr>");
html.append("<tr><td ").append(TD_HEADER).append(">수신</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(recipient)).append("</td>");
html.append("<td ").append(TD_HEADER).append(">담당자</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(contactPerson)).append("</td></tr>");
html.append("<tr><td ").append(TD_HEADER).append(">담당자</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(contactPerson)).append("</td>");
html.append("<tr><td ").append(TD_HEADER).append(">작성자</td>");
html.append("<td ").append(TD_VALUE).append(">").append(escapeHtml(writerName)).append("</td>");