Compare commits
17 Commits
V202603190
...
V20260210
| Author | SHA1 | Date | |
|---|---|---|---|
| ed261664ef | |||
| c4eeec1450 | |||
| 5542f00ea2 | |||
| 24036b9abd | |||
| fa6021d77b | |||
| 791d1e2ae8 | |||
| 58fe844597 | |||
| 347ece6a6c | |||
| d422b68d78 | |||
| 06b5a2a04d | |||
| a82b944d5d | |||
| 47747b6df3 | |||
| c3cc8eaf99 | |||
| 4bca46816f | |||
| 4ad2f8d7bc | |||
| 3330cf5c62 | |||
| 7c540d109b |
@@ -1168,6 +1168,21 @@
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<!-- arrival_plan 마감정보 저장 -->
|
||||
<update id="saveArrivalPlanDeadlineInfo" parameterType="map">
|
||||
/* purchaseOrder.saveArrivalPlanDeadlineInfo - 입고건별 마감정보 저장 */
|
||||
UPDATE arrival_plan SET
|
||||
tax_type = #{taxType}
|
||||
<if test="taxInvoiceDate != null and taxInvoiceDate != ''">, tax_invoice_date = #{taxInvoiceDate}</if>
|
||||
<if test="exportDeclNo != null">, export_decl_no = #{exportDeclNo}</if>
|
||||
<if test="loadingDate != null and loadingDate != ''">, loading_date = #{loadingDate}</if>
|
||||
<if test="foreignType != null and foreignType != ''">, foreign_type = #{foreignType}</if>
|
||||
<if test="duty != null and duty != ''">, duty = CAST(#{duty} AS NUMERIC)</if>
|
||||
<if test="exchangeRate != null and exchangeRate != ''">, exchange_rate = CAST(#{exchangeRate} AS NUMERIC)</if>
|
||||
<if test="importVat != null and importVat != ''">, import_vat = CAST(#{importVat} AS NUMERIC)</if>
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<update id="updatePurchaseOrderMasterPriceAll" parameterType="map">
|
||||
UPDATE PURCHASE_ORDER_MASTER SET
|
||||
TOTAL_PRICE_TXT_ALL = NUM_TO_KOR((T.REAL_SUPPLY_PRICE_VAT)::varchar,'일금 ',' 원정 (₩ ') || TRIM(TO_CHAR((T.REAL_SUPPLY_PRICE_VAT), '999,999,999,999')) ||')'
|
||||
@@ -6608,6 +6623,18 @@ FROM(
|
||||
<!-- 매입마감일 (입고건 단위) -->
|
||||
,AP.PURCHASE_CLOSE_DATE
|
||||
|
||||
<!-- 마감정보 -->
|
||||
,COALESCE(AP.tax_type, '') AS TAX_TYPE
|
||||
,COALESCE((SELECT CODE_NAME FROM COMM_CODE CC WHERE CC.CODE_ID = AP.tax_type), '') AS TAX_TYPE_NAME
|
||||
,COALESCE(AP.tax_invoice_date, '') AS TAX_INVOICE_DATE
|
||||
,COALESCE(AP.export_decl_no, '') AS EXPORT_DECL_NO
|
||||
,COALESCE(AP.loading_date, '') AS LOADING_DATE
|
||||
,COALESCE(AP.foreign_type, '') AS FOREIGN_TYPE
|
||||
,COALESCE((SELECT CODE_NAME FROM COMM_CODE CC WHERE CC.CODE_ID = AP.foreign_type), '') AS FOREIGN_TYPE_NAME
|
||||
,COALESCE(AP.duty, 0) AS DUTY
|
||||
,COALESCE(AP.exchange_rate, 0) AS EXCHANGE_RATE
|
||||
,COALESCE(AP.import_vat, 0) AS IMPORT_VAT
|
||||
|
||||
FROM ARRIVAL_PLAN AP
|
||||
INNER JOIN PURCHASE_ORDER_MASTER POM ON POM.OBJID = AP.PARENT_OBJID
|
||||
INNER JOIN PURCHASE_ORDER_PART POP ON POP.PURCHASE_ORDER_MASTER_OBJID = POM.OBJID::VARCHAR
|
||||
|
||||
@@ -243,20 +243,20 @@
|
||||
,#{class1} /* */
|
||||
,#{class2} /* */
|
||||
,#{goodsGuarantee}:: INTEGER /* 보증기간 */
|
||||
,#{costAmt}:: BIGINT /* 판매금액 */
|
||||
,#{saleAmt}:: BIGINT /* */
|
||||
,#{saftyQty}:: BIGINT /* */
|
||||
,#{royalty}:: BIGINT /* */
|
||||
,#{costAmt}:: NUMERIC /* 판매금액 */
|
||||
,#{saleAmt}:: NUMERIC /* */
|
||||
,#{saftyQty}:: NUMERIC /* */
|
||||
,#{royalty}:: NUMERIC /* */
|
||||
,#{regYmd} /* 등록일자 */
|
||||
,#{delYmd} /* 단종일자 */
|
||||
,#{remark} /* 비고 */
|
||||
,#{commiYn} /* 판매수수료적용여부 */
|
||||
,#{commiGb} /* 방식/수식 */
|
||||
,#{commiGive} /* */
|
||||
,#{cCommiPer}:: BIGINT /* 크레인(%) */
|
||||
,#{tCommiPer}:: BIGINT /* 특장(%) */
|
||||
,#{cCommiAmt}:: BIGINT /* 크레인(금액) */
|
||||
,#{tCommiAmt}:: BIGINT /* 특장(금액) */
|
||||
,#{cCommiPer}:: NUMERIC /* 크레인(%) */
|
||||
,#{tCommiPer}:: NUMERIC /* 특장(%) */
|
||||
,#{cCommiAmt}:: NUMERIC /* 크레인(금액) */
|
||||
,#{tCommiAmt}:: NUMERIC /* 특장(금액) */
|
||||
,#{gb1} /* 영업소 */
|
||||
,now() /* 생성일시 */
|
||||
,#{cretEmpNo} /* 생성자 */
|
||||
@@ -276,20 +276,20 @@
|
||||
,Class1 = #{class1} /* */
|
||||
,Class2 = #{class2} /* */
|
||||
,GoodsGuarantee = #{goodsGuarantee}:: INTEGER /* 보증기간 */
|
||||
,Cost_Amt = #{costAmt}:: BIGINT /* 판매금액 */
|
||||
,Sale_Amt = #{saleAmt}:: BIGINT /* */
|
||||
,SaftyQty = #{saftyQty}:: BIGINT /* */
|
||||
,Royalty = #{royalty}:: BIGINT /* */
|
||||
,Cost_Amt = #{costAmt}:: NUMERIC /* 판매금액 */
|
||||
,Sale_Amt = #{saleAmt}:: NUMERIC /* */
|
||||
,SaftyQty = #{saftyQty}:: NUMERIC /* */
|
||||
,Royalty = #{royalty}:: NUMERIC /* */
|
||||
,RegYmd = #{regYmd} /* 등록일자 */
|
||||
,DelYmd = #{delYmd} /* 단종일자 */
|
||||
,Remark = #{remark} /* 비고 */
|
||||
,CommiYN = #{commiYn} /* 판매수수료적용여부 */
|
||||
,CommiGB = #{commiGb} /* 방식/수식 */
|
||||
,CommiGive = #{commiGive} /* */
|
||||
,CCommiPer = #{cCommiPer}:: BIGINT /* 크레인(%) */
|
||||
,TCommiPer = #{tCommiPer}:: BIGINT /* 특장(%) */
|
||||
,CCommiAmt = #{cCommiAmt}:: BIGINT /* 크레인(금액) */
|
||||
,TCommiAmt = #{tCommiAmt}:: BIGINT /* 특장(금액) */
|
||||
,CCommiPer = #{cCommiPer}:: NUMERIC /* 크레인(%) */
|
||||
,TCommiPer = #{tCommiPer}:: NUMERIC /* 특장(%) */
|
||||
,CCommiAmt = #{cCommiAmt}:: NUMERIC /* 크레인(금액) */
|
||||
,TCommiAmt = #{tCommiAmt}:: NUMERIC /* 특장(금액) */
|
||||
,GB1 = #{gb1} /* 영업소 */
|
||||
,EDIT_DATE = now() /* 수정일시 */
|
||||
,EditEmpNo = #{cretEmpNo} /* 수정자 */
|
||||
|
||||
@@ -66,7 +66,21 @@
|
||||
*/
|
||||
}
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
if($(this).attr("id") === "facility_qty") {
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
});
|
||||
$("input:text[numberOnly]").on("blur", function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
if($(this).attr("id") === "facility_qty") {
|
||||
$(this).val(formatInteger(removeComma(val)));
|
||||
} else {
|
||||
$(this).val(formatMoney(removeComma(val)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.select2').select2();
|
||||
@@ -153,7 +167,7 @@
|
||||
});
|
||||
|
||||
function addComma(data) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return formatMoney(data);
|
||||
}
|
||||
|
||||
function fnc_setFileDropZone2(divId, targetObjId, docType, docTypeName,
|
||||
@@ -457,7 +471,7 @@
|
||||
}
|
||||
|
||||
function fnc_numberOnly(obj) {
|
||||
$("#" + obj.attr("id")).val(addComma(obj.val().replace(/[^0-9]/g, "")));
|
||||
$("#" + obj.attr("id")).val(fnc_addComma(obj.val().replace(/[^0-9.]/g, "")));
|
||||
//.replace(/[^0-9]/g,""))
|
||||
}
|
||||
|
||||
@@ -677,7 +691,7 @@
|
||||
<td class="input_title"><label for="">수주가</label></td>
|
||||
<td class="input_sub_title" colspan="2"><input type="text"
|
||||
name="contract_price_currency" id="contract_price_currency"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE_CURRENCY}" pattern="#,###" />"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE_CURRENCY}" pattern="#,##0.00" />"
|
||||
reqTitle="수주가(통화)" numberOnly /></td>
|
||||
|
||||
</tr>
|
||||
@@ -685,7 +699,7 @@
|
||||
<td class="input_title"><label for="">원화 환산금액</label></td>
|
||||
<td class="input_sub_title" colspan="2"><input type="text"
|
||||
name="contract_price" id="contract_price"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE}" pattern="#,###" />"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE}" pattern="#,##0.00" />"
|
||||
reqTitle="원화 환산금액" numberOnly /></td>
|
||||
<td class="input_title"><label for=""></label></td>
|
||||
<td class="input_sub_title" colspan="2"></td>
|
||||
|
||||
@@ -68,7 +68,21 @@
|
||||
|
||||
// 숫자만 입력 처리
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") {
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
});
|
||||
$("input:text[numberOnly]").on("blur", function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") {
|
||||
$(this).val(formatInteger(removeComma(val)));
|
||||
} else {
|
||||
$(this).val(formatMoney(removeComma(val)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.select2').select2();
|
||||
@@ -117,7 +131,7 @@
|
||||
});
|
||||
|
||||
function addComma(data) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return formatMoney(data);
|
||||
}
|
||||
|
||||
function removeComma(data) {
|
||||
@@ -125,14 +139,21 @@
|
||||
return data.toString().replace(/,/g, "");
|
||||
}
|
||||
|
||||
var isSaving = false;
|
||||
|
||||
function fn_save() {
|
||||
if(isSaving) return false;
|
||||
|
||||
if (fnc_valitate("form1")) {
|
||||
// 품목 유효성 검사
|
||||
if(!fn_validateItems()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(confirm("등록하시겠습니까?")) {
|
||||
isSaving = true;
|
||||
$("#btnSave").prop("disabled", true);
|
||||
|
||||
// 품목 데이터 수집
|
||||
var itemsData = fn_collectItemsData();
|
||||
console.log("최종 전송 데이터:", JSON.stringify(itemsData, null, 2));
|
||||
@@ -163,6 +184,8 @@
|
||||
},
|
||||
error : function(jqxhr, status, error) {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
isSaving = false;
|
||||
$("#btnSave").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -195,12 +218,6 @@
|
||||
$row.find(".item-order-quantity").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(orderUnitPrice == "" || orderUnitPrice == "0") {
|
||||
alert((i+1) + "번째 품목의 수주단가를 입력해주세요.");
|
||||
$row.find(".item-order-unit-price").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -321,7 +338,7 @@
|
||||
|
||||
// 수주단가
|
||||
html += '<td style="padding:5px; border:1px solid #ddd;">';
|
||||
html += '<input type="text" name="item_order_unit_price[]" class="item-order-unit-price" style="width:90%; padding:5px;" required numberOnly />';
|
||||
html += '<input type="text" name="item_order_unit_price[]" class="item-order-unit-price" style="width:90%; padding:5px;" numberOnly />';
|
||||
html += '</td>';
|
||||
|
||||
// 수주공급가액 (자동계산 + 수정가능)
|
||||
@@ -369,7 +386,11 @@
|
||||
|
||||
// 숫자만 입력 처리 및 금액 계산
|
||||
$("#" + itemId + " .item-order-quantity, #" + itemId + " .item-order-unit-price, #" + itemId + " .item-order-supply-price, #" + itemId + " .item-order-vat, #" + itemId + " .item-order-total-amount").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
if($(this).hasClass("item-order-quantity")) {
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
|
||||
// 수주 금액 계산
|
||||
if($(this).hasClass("item-order-quantity") || $(this).hasClass("item-order-unit-price")) {
|
||||
@@ -420,7 +441,7 @@
|
||||
}
|
||||
|
||||
// 수주 정보 설정
|
||||
if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(addComma(existingData.orderQuantity));
|
||||
if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(formatInteger(existingData.orderQuantity));
|
||||
if(existingData.orderUnitPrice) $("#" + itemId + " .item-order-unit-price").val(addComma(existingData.orderUnitPrice));
|
||||
if(existingData.orderSupplyPrice) $("#" + itemId + " .item-order-supply-price").val(addComma(existingData.orderSupplyPrice));
|
||||
if(existingData.orderVat) $("#" + itemId + " .item-order-vat").val(addComma(existingData.orderVat));
|
||||
@@ -521,13 +542,13 @@
|
||||
// 수주 정보 (Machine이고 프로젝트가 있으면 수량 readonly)
|
||||
html += '<td style="padding:5px; border:1px solid #ddd;">';
|
||||
if(isMachine && hasProject) {
|
||||
html += '<input type="text" name="item_order_quantity[]" class="item-order-quantity" style="width:90%; padding:5px; background:#f5f5f5;" required numberOnly readonly title="Machine 제품은 프로젝트 생성 후 수량 변경이 불가능합니다." value="' + (orderQuantity ? addComma(orderQuantity) : '') + '" />';
|
||||
html += '<input type="text" name="item_order_quantity[]" class="item-order-quantity" style="width:90%; padding:5px; background:#f5f5f5;" required numberOnly readonly title="Machine 제품은 프로젝트 생성 후 수량 변경이 불가능합니다." value="' + (orderQuantity ? formatInteger(orderQuantity) : '') + '" />';
|
||||
} else {
|
||||
html += '<input type="text" name="item_order_quantity[]" class="item-order-quantity" style="width:90%; padding:5px;" required numberOnly value="' + (orderQuantity ? addComma(orderQuantity) : '') + '" />';
|
||||
html += '<input type="text" name="item_order_quantity[]" class="item-order-quantity" style="width:90%; padding:5px;" required numberOnly value="' + (orderQuantity ? formatInteger(orderQuantity) : '') + '" />';
|
||||
}
|
||||
html += '</td>';
|
||||
html += '<td style="padding:5px; border:1px solid #ddd;">';
|
||||
html += '<input type="text" name="item_order_unit_price[]" class="item-order-unit-price" style="width:90%; padding:5px;" required numberOnly value="' + (orderUnitPrice ? addComma(orderUnitPrice) : '') + '" />';
|
||||
html += '<input type="text" name="item_order_unit_price[]" class="item-order-unit-price" style="width:90%; padding:5px;" numberOnly value="' + (orderUnitPrice ? addComma(orderUnitPrice) : '') + '" />';
|
||||
html += '</td>';
|
||||
html += '<td style="padding:5px; border:1px solid #ddd;">';
|
||||
html += '<input type="text" name="item_order_supply_price[]" class="item-order-supply-price" style="width:90%; padding:5px;" numberOnly value="' + (orderSupplyPrice ? addComma(orderSupplyPrice) : '') + '" />';
|
||||
@@ -589,7 +610,11 @@
|
||||
|
||||
// 숫자만 입력 처리 및 금액 계산
|
||||
$("#" + itemId + " .item-order-quantity, #" + itemId + " .item-order-unit-price, #" + itemId + " .item-order-supply-price, #" + itemId + " .item-order-vat, #" + itemId + " .item-order-total-amount").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
if($(this).hasClass("item-order-quantity")) {
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
|
||||
if($(this).hasClass("item-order-quantity") || $(this).hasClass("item-order-unit-price")) {
|
||||
fn_calculateItemAmount(itemId);
|
||||
@@ -614,8 +639,8 @@
|
||||
|
||||
// 품목별 금액 계산
|
||||
function fn_calculateItemAmount(itemId) {
|
||||
var quantity = parseInt(removeComma($("#" + itemId + " .item-order-quantity").val())) || 0;
|
||||
var unitPrice = parseInt(removeComma($("#" + itemId + " .item-order-unit-price").val())) || 0;
|
||||
var quantity = parseFloat(removeComma($("#" + itemId + " .item-order-quantity").val())) || 0;
|
||||
var unitPrice = parseFloat(removeComma($("#" + itemId + " .item-order-unit-price").val())) || 0;
|
||||
|
||||
// 공급가액 계산
|
||||
var supplyPrice = quantity * unitPrice;
|
||||
@@ -632,8 +657,8 @@
|
||||
|
||||
// 부가세 직접 입력 시 총액만 재계산
|
||||
function fn_calculateTotalFromVat(itemId) {
|
||||
var supplyPrice = parseInt(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0;
|
||||
var vat = parseInt(removeComma($("#" + itemId + " .item-order-vat").val())) || 0;
|
||||
var supplyPrice = parseFloat(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0;
|
||||
var vat = parseFloat(removeComma($("#" + itemId + " .item-order-vat").val())) || 0;
|
||||
|
||||
// 총액 계산
|
||||
var totalAmount = supplyPrice + vat;
|
||||
@@ -642,7 +667,7 @@
|
||||
|
||||
// 공급가액 직접 입력 시 부가세와 총액 재계산
|
||||
function fn_calculateFromSupplyPrice(itemId) {
|
||||
var supplyPrice = parseInt(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0;
|
||||
var supplyPrice = parseFloat(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0;
|
||||
|
||||
// 부가세 자동 계산 (공급가액의 10%)
|
||||
var vat = Math.round(supplyPrice * 0.1);
|
||||
@@ -1451,7 +1476,7 @@
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#e3f2fd;">고객요청사항</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#e3f2fd;">반납사유</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주수량 <span style="color:red;">*</span></th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주단가 <span style="color:red;">*</span></th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주단가 </th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주공급가액</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주부가세</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd; background:#fff3e0;">수주총액</th>
|
||||
|
||||
@@ -19,144 +19,145 @@ $(function(){
|
||||
|
||||
//금액1(원)
|
||||
$("#contract_product_price").change(function(){
|
||||
var contract_product_price = $(this).val().replace(/,/gi,"");
|
||||
var contract_product_price = parseFloat($(this).val().replace(/,/gi,"")) || 0;
|
||||
|
||||
var qty = $("#qty").val().replace(/,/gi,"");
|
||||
var qty = parseInt($("#qty").val().replace(/,/gi,""), 10) || 0;
|
||||
|
||||
var sale = $("#sale").val().replace(/,/gi,"");
|
||||
var sale = parseFloat($("#sale").val().replace(/,/gi,""));
|
||||
if (isNaN(sale) || $("#sale").val().replace(/,/gi,"") === "") sale = 1;
|
||||
|
||||
var other_price = $("#other_price").val().replace(/,/gi,"");
|
||||
var other_price = parseFloat($("#other_price").val().replace(/,/gi,"")) || 0;
|
||||
|
||||
if (isNaN(contract_product_price) || ""==contract_product_price) contract_product_price = 0;
|
||||
|
||||
if (isNaN(other_price) || ""==other_price) other_price = 0;
|
||||
if (isNaN(qty) || ""==qty) qty = 0;
|
||||
if (isNaN(sale) || ""==sale) sale = 1;
|
||||
|
||||
var product_price = (parseInt(contract_product_price) * parseInt(qty));
|
||||
var product_price = contract_product_price * qty;
|
||||
if (isNaN(product_price)) product_price = 0;
|
||||
$("#product_price").val(addComma(product_price));
|
||||
$("#product_price").val(formatMoney(product_price));
|
||||
|
||||
|
||||
var total_price = parseInt(product_price)+parseInt(other_price);
|
||||
var total_price = product_price + other_price;
|
||||
|
||||
if (isNaN(total_price)) total_price = 0;
|
||||
|
||||
$("#total_price").val(addComma(total_price));
|
||||
$("#total_price").val(formatMoney(total_price));
|
||||
var final_price = "";
|
||||
if($("#sale").val()==""){
|
||||
final_price = parseInt(total_price) * sale;
|
||||
final_price = total_price * sale;
|
||||
|
||||
}else{
|
||||
final_price = parseInt(total_price) - (parseInt(total_price) * (parseInt(sale) / 100));
|
||||
final_price = total_price - (total_price * (sale / 100));
|
||||
}
|
||||
|
||||
if (isNaN(final_price)) final_price = 0;
|
||||
$("#final_total_price").val(addComma(final_price));
|
||||
$("#final_total_price").val(formatMoney(final_price));
|
||||
|
||||
});
|
||||
|
||||
//수량(원)
|
||||
$("#qty").change(function(){
|
||||
var contract_product_price = $("#contract_product_price").val().replace(/,/gi,"");
|
||||
var contract_product_price = parseFloat($("#contract_product_price").val().replace(/,/gi,"")) || 0;
|
||||
|
||||
var qty = $(this).val().replace(/,/gi,"");
|
||||
var qty = parseInt($(this).val().replace(/,/gi,""), 10) || 0;
|
||||
|
||||
var sale = $("#sale").val().replace(/,/gi,"");
|
||||
var sale = parseFloat($("#sale").val().replace(/,/gi,""));
|
||||
if (isNaN(sale) || $("#sale").val().replace(/,/gi,"") === "") sale = 1;
|
||||
|
||||
var other_price = $("#other_price").val().replace(/,/gi,"");
|
||||
var other_price = parseFloat($("#other_price").val().replace(/,/gi,"")) || 0;
|
||||
|
||||
if (isNaN(contract_product_price) || ""==contract_product_price) contract_product_price = 0;
|
||||
|
||||
if (isNaN(other_price) || ""==other_price) other_price = 0;
|
||||
if (isNaN(qty) || ""==qty) qty = 0;
|
||||
if (isNaN(sale) || ""==sale) sale = 1;
|
||||
|
||||
var product_price = (parseInt(contract_product_price) * parseInt(qty));
|
||||
var product_price = contract_product_price * qty;
|
||||
if (isNaN(product_price)) product_price = 0;
|
||||
$("#product_price").val(addComma(product_price));
|
||||
$("#product_price").val(formatMoney(product_price));
|
||||
|
||||
|
||||
var total_price = parseInt(product_price)+parseInt(other_price);
|
||||
var total_price = product_price + other_price;
|
||||
|
||||
if (isNaN(total_price)) total_price = 0;
|
||||
|
||||
$("#total_price").val(addComma(total_price));
|
||||
$("#total_price").val(formatMoney(total_price));
|
||||
var final_price = "";
|
||||
if($("#sale").val()==""){
|
||||
final_price = parseInt(total_price) * sale;
|
||||
final_price = total_price * sale;
|
||||
|
||||
}else{
|
||||
final_price = parseInt(total_price) - (parseInt(total_price) * (parseInt(sale) / 100));
|
||||
final_price = total_price - (total_price * (sale / 100));
|
||||
}
|
||||
|
||||
if (isNaN(final_price)) final_price = 0;
|
||||
$("#final_total_price").val(addComma(final_price));
|
||||
$("#final_total_price").val(formatMoney(final_price));
|
||||
|
||||
});
|
||||
|
||||
//기타비용
|
||||
$("#other_price").change(function(){
|
||||
var contract_product_price = $("#contract_product_price").val().replace(/,/gi,"");
|
||||
var contract_product_price = parseFloat($("#contract_product_price").val().replace(/,/gi,"")) || 0;
|
||||
|
||||
var qty = $("#qty").val().replace(/,/gi,"");
|
||||
var qty = parseInt($("#qty").val().replace(/,/gi,""), 10) || 0;
|
||||
|
||||
var sale = $("#sale").val().replace(/,/gi,"");
|
||||
var sale = parseFloat($("#sale").val().replace(/,/gi,""));
|
||||
if (isNaN(sale) || $("#sale").val().replace(/,/gi,"") === "") sale = 1;
|
||||
|
||||
var other_price = $(this).val().replace(/,/gi,"");
|
||||
var other_price = parseFloat($(this).val().replace(/,/gi,"")) || 0;
|
||||
|
||||
if (isNaN(contract_product_price) || ""==contract_product_price) contract_product_price = 0;
|
||||
|
||||
if (isNaN(other_price) || ""==other_price) other_price = 0;
|
||||
if (isNaN(qty) || ""==qty) qty = 0;
|
||||
if (isNaN(sale) || ""==sale) sale = 1;
|
||||
|
||||
var product_price = (parseInt(contract_product_price) * parseInt(qty));
|
||||
var product_price = contract_product_price * qty;
|
||||
if (isNaN(product_price)) product_price = 0;
|
||||
$("#product_price").val(addComma(product_price));
|
||||
$("#product_price").val(formatMoney(product_price));
|
||||
|
||||
|
||||
var total_price = parseInt(product_price)+parseInt(other_price);
|
||||
var total_price = product_price + other_price;
|
||||
|
||||
if (isNaN(total_price)) total_price = 0;
|
||||
|
||||
$("#total_price").val(addComma(total_price));
|
||||
$("#total_price").val(formatMoney(total_price));
|
||||
var final_price = "";
|
||||
if($("#sale").val()==""){
|
||||
final_price = parseInt(total_price) * sale;
|
||||
final_price = total_price * sale;
|
||||
|
||||
}else{
|
||||
final_price = parseInt(total_price) - (parseInt(total_price) * (parseInt(sale) / 100));
|
||||
final_price = total_price - (total_price * (sale / 100));
|
||||
}
|
||||
|
||||
if (isNaN(final_price)) final_price = 0;
|
||||
$("#final_total_price").val(addComma(final_price));
|
||||
$("#final_total_price").val(formatMoney(final_price));
|
||||
|
||||
});
|
||||
|
||||
|
||||
//할인
|
||||
$("#sale").change(function(){
|
||||
var total_price = $("#total_price").val().replace(/,/gi,"");
|
||||
var sale = $(this).val().replace(/,/gi,"");
|
||||
|
||||
if (isNaN(total_price)) total_price = 0;
|
||||
var total_price = parseFloat($("#total_price").val().replace(/,/gi,"")) || 0;
|
||||
var saleRaw = $(this).val().replace(/,/gi,"");
|
||||
var sale = parseFloat(saleRaw);
|
||||
if (isNaN(sale) || saleRaw === "") sale = 1;
|
||||
|
||||
var final_price = "";
|
||||
if($("#sale").val()==""){
|
||||
final_price = parseInt(total_price) * sale;
|
||||
final_price = total_price * sale;
|
||||
|
||||
}else{
|
||||
final_price = parseInt(total_price) - (parseInt(total_price) * (parseInt(sale) / 100));
|
||||
final_price = total_price - (total_price * (sale / 100));
|
||||
}
|
||||
|
||||
if (isNaN(final_price)) final_price = 0;
|
||||
$("#final_total_price").val(addComma(final_price));
|
||||
$("#final_total_price").val(formatMoney(final_price));
|
||||
|
||||
});
|
||||
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g,"")));
|
||||
var $t = $(this);
|
||||
if ($t.attr("id") === "qty") {
|
||||
$t.val(formatInteger($t.val().replace(/[^0-9]/g,"")));
|
||||
} else {
|
||||
$t.val(fnc_addComma($t.val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
});
|
||||
$("input:text[numberOnly]").on("blur", function() {
|
||||
var $t = $(this);
|
||||
var val = $t.val();
|
||||
if (val && val !== '') {
|
||||
if ($t.attr("id") === "qty") {
|
||||
$t.val(formatInteger(removeComma(val)));
|
||||
} else {
|
||||
$t.val(formatMoney(removeComma(val)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -285,7 +286,7 @@ function set_contract(USER_ID){
|
||||
|
||||
|
||||
function addComma(data) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return formatMoney(data);
|
||||
}
|
||||
|
||||
function set_customer(OBJID){
|
||||
@@ -463,14 +464,15 @@ function fileDelete(fileObjId, areaId){
|
||||
}
|
||||
}
|
||||
function fnc_numberOnly(obj){
|
||||
$("#"+obj.attr("id")).val(addComma(obj.val().replace(/[^0-9]/g,"")));
|
||||
var id = obj.attr("id");
|
||||
if (id === "qty") {
|
||||
$("#"+id).val(formatInteger(obj.val().replace(/[^0-9]/g,"")));
|
||||
} else {
|
||||
$("#"+id).val(fnc_addComma(obj.val().replace(/[^0-9.]/g,"")));
|
||||
}
|
||||
//.replace(/[^0-9]/g,""))
|
||||
}
|
||||
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g,"")));
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -622,7 +624,7 @@ $("input:text[numberOnly]").on("keyup", function() {
|
||||
<input type="text" class="date_icon" name="cus_request_date" id="cus_request_date" value="${info.CUS_REQUEST_DATE}" />
|
||||
</td> --%>
|
||||
<td class="input_sub_title" >
|
||||
<input type="text" name="contract_product_price" id="contract_product_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.CONTRACT_PRODUCT_PRICE}" pattern="#,###" />" maxlength="100" numberOnly />
|
||||
<input type="text" name="contract_product_price" id="contract_product_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.CONTRACT_PRODUCT_PRICE}" pattern="#,##0.00" />" maxlength="100" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -643,20 +645,20 @@ $("input:text[numberOnly]").on("keyup", function() {
|
||||
<tr>
|
||||
<td class="input_title" colspan="6"><label for="">제품가 합계금액(원)</label></td>
|
||||
<td class="input_sub_title">
|
||||
<input type="text" name="product_price" id="product_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.PRODUCT_PRICE}" pattern="#,###" />" maxlength="100" numberOnly readonly/>
|
||||
<input type="text" name="product_price" id="product_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.PRODUCT_PRICE}" pattern="#,##0.00" />" maxlength="100" numberOnly readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="input_title" colspan="6"><label for="">기타비용(원)</label></td>
|
||||
<td class="input_sub_title">
|
||||
<input type="text" name="other_price" id="other_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.OTHER_PRICE}" pattern="#,###" />" maxlength="100" numberOnly />
|
||||
<input type="text" name="other_price" id="other_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.OTHER_PRICE}" pattern="#,##0.00" />" maxlength="100" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="input_title" colspan="6"><label for="">총 견적금액(원)</label></td>
|
||||
<td class="input_sub_title">
|
||||
<input type="text" name="total_price" id="total_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.TOTAL_PRICE}" pattern="#,###" />" maxlength="100" numberOnly readonly />
|
||||
<input type="text" name="total_price" id="total_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.TOTAL_PRICE}" pattern="#,##0.00" />" maxlength="100" numberOnly readonly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -664,12 +666,12 @@ $("input:text[numberOnly]").on("keyup", function() {
|
||||
|
||||
<td class="input_title"><label for="">특별할인(%)</label></td>
|
||||
<td class="input_sub_title">
|
||||
<input type="text" name="sale" id="sale" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.SALE}" pattern="#,###" />" maxlength="100" numberOnly />
|
||||
<input type="text" name="sale" id="sale" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.SALE}" pattern="#,##0.00" />" maxlength="100" numberOnly />
|
||||
</td>
|
||||
|
||||
<td class="input_title" colspan="4"><label for="">견적 합계금액(원)</label></td>
|
||||
<td class="input_sub_title">
|
||||
<input type="text" name="final_total_price" id="final_total_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.FINAL_TOTAL_PRICE}" pattern="#,###" />" maxlength="100" numberOnly readonly />
|
||||
<input type="text" name="final_total_price" id="final_total_price" style="text-align: right; padding-right: 4px;" value="<fmt:formatNumber value="${info.FINAL_TOTAL_PRICE}" pattern="#,##0.00" />" maxlength="100" numberOnly readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -471,7 +471,8 @@ var columns = [
|
||||
},
|
||||
// 17. 품번
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth: 80, widthGrow: 1, title : '품번', field : 'PART_NO' },
|
||||
|
||||
// 18. 작성자
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth: 70, widthGrow: 0.8, title : '작성자', field : 'WRITER_NAME' },
|
||||
/* 아래는 주석처리된 컬럼들 - 필요시 활성화 */
|
||||
/*
|
||||
// 제품구분
|
||||
@@ -486,7 +487,6 @@ var columns = [
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '설비대수', field : 'FACILITY_QTY' },
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '설비타입', field : 'FACILITY_TYPE' },
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '설비길이', field : 'FACILITY_DEPTH' },
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '담당자', field : 'WRITER_NAME' },
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '등록일', field : 'REG_DATE' },
|
||||
// {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '첨부파일', field : 'CU01_CNT',
|
||||
// formatter:fnc_subInfoValueFormatter,
|
||||
@@ -606,18 +606,25 @@ function fn_delete(){
|
||||
data: {
|
||||
"objId": objIds
|
||||
},
|
||||
traditional: true, // 배열 파라미터를 올바르게 전송
|
||||
traditional: true,
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data.result == 'true'){
|
||||
if(data.result == 'true' || data.result === true){
|
||||
var successMessage = deleteCount === 1
|
||||
? '삭제되었습니다.'
|
||||
: deleteCount + '개의 항목이 삭제되었습니다.';
|
||||
Swal.fire(successMessage);
|
||||
fn_search();
|
||||
};
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: '삭제 불가',
|
||||
text: data.msg || '삭제할 수 없습니다.',
|
||||
icon: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
,error: function(jqxhr, status, error){
|
||||
Swal.fire('삭제 중 오류가 발생했습니다.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -100,7 +100,23 @@
|
||||
*/
|
||||
}
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
var $t = $(this);
|
||||
if ($t.attr("id") === "facility_qty" || $t.hasClass("item-quantity")) {
|
||||
$t.val(formatInteger($t.val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$t.val(fnc_addComma($t.val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
});
|
||||
$("input:text[numberOnly]").on("blur", function() {
|
||||
var $t = $(this);
|
||||
var val = $t.val();
|
||||
if (val && val !== '') {
|
||||
if ($t.attr("id") === "facility_qty" || $t.hasClass("item-quantity")) {
|
||||
$t.val(formatInteger(removeComma(val)));
|
||||
} else {
|
||||
$t.val(formatMoney(removeComma(val)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.select2').select2();
|
||||
@@ -223,7 +239,7 @@
|
||||
});
|
||||
|
||||
function addComma(data) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return formatMoney(data);
|
||||
}
|
||||
|
||||
function fnc_setFileDropZone2(divId, targetObjId, docType, docTypeName,
|
||||
@@ -584,11 +600,11 @@
|
||||
|
||||
// 숫자만 입력 처리 및 콤마 추가
|
||||
$("#" + itemId + " .item-quantity").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
});
|
||||
// 이미 저장된 수량에 콤마 추가
|
||||
var qtyInput = $("#" + itemId + " .item-quantity");
|
||||
qtyInput.val(addComma(qtyInput.val()));
|
||||
qtyInput.val(formatInteger(removeComma(qtyInput.val())));
|
||||
|
||||
// 품목 정보 저장
|
||||
itemList.push({
|
||||
@@ -803,7 +819,16 @@
|
||||
}
|
||||
|
||||
function fnc_numberOnly(obj) {
|
||||
$("#" + obj.attr("id")).val(addComma(obj.val().replace(/[^0-9]/g, "")));
|
||||
var isQty = obj.attr("id") === "facility_qty" || obj.hasClass("item-quantity");
|
||||
var formatted = isQty
|
||||
? formatInteger(obj.val().replace(/[^0-9]/g, ""))
|
||||
: fnc_addComma(obj.val().replace(/[^0-9.]/g, ""));
|
||||
var tid = obj.attr("id");
|
||||
if (tid) {
|
||||
$("#" + tid).val(formatted);
|
||||
} else {
|
||||
obj.val(formatted);
|
||||
}
|
||||
//.replace(/[^0-9]/g,""))
|
||||
}
|
||||
// Drag & Drop 관련 함수 주석처리 끝 */
|
||||
@@ -1331,7 +1356,7 @@
|
||||
|
||||
// 숫자만 입력 처리
|
||||
$("#" + itemId + " .item-quantity").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
$(this).val(formatInteger($(this).val().replace(/[^0-9]/g, "")));
|
||||
});
|
||||
|
||||
// 품목 정보 저장
|
||||
@@ -1994,7 +2019,7 @@
|
||||
</td>
|
||||
<td class="input_title"><label for="">견적환율</label></td>
|
||||
<td>
|
||||
<input type="text" name="exchange_rate" id="exchange_rate" reqTitle="환율" value="${info.EXCHANGE_RATE}" />
|
||||
<input type="text" name="exchange_rate" id="exchange_rate" reqTitle="환율" value="${info.EXCHANGE_RATE}" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -2181,14 +2206,14 @@
|
||||
<td class="input_title"><label for="">수주가</label></td>
|
||||
<td class="input_sub_title" colspan="2"><input type="text"
|
||||
name="contract_price_currency" id="contract_price_currency"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE_CURRENCY}" pattern="#,###" />"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE_CURRENCY}" pattern="#,##0.00" />"
|
||||
reqTitle="수주가(통화)" numberOnly /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="input_title"><label for="">원화 환산금액</label></td>
|
||||
<td class="input_sub_title" colspan="2"><input type="text"
|
||||
name="contract_price" id="contract_price"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE}" pattern="#,###" />"
|
||||
value="<fmt:formatNumber value="${info.CONTRACT_PRICE}" pattern="#,##0.00" />"
|
||||
reqTitle="원화 환산금액" numberOnly /></td>
|
||||
<td class="input_title"><label for=""></label></td>
|
||||
<td class="input_sub_title" colspan="2"></td>
|
||||
|
||||
@@ -1387,9 +1387,7 @@ function fn_save() {
|
||||
<tr>
|
||||
<td class="label">수신인</td>
|
||||
<td class="editable">
|
||||
<select id="contact_person" style="width: 100%; border: none; font-size: 9pt; padding: 2px;">
|
||||
<option value="">담당자 선택</option>
|
||||
</select>
|
||||
<input type="text" id="contact_person" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -148,7 +148,7 @@ $(function(){
|
||||
{title: "품명", field: "PART_NAME", hozAlign: "left", minWidth: 120},
|
||||
// 견적 정보
|
||||
{title: "견적수량", field: "EST_QUANTITY", hozAlign: "right", minWidth: 70, cssClass: "estimate-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
formatter: function(cell) { return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{title: "견적단가", field: "EST_UNIT_PRICE", hozAlign: "right", minWidth: 80, cssClass: "estimate-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
@@ -161,7 +161,7 @@ $(function(){
|
||||
},
|
||||
// 수주 정보
|
||||
{title: "수주수량", field: "ORDER_QUANTITY", hozAlign: "right", minWidth: 70, cssClass: "order-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
formatter: function(cell) { return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{title: "수주단가", field: "ORDER_UNIT_PRICE", hozAlign: "right", minWidth: 80, cssClass: "order-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
@@ -174,7 +174,7 @@ $(function(){
|
||||
},
|
||||
// 판매 정보
|
||||
{title: "판매수량", field: "SALES_QUANTITY", hozAlign: "right", minWidth: 70, cssClass: "sales-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
formatter: function(cell) { return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{title: "판매단가", field: "SALES_UNIT_PRICE", hozAlign: "right", minWidth: 80, cssClass: "sales-cell",
|
||||
formatter: function(cell) { return formatNumber(cell.getValue()); }
|
||||
@@ -209,10 +209,16 @@ $(function(){
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 숫자 포맷
|
||||
// 금액·단가 (소수 둘째 자리 고정)
|
||||
function formatNumber(num) {
|
||||
if(num == null || num == '' || isNaN(num) || num == 0) return '-';
|
||||
return parseFloat(num).toLocaleString('ko-KR');
|
||||
if(!num || num === '' || isNaN(num)) return '-';
|
||||
return Number(num).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
|
||||
// 수량 (정수, 천단위 구분)
|
||||
function formatInteger(num) {
|
||||
if(num == null || num === '' || isNaN(num)) return '-';
|
||||
return Number(num).toLocaleString(undefined, {maximumFractionDigits: 0});
|
||||
}
|
||||
|
||||
// 조회
|
||||
|
||||
@@ -180,16 +180,16 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// 숫자 포맷 (천단위 콤마)
|
||||
// 숫자 포맷 (천단위 콤마, 소수 둘째 자리)
|
||||
function formatNumber(num) {
|
||||
if(num == null || num == '' || isNaN(num)) return '-';
|
||||
return parseFloat(num).toLocaleString('ko-KR');
|
||||
return Number(num).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
|
||||
// 통화 포맷
|
||||
function formatCurrency(num, currency) {
|
||||
if(num == null || num == '' || isNaN(num)) return '-';
|
||||
var formatted = parseFloat(num).toLocaleString('ko-KR');
|
||||
var formatted = Number(num).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
if(currency == 'KRW' || currency == '원') {
|
||||
return '₩' + formatted;
|
||||
} else if(currency == 'USD' || currency == '달러') {
|
||||
@@ -275,35 +275,35 @@ function formatCurrency(num, currency) {
|
||||
<!-- 견적 -->
|
||||
<td class="price-estimate text-right">${item.EST_QUANTITY}</td>
|
||||
<td class="price-estimate text-right">
|
||||
<fmt:formatNumber value="${item.EST_UNIT_PRICE}" pattern="#,##0.##"/>
|
||||
<fmt:formatNumber value="${item.EST_UNIT_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-estimate text-right">
|
||||
<fmt:formatNumber value="${item.EST_SUPPLY_PRICE}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.EST_SUPPLY_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-estimate text-right">
|
||||
<fmt:formatNumber value="${item.EST_TOTAL_AMOUNT}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.EST_TOTAL_AMOUNT}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<!-- 수주 -->
|
||||
<td class="price-order text-right">${item.ORDER_QUANTITY}</td>
|
||||
<td class="price-order text-right">
|
||||
<fmt:formatNumber value="${item.ORDER_UNIT_PRICE}" pattern="#,##0.##"/>
|
||||
<fmt:formatNumber value="${item.ORDER_UNIT_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-order text-right">
|
||||
<fmt:formatNumber value="${item.ORDER_SUPPLY_PRICE}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.ORDER_SUPPLY_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-order text-right">
|
||||
<fmt:formatNumber value="${item.ORDER_TOTAL_AMOUNT}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.ORDER_TOTAL_AMOUNT}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<!-- 판매 -->
|
||||
<td class="price-sales text-right">${item.SALES_QUANTITY}</td>
|
||||
<td class="price-sales text-right">
|
||||
<fmt:formatNumber value="${item.SALES_UNIT_PRICE}" pattern="#,##0.##"/>
|
||||
<fmt:formatNumber value="${item.SALES_UNIT_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-sales text-right">
|
||||
<fmt:formatNumber value="${item.SALES_SUPPLY_PRICE}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.SALES_SUPPLY_PRICE}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-sales text-right">
|
||||
<fmt:formatNumber value="${item.SALES_TOTAL_AMOUNT}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${item.SALES_TOTAL_AMOUNT}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<!-- 비고 (가격 차이) -->
|
||||
<td>
|
||||
@@ -328,28 +328,28 @@ function formatCurrency(num, currency) {
|
||||
<td class="price-estimate text-right">${totalEstQuantity}</td>
|
||||
<td class="price-estimate text-right">-</td>
|
||||
<td class="price-estimate text-right">
|
||||
<fmt:formatNumber value="${totalEstSupply}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalEstSupply}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-estimate text-right">
|
||||
<fmt:formatNumber value="${totalEstAmount}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalEstAmount}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<!-- 수주 합계 -->
|
||||
<td class="price-order text-right">${totalOrderQuantity}</td>
|
||||
<td class="price-order text-right">-</td>
|
||||
<td class="price-order text-right">
|
||||
<fmt:formatNumber value="${totalOrderSupply}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalOrderSupply}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-order text-right">
|
||||
<fmt:formatNumber value="${totalOrderAmount}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalOrderAmount}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<!-- 판매 합계 -->
|
||||
<td class="price-sales text-right">${totalSalesQuantity}</td>
|
||||
<td class="price-sales text-right">-</td>
|
||||
<td class="price-sales text-right">
|
||||
<fmt:formatNumber value="${totalSalesSupply}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalSalesSupply}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td class="price-sales text-right">
|
||||
<fmt:formatNumber value="${totalSalesAmount}" pattern="#,##0"/>
|
||||
<fmt:formatNumber value="${totalSalesAmount}" pattern="#,##0.00"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
|
||||
@@ -362,6 +362,9 @@ var columns = [
|
||||
// 21. 품번
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth : 70, widthGrow: 0.8, title : '품번', field : 'PART_NO' },
|
||||
|
||||
// 22. 작성자
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth : 100, widthGrow: 1.2, title : '작성자', field : 'WRITER_NAME' },
|
||||
|
||||
/* 주석처리된 컬럼 - 필요시 활성화 */
|
||||
/*
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth : 55, widthGrow: 0.6, title : '제품구분', field : 'PRODUCT_NAME' },
|
||||
|
||||
@@ -51,28 +51,46 @@
|
||||
// console.log("===== 수주등록 팝업 로드됨 =====");
|
||||
// console.log("useEstimateTemplate 값:", "${useEstimateTemplate}");
|
||||
|
||||
// 숫자 입력 필드에 콤마 자동 추가 및 금액 계산
|
||||
// 입력 중: 수량은 정수만, 나머지는 소수점 허용
|
||||
$(document).on("keyup", "input:text[numberOnly]", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9.]/g, "")));
|
||||
if($(this).hasClass("item-quantity")) {
|
||||
$(this).val(addCommaInput($(this).val().replace(/[^0-9]/g, "")));
|
||||
} else {
|
||||
$(this).val(addCommaInput($(this).val().replace(/[^0-9.]/g, "")));
|
||||
}
|
||||
|
||||
var itemId = $(this).closest("tr").attr("id");
|
||||
if(itemId) {
|
||||
// 수주수량 또는 수주단가가 변경되면 공급가액, 부가세, 총액 모두 재계산
|
||||
if($(this).hasClass("item-quantity") || $(this).hasClass("item-unit-price")) {
|
||||
fn_calculateItemAmount(itemId);
|
||||
}
|
||||
// 수주부가세만 변경되면 총액만 재계산
|
||||
else if($(this).hasClass("item-vat")) {
|
||||
fn_calculateTotalFromVat(itemId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 페이지 로드 시 기존 값에 콤마 표시
|
||||
// 입력 완료(blur): 수량은 정수 콤마, 나머지는 소수점 2자리
|
||||
$(document).on("blur", "input:text[numberOnly]", function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
if($(this).hasClass("item-quantity")) {
|
||||
$(this).val(addCommaInt(removeComma(val)));
|
||||
} else {
|
||||
$(this).val(addComma(removeComma(val)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 페이지 로드 시: 수량은 정수 콤마, 나머지는 소수점 2자리
|
||||
$("input:text[numberOnly]").each(function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
$(this).val(addComma(val.replace(/,/g, "")));
|
||||
if($(this).hasClass("item-quantity")) {
|
||||
$(this).val(addCommaInt(val.replace(/,/g, "")));
|
||||
} else {
|
||||
$(this).val(addComma(val.replace(/,/g, "")));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -95,10 +113,30 @@
|
||||
fn_loadContractItems();
|
||||
});
|
||||
|
||||
// 금액 포맷 (소수점 2자리 + 천단위 콤마)
|
||||
// 표시용 포맷 (천단위 콤마 + 소수점 2자리)
|
||||
function addComma(data) {
|
||||
if(!data && data !== 0) return '';
|
||||
return Number(data).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
var num = Number(String(data).replace(/,/g, ''));
|
||||
if(isNaN(num)) return '';
|
||||
return num.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
|
||||
// 정수 표시용 포맷 (천단위 콤마, 소수점 없음)
|
||||
function addCommaInt(data) {
|
||||
if(!data && data !== 0) return '';
|
||||
var num = Math.round(Number(String(data).replace(/,/g, '')));
|
||||
if(isNaN(num)) return '';
|
||||
return num.toLocaleString();
|
||||
}
|
||||
|
||||
// 입력 중 포맷 (천단위 콤마만, 소수점 강제 안함)
|
||||
function addCommaInput(data) {
|
||||
if(!data && data !== 0) return '';
|
||||
var str = String(data).replace(/,/g, '');
|
||||
if(str === '' || isNaN(str)) return '';
|
||||
var parts = str.split('.');
|
||||
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
return parts.length > 1 ? parts[0] + '.' + parts[1] : parts[0];
|
||||
}
|
||||
|
||||
// 콤마 제거 함수
|
||||
@@ -227,7 +265,7 @@
|
||||
html += '<td><input type="text" class="item-quantity" value="' + (item.ORDER_QUANTITY || item.QUANTITY || '') + '" numberOnly required /></td>';
|
||||
}
|
||||
// ORDER_UNIT_PRICE 수정 가능
|
||||
html += '<td><input type="text" class="item-unit-price" value="' + (item.ORDER_UNIT_PRICE || '') + '" numberOnly required /></td>';
|
||||
html += '<td><input type="text" class="item-unit-price" value="' + (item.ORDER_UNIT_PRICE || '') + '" numberOnly /></td>';
|
||||
// ORDER_SUPPLY_PRICE 자동 계산
|
||||
html += '<td><input type="text" class="item-supply-price" value="' + (item.ORDER_SUPPLY_PRICE || '') + '" numberOnly readonly style="background:#f5f5f5;" /></td>';
|
||||
// ORDER_VAT 수정 가능
|
||||
@@ -243,8 +281,8 @@
|
||||
|
||||
$("#itemListBody").append(html);
|
||||
|
||||
// 콤마 추가
|
||||
$("#" + itemId + " .item-quantity").val(addComma($("#" + itemId + " .item-quantity").val()));
|
||||
// 콤마 추가 (수량은 정수, 금액은 소수점 2자리)
|
||||
$("#" + itemId + " .item-quantity").val(addCommaInt(removeComma($("#" + itemId + " .item-quantity").val())));
|
||||
$("#" + itemId + " .item-unit-price").val(addComma($("#" + itemId + " .item-unit-price").val()));
|
||||
$("#" + itemId + " .item-supply-price").val(addComma($("#" + itemId + " .item-supply-price").val()));
|
||||
$("#" + itemId + " .item-vat").val(addComma($("#" + itemId + " .item-vat").val()));
|
||||
@@ -480,7 +518,7 @@
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">품명</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">S/N</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주수량 <span style="color:red;">*</span></th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주단가 <span style="color:red;">*</span></th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주단가 </th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주공급가액</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주부가세</th>
|
||||
<th style="text-align:center; padding:8px; border:1px solid #ddd;">수주총액</th>
|
||||
|
||||
@@ -91,8 +91,8 @@ function openPartMngPopup(objId){
|
||||
<td style="text-align:left !important;" title="${item.UNIT_NAME}">
|
||||
<a href="#" class="btnPartDetail" data-PART_OBJID="${item.UNIT_NAME}">${item.UNIT_NAME}</a>
|
||||
</td>
|
||||
<td title="${item.NEW_TOTAL_PRICE}" class="align_r"><fmt:formatNumber value="${item.NEW_TOTAL_PRICE}" pattern="#,###" /></td>
|
||||
<td title="${item.RE_TOTAL_PRICE}" class="align_r"><fmt:formatNumber value="${item.RE_TOTAL_PRICE}" pattern="#,###" /></td>
|
||||
<td title="${item.NEW_TOTAL_PRICE}" class="align_r"><fmt:formatNumber value="${item.NEW_TOTAL_PRICE}" pattern="#,##0.00" /></td>
|
||||
<td title="${item.RE_TOTAL_PRICE}" class="align_r"><fmt:formatNumber value="${item.RE_TOTAL_PRICE}" pattern="#,##0.00" /></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:otherwise>
|
||||
|
||||
@@ -133,37 +133,37 @@ var columns = [
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '입고금액', field : 'TOTAL_DELIVERY_PRICE',
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
if(!value || value === '' || value === '0') return '';
|
||||
var cn = cell.getRow().getData().CURRENCY_NAME || '';
|
||||
var s = '';
|
||||
if(cn.includes('원') || cn === 'KRW') s = '₩';
|
||||
else if(cn.includes('달러') || cn === 'USD') s = '$';
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '미입고금액', field : 'TOTAL_NOT_DELIVERY_PRICE',
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
if(!value || value === '' || value === '0') return '';
|
||||
var cn = cell.getRow().getData().CURRENCY_NAME || '';
|
||||
var s = '';
|
||||
if(cn.includes('원') || cn === 'KRW') s = '₩';
|
||||
else if(cn.includes('달러') || cn === 'USD') s = '$';
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
}
|
||||
},
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '입고금액', field : 'TOTAL_DELIVERY_PRICE',
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
if(!value || value === '' || value === '0') return '';
|
||||
var cn = cell.getRow().getData().CURRENCY_NAME || '';
|
||||
var s = '';
|
||||
if(cn.includes('원') || cn === 'KRW') s = '₩';
|
||||
else if(cn.includes('달러') || cn === 'USD') s = '$';
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '미입고금액', field : 'TOTAL_NOT_DELIVERY_PRICE',
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
if(!value || value === '' || value === '0') return '';
|
||||
var cn = cell.getRow().getData().CURRENCY_NAME || '';
|
||||
var s = '';
|
||||
if(cn.includes('원') || cn === 'KRW') s = '₩';
|
||||
else if(cn.includes('달러') || cn === 'USD') s = '$';
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth : 100, widthGrow : 1, title : '업체성적서', field : 'INSPECTION_FILE_CNT',
|
||||
formatter:fnc_subInfoValueFormatter,
|
||||
cellClick:function(e, cell){
|
||||
@@ -269,9 +269,9 @@ function fn_calculateTotalAmount(){
|
||||
}
|
||||
|
||||
// 합계 표시
|
||||
$("#totalOrderAmount").text(Number(Math.round(totalOrderAmount)).toLocaleString());
|
||||
$("#deliveredAmount").text(Number(Math.round(totalDeliveredAmount)).toLocaleString());
|
||||
$("#notDeliveredAmount").text(Number(Math.round(totalNotDeliveredAmount)).toLocaleString());
|
||||
$("#totalOrderAmount").text(Number(totalOrderAmount).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
$("#deliveredAmount").text(Number(totalDeliveredAmount).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
$("#notDeliveredAmount").text(Number(totalNotDeliveredAmount).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
}
|
||||
|
||||
//수입검사등록
|
||||
|
||||
@@ -151,7 +151,7 @@ var columns = [
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '입고금액', field : 'TOTAL_DELIVERY_PRICE',
|
||||
@@ -165,7 +165,7 @@ var columns = [
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '미입고금액', field : 'TOTAL_NOT_DELIVERY_PRICE',
|
||||
@@ -179,7 +179,7 @@ var columns = [
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1.1, title:'수입검사 검사현황', field:'INSPECTION_STATUS'},
|
||||
|
||||
@@ -517,7 +517,7 @@ function fn_downmater(){
|
||||
<td style="text-align:right; padding-right: 10px;"><fmt:formatNumber value="${item.TOTAL_ORDER_QTY}" pattern="#,###" /></td><!-- 발주 총수량 -->
|
||||
<%-- <td><fmt:formatNumber value="${item.PURCHASE_TOTAL_PRICE}" pattern="#,###" /></td> --%><!-- 발주 공급가 총액 -->
|
||||
<td style="text-align:right; padding-right: 10px;"><fmt:formatNumber value="${item.TOTAL_DELIVERY_QTY}" pattern="#,###" /></td><!-- 입고 총수량 -->
|
||||
<td style="text-align:right; padding-right: 10px;"><fmt:formatNumber value="${item.TOTAL_DELIVERY_PRICE}" pattern="#,###" /></td><!-- 입고 공급가 총액 -->
|
||||
<td style="text-align:right; padding-right: 10px;"><fmt:formatNumber value="${item.TOTAL_DELIVERY_PRICE}" pattern="#,##0.00" /></td><!-- 입고 공급가 총액 -->
|
||||
<td style="text-align:right; padding-right: 10px;"><fmt:formatNumber value="${item.NON_ARRIVAL_QTY}" pattern="#,###" /></td><!-- 미착 총수량 -->
|
||||
<td>${item.DELIVERY_DATE}</td><!-- 납기일자 -->
|
||||
<td>${item.WRITER_NAME}</td>
|
||||
|
||||
@@ -14,6 +14,31 @@ String userId = CommonUtils.checkNull(person.getUserId());
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
</head>
|
||||
<script>
|
||||
/** 단가 입력: 숫자·소수점(최대 2자리)·천단위 콤마 */
|
||||
function fnc_bindPurchaseCostMoneyInputs() {
|
||||
$(document).off("keyup.purchaseCostMoney", ".purchase-cost-money").on("keyup.purchaseCostMoney", ".purchase-cost-money", function() {
|
||||
var v = $(this).val().replace(/,/g, "").replace(/[^0-9.]/g, "");
|
||||
var d = v.indexOf(".");
|
||||
if (d >= 0) {
|
||||
v = v.slice(0, d + 1) + v.slice(d + 1).replace(/\./g, "");
|
||||
}
|
||||
var parts = v.split(".");
|
||||
if (parts.length > 1 && parts[1].length > 2) {
|
||||
parts[1] = parts[1].slice(0, 2);
|
||||
v = parts[0] + "." + parts[1];
|
||||
}
|
||||
if (v === "" || v === ".") {
|
||||
$(this).val(v);
|
||||
return;
|
||||
}
|
||||
parts = v.split(".");
|
||||
var intPart = parts[0] === "" && parts.length > 1 ? "0" : parts[0];
|
||||
var decPart = parts.length > 1 ? parts[1] : "";
|
||||
var tail = parts.length > 1 ? "." + decPart : (v.slice(-1) === "." ? "." : "");
|
||||
$(this).val(fnc_addComma(intPart) + tail);
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(document).ready(function() {
|
||||
$("#btnClose").click(function(){
|
||||
@@ -27,14 +52,7 @@ $(function() {
|
||||
fn_getPurchaseOrderTargetPartList();
|
||||
|
||||
fnc_datepickForName();
|
||||
|
||||
$("input[numberOnly='']")
|
||||
.each(function(){
|
||||
$(this).css({'text-align':'center'})
|
||||
})
|
||||
.on("keyup", function() {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9]/g,"")));
|
||||
});
|
||||
fnc_bindPurchaseCostMoneyInputs();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -153,39 +171,39 @@ function fn_getPurchaseOrderTargetPartList(){
|
||||
/* 발주수량 */
|
||||
appendText += " <td class='align_c'>";
|
||||
appendText += " <input type='hidden' name='ORDER_QTY_"+OBJID+"' id='ORDER_QTY_"+OBJID+"' value='"+QTY+"'>";
|
||||
appendText += " "+numberWithCommas(QTY);
|
||||
appendText += " "+formatInteger(QTY);
|
||||
appendText += " </td>";
|
||||
|
||||
/* 단가 공급업체 */
|
||||
appendText += " <td class='align_c'>";
|
||||
appendText += " <input style='text-align:center' type='text' name='PARTNER_PRICE_"+OBJID+"' id='PARTNER_PRICE_"+OBJID+"' value='"+numberWithCommas(PARTNER_PRICE)+"' onchange='fn_calc("+OBJID+");' numberOnly>";
|
||||
appendText += " <input style='text-align:center' class='purchase-cost-money' type='text' name='PARTNER_PRICE_"+OBJID+"' id='PARTNER_PRICE_"+OBJID+"' value='"+formatMoney(PARTNER_PRICE)+"' onchange='fn_calc("+OBJID+");'>";
|
||||
//appendText += " "+numberWithCommas(PARTNER_PRICE);
|
||||
appendText += " </td>";
|
||||
/* 단가 레이져업체 */
|
||||
appendText += " <td class='align_c'>";
|
||||
appendText += " <input style='text-align:center' type='text' name='PRICE1_"+OBJID+"' id='PRICE1_"+OBJID+"' value='"+numberWithCommas(PRICE1)+"' onchange='fn_calc("+OBJID+");' numberOnly>";
|
||||
appendText += " <input style='text-align:center' class='purchase-cost-money' type='text' name='PRICE1_"+OBJID+"' id='PRICE1_"+OBJID+"' value='"+formatMoney(PRICE1)+"' onchange='fn_calc("+OBJID+");'>";
|
||||
//appendText += " "+numberWithCommas(PRICE1);
|
||||
appendText += " </td>";
|
||||
/* 단가 용접업체 */
|
||||
appendText += " <td class='align_c'>";
|
||||
appendText += " <input style='text-align:center' type='text' name='PRICE2_"+OBJID+"' id='PRICE2_"+OBJID+"' value='"+numberWithCommas(PRICE2)+"' onchange='fn_calc("+OBJID+");' numberOnly>";
|
||||
appendText += " <input style='text-align:center' class='purchase-cost-money' type='text' name='PRICE2_"+OBJID+"' id='PRICE2_"+OBJID+"' value='"+formatMoney(PRICE2)+"' onchange='fn_calc("+OBJID+");'>";
|
||||
//appendText += " "+numberWithCommas(PRICE2);
|
||||
appendText += " </td>";
|
||||
/* 단가 가공업체 */
|
||||
appendText += " <td>";
|
||||
appendText += " <input style='text-align:center' type='text' name='PRICE3_"+OBJID+"' id='PRICE3_"+OBJID+"' value='"+numberWithCommas(PRICE3)+"' onchange='fn_calc("+OBJID+");' numberOnly>";
|
||||
//appendText += " "+numberWithCommas(PRICE3);
|
||||
appendText += " <input type='hidden' name='PRICE_SUM_"+OBJID+"' id='PRICE_SUM_"+OBJID+"' value='"+numberWithCommas(PRICE_SUM)+"'>";
|
||||
appendText += " <input style='text-align:center' class='purchase-cost-money' type='text' name='PRICE3_"+OBJID+"' id='PRICE3_"+OBJID+"' value='"+formatMoney(PRICE3)+"' onchange='fn_calc("+OBJID+");'>";
|
||||
//appendText += " "+formatMoney(PRICE3);
|
||||
appendText += " <input type='hidden' name='PRICE_SUM_"+OBJID+"' id='PRICE_SUM_"+OBJID+"' value='"+removeComma(formatMoney(PRICE_SUM))+"'>";
|
||||
appendText += " </td>";
|
||||
|
||||
/* 공급가 */
|
||||
appendText += " <td class='align_r' id='TD_PRICE_SUM_"+OBJID+"'>";
|
||||
appendText += " "+numberWithCommas(PRICE_SUM);
|
||||
appendText += " "+formatMoney(PRICE_SUM);
|
||||
appendText += " </td>";
|
||||
|
||||
/* 부가세 */
|
||||
appendText += " <td class='align_r' id='TD_VAT_PRICE_SUM_"+OBJID+"'>";
|
||||
appendText += " "+numberWithCommas(Number(PRICE_SUM)*0.1);
|
||||
appendText += " "+formatMoney(Number(String(PRICE_SUM).replace(/,/g,""))*0.1);
|
||||
appendText += " </td>";
|
||||
|
||||
appendText += " </tr>";
|
||||
@@ -212,7 +230,7 @@ function fn_save(){
|
||||
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
|
||||
$("input[numberOnly='']").each(function(){
|
||||
$("input.purchase-cost-money").each(function(){
|
||||
$(this).val($(this).val().replace(/,/gi,""));
|
||||
});
|
||||
$("input[name*='PRICE']").each(function(){
|
||||
@@ -246,11 +264,11 @@ function fn_checkInputData(){
|
||||
$("input[name=OBJID]").each(function(i) {
|
||||
var targetObjId = $(this).val();
|
||||
|
||||
var PRICE1 = Number($("#PRICE1_" +targetObjId).val()); //단가
|
||||
var PRICE2 = Number($("#PRICE2_" +targetObjId).val()); //단가
|
||||
var PRICE3 = Number($("#PRICE3_" +targetObjId).val()); //단가
|
||||
var PRICE1 = parseFloat(String($("#PRICE1_" +targetObjId).val() || "").replace(/,/g, "")); //단가
|
||||
var PRICE2 = parseFloat(String($("#PRICE2_" +targetObjId).val() || "").replace(/,/g, "")); //단가
|
||||
var PRICE3 = parseFloat(String($("#PRICE3_" +targetObjId).val() || "").replace(/,/g, "")); //단가
|
||||
|
||||
if("" == PRICE1){
|
||||
if(isNaN(PRICE1) || PRICE1 === 0){
|
||||
Swal.fire("단가를 입력해 주세요.");
|
||||
returnFlag = false;
|
||||
return false;
|
||||
@@ -272,9 +290,9 @@ function fn_calc(objid){
|
||||
|
||||
var PRICE_SUM = (PRICE1 + PRICE2 + PRICE3 + PARTNER_PRICE) * ORDER_QTY;
|
||||
|
||||
$("#PRICE_SUM_"+objid).val(numberWithCommas(PRICE_SUM+""));
|
||||
$("#TD_PRICE_SUM_"+objid).html(numberWithCommas(PRICE_SUM+""));
|
||||
$("#TD_VAT_PRICE_SUM_"+objid).html(numberWithCommas(Number(PRICE_SUM)*0.1 +""));
|
||||
$("#PRICE_SUM_"+objid).val(removeComma(formatMoney(PRICE_SUM)));
|
||||
$("#TD_PRICE_SUM_"+objid).html(formatMoney(PRICE_SUM));
|
||||
$("#TD_VAT_PRICE_SUM_"+objid).html(formatMoney(PRICE_SUM * 0.1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -159,19 +159,19 @@ function fn_getPurchaseOrderTargetPartList(){
|
||||
/* 발주수량 */
|
||||
appendText += " <td class='align_r'>";
|
||||
appendText += " <input type='hidden' name='ORDER_QTY_"+OBJID+"' id='ORDER_QTY_"+OBJID+"' value='"+QTY+"'>";
|
||||
appendText += " "+numberWithCommas(QTY);
|
||||
appendText += " "+formatInteger(QTY);
|
||||
appendText += " </td>";
|
||||
|
||||
/* 단가 */
|
||||
appendText += " <td class='align_r'>";
|
||||
appendText += " <input type='hidden' name='PARTNER_PRICE_"+OBJID+"' id='PARTNER_PRICE_"+OBJID+"' value='"+PARTNER_PRICE+"'>";
|
||||
appendText += " "+numberWithCommas(PARTNER_PRICE);
|
||||
appendText += " "+formatMoney(PARTNER_PRICE);
|
||||
appendText += " </td>";
|
||||
|
||||
/* 공급가 */
|
||||
appendText += " <td class='align_r'>";
|
||||
appendText += " <input type='hidden' name='SUPPLY_UNIT_PRICE_"+OBJID+"' id='SUPPLY_UNIT_PRICE_"+OBJID+"' value='"+SUPPLY_UNIT_PRICE+"'>";
|
||||
appendText += " "+numberWithCommas(SUPPLY_UNIT_PRICE);
|
||||
appendText += " "+formatMoney(SUPPLY_UNIT_PRICE);
|
||||
appendText += " </td>";
|
||||
|
||||
/* 입고요청일 */
|
||||
|
||||
@@ -69,6 +69,199 @@ $(document).ready(function(){
|
||||
$("#project_no").change(function(){
|
||||
fn_UnitCodeList(this.value, "unit_code", "");
|
||||
});
|
||||
|
||||
|
||||
// 마감정보입력 버튼
|
||||
$("#btnDeadlineInfo").click(function(){
|
||||
var targetObj = _tabulGrid.getSelectedData();
|
||||
|
||||
if(0 == targetObj.length){
|
||||
Swal.fire("선택된 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 선택된 OBJID 목록
|
||||
var objIdList = [];
|
||||
for(var i = 0; i < targetObj.length; i++){
|
||||
objIdList.push(fnc_checkNull(targetObj[i].ARRIVAL_PLAN_OBJID));
|
||||
}
|
||||
|
||||
// 단건 선택 시 기존 마감정보 불러오기
|
||||
var loadExisting = (targetObj.length === 1);
|
||||
|
||||
function openDeadlineInfoPopup(existingInfo) {
|
||||
var taxType = (existingInfo && existingInfo.TAX_TYPE) ? existingInfo.TAX_TYPE : '';
|
||||
var taxInvoiceDate = (existingInfo && existingInfo.TAX_INVOICE_DATE) ? existingInfo.TAX_INVOICE_DATE : '';
|
||||
var exportDeclNo = (existingInfo && existingInfo.EXPORT_DECL_NO) ? existingInfo.EXPORT_DECL_NO : '';
|
||||
var loadingDate = (existingInfo && existingInfo.LOADING_DATE) ? existingInfo.LOADING_DATE : '';
|
||||
var foreignType = (existingInfo && existingInfo.FOREIGN_TYPE) ? existingInfo.FOREIGN_TYPE : '';
|
||||
var duty = (existingInfo && existingInfo.DUTY) ? existingInfo.DUTY : '';
|
||||
var importVat = (existingInfo && existingInfo.IMPORT_VAT) ? existingInfo.IMPORT_VAT : '';
|
||||
var exchangeRate = (existingInfo && existingInfo.EXCHANGE_RATE) ? existingInfo.EXCHANGE_RATE : '';
|
||||
|
||||
// hidden select에서 과세구분 옵션 HTML 가져오기
|
||||
var taxTypeOptionsHtml = $('#hiddenTaxTypeList').html();
|
||||
|
||||
// hidden select에서 국내/해외 옵션 HTML 가져오기
|
||||
var foreignTypeOptionsHtml = $('#hiddenForeignTypeList').html();
|
||||
|
||||
Swal.fire({
|
||||
title: '마감정보입력',
|
||||
width: '600px',
|
||||
html:
|
||||
'<div style="padding:10px;">' +
|
||||
'<table style="width:100%; border-collapse:collapse;">' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">국내/해외</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;">' +
|
||||
' <select id="swal_foreignType" style="width:100%; padding:5px;">' +
|
||||
foreignTypeOptionsHtml +
|
||||
' </select>' +
|
||||
' </td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">환율</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exchangeRate" style="width:95%; padding:5px;"></td>' +
|
||||
'</tr>' +
|
||||
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">과세구분</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;">' +
|
||||
' <select id="swal_taxType" style="width:100%; padding:5px;">' +
|
||||
taxTypeOptionsHtml +
|
||||
' </select>' +
|
||||
' </td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">세금계산서발행일</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_taxInvoiceDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수출신고필증신고번호</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exportDeclNo" style="width:95%; padding:5px;"></td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">선적일자</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_loadingDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">관세</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_duty" style="width:95%; padding:5px;"></td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수입부가세</td>' +
|
||||
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_importVat" style="width:95%; padding:5px;"></td>' +
|
||||
'</tr>' +
|
||||
'</table>' +
|
||||
'<div style="margin-top:10px; color:#666; font-size:12px;">선택된 ' + targetObj.length + '건의 데이터에 마감정보를 입력합니다.</div>' +
|
||||
'</div>',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#2196F3',
|
||||
cancelButtonColor: '#666',
|
||||
confirmButtonText: '저장',
|
||||
cancelButtonText: '닫기',
|
||||
onOpen: function() {
|
||||
// 날짜 필드 datepicker 초기화
|
||||
$('#swal_taxInvoiceDate').datepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
changeMonth: true,
|
||||
changeYear: true
|
||||
});
|
||||
$('#swal_loadingDate').datepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
changeMonth: true,
|
||||
changeYear: true
|
||||
});
|
||||
// 기존 데이터 세팅
|
||||
if(taxType) $('#swal_taxType').val(taxType);
|
||||
if(taxInvoiceDate) $('#swal_taxInvoiceDate').val(taxInvoiceDate);
|
||||
if(exportDeclNo) $('#swal_exportDeclNo').val(exportDeclNo);
|
||||
if(loadingDate) $('#swal_loadingDate').val(loadingDate);
|
||||
if(foreignType) $('#swal_foreignType').val(foreignType);
|
||||
if(duty) $('#swal_duty').val(formatMoney(duty));
|
||||
if(importVat) $('#swal_importVat').val(formatMoney(importVat));
|
||||
if(exchangeRate) $('#swal_exchangeRate').val(formatMoney(exchangeRate));
|
||||
|
||||
// 금액 입력 필드 포맷 (keyup: 천단위 콤마, blur: 소수점 2자리)
|
||||
$('#swal_exchangeRate, #swal_duty, #swal_importVat').on('keyup', function(){
|
||||
var val = this.value.replace(/[^0-9.]/g, '');
|
||||
var parts = val.split('.');
|
||||
if(parts.length > 2) val = parts[0] + '.' + parts.slice(1).join('');
|
||||
if(parts[0]) parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
this.value = parts.join('.');
|
||||
}).on('blur', function(){
|
||||
var v = this.value.replace(/,/g, '');
|
||||
if(v && !isNaN(v)) this.value = formatMoney(v);
|
||||
});
|
||||
},
|
||||
preConfirm: function() {
|
||||
return {
|
||||
taxType: $('#swal_taxType').val(),
|
||||
taxInvoiceDate: $('#swal_taxInvoiceDate').val(),
|
||||
exportDeclNo: $('#swal_exportDeclNo').val(),
|
||||
loadingDate: $('#swal_loadingDate').val(),
|
||||
foreignType: $('#swal_foreignType').val(),
|
||||
duty: removeComma($('#swal_duty').val()),
|
||||
importVat: removeComma($('#swal_importVat').val()),
|
||||
exchangeRate: removeComma($('#swal_exchangeRate').val())
|
||||
};
|
||||
}
|
||||
}).then(function(result) {
|
||||
if (result.isConfirmed) {
|
||||
var formData = result.value;
|
||||
|
||||
$.ajax({
|
||||
url: "/purchaseOrder/saveArrivalPlanDeadlineInfo.do",
|
||||
type: "POST",
|
||||
data: {
|
||||
"objIdList": objIdList.join(','),
|
||||
"taxType": formData.taxType,
|
||||
"taxInvoiceDate": formData.taxInvoiceDate,
|
||||
"exportDeclNo": formData.exportDeclNo,
|
||||
"loadingDate": formData.loadingDate,
|
||||
"foreignType": formData.foreignType,
|
||||
"duty": formData.duty,
|
||||
"importVat": formData.importVat,
|
||||
"exchangeRate": formData.exchangeRate
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
Swal.fire({
|
||||
title: data.msg || '처리되었습니다.',
|
||||
icon: data.result ? 'success' : 'error'
|
||||
}).then(function() {
|
||||
if(data.result) fn_search();
|
||||
});
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.fire({
|
||||
title: '마감정보 저장 중 오류가 발생했습니다.',
|
||||
text: error || jqxhr.statusText || '서버 오류',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 단건 선택 시 그리드 데이터에서 기존 마감정보 가져오기
|
||||
if(loadExisting) {
|
||||
var row = targetObj[0];
|
||||
openDeadlineInfoPopup({
|
||||
TAX_TYPE: fnc_checkNull(row.TAX_TYPE),
|
||||
TAX_INVOICE_DATE: fnc_checkNull(row.TAX_INVOICE_DATE),
|
||||
EXPORT_DECL_NO: fnc_checkNull(row.EXPORT_DECL_NO),
|
||||
LOADING_DATE: fnc_checkNull(row.LOADING_DATE),
|
||||
FOREIGN_TYPE: fnc_checkNull(row.FOREIGN_TYPE),
|
||||
DUTY: fnc_checkNull(row.DUTY),
|
||||
EXCHANGE_RATE: fnc_checkNull(row.EXCHANGE_RATE),
|
||||
IMPORT_VAT: fnc_checkNull(row.IMPORT_VAT)
|
||||
});
|
||||
} else {
|
||||
openDeadlineInfoPopup(null);
|
||||
}
|
||||
});
|
||||
|
||||
fn_search();
|
||||
});
|
||||
@@ -126,7 +319,7 @@ var columns = [
|
||||
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
||||
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
||||
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
},
|
||||
// {headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'미입고금액', field:'TOTAL_NOT_DELIVERY_PRICE',
|
||||
@@ -139,7 +332,21 @@ var columns = [
|
||||
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:0.9, title:'확정입고수량', field:'CONFIRMED_QTY',
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'left', minWidth:100, widthGrow:1.2, title:'계정과목', field:'SUB_LOCATION_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'계정과목', field:'SUB_LOCATION_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'국내/해외', field:'FOREIGN_TYPE_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'환율', field:'EXCHANGE_RATE',
|
||||
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'과세구분', field:'TAX_TYPE_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'세금계산서발행일', field:'TAX_INVOICE_DATE'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'수출신고필증신고번호', field:'EXPORT_DECL_NO'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'선적일자', field:'LOADING_DATE'},
|
||||
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'관세', field:'DUTY',
|
||||
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'수입부가세', field:'IMPORT_VAT',
|
||||
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:85, widthGrow:0.6, title:'매입마감', field:'PURCHASE_CLOSE_DATE'}
|
||||
];
|
||||
|
||||
@@ -279,7 +486,17 @@ function fn_purchaseClose(){
|
||||
</form>
|
||||
<form name="form1" id="form1" action="" method="post">
|
||||
<textarea style="width:0px; height:0px; visibility: hidden;" id="jsonLevel3_csmCategory">${code_map.jsonLevel3_csmCategory}</textarea>
|
||||
|
||||
<select id="hiddenTaxTypeList" style="display:none;">
|
||||
<option value="">선택</option>
|
||||
<option value="0900218">과세매입</option>
|
||||
<option value="0900219">영세매입</option>
|
||||
<option value="0900220">수입</option>
|
||||
</select>
|
||||
<select id="hiddenForeignTypeList" style="display:none;">
|
||||
<option value="">선택</option>
|
||||
<option value="0001220">국내</option>
|
||||
<option value="0001221">해외</option>
|
||||
</select>
|
||||
<div class="content-box" style="height: 99.3%;">
|
||||
<div class="content-box-s">
|
||||
<div class="plm_menu_name_gdnsi">
|
||||
@@ -288,6 +505,7 @@ function fn_purchaseClose(){
|
||||
</h2>
|
||||
<div class="btnArea">
|
||||
<input type="button" class="plm_btns" value="조회" id="btnSearch">
|
||||
<input type="button" class="plm_btns"value="마감정보입력" id="btnDeadlineInfo" style="background-color: #2196F3; color: white;">
|
||||
<input type="button" class="plm_btns" value="매입마감" id="btnClose">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -172,6 +172,11 @@ input.date_icon {
|
||||
.ui-jqgrid .select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 24px;
|
||||
}
|
||||
.ui-jqgrid tr.jqgrow td {
|
||||
white-space: normal !important;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
@@ -186,12 +191,19 @@ $(document).ready(function(){
|
||||
$(this).css({'text-align':'right'})
|
||||
})
|
||||
.on("keyup", function() {
|
||||
$(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g,"")));
|
||||
var idn = ($(this).attr("id")||"") + ($(this).attr("name")||"");
|
||||
var allowDecimal = /PRICE|AMOUNT|TOTAL_SUPPLY|TOTAL_VAT|TOTAL_PRICE|SUPPLY_UNIT/i.test(idn);
|
||||
$(this).val(fnc_addComma($(this).val().replace(allowDecimal ? /[^0-9.]/g : /[^0-9]/g,"")));
|
||||
});
|
||||
|
||||
var unit_cd = $.parseJSON($("#unit_cd").val());
|
||||
var currency_cd = $.parseJSON($("#currency_cd").val());
|
||||
var _gridData = $.parseJSON($("#gridDetailList").val());
|
||||
for(var i = 0; i < _gridData.length; i++) {
|
||||
if(_gridData[i].SPEC && _gridData[i].SPEC.trim() !== '') {
|
||||
_gridData[i].PART_NAME = _gridData[i].PART_NAME + '/' + _gridData[i].SPEC;
|
||||
}
|
||||
}
|
||||
console.log("=== gridDetailList ===", JSON.stringify(_gridData));
|
||||
console.log("=== currency_cd ===", JSON.stringify(currency_cd));
|
||||
|
||||
@@ -199,18 +211,17 @@ $(document).ready(function(){
|
||||
url: ""
|
||||
,datatype: "local"
|
||||
,data: _gridData
|
||||
,colNames: ["OBJID","PART_OBJID","Item No.","Commodity & Description","Spec","Unit","Q'ty","Currency","Unit Price","Amount","Delivery"]
|
||||
,colNames: ["OBJID","PART_OBJID","Item No.","Commodity & Description","Unit","Q'ty","Currency","Unit Price","Amount","Delivery"]
|
||||
,colModel: [
|
||||
{name:"OBJID" , hidden: true, sortable:false, editable:false}
|
||||
,{name:"PART_OBJID" , hidden: true, sortable:false, editable:false}
|
||||
,{name:"PART_NO" , width:90, align:"center", sortable:false, editable:false}
|
||||
,{name:"PART_NAME" , width:200, align:"left", sortable:false, editable:false}
|
||||
,{name:"SPEC" , width:120, align:"left", sortable:false, editable:false}
|
||||
,{name:"PART_NO" , width:120, align:"center", sortable:false, editable:false}
|
||||
,{name:"PART_NAME" , width:260, align:"left", sortable:false, editable:false}
|
||||
,{name:"UNIT" , width:50, align:"center", sortable:false, editable:<%= isModify %>
|
||||
,edittype:"select", formatter:"select"
|
||||
,editoptions:{ value: unit_cd }
|
||||
}
|
||||
,{name:"ORDER_QTY" , width:60, align:"right", sortable:false, editable:<%= isModify %>
|
||||
,{name:"ORDER_QTY" , width:50, align:"right", sortable:false, editable:<%= isModify %>
|
||||
,formatter:"integer", formatoptions:{thousandsSeparator:","}
|
||||
,editoptions:{
|
||||
dataInit: function(e){ e.style.textAlign = "right"; }
|
||||
@@ -241,7 +252,7 @@ $(document).ready(function(){
|
||||
,{name:"SUPPLY_UNIT_PRICE", width:90, align:"right", sortable:false, editable:false
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2}
|
||||
}
|
||||
,{name:"DELIVERY_REQUEST_DATE", width:120, align:"center", sortable:false, editable:<%= isModify %>
|
||||
,{name:"DELIVERY_REQUEST_DATE", width:90, align:"center", sortable:false, editable:<%= isModify %>
|
||||
,editoptions:{
|
||||
dataInit: function(elem) {
|
||||
$(elem).datepicker({
|
||||
@@ -308,8 +319,13 @@ $(document).ready(function(){
|
||||
return MONTH_NAMES_EN[d.getMonth()] + ". " + ("0"+d.getDate()).slice(-2) + ". " + d.getFullYear();
|
||||
}
|
||||
|
||||
// 저장값(hidden) → 표시값 초기 세팅
|
||||
// 저장값(hidden) → 표시값 초기 세팅 (비어있으면 오늘 날짜)
|
||||
var initDate = $("#PURCHASE_DATE").val();
|
||||
if(!initDate || initDate.trim() === '') {
|
||||
var today = new Date();
|
||||
initDate = today.getFullYear() + '-' + ('0'+(today.getMonth()+1)).slice(-2) + '-' + ('0'+today.getDate()).slice(-2);
|
||||
$("#PURCHASE_DATE").val(initDate);
|
||||
}
|
||||
$("#PURCHASE_DATE_DISPLAY").val(toEnglishDateDisplay(initDate));
|
||||
|
||||
$("#PURCHASE_DATE_DISPLAY").datepicker({
|
||||
@@ -342,8 +358,7 @@ function fn_addRow(rowData){
|
||||
var addData = {
|
||||
"PART_OBJID" : rowData.map.PART_OBJID
|
||||
,"PART_NO" : rowData.map.PART_NO
|
||||
,"PART_NAME" : rowData.map.PART_NAME
|
||||
,"SPEC" : rowData.map.SPEC
|
||||
,"PART_NAME" : rowData.map.PART_NAME + (rowData.map.SPEC ? '/' + rowData.map.SPEC : '')
|
||||
,"ORDER_QTY" : v1
|
||||
,"UNIT" : fnc_checkNullDefaultValue(rowData.map.UNIT, '0001400')
|
||||
,"CURRENCY" : "0001534"
|
||||
@@ -484,8 +499,7 @@ var gridFn = {
|
||||
}
|
||||
|
||||
function numberWithCommasDecimal(num) {
|
||||
var n = Number(num);
|
||||
return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
return formatMoney(num);
|
||||
}
|
||||
|
||||
function getCurrencySymbol(currencyCode) {
|
||||
|
||||
@@ -268,7 +268,7 @@ $(document).ready(function(){
|
||||
}
|
||||
}
|
||||
,{name:"PARTNER_PRICE" , width:80, align:"right", sortable:false, editable:<%= isModify %>
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2}
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:0}
|
||||
,editoptions:{
|
||||
dataInit: function(e){
|
||||
e.style.textAlign = "right";
|
||||
@@ -285,7 +285,7 @@ $(document).ready(function(){
|
||||
}
|
||||
}
|
||||
,{name:"SUPPLY_UNIT_PRICE", width:90, align:"right", sortable:false, editable:false
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2}
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:0}
|
||||
}
|
||||
,{name:"REMARK" , width:180, align:"left", sortable:false, editable:<%= isModify %>}
|
||||
,{name:"DELIVERY_REQUEST_DATE", width:90, align:"center", sortable:false, editable:<%= isModify %>}
|
||||
@@ -551,8 +551,8 @@ var gridFn = {
|
||||
}
|
||||
|
||||
function numberWithCommasDecimal(num) {
|
||||
var n = Number(num);
|
||||
return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
var n = Math.round(Number(num));
|
||||
return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
// 라이브러리 로드 완료 후 dataLoaded 플래그 설정
|
||||
|
||||
@@ -227,7 +227,7 @@ $(document).ready(function(){
|
||||
,editoptions:{ value: unit_cd }
|
||||
}
|
||||
,{name:"PARTNER_PRICE" , width:80, align:"right", sortable:false, editable:<%= isModify %>
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2}
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:0}
|
||||
,editoptions:{
|
||||
dataInit: function(e){
|
||||
e.style.textAlign = "right";
|
||||
@@ -244,7 +244,7 @@ $(document).ready(function(){
|
||||
}
|
||||
}
|
||||
,{name:"SUPPLY_UNIT_PRICE" , width:90, align:"right", sortable:false, editable:false
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2}
|
||||
,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:0}
|
||||
}
|
||||
,{name:"WORK_ORDER_NO" , width:100, align:"center", sortable:false, editable:<%= isModify %>}
|
||||
,{name:"PART_NO" , width:90, align:"center", sortable:false, editable:false}
|
||||
@@ -467,8 +467,8 @@ var gridFn = {
|
||||
}
|
||||
|
||||
function numberWithCommasDecimal(num) {
|
||||
var n = Number(num);
|
||||
return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
var n = Math.round(Number(num));
|
||||
return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
// 라이브러리 로드 완료 후 dataLoaded 플래그 설정
|
||||
|
||||
@@ -524,9 +524,9 @@ function fn_downmater(){
|
||||
<td>${item.PRODUCT_CODE_NAME}</td><!-- 기종 -->
|
||||
<td>${item.PARTNER_NAME}</td><!-- 공급업체 -->
|
||||
<td><fmt:formatNumber value="${item.TOTAL_ORDER_QTY}" pattern="#,###" /></td><!-- 발주 총수량 -->
|
||||
<td><fmt:formatNumber value="${item.PURCHASE_TOTAL_PRICE}" pattern="#,###" /></td><!-- 발주 공급가 총액 -->
|
||||
<td><fmt:formatNumber value="${item.PURCHASE_TOTAL_PRICE}" pattern="#,##0.00" /></td><!-- 발주 공급가 총액 -->
|
||||
<td><fmt:formatNumber value="${item.TOTAL_DELIVERY_QTY}" pattern="#,###" /></td><!-- 입고 총수량 -->
|
||||
<td><fmt:formatNumber value="${item.TOTAL_DELIVERY_PRICE}" pattern="#,###" /></td><!-- 입고 공급가 총액 -->
|
||||
<td><fmt:formatNumber value="${item.TOTAL_DELIVERY_PRICE}" pattern="#,##0.00" /></td><!-- 입고 공급가 총액 -->
|
||||
<td><fmt:formatNumber value="${item.NON_ARRIVAL_QTY}" pattern="#,###" /></td><!-- 미착 총수량 -->
|
||||
<td>${item.DELIVERY_DATE}</td><!-- 납기일자 -->
|
||||
<td>${item.WRITER_NAME}</td>
|
||||
|
||||
@@ -216,9 +216,9 @@ $(document).ready(function(){
|
||||
row.update(rowData);
|
||||
return;
|
||||
}
|
||||
DISCOUNT_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE * NEGO_RATE/100).toFixed(1);
|
||||
DISCOUNT_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE * NEGO_RATE/100).toFixed(2);
|
||||
rowData.DISCOUNT_PRICE_ALL = DISCOUNT_PRICE_ALL;
|
||||
rowData.TOTAL_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE - DISCOUNT_PRICE_ALL).toFixed(1);
|
||||
rowData.TOTAL_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE - DISCOUNT_PRICE_ALL).toFixed(2);
|
||||
row.update(rowData);
|
||||
}else if(columnField == 'DISCOUNT_PRICE_ALL'){
|
||||
if(DISCOUNT_PRICE_ALL == 0 || DISCOUNT_PRICE_ALL < 0){
|
||||
@@ -360,7 +360,7 @@ var columns = [
|
||||
else if(currencyName.includes('유로') || currencyName === 'EUR') s = '€';
|
||||
else if(currencyName.includes('엔') || currencyName === 'JPY') s = '¥';
|
||||
else if(currencyName.includes('위안') || currencyName === 'CNY') s = '¥';
|
||||
return s + Number(value).toLocaleString();
|
||||
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits:2, maximumFractionDigits:2});
|
||||
}
|
||||
},
|
||||
// {headerHozAlign:'center', hozAlign:'right', widthGrow:1.2, title:'총액', field:'TOTAL_PRICE_ALL',
|
||||
@@ -434,7 +434,7 @@ function fn_search(){
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(data){
|
||||
_sum = numberWithCommas(data.TOTAL_SUPPLY_PRICE);
|
||||
_sum = formatMoney(data.TOTAL_SUPPLY_PRICE);
|
||||
//_sum2 = numberWithCommas(data.TOTAL_SUPPLY_PRICE);
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
|
||||
@@ -305,9 +305,9 @@ $(document).ready(function(){
|
||||
row.update(rowData);
|
||||
return;
|
||||
}
|
||||
DISCOUNT_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE * NEGO_RATE/100).toFixed(1);
|
||||
DISCOUNT_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE * NEGO_RATE/100).toFixed(2);
|
||||
rowData.DISCOUNT_PRICE_ALL = DISCOUNT_PRICE_ALL;
|
||||
rowData.TOTAL_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE - DISCOUNT_PRICE_ALL).toFixed(1);
|
||||
rowData.TOTAL_PRICE_ALL = (TOTAL_REAL_SUPPLY_PRICE - DISCOUNT_PRICE_ALL).toFixed(2);
|
||||
row.update(rowData);
|
||||
}else if(columnField == 'DISCOUNT_PRICE_ALL'){
|
||||
if(DISCOUNT_PRICE_ALL == 0 || DISCOUNT_PRICE_ALL < 0){
|
||||
@@ -465,16 +465,16 @@ var columns = [
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '등록일', field : 'SPEC_REG_DATE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '상태', field : 'SPEC_STATUS_NAME' },
|
||||
*/
|
||||
{visible:false, headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '부가세포함공급가', field : "TOTAL_SUPPLY_UNIT_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:false, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '공급가', field : "TOTAL_SUPPLY_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:false, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '실공급가', field : "TOTAL_REAL_SUPPLY_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:false, } },
|
||||
{visible:false, headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '부가세포함공급가', field : "TOTAL_SUPPLY_UNIT_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:2, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '공급가', field : "TOTAL_SUPPLY_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:2, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , /* width : '90', */ title : '실공급가', field : "TOTAL_REAL_SUPPLY_PRICE", formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:2, } },
|
||||
],
|
||||
},
|
||||
/*
|
||||
{title:"단일", headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , width : '75', title : '공급가', field : "TOTAL_SUPPLY_PRICE" ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false, } },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2, } },
|
||||
],
|
||||
},
|
||||
*/
|
||||
@@ -482,7 +482,7 @@ var columns = [
|
||||
{title:"할인(NEGO)", headerHozAlign:'center', //고객정보
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , width : '80', title : '할인금액', field : "DISCOUNT_PRICE_ALL", editable:editCheck, //DISCOUNT_PRICE
|
||||
formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:false, },
|
||||
formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:2, },
|
||||
editor:"number", editorParams:{
|
||||
min:0, max:9999999999, maxlength:10,//step:10, mask:"999",
|
||||
elementAttributes:{ maxlength:"10", pattern:"\d*",min:0, max:9999999999, oninput:"fnc_maxLengthCheck(this)" },
|
||||
@@ -497,7 +497,7 @@ var columns = [
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , /* width : '115', */ title : '할인공급가', field : "TOTAL_PRICE_ALL" , //TOTAL_PRICE
|
||||
formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:false, } }, //NEGO_ORDER_PRICE
|
||||
formatter:"money", formatterParams:{ thousand:",", symbolAfter:"p", precision:2, } }, //NEGO_ORDER_PRICE
|
||||
],
|
||||
}
|
||||
];
|
||||
@@ -573,8 +573,8 @@ function fn_search(){
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(data){
|
||||
_sum = numberWithCommas(data.TOTAL_REAL_SUPPLY_PRICE);
|
||||
_sum2 = numberWithCommas(data.TOTAL_SUPPLY_PRICE);
|
||||
_sum = formatMoney(data.TOTAL_REAL_SUPPLY_PRICE);
|
||||
_sum2 = formatMoney(data.TOTAL_SUPPLY_PRICE);
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
|
||||
@@ -79,44 +79,44 @@ $(document).ready(function(){
|
||||
var columns = [
|
||||
{headerHozAlign : 'center', hozAlign : 'left', /* width : '150', */ title : '공급업체명', field : 'SUPPLY_NAME' },
|
||||
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '소계', field : 'TOTAL_SUPPLY_UNIT_PRICE', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '소계', field : 'TOTAL_SUPPLY_UNIT_PRICE', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '1월', field : 'M01', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '1월', field : 'M01', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '2월', field : 'M02', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '2월', field : 'M02', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '3월', field : 'M03', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '3월', field : 'M03', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '4월', field : 'M04', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '4월', field : 'M04', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '5월', field : 'M05', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '5월', field : 'M05', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '6월', field : 'M06', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '6월', field : 'M06', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '7월', field : 'M07', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '7월', field : 'M07', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '8월', field : 'M08', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '8월', field : 'M08', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '9월', field : 'M09', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '9월', field : 'M09', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '10월', field : 'M10', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '10월', field : 'M10', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '11월', field : 'M11', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '11월', field : 'M11', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '12월', field : 'M12', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '115', title : '12월', field : 'M12', topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -148,19 +148,19 @@ function fn_search(){
|
||||
<tr>
|
||||
<%-- <td><input style="width: 15px; height: 15px" type="checkbox" value="${info.OBJID}" name="chk_objId" id="chk_objId" data-objId="${info.OBJID}"></td> --%>
|
||||
<td style="text-align:center;background:#E4E4E4">합계금액</td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${SUM_PRICE_MAP.M12}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${SUM_PRICE_MAP.M12}" /></td>
|
||||
</tr>
|
||||
|
||||
<c:choose>
|
||||
@@ -169,19 +169,19 @@ function fn_search(){
|
||||
<tr>
|
||||
<%-- <td><input style="width: 15px; height: 15px" type="checkbox" value="${info.OBJID}" name="chk_objId" id="chk_objId" data-objId="${info.OBJID}"></td> --%>
|
||||
<td style="text-align: left;" title="${row.SUPPLY_NAME}">${row.SUPPLY_NAME}</td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,###" value="${row.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.M12}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;background:#E4E4E4"" ><fmt:formatNumber pattern="#,##0.00" value="${row.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.M12}" /></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
@@ -261,19 +261,19 @@ function fn_search(){
|
||||
<tr>
|
||||
<td><input style="width: 15px; height: 15px" type="checkbox" value="${info.OBJID}" name="chk_objId" id="chk_objId" data-objId="${info.OBJID}"></td>
|
||||
<td style="text-align:center;">총 계</td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${sumM12}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${TOTAL}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM01}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM02}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM03}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM04}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM05}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM06}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM07}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM08}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM09}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM10}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM11}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${sumM12}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${TOTAL}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,7 @@ var columns = [
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '73', title : '발주품수', field : 'TOTAL_PO_PART_CNT' ,
|
||||
//formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
//formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
formatter:fnc_createGridAnchorTagAndComma,
|
||||
cellClick:function(e, cell){
|
||||
var objId = fnc_checkNull(cell.getData().SALES_OBJID);
|
||||
@@ -133,7 +133,7 @@ var columns = [
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '87', title : '미발주품수', field : 'NON_PO_PART_CNT',
|
||||
//formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
//formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
formatter:fnc_createGridAnchorTagAndComma,
|
||||
cellClick:function(e, cell){
|
||||
var objId = fnc_checkNull(cell.getData().SALES_OBJID);
|
||||
@@ -142,30 +142,30 @@ var columns = [
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '발주율', field : 'RATE_PO_S' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
/*
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '*발주금액(계)', field : 'TOTAL_SUPPLY_UNIT_PRICE' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
*/
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '구매품', field : 'PRICE_PT_1' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
//{headerHozAlign : 'center', hozAlign : 'right', width : '84', title : '구매품(%)', field : 'RATE_PRICE_PT_1' ,
|
||||
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
//},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '제작품', field : 'PRICE_PT_2' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
//{headerHozAlign : 'center', hozAlign : 'right', width : '84', title : '제작품(%)', field : 'RATE_PRICE_PT_2' ,
|
||||
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
//},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '사급품', field : 'PRICE_PT_3' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '기타', field : 'PRICE_PT_ETC' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
},
|
||||
|
||||
],
|
||||
@@ -173,45 +173,45 @@ var columns = [
|
||||
{title:"재발주현황", headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '50', title : '건수', field : 'RE_COUNT' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:function(cell){ return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '80', title : '금액(원)', field : 'RE_TOTAL_SUPPLY_UNIT_PRICE' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
}
|
||||
],
|
||||
},
|
||||
{title:"턴키현황", headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '50', title : '건수', field : 'TURNKEY_COUNT' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:function(cell){ return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '80', title : '금액(원)', field : 'TURNKEY_TOTAL_SUPPLY_UNIT_PRICE' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 }
|
||||
}
|
||||
],
|
||||
},
|
||||
{title:"총발주현황", headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , width : '110', title : '총발주금액(원)', field : "TOTAL_SUPPLY_PRICE" ,
|
||||
//topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:false },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false, } },
|
||||
//topCalc:'sum', topCalcFormatter : "money", topCalcFormatterParams : {thousand:",", symbolAfter:"p", precision:2 },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , width : '130', title : '구매BOM금액(원)', field : "SBOM_PRICE_SUM_ALL" ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false, } },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2, } },
|
||||
],
|
||||
},
|
||||
|
||||
{title:"할인현황", headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'right' , width : '73', title : '할인금액', field : "DISCOUNT_PRICE" ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false, } },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2, } },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '84', title : '네고율(%)', field : "NEGO_RATE", headerSort:true,},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '107', title : '총발주금액(원)', field : 'NEGO_TOTAL_PRICE' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 } },
|
||||
/*
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '117', title : '*실발주금액(원)', field : 'TOTAL_PRICE' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } },
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 } },
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '129', title : '*실발주금액(원) 총', field : 'TOTAL_PRICE_ALL' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } }
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:2 } }
|
||||
*/
|
||||
],
|
||||
}
|
||||
@@ -252,8 +252,8 @@ function fn_searchSum(){
|
||||
async:false,
|
||||
success:function(data){
|
||||
//_sum = numberWithCommas(data.TOTAL_SUPPLY_UNIT_PRICE);
|
||||
_sum = numberWithCommas(data.TOTAL_REAL_SUPPLY_PRICE);
|
||||
_sum2 = numberWithCommas(data.TOTAL_SUPPLY_PRICE);
|
||||
_sum = formatMoney(data.TOTAL_REAL_SUPPLY_PRICE);
|
||||
_sum2 = formatMoney(data.TOTAL_SUPPLY_PRICE);
|
||||
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
@@ -337,7 +337,7 @@ function fn_excel() {
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:50%;float:left; color: RED;" class="purchaseOrderSum">
|
||||
<%-- <font size="2px" color="red">총발주금액(원) : <fmt:formatNumber pattern="#,###" value="${resultMap.TOTAL_SUPPLY_UNIT_PRICE}" /> </font> --%>
|
||||
<%-- <font size="2px" color="red">총발주금액(원) : <fmt:formatNumber pattern="#,##0.00" value="${resultMap.TOTAL_SUPPLY_UNIT_PRICE}" /> </font> --%>
|
||||
</div>
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
|
||||
@@ -348,7 +348,7 @@ function fn_excel() {
|
||||
|
||||
|
||||
-->
|
||||
<font size="2px" color="red">발주금액 합 : <fmt:formatNumber pattern="#,###" value="${resultMap.TOTAL_SUPPLY_UNIT_PRICE}" /></font>
|
||||
<font size="2px" color="red">발주금액 합 : <fmt:formatNumber pattern="#,##0.00" value="${resultMap.TOTAL_SUPPLY_UNIT_PRICE}" /></font>
|
||||
</div>
|
||||
|
||||
<div class="in_table_scroll_wrap _table1" style="height:53px;width:99.4%;">
|
||||
@@ -455,21 +455,21 @@ function fn_excel() {
|
||||
<td style="text-align: right; padding-right: 10px;" title="${row.TOTAL_BOM_PART_CNT}">${row.TOTAL_BOM_PART_CNT}</td>
|
||||
<td style="text-align: right; padding-right: 10px;" title="${row.TOTAL_PO_PART_CNT}">${row.TOTAL_PO_PART_CNT}</td>
|
||||
<td style="text-align: right; padding-right: 10px;" title="${row.NON_PO_PART_CNT}">${row.NON_PO_PART_CNT}</td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.PRICE_PT_1}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.PRICE_PT_1}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" >${row.RATE_PRICE_PT_1}<c:if test="${not empty row.RATE_PRICE_PT_1}">%</c:if></td>
|
||||
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.PRICE_PT_2}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.PRICE_PT_2}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" >${row.RATE_PRICE_PT_2}<c:if test="${not empty row.RATE_PRICE_PT_2}">%</c:if></td>
|
||||
|
||||
기타
|
||||
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.PRICE_PT_ETC}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.PRICE_PT_ETC}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" >${row.RATE_PRICE_PT_ETC}<c:if test="${not empty row.RATE_PRICE_PT_ETC}">%</c:if></td>
|
||||
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.RE_COUNT}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,###" value="${row.RE_TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
<td style="text-align: right; padding-right: 10px;" ><fmt:formatNumber pattern="#,##0.00" value="${row.RE_TOTAL_SUPPLY_UNIT_PRICE}" /></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
|
||||
@@ -78,10 +78,10 @@ var columns = [
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '150', title : '발주수량', field : 'TOTAL_PURCHASE_ORDER_CNT' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:function(cell){ return formatInteger(cell.getValue()); }
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '150', title : '보유수량', field : 'STOCK_CNT' ,
|
||||
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false }
|
||||
formatter:function(cell){ return formatInteger(cell.getValue()); }
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
@@ -682,7 +682,8 @@ function fn_initGrid() {
|
||||
editable: true,
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
return value ? Number(value).toLocaleString() : '0';
|
||||
if(value === null || value === undefined || value === '') return '0.00';
|
||||
return formatMoney(value);
|
||||
}
|
||||
},
|
||||
// 32. 총단가 -> 소재총단가
|
||||
@@ -697,7 +698,7 @@ function fn_initGrid() {
|
||||
var qty = parseFloat(data.PO_QTY) || 0;
|
||||
var unitPrice = parseFloat(data.UNIT_PRICE) || 0;
|
||||
var totalPrice = qty * unitPrice;
|
||||
return totalPrice > 0 ? totalPrice.toLocaleString() : '0';
|
||||
return totalPrice > 0 ? formatMoney(totalPrice) : '0.00';
|
||||
}
|
||||
},
|
||||
|
||||
@@ -798,7 +799,8 @@ function fn_initGrid() {
|
||||
editable: true,
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
return value ? Number(value).toLocaleString() : '0';
|
||||
if(value === null || value === undefined || value === '') return '0.00';
|
||||
return formatMoney(value);
|
||||
}
|
||||
},
|
||||
// 가공총단가 (가공단가 × 제작수량)
|
||||
@@ -813,7 +815,7 @@ function fn_initGrid() {
|
||||
var productionQty = parseFloat(data.PRODUCTION_QTY) || 0;
|
||||
var processingUnitPrice = parseFloat(data.PROCESSING_UNIT_PRICE) || 0;
|
||||
var processingTotalPrice = productionQty * processingUnitPrice;
|
||||
return processingTotalPrice > 0 ? processingTotalPrice.toLocaleString() : '0';
|
||||
return processingTotalPrice > 0 ? formatMoney(processingTotalPrice) : '0.00';
|
||||
}
|
||||
},
|
||||
// 총합계 (소재총단가 + 가공총단가)
|
||||
@@ -835,7 +837,7 @@ function fn_initGrid() {
|
||||
var processingTotalPrice = productionQty * processingUnitPrice;
|
||||
// 총합계
|
||||
var grandTotal = materialTotalPrice + processingTotalPrice;
|
||||
return grandTotal > 0 ? grandTotal.toLocaleString() : '0';
|
||||
return grandTotal > 0 ? formatMoney(grandTotal) : '0.00';
|
||||
}
|
||||
},
|
||||
/* // 25. 가공납기 - 주석처리
|
||||
|
||||
@@ -403,11 +403,11 @@ function fn_cancel(){
|
||||
<td>${item.IMDRAWINGNO}</td>
|
||||
<td>${item.IMIMAGE}</td>
|
||||
<td>
|
||||
<fmt:formatNumber value="${item.IMPACKQTY}" type="number" maxFractionDigits="3" />
|
||||
<fmt:formatNumber value="${item.IMPACKQTY}" pattern="#,##0" />
|
||||
</td>
|
||||
<td>${item.IMDELIVERY}</td>
|
||||
<td>
|
||||
<fmt:formatNumber value="${item.IMMINORDERQTY}" type="number" maxFractionDigits="3" />
|
||||
<fmt:formatNumber value="${item.IMMINORDERQTY}" pattern="#,##0" />
|
||||
</td>
|
||||
<td>${item.IMSOURCINGTPNM}</td>
|
||||
<td>${item.IMSAGUPTPNM}</td>
|
||||
@@ -418,7 +418,7 @@ function fn_cancel(){
|
||||
<fmt:formatDate value="${upStartDt1}" pattern="yyyy-MM-dd" />
|
||||
</td>
|
||||
<td>
|
||||
<fmt:formatNumber value="${item.UPPRICE1}" type="number" maxFractionDigits="3" />
|
||||
<fmt:formatNumber value="${item.UPPRICE1}" pattern="#,##0.00" />
|
||||
</td>
|
||||
<td>${item.SUVNDNM2}</td>
|
||||
<td>
|
||||
@@ -426,7 +426,7 @@ function fn_cancel(){
|
||||
<fmt:formatDate value="${upStartDt2}" pattern="yyyy-MM-dd" />
|
||||
</td>
|
||||
<td>
|
||||
<fmt:formatNumber value="${item.UPPRICE2}" type="number" maxFractionDigits="3" />
|
||||
<fmt:formatNumber value="${item.UPPRICE2}" pattern="#,##0.00" />
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
@@ -696,7 +696,7 @@ function fn_loadSavedStatement(projectObjid, gridData) {
|
||||
for(var i = 0; i < savedData.length; i++) {
|
||||
var item = savedData[i];
|
||||
var quantity = parseInt(item.isqty || item.ISQTY || 0);
|
||||
var supply = parseInt(item.isamount || item.ISAMOUNT || 0);
|
||||
var supply = parseFloat(item.isamount || item.ISAMOUNT || 0);
|
||||
var vat = supply * 0.1; // VAT 10%
|
||||
|
||||
totalQuantity += quantity;
|
||||
@@ -849,8 +849,8 @@ function fn_fillData(data) {
|
||||
console.log("품목 " + (i+1) + ":", item);
|
||||
|
||||
var quantity = parseInt(item.QUANTITY || item.quantity || 0);
|
||||
var supply = parseInt(item.SUPPLYPRICE || item.supplyPrice || 0);
|
||||
var vat = parseInt(item.VAT || item.vat || 0);
|
||||
var supply = parseFloat(item.SUPPLYPRICE || item.supplyPrice || 0);
|
||||
var vat = parseFloat(item.VAT || item.vat || 0);
|
||||
totalQuantity += quantity;
|
||||
totalSupply += supply;
|
||||
totalVat += vat;
|
||||
@@ -935,11 +935,11 @@ function fn_recalculateTotal() {
|
||||
|
||||
// 공급가액 (5번째 열, index 4)
|
||||
var supplyText = $(cells[4]).text().trim().replace(/,/g, '');
|
||||
var supply = parseInt(supplyText) || 0;
|
||||
var supply = parseFloat(supplyText) || 0;
|
||||
|
||||
// 세액 (6번째 열, index 5)
|
||||
var vatText = $(cells[5]).text().trim().replace(/,/g, '');
|
||||
var vat = parseInt(vatText) || 0;
|
||||
var vat = parseFloat(vatText) || 0;
|
||||
|
||||
totalQuantity += quantity;
|
||||
totalSupply += supply;
|
||||
|
||||
@@ -80,13 +80,19 @@ pageContext.setAttribute("newLineChar", "\n");
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.datepicker-ko.js" ></script>
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.widget.js" ></script>
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.button.js" ></script>
|
||||
<script type="text/javascript" src="/js/common.js" ></script>
|
||||
<script type="text/javascript" src="/js/common.js?v=20260320" ></script>
|
||||
|
||||
<!-- //month picker -->
|
||||
<script type="text/javascript" src="/js/jquery.mtz.monthpicker.js" ></script>
|
||||
|
||||
<!-- //ppt viewer -->
|
||||
<script type="text/javascript" src="/js/jquery.gdocsviewer.js" ></script>
|
||||
<!-- select2를 위한 jQuery 전역 변수 설정 -->
|
||||
<script type="text/javascript">
|
||||
if(typeof jQuery === 'undefined' && typeof $ !== 'undefined') {
|
||||
window.jQuery = $;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="/js/select2.js" ></script>
|
||||
<script type="text/javascript" src="/js/sweetalert2.js" ></script>
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ pageContext.setAttribute("newLineChar", "\n");
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.datepicker-ko.js" ></script>
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.widget.js" ></script>
|
||||
<script type="text/javascript" src="/js/ui/jquery.ui.button.js" ></script>
|
||||
<script type="text/javascript" src="/js/common.js" ></script>
|
||||
<script type="text/javascript" src="/js/common.js?v=20260320" ></script>
|
||||
|
||||
<!-- //month picker -->
|
||||
<script type="text/javascript" src="/js/jquery.mtz.monthpicker.js" ></script>
|
||||
|
||||
@@ -3552,4 +3552,35 @@ function initPartSelect2Ajax(partNoSelectId, partNameSelectId, partObjIdInputId,
|
||||
$(partNoSelectId).on('select2:clear', partNoClearHandler);
|
||||
$(partNameSelectId).on('select2:select', partNameSelectHandler);
|
||||
$(partNameSelectId).on('select2:clear', partNameClearHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* 금액 표시용 포맷 (천단위 콤마 + 소수점 2자리 고정)
|
||||
* 예: 1005.04 → "1,005.04", 1000 → "1,000.00"
|
||||
*/
|
||||
function formatMoney(data) {
|
||||
if(!data && data !== 0) return '';
|
||||
var num = Number(String(data).replace(/,/g, ''));
|
||||
if(isNaN(num)) return '';
|
||||
return num.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||
}
|
||||
|
||||
/**
|
||||
* 정수 표시용 포맷 (천단위 콤마, 소수점 없음)
|
||||
* 예: 2.00 → "2", 1000 → "1,000"
|
||||
*/
|
||||
function formatInteger(data) {
|
||||
if(!data && data !== 0) return '';
|
||||
var num = Math.round(Number(String(data).replace(/,/g, '')));
|
||||
if(isNaN(num)) return '';
|
||||
return num.toLocaleString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 콤마 제거 함수
|
||||
* 예: "1,005.04" → "1005.04"
|
||||
*/
|
||||
function removeComma(data) {
|
||||
if(!data) return '';
|
||||
return data.toString().replace(/,/g, '');
|
||||
}
|
||||
@@ -53,7 +53,7 @@ echo "DEBUG: Effective classpath for javac: $EFFECTIVE_CLASSPATH"
|
||||
# src 폴더 내의 모든 .java 파일 컴파일
|
||||
echo "Compiling Java files for development..."
|
||||
|
||||
find src -name "*.java" -print0 | xargs -0 javac -encoding UTF-8 -source 1.8 -target 1.8 -d WebContent/WEB-INF/classes -cp "$EFFECTIVE_CLASSPATH"
|
||||
find src -name "*.java" -print0 | xargs -0 javac -encoding UTF-8 -source 1.7 -target 1.7 -d WebContent/WEB-INF/classes -cp "$EFFECTIVE_CLASSPATH"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Java compilation failed. Exiting script."
|
||||
exit 1
|
||||
|
||||
@@ -1795,6 +1795,13 @@ public class CommonUtils {
|
||||
DecimalFormat formatter = new DecimalFormat("#,##0.###");
|
||||
return formatter.format(num);
|
||||
}
|
||||
|
||||
// 소수점 2자리 고정 포맷 (천단위 콤마 포함)
|
||||
public static String numberFormatDecimal2(String num) {
|
||||
if(isBlank(num)) return num;
|
||||
DecimalFormat formatter = new DecimalFormat("#,##0.00");
|
||||
return formatter.format(Double.parseDouble(num.replace(",", "")));
|
||||
}
|
||||
|
||||
public static Map requestLogApi(HttpServletRequest request,Map paramMap,String useType){
|
||||
Map resultMap = new HashMap();
|
||||
|
||||
@@ -1633,6 +1633,16 @@ public class PurchaseOrderController {
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 입고건별 마감정보 저장
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/purchaseOrder/saveArrivalPlanDeadlineInfo.do")
|
||||
public Map saveArrivalPlanDeadlineInfo(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap) {
|
||||
return purchaseOrderService.saveArrivalPlanDeadlineInfo(request, paramMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 매입마감 관리 화면 (입고일별 입고관리)
|
||||
*/
|
||||
|
||||
@@ -1168,6 +1168,21 @@
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<!-- arrival_plan 마감정보 저장 -->
|
||||
<update id="saveArrivalPlanDeadlineInfo" parameterType="map">
|
||||
/* purchaseOrder.saveArrivalPlanDeadlineInfo - 입고건별 마감정보 저장 */
|
||||
UPDATE arrival_plan SET
|
||||
tax_type = #{taxType}
|
||||
<if test="taxInvoiceDate != null and taxInvoiceDate != ''">, tax_invoice_date = #{taxInvoiceDate}</if>
|
||||
<if test="exportDeclNo != null">, export_decl_no = #{exportDeclNo}</if>
|
||||
<if test="loadingDate != null and loadingDate != ''">, loading_date = #{loadingDate}</if>
|
||||
<if test="foreignType != null and foreignType != ''">, foreign_type = #{foreignType}</if>
|
||||
<if test="duty != null and duty != ''">, duty = CAST(#{duty} AS NUMERIC)</if>
|
||||
<if test="exchangeRate != null and exchangeRate != ''">, exchange_rate = CAST(#{exchangeRate} AS NUMERIC)</if>
|
||||
<if test="importVat != null and importVat != ''">, import_vat = CAST(#{importVat} AS NUMERIC)</if>
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<update id="updatePurchaseOrderMasterPriceAll" parameterType="map">
|
||||
UPDATE PURCHASE_ORDER_MASTER SET
|
||||
TOTAL_PRICE_TXT_ALL = NUM_TO_KOR((T.REAL_SUPPLY_PRICE_VAT)::varchar,'일금 ',' 원정 (₩ ') || TRIM(TO_CHAR((T.REAL_SUPPLY_PRICE_VAT), '999,999,999,999')) ||')'
|
||||
@@ -6608,6 +6623,18 @@ FROM(
|
||||
<!-- 매입마감일 (입고건 단위) -->
|
||||
,AP.PURCHASE_CLOSE_DATE
|
||||
|
||||
<!-- 마감정보 -->
|
||||
,COALESCE(AP.tax_type, '') AS TAX_TYPE
|
||||
,COALESCE((SELECT CODE_NAME FROM COMM_CODE CC WHERE CC.CODE_ID = AP.tax_type), '') AS TAX_TYPE_NAME
|
||||
,COALESCE(AP.tax_invoice_date, '') AS TAX_INVOICE_DATE
|
||||
,COALESCE(AP.export_decl_no, '') AS EXPORT_DECL_NO
|
||||
,COALESCE(AP.loading_date, '') AS LOADING_DATE
|
||||
,COALESCE(AP.foreign_type, '') AS FOREIGN_TYPE
|
||||
,COALESCE((SELECT CODE_NAME FROM COMM_CODE CC WHERE CC.CODE_ID = AP.foreign_type), '') AS FOREIGN_TYPE_NAME
|
||||
,COALESCE(AP.duty, 0) AS DUTY
|
||||
,COALESCE(AP.exchange_rate, 0) AS EXCHANGE_RATE
|
||||
,COALESCE(AP.import_vat, 0) AS IMPORT_VAT
|
||||
|
||||
FROM ARRIVAL_PLAN AP
|
||||
INNER JOIN PURCHASE_ORDER_MASTER POM ON POM.OBJID = AP.PARENT_OBJID
|
||||
INNER JOIN PURCHASE_ORDER_PART POP ON POP.PURCHASE_ORDER_MASTER_OBJID = POM.OBJID::VARCHAR
|
||||
|
||||
@@ -2690,7 +2690,7 @@ public class ContractMgmtController {
|
||||
code_map.put("contract_currency", commonService.bizMakeOptionList("0001533", CommonUtils.nullToEmpty((String)info.get("CONTRACT_CURRENCY")), "common.getCodeselect"));
|
||||
|
||||
// 반납사유 코드
|
||||
code_map.put("return_reason_cd", commonService.bizMakeOptionList("0002268", "", "common.getCodeselect"));
|
||||
code_map.put("return_reason_cd", commonService.bizMakeOptionList("0001810", CommonUtils.nullToEmpty((String)info.get("RETURN_REASON_CD")), "common.getCodeselect"));
|
||||
|
||||
request.setAttribute("code_map",code_map);
|
||||
request.setAttribute("info", info);
|
||||
|
||||
@@ -243,20 +243,20 @@
|
||||
,#{class1} /* */
|
||||
,#{class2} /* */
|
||||
,#{goodsGuarantee}:: INTEGER /* 보증기간 */
|
||||
,#{costAmt}:: BIGINT /* 판매금액 */
|
||||
,#{saleAmt}:: BIGINT /* */
|
||||
,#{saftyQty}:: BIGINT /* */
|
||||
,#{royalty}:: BIGINT /* */
|
||||
,#{costAmt}:: NUMERIC /* 판매금액 */
|
||||
,#{saleAmt}:: NUMERIC /* */
|
||||
,#{saftyQty}:: NUMERIC /* */
|
||||
,#{royalty}:: NUMERIC /* */
|
||||
,#{regYmd} /* 등록일자 */
|
||||
,#{delYmd} /* 단종일자 */
|
||||
,#{remark} /* 비고 */
|
||||
,#{commiYn} /* 판매수수료적용여부 */
|
||||
,#{commiGb} /* 방식/수식 */
|
||||
,#{commiGive} /* */
|
||||
,#{cCommiPer}:: BIGINT /* 크레인(%) */
|
||||
,#{tCommiPer}:: BIGINT /* 특장(%) */
|
||||
,#{cCommiAmt}:: BIGINT /* 크레인(금액) */
|
||||
,#{tCommiAmt}:: BIGINT /* 특장(금액) */
|
||||
,#{cCommiPer}:: NUMERIC /* 크레인(%) */
|
||||
,#{tCommiPer}:: NUMERIC /* 특장(%) */
|
||||
,#{cCommiAmt}:: NUMERIC /* 크레인(금액) */
|
||||
,#{tCommiAmt}:: NUMERIC /* 특장(금액) */
|
||||
,#{gb1} /* 영업소 */
|
||||
,now() /* 생성일시 */
|
||||
,#{cretEmpNo} /* 생성자 */
|
||||
@@ -276,20 +276,20 @@
|
||||
,Class1 = #{class1} /* */
|
||||
,Class2 = #{class2} /* */
|
||||
,GoodsGuarantee = #{goodsGuarantee}:: INTEGER /* 보증기간 */
|
||||
,Cost_Amt = #{costAmt}:: BIGINT /* 판매금액 */
|
||||
,Sale_Amt = #{saleAmt}:: BIGINT /* */
|
||||
,SaftyQty = #{saftyQty}:: BIGINT /* */
|
||||
,Royalty = #{royalty}:: BIGINT /* */
|
||||
,Cost_Amt = #{costAmt}:: NUMERIC /* 판매금액 */
|
||||
,Sale_Amt = #{saleAmt}:: NUMERIC /* */
|
||||
,SaftyQty = #{saftyQty}:: NUMERIC /* */
|
||||
,Royalty = #{royalty}:: NUMERIC /* */
|
||||
,RegYmd = #{regYmd} /* 등록일자 */
|
||||
,DelYmd = #{delYmd} /* 단종일자 */
|
||||
,Remark = #{remark} /* 비고 */
|
||||
,CommiYN = #{commiYn} /* 판매수수료적용여부 */
|
||||
,CommiGB = #{commiGb} /* 방식/수식 */
|
||||
,CommiGive = #{commiGive} /* */
|
||||
,CCommiPer = #{cCommiPer}:: BIGINT /* 크레인(%) */
|
||||
,TCommiPer = #{tCommiPer}:: BIGINT /* 특장(%) */
|
||||
,CCommiAmt = #{cCommiAmt}:: BIGINT /* 크레인(금액) */
|
||||
,TCommiAmt = #{tCommiAmt}:: BIGINT /* 특장(금액) */
|
||||
,CCommiPer = #{cCommiPer}:: NUMERIC /* 크레인(%) */
|
||||
,TCommiPer = #{tCommiPer}:: NUMERIC /* 특장(%) */
|
||||
,CCommiAmt = #{cCommiAmt}:: NUMERIC /* 크레인(금액) */
|
||||
,TCommiAmt = #{tCommiAmt}:: NUMERIC /* 특장(금액) */
|
||||
,GB1 = #{gb1} /* 영업소 */
|
||||
,EDIT_DATE = now() /* 수정일시 */
|
||||
,EditEmpNo = #{cretEmpNo} /* 수정자 */
|
||||
|
||||
@@ -611,12 +611,12 @@ public class ContractMgmtService {
|
||||
String target_project_no= CommonUtils.checkNull(paramMap.get("target_project_no_direct"));
|
||||
int overhaul_order = Integer.parseInt(CommonUtils.checkNull(paramMap.get("overhaul_order"),"1"));
|
||||
int project_cnt= Integer.parseInt(CommonUtils.checkNull(paramMap.get("facility_qty"), "1"));
|
||||
long contract_price_currency= Long.parseLong(CommonUtils.checkNull(paramMap.get("contract_price_currency"), "0"));
|
||||
long contract_price= Long.parseLong(CommonUtils.checkNull(paramMap.get("contract_price"), "0"));
|
||||
double contract_price_currency= Double.parseDouble(CommonUtils.checkNull(paramMap.get("contract_price_currency"), "0").replace(",", ""));
|
||||
double contract_price= Double.parseDouble(CommonUtils.checkNull(paramMap.get("contract_price"), "0").replace(",", ""));
|
||||
|
||||
//수주가와 금액은 대수로 나누어서 등록
|
||||
paramMap.put("contract_price_currency", contract_price_currency/project_cnt + "");
|
||||
paramMap.put("contract_price", contract_price/project_cnt + "");
|
||||
paramMap.put("contract_price_currency", String.valueOf(contract_price_currency/project_cnt));
|
||||
paramMap.put("contract_price", String.valueOf(contract_price/project_cnt));
|
||||
|
||||
if("0000964".equals(result_cd)){
|
||||
resultList = sqlSession.selectOne("contractMgmt.getProjectListBycontractObjid", paramMap);
|
||||
@@ -847,6 +847,22 @@ public class ContractMgmtService {
|
||||
|
||||
String[] objIds = request.getParameterValues("objId");
|
||||
|
||||
// 프로젝트가 생성된 건이 있는지 먼저 체크
|
||||
List<String> hasProjectList = new ArrayList<String>();
|
||||
for(int i=0; i<objIds.length; i++){
|
||||
paramMap.put("objId", objIds[i]);
|
||||
Map projectInfo = (Map) sqlSession.selectOne("contractMgmt.getProjectListBycontractObjid", paramMap);
|
||||
if(projectInfo != null){
|
||||
hasProjectList.add(objIds[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!hasProjectList.isEmpty()){
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", "프로젝트가 생성된 건은 삭제할 수 없습니다. (" + hasProjectList.size() + "건)");
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
int cnt = 0;
|
||||
for(int i=0; i<objIds.length; i++){
|
||||
paramMap.put("objId", objIds[i]);
|
||||
@@ -1690,7 +1706,7 @@ public class ContractMgmtService {
|
||||
|
||||
if(!"".equals(partName) && totalAmount != null) {
|
||||
try {
|
||||
long amount = Long.parseLong(totalAmount.toString().replaceAll("[^0-9]", ""));
|
||||
double amount = Double.parseDouble(totalAmount.toString().replaceAll("[^0-9.]", ""));
|
||||
|
||||
// 수량은 categories JSON에서 CNC Machine의 quantity를 가져옴
|
||||
int quantity = 1; // 기본값
|
||||
@@ -1761,7 +1777,7 @@ public class ContractMgmtService {
|
||||
}
|
||||
|
||||
// 단가 계산 (총액 / 수량)
|
||||
long unitPrice = quantity > 0 ? amount / quantity : amount;
|
||||
double unitPrice = quantity > 0 ? amount / quantity : amount;
|
||||
|
||||
// JSON 형식으로 품목 데이터 생성
|
||||
String itemJson = "[{" +
|
||||
@@ -2164,13 +2180,13 @@ private String makeEstimateMailContents(Map contractInfo, Map estimateTemplate,
|
||||
contents.append("</thead>");
|
||||
contents.append("<tbody>");
|
||||
|
||||
long totalAmount = 0;
|
||||
double totalAmount = 0;
|
||||
for(int i = 0; i < estimateItems.size(); i++){
|
||||
Map item = estimateItems.get(i);
|
||||
String amount = CommonUtils.checkNull(item.get("amount"));
|
||||
if(!"".equals(amount)){
|
||||
try {
|
||||
totalAmount += Long.parseLong(amount.replace(",", ""));
|
||||
totalAmount += Double.parseDouble(amount.replace(",", ""));
|
||||
} catch(Exception e){}
|
||||
}
|
||||
|
||||
@@ -2451,24 +2467,24 @@ private String encodeImageToBase64(String imagePath) {
|
||||
item.put("order_quantity", estimateItem.get("quantity"));
|
||||
item.put("order_unit_price", estimateItem.get("unit_price"));
|
||||
|
||||
// 공급가액 계산
|
||||
Object quantity = estimateItem.get("quantity");
|
||||
Object unitPrice = estimateItem.get("unit_price");
|
||||
long supplyPrice = 0;
|
||||
|
||||
if(quantity != null && unitPrice != null) {
|
||||
try {
|
||||
long qty = Long.parseLong(quantity.toString().replaceAll("[^0-9]", ""));
|
||||
long price = Long.parseLong(unitPrice.toString().replaceAll("[^0-9]", ""));
|
||||
supplyPrice = qty * price;
|
||||
} catch(Exception e) {
|
||||
System.out.println("금액 계산 실패: " + e.getMessage());
|
||||
}
|
||||
// 공급가액 계산 (소수점 단가 지원)
|
||||
Object quantity = estimateItem.get("quantity");
|
||||
Object unitPrice = estimateItem.get("unit_price");
|
||||
double supplyPrice = 0;
|
||||
|
||||
if(quantity != null && unitPrice != null) {
|
||||
try {
|
||||
double qty = Double.parseDouble(quantity.toString().replaceAll("[^0-9.]", ""));
|
||||
double price = Double.parseDouble(unitPrice.toString().replaceAll("[^0-9.]", ""));
|
||||
supplyPrice = qty * price;
|
||||
} catch(Exception e) {
|
||||
System.out.println("금액 계산 실패: " + e.getMessage());
|
||||
}
|
||||
|
||||
item.put("order_supply_price", supplyPrice);
|
||||
item.put("order_vat", Math.round(supplyPrice * 0.1));
|
||||
item.put("order_total_amount", supplyPrice + Math.round(supplyPrice * 0.1));
|
||||
}
|
||||
|
||||
item.put("order_supply_price", supplyPrice);
|
||||
item.put("order_vat", Math.round(supplyPrice * 0.1));
|
||||
item.put("order_total_amount", supplyPrice + Math.round(supplyPrice * 0.1));
|
||||
|
||||
System.out.println("계산 완료 - 공급가액: " + supplyPrice + ", 부가세: " + Math.round(supplyPrice * 0.1));
|
||||
}
|
||||
@@ -2601,12 +2617,12 @@ private String encodeImageToBase64(String imagePath) {
|
||||
// 공급가액 계산 (수량 * 단가)
|
||||
Object quantity = templateItem.get("quantity");
|
||||
Object unitPrice = templateItem.get("unit_price");
|
||||
long supplyPrice = 0;
|
||||
double supplyPrice = 0;
|
||||
|
||||
if(quantity != null && unitPrice != null) {
|
||||
try {
|
||||
long qty = Long.parseLong(quantity.toString().replaceAll("[^0-9]", ""));
|
||||
long price = Long.parseLong(unitPrice.toString().replaceAll("[^0-9]", ""));
|
||||
double qty = Double.parseDouble(quantity.toString().replaceAll("[^0-9.]", ""));
|
||||
double price = Double.parseDouble(unitPrice.toString().replaceAll("[^0-9.]", ""));
|
||||
supplyPrice = qty * price;
|
||||
} catch(Exception e) {
|
||||
// 계산 실패 시 0
|
||||
@@ -2614,7 +2630,7 @@ private String encodeImageToBase64(String imagePath) {
|
||||
}
|
||||
|
||||
orderItem.put("ORDER_SUPPLY_PRICE", supplyPrice);
|
||||
orderItem.put("ORDER_VAT", Math.round(supplyPrice * 0.1)); // 부가세 10%
|
||||
orderItem.put("ORDER_VAT", Math.round(supplyPrice * 0.1));
|
||||
orderItem.put("ORDER_TOTAL_AMOUNT", supplyPrice + Math.round(supplyPrice * 0.1));
|
||||
|
||||
items.add(orderItem);
|
||||
@@ -2674,9 +2690,9 @@ private String encodeImageToBase64(String imagePath) {
|
||||
|
||||
// 2. 품목 정보 저장 (CONTRACT_ITEM 테이블)
|
||||
String itemsJson = CommonUtils.checkNull(paramMap.get("items_json"));
|
||||
long totalSupplyPrice = 0;
|
||||
long totalVat = 0;
|
||||
long totalAmount = 0;
|
||||
double totalSupplyPrice = 0;
|
||||
double totalVat = 0;
|
||||
double totalAmount = 0;
|
||||
|
||||
if(!"".equals(itemsJson)){
|
||||
try {
|
||||
@@ -2743,13 +2759,13 @@ private String encodeImageToBase64(String imagePath) {
|
||||
}
|
||||
}
|
||||
|
||||
// 합계 계산
|
||||
// 합계 계산 (소수점 지원)
|
||||
try {
|
||||
totalSupplyPrice += Long.parseLong(orderSupplyPrice);
|
||||
totalVat += Long.parseLong(orderVat);
|
||||
totalAmount += Long.parseLong(orderTotalAmount);
|
||||
totalSupplyPrice += Double.parseDouble(orderSupplyPrice);
|
||||
totalVat += Double.parseDouble(orderVat);
|
||||
totalAmount += Double.parseDouble(orderTotalAmount);
|
||||
} catch (NumberFormatException e) {
|
||||
// 숫자 변환 실패 시 무시
|
||||
System.out.println("합계 계산 실패 - supply:" + orderSupplyPrice + ", vat:" + orderVat + ", total:" + orderTotalAmount);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -2788,19 +2804,20 @@ private String encodeImageToBase64(String imagePath) {
|
||||
System.out.println("제품구분: Machine(0000928) - 품목별 수량만큼 프로젝트 생성");
|
||||
}
|
||||
|
||||
// 품목별로 프로젝트 생성 또는 업데이트
|
||||
// 품목별로 프로젝트 생성 또는 업데이트 (같은 트랜잭션의 sqlSession 사용)
|
||||
paramMap.put("contractObjId", contract_objid);
|
||||
List<Map> contractItems = getContractItems(paramMap);
|
||||
List contractItemsRaw = sqlSession.selectList("contractMgmt.getContractItems", paramMap);
|
||||
List<Map<String, Object>> contractItems = CommonUtils.toUpperCaseMapKey(contractItemsRaw);
|
||||
|
||||
if(contractItems != null && !contractItems.isEmpty()) {
|
||||
System.out.println("품목 개수: " + contractItems.size() + "개 - 프로젝트 " + (hasProject ? "업데이트" : "생성") + " 시작" + (isMachine ? " (Machine - 수량별 생성)" : ""));
|
||||
|
||||
for(Map item : contractItems) {
|
||||
// 수량 가져오기
|
||||
// 수량 가져오기 (소수점 형태 "2.00"도 처리)
|
||||
Object quantityObj = item.get("ORDER_QUANTITY") != null ? item.get("ORDER_QUANTITY") : item.get("QUANTITY");
|
||||
int itemQuantity = 1;
|
||||
try {
|
||||
itemQuantity = Integer.parseInt(String.valueOf(quantityObj));
|
||||
itemQuantity = (int) Double.parseDouble(String.valueOf(quantityObj).replaceAll("[^0-9.]", ""));
|
||||
} catch (Exception e) {
|
||||
itemQuantity = 1;
|
||||
}
|
||||
@@ -2937,11 +2954,11 @@ private String encodeImageToBase64(String imagePath) {
|
||||
String contract_objid= CommonUtils.checkNull(paramMap.get("contractObjId"));
|
||||
paramMap.put("objId", contract_objid);
|
||||
|
||||
// 품목별 수주 정보 업데이트 및 합계 계산
|
||||
// 품목별 수주 정보 업데이트 및 합계 계산 (소수점 단가 지원)
|
||||
String itemsJson = CommonUtils.checkNull(paramMap.get("items_json"));
|
||||
long totalSupplyPrice = 0;
|
||||
long totalVat = 0;
|
||||
long totalAmount = 0;
|
||||
double totalSupplyPrice = 0;
|
||||
double totalVat = 0;
|
||||
double totalAmount = 0;
|
||||
|
||||
if(!"".equals(itemsJson)){
|
||||
try {
|
||||
@@ -2967,13 +2984,13 @@ private String encodeImageToBase64(String imagePath) {
|
||||
|
||||
sqlSession.update("contractMgmt.updateContractItemOrderInfo", itemMap);
|
||||
|
||||
// 합계 계산
|
||||
// 합계 계산 (소수점 지원)
|
||||
try {
|
||||
totalSupplyPrice += Long.parseLong(orderSupplyPrice);
|
||||
totalVat += Long.parseLong(orderVat);
|
||||
totalAmount += Long.parseLong(orderTotalAmount);
|
||||
totalSupplyPrice += Double.parseDouble(orderSupplyPrice);
|
||||
totalVat += Double.parseDouble(orderVat);
|
||||
totalAmount += Double.parseDouble(orderTotalAmount);
|
||||
} catch (NumberFormatException e) {
|
||||
// 숫자 변환 실패 시 무시
|
||||
System.out.println("합계 계산 실패 - supplyPrice:" + orderSupplyPrice + ", vat:" + orderVat + ", total:" + orderTotalAmount);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -3021,19 +3038,20 @@ private String encodeImageToBase64(String imagePath) {
|
||||
System.out.println("제품구분: Machine(0000928) - 품목별 수량만큼 프로젝트 생성");
|
||||
}
|
||||
|
||||
// 품목별로 프로젝트 생성 또는 업데이트
|
||||
// 품목별로 프로젝트 생성 또는 업데이트 (같은 트랜잭션의 sqlSession 사용)
|
||||
paramMap.put("contractObjId", contract_objid);
|
||||
List<Map> contractItems = getContractItems(paramMap);
|
||||
List contractItemsRaw2 = sqlSession.selectList("contractMgmt.getContractItems", paramMap);
|
||||
List<Map<String, Object>> contractItems = CommonUtils.toUpperCaseMapKey(contractItemsRaw2);
|
||||
|
||||
if(contractItems != null && !contractItems.isEmpty()) {
|
||||
System.out.println("품목 개수: " + contractItems.size() + "개 - 프로젝트 " + (hasProject ? "업데이트" : "생성") + " 시작" + (isMachine ? " (Machine - 수량별 생성)" : ""));
|
||||
|
||||
for(Map item : contractItems) {
|
||||
// 수량 가져오기
|
||||
// 수량 가져오기 (소수점 형태 "2.00"도 처리)
|
||||
Object quantityObj = item.get("ORDER_QUANTITY") != null ? item.get("ORDER_QUANTITY") : item.get("QUANTITY");
|
||||
int itemQuantity = 1;
|
||||
try {
|
||||
itemQuantity = Integer.parseInt(String.valueOf(quantityObj));
|
||||
itemQuantity = (int) Double.parseDouble(String.valueOf(quantityObj).replaceAll("[^0-9.]", ""));
|
||||
} catch (Exception e) {
|
||||
itemQuantity = 1;
|
||||
}
|
||||
|
||||
@@ -639,8 +639,8 @@ public Map<String, Object> saveSaleRegistration(HttpServletRequest request, Map<
|
||||
int supplyQty = Integer.parseInt((String) paramMap.get("supplyQty"));
|
||||
totalSupplyQty += supplyQty;
|
||||
|
||||
// 화면에서 입력한 공급가
|
||||
BigDecimal supplyAmt = new BigDecimal(Integer.parseInt((String) paramMap.get("supplyAmt")));
|
||||
// 화면에서 입력한 공급가 (소수점 지원)
|
||||
BigDecimal supplyAmt = new BigDecimal(((String) paramMap.get("supplyAmt")).replace(",", ""));
|
||||
|
||||
// 매출수량이 계약관리의 계약수량보다 많을 수 없음
|
||||
if (totalSupplyQty > goodsQty) {
|
||||
@@ -908,8 +908,8 @@ public Map<String, Object> saveSaleRegistration(HttpServletRequest request, Map<
|
||||
|
||||
paramMap.put("acntUnit", acntUnit);
|
||||
|
||||
// 화면에서 입력한 수금금액
|
||||
BigDecimal rcptAmt = new BigDecimal(Integer.parseInt((String) paramMap.get("rcptAmt")));
|
||||
// 화면에서 입력한 수금금액 (소수점 지원)
|
||||
BigDecimal rcptAmt = new BigDecimal(((String) paramMap.get("rcptAmt")).replace(",", ""));
|
||||
BigDecimal collectRcptAmt = new BigDecimal(0); // 수금금액
|
||||
|
||||
if (StringUtils.isBlank((String) paramMap.get("rcptNo"))) { //매출번호 없으면
|
||||
|
||||
@@ -1944,7 +1944,7 @@ public class PurchaseOrderService {
|
||||
try {
|
||||
double orderQty = Double.parseDouble(orderQtyStr);
|
||||
double price = Double.parseDouble(partnerPrice);
|
||||
totalPrice = String.valueOf((long)(orderQty * price));
|
||||
totalPrice = String.valueOf(orderQty * price);
|
||||
} catch (NumberFormatException e) {
|
||||
totalPrice = "0";
|
||||
}
|
||||
@@ -3443,4 +3443,62 @@ public class PurchaseOrderService {
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 입고건별 마감정보 저장
|
||||
* @param request
|
||||
* @param paramMap - objIdList, taxType, taxInvoiceDate, exportDeclNo, loadingDate, foreignType, duty, exchangeRate, importVat
|
||||
* @return 처리 결과
|
||||
*/
|
||||
public Map saveArrivalPlanDeadlineInfo(HttpServletRequest request, Map paramMap) {
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
try {
|
||||
String objIdListStr = CommonUtils.checkNull(paramMap.get("objIdList"));
|
||||
String taxType = CommonUtils.checkNull(paramMap.get("taxType"));
|
||||
String taxInvoiceDate = CommonUtils.checkNull(paramMap.get("taxInvoiceDate"));
|
||||
String exportDeclNo = CommonUtils.checkNull(paramMap.get("exportDeclNo"));
|
||||
String loadingDate = CommonUtils.checkNull(paramMap.get("loadingDate"));
|
||||
String foreignType = CommonUtils.checkNull(paramMap.get("foreignType"));
|
||||
String duty = CommonUtils.checkNull(paramMap.get("duty"));
|
||||
String exchangeRate = CommonUtils.checkNull(paramMap.get("exchangeRate"));
|
||||
String importVat = CommonUtils.checkNull(paramMap.get("importVat"));
|
||||
|
||||
if (objIdListStr == null || objIdListStr.isEmpty()) {
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", "선택된 항목이 없습니다.");
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
String[] targetObjIdList = objIdListStr.split(",");
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||||
|
||||
for (int i = 0; i < targetObjIdList.length; i++) {
|
||||
HashMap sqlParamMap = new HashMap();
|
||||
sqlParamMap.put("OBJID", CommonUtils.checkNull(targetObjIdList[i]).trim());
|
||||
sqlParamMap.put("taxType", taxType);
|
||||
sqlParamMap.put("taxInvoiceDate", taxInvoiceDate);
|
||||
sqlParamMap.put("exportDeclNo", exportDeclNo);
|
||||
sqlParamMap.put("loadingDate", loadingDate);
|
||||
sqlParamMap.put("foreignType", foreignType);
|
||||
sqlParamMap.put("duty", duty);
|
||||
sqlParamMap.put("exchangeRate", exchangeRate);
|
||||
sqlParamMap.put("importVat", importVat);
|
||||
|
||||
sqlSession.update("purchaseOrder.saveArrivalPlanDeadlineInfo", sqlParamMap);
|
||||
}
|
||||
sqlSession.commit();
|
||||
resultMap.put("result", true);
|
||||
resultMap.put("msg", targetObjIdList.length + "건의 마감정보가 저장되었습니다.");
|
||||
} catch (Exception e) {
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", "마감정보 저장 중 오류가 발생했습니다.");
|
||||
if (sqlSession != null) sqlSession.rollback();
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (sqlSession != null) sqlSession.close();
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user