[RAPID-fix] 수주통합등록 수량 정수포맷 복원, 금액필드 blur시 소수점2자리 포맷 적용
- 수주수량: 정수 포맷(formatInteger) 유지, 우측정렬 - 공급가액/부가세/총액: blur 시 formatMoney로 .00 포맷 복원 - blur 이벤트를 이벤트 위임 방식으로 변경하여 동적 행에도 적용 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,16 +68,16 @@
|
||||
|
||||
// 숫자만 입력 처리
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
if($(this).attr("id") === "facility_qty") {
|
||||
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() {
|
||||
$(document).on("blur", "input:text[numberOnly]", function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
if($(this).attr("id") === "facility_qty") {
|
||||
if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") {
|
||||
$(this).val(formatInteger(removeComma(val)));
|
||||
} else {
|
||||
$(this).val(formatMoney(removeComma(val)));
|
||||
@@ -450,7 +450,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));
|
||||
@@ -551,9 +551,9 @@
|
||||
// 수주 정보 (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; text-align:right; 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; text-align:right; 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; text-align:right;" required numberOnly value="' + (orderQuantity ? addComma(orderQuantity) : '') + '" />';
|
||||
html += '<input type="text" name="item_order_quantity[]" class="item-order-quantity" style="width:90%; padding:5px; text-align:right;" required numberOnly value="' + (orderQuantity ? formatInteger(orderQuantity) : '') + '" />';
|
||||
}
|
||||
html += '</td>';
|
||||
html += '<td style="padding:5px; border:1px solid #ddd;">';
|
||||
@@ -703,7 +703,7 @@
|
||||
totalVat += parseFloat(removeComma($(this).find(".item-order-vat").val())) || 0;
|
||||
totalAmount += parseFloat(removeComma($(this).find(".item-order-total-amount").val())) || 0;
|
||||
});
|
||||
$("#totalOrderQuantity").text(addComma(totalQty));
|
||||
$("#totalOrderQuantity").text(addCommaInt(totalQty));
|
||||
$("#totalOrderSupplyPrice").text(addComma(totalSupply));
|
||||
$("#totalOrderVat").text(addComma(totalVat));
|
||||
$("#totalOrderTotalAmount").text(addComma(totalAmount));
|
||||
|
||||
Reference in New Issue
Block a user