var formEditListTable_RowCounter=0;function formEditListTable_dataMerge($srcTable,itemCode,quantity){var result=false;var trID="";$srcTable.find("tr").each(function(){var $tr=$(this);var $hfItemCode=null;if($tr.find("input[name=hfItemCode]").length>0){$hfItemCode=$tr.find("input[name=hfItemCode]").eq(0);if($hfItemCode.val()==itemCode){var $txtQuantity=$tr.find("input[name=txtQuantity]").eq(0);var sOldQuantity=$($txtQuantity).val();var sNewQuantity=(parseFloat(sOldQuantity)+parseFloat(quantity)).toString();$txtQuantity.val(sNewQuantity);result=true;trID=$tr.attr("id").replace("tr_","");return false;}}});if(result==true){formEditListTable_caculateAmount(trID)};return result};function formEditListTable_removeRow(rowID){var $srcTable=$("#srcTable");$srcTable.find("#tr_"+rowID).remove();var dataRowCount=$srcTable.find("input[name=hfAmount]").length;if(dataRowCount==0){dataRowCount=$srcTable.find("input[name=hfItemCode]").length};if(dataRowCount==0){formEditListTable_RowCounter=0;formEditListTable_showTbNoRecord()};formEditListTable_setRowNo();formEditListTable_setTotalAmount()};function formEditListTable_clearRows(){var $srcTable=$("#srcTable");$srcTable.find("tr[id]").remove();formEditListTable_setTotalAmount();formEditListTable_showTbNoRecord()};function formEditListTable_showTbNoRecord(){$("#tbNoRecord").show()};function formEditListTable_hideTbNoRecord(){$("#tbNoRecord").hide()};function formEditListTable_setRowNo(){var $srcTable=$("#srcTable");var $tdNos=$srcTable.find("td.tdRowNo");$.each($tdNos,function(n,value){$(value).html(n+1)})};function formEditListTable_clearNoNum(obj){obj.value=obj.value.replace(/[^\d.]/g,"");obj.value=obj.value.replace(/^\./g,"");obj.value=obj.value.replace(/\.{2,}/g,".");obj.value=obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".")}