/*
오픈전에 소스 정리해야함.
실제 요금계산하는 파일
*/
/* ajax xml 데이터 획득 */
var ajax_submit = false;
// Ajax 기준요금등 xml 데이터 가져오기 (서버 xml 확인필)
function getRateData() {
var reg_date = "20131121";
if($("#Proc_CODE").val()=="HouseL" || $("#Proc_CODE").val()=="HouseH" || $("#Proc_CODE").val()=="TempK" || $("#Proc_CODE").val()=="OneHouse"){
reg_date = "20161201";
}
if(ajax_submit) {
//alert("실행중입니다.");
return false;
}
ajax_submit = true;
$.ajax({
url: xml_base_url+'get_unitcost_'+($("#Proc_CODE").val())+'.jsp?reg_date='+reg_date+'&contractType='+($("#Proc_CODE").val()),
type : "get",
dataType : "xml",
scriptCharset: "utf-8" ,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
beforeSend: function(jqXHR, settings) {
showLoading();
},
success: function(data, textStatus, jqXHR) {
var rdata = data;
ajax_submit = false;
CalcHouseL(rdata);
hideLoading();
},
error: function(jqXHR, textStatus, errorThrown) {
ajax_submit = false;
calClear();
hideLoading();
alert("요금 데이터를 가져오는데 [실패]하였습니다.");
},
complete: function(jqXHR, textStatus) {
},
timeout: 15000
});
}
function formatComma(input_value){
return (""+input_value).replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,');
}
// 3자리 콤보
function fmComma(input_value){
return (""+input_value).replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,');
}
// 원미만 절사
function fmFloor(input_value){
return Math.floor(input_value);
}
// 10월미만 절사
function fm10Floor(input_value){
return Math.floor(input_value / 10) * 10;
}
// 원미만 4사5입(반올림)
function fmRound(input_value){
return Math.round(input_value);
}
// 소숫점 1자리 4사5입(반올림)
function fmS1Round(input_value){
return Math.round(input_value * 10) / 10;
}
// 소숫점 2자리 4사5입(반올림)
function fmS2Round(input_value){
return Math.round(input_value * 100) / 100;
}
// 뷰생성00
function viewGen00(input_value){
return "
- Calculated results
Current version is being updated
";
}
// 뷰생성01
function viewGen01(input_value){
return "";
}
// 뷰생성01
function viewGen01_H(input_value){
return "";
}
// 뷰생성02
function viewGen02(input_value){
return "";
}
/*13.03.06 계산내역보기 버튼 수정부분*/
// 뷰생성03
function viewGen03(input_value, input_value2, input_value3){
var output_tmp = "";
detail_view_toggle_01 = false;
if(input_value2){
output_tmp += " Calculation details";
output_tmp += "";
}
output_tmp += "
";
if(input_value2){
output_tmp += "
";
}
return output_tmp;
}
// 뷰생성05 2015.09.18
function viewGen05(input_value){
return "";
}
// 계산내역 보기 상태(열림/닫힘)
var detail_view_toggle_01 = false;
var detail_view_toggle_02 = false;
var detail_view_toggle_03 = false;
var detail_view_toggle_04 = false;
var detail_view_toggle_05 = false;
// 더미 callback
function callback() {
return false;
};
// XML 파싱 (기본요금 및 기준단가 데이터)
function fnStepXML(){
xmlData01[0] = "${enfbpp002VO.basCust1}";
xmlData01[1] = "${enfbpp002VO.basCust2}";
xmlData01[2] = "${enfbpp002VO.basCust3}";
xmlData01[3] = "${enfbpp002VO.basCust4}";
xmlData01[4] = "${enfbpp002VO.basCust5}";
xmlData01[5] = "${enfbpp002VO.basCust6}";
xmlData01[6] = "${enfbpp002VO.basCust7}";
xmlData01[7] = "${enfbpp002VO.basCust8}";
xmlData01[8] = "${enfbpp002VO.basCust9}";
xmlData01[9] = "${enfbpp002VO.basCust10}";
xmlData01[10] = "${enfbpp002VO.basCust11}";
xmlData01[11] = "${enfbpp002VO.basCust12}";
xmlData02[0] = "${enfbpp002VO.unitCust1}";
xmlData02[1] = "${enfbpp002VO.unitCust2}";
xmlData02[2] = "${enfbpp002VO.unitCust3}";
xmlData02[3] = "${enfbpp002VO.unitCust4}";
xmlData02[4] = "${enfbpp002VO.unitCust5}";
xmlData02[5] = "${enfbpp002VO.unitCust6}";
xmlData02[6] = "${enfbpp002VO.unitCust7}";
xmlData02[7] = "${enfbpp002VO.unitCust8}";
xmlData02[8] = "${enfbpp002VO.unitCust9}";
xmlData02[9] = "${enfbpp002VO.unitCust10}";
xmlData02[10] = "${enfbpp002VO.unitCust11}";
xmlData02[11] = "${enfbpp002VO.unitCust12}";
return true;
}
// 전력량 적용 최종 단계
function fnStepSTD(){
if(iSuperUserBoolean){
xmlData00_STD = xmlData00_STD_SUPER; //기준 사용량
}else{
xmlData00_STD = xmlData00_STD_ORI; //기준 사용량
}
for(var i=0;i xmlData00_STD[i]){
iUsedAmount_STD = i;
}
}
return true;
}
// 전력량 적용 최종 단계
function fnStepSTD2(){
if(iSuperUserBoolean){
xmlData00_STD = xmlData00_STD_SUPER; //기준 사용량
}else{
xmlData00_STD = xmlData00_STD_ORI; //기준 사용량
}
for(var i=0;i xmlData00_STD[i]){
iUsedAmount_STD = i;
}
}
return true;
}
// 전력량 적용 최종 단계
function fnStepSTD3(){
if(iSuperUserBoolean){
xmlData00_STD = xmlData00_STD_SUPER; //기준 사용량
}else{
xmlData00_STD = xmlData00_STD_ORI; //기준 사용량
}
for(var i=0;i (xmlData00_STD[i]*iNumHouse)){
iUsedAmount_STD2 = i;
}
}
return true;
}
// 월별 사용량 할당 (년월별 가중치 계산)
function fnStepMonthALoc(){
for(var loadDt_i = loadDt_start; dateFormat(loadDt_i)<=loadDt_last; loadDt_i.setDate(loadDt_i.getDate()+1)){ // 해당 기간 루프
var tmp_month = dateFormat(loadDt_i).substring(0,7); // 현재 년월
if(prev_month == tmp_month){ //이전건과 현재건이 동일할 경우
monthDayCnt++; // 년월 건수 증가
}else{ //이전 년월과 현재 년월이 다를 경우 이전년월 저장하고 새로운 년월로 세팅
dayByMonth[dayByMonthInc] = prev_month;
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
monthDayCnt = 0;
prev_month = tmp_month;
monthDayCnt = 1;
}
if(dateFormat(loadDt_i) == dateFormat(loadDt_end)){ // 마지막일 검사
if(prev_month == (dateFormat(loadDt_i).substring(0,7))){ //시작년월과 동일할 경우
dayByMonth[dayByMonthInc] = prev_month;
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
monthDayCnt = 0;
}else{ //시작년월과 다를 경우
monthDayCnt++;
dayByMonth[dayByMonthInc] = (dateFormat(loadDt_i).substring(0,7));
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
}
}
dayByMonthTotal++;
}
// 월별 사용량 할당
var iUsedAmount_reloc = 0;
for(var i=0;i 0){
dayByMonthUsedAmount[0] += iUsedAmount-iUsedAmount_reloc;
}else{
dayByMonthUsedAmount[dayByMonth.length -1] -= (iUsedAmount_reloc - iUsedAmount);
}
}
return true;
}
// 월별 사용량 할당 (년월별 가중치 계산)
function fnStepMonthALoc2(){
for(var loadDt_i = loadDt_start; dateFormat(loadDt_i)<=loadDt_last; loadDt_i.setDate(loadDt_i.getDate()+1)){ // 해당 기간 루프
var tmp_month = dateFormat(loadDt_i).substring(0,7); // 현재 년월
if(prev_month == tmp_month){ //이전건과 현재건이 동일할 경우
monthDayCnt++; // 년월 건수 증가
}else{ //이전 년월과 현재 년월이 다를 경우 이전년월 저장하고 새로운 년월로 세팅
dayByMonth[dayByMonthInc] = prev_month;
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
monthDayCnt = 0;
prev_month = tmp_month;
monthDayCnt = 1;
}
if(dateFormat(loadDt_i) == dateFormat(loadDt_end)){ // 마지막일 검사
if(prev_month == (dateFormat(loadDt_i).substring(0,7))){ //시작년월과 동일할 경우
dayByMonth[dayByMonthInc] = prev_month;
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
monthDayCnt = 0;
}else{ //시작년월과 다를 경우
monthDayCnt++;
dayByMonth[dayByMonthInc] = (dateFormat(loadDt_i).substring(0,7));
dayByMonthCnt[dayByMonthInc] = monthDayCnt;
dayByMonthInc++;
}
}
dayByMonthTotal++;
}
// 월별 사용량 할당
var iUsedAmount_reloc = 0;
for(var i=0;i 0){
dayByMonthUsedAmount[0] += iUsedAmount-iUsedAmount_reloc;
}else{
dayByMonthUsedAmount[dayByMonth.length -1] -= (iUsedAmount_reloc-iUsedAmount);
}
}
iUsedAmount_reloc = 0;
for(var i=0;i 0){
dayByMonthUsedAmountM[0] += iUsedAmountM-iUsedAmount_reloc;
}else{
dayByMonthUsedAmountM[dayByMonth.length -1] -= (iUsedAmount_reloc-iUsedAmountM);
}
}
iUsedAmount_reloc = 0;
for(var i=0;i 0){
dayByMonthUsedAmountT[0] += iUsedAmountT-iUsedAmount_reloc;
}else{
dayByMonthUsedAmountT[dayByMonth.length -1] -= (iUsedAmount_reloc-iUsedAmountT);
}
}
iUsedAmount_reloc = 0;
for(var i=0;i 0){
dayByMonthUsedAmountB[0] += iUsedAmountB-iUsedAmount_reloc;
}else{
dayByMonthUsedAmountB[dayByMonth.length -1] -= (iUsedAmount_reloc-iUsedAmountB);
}
}
return true;
}
//13.03.06 상세계산내역 기본요금 부분
// 기본/전력량 요금 계산
function fnStepBasic(){
//if(iGubun==2 && iUsedAmount_STD == 0){ //20161201 개편으로 비주거도 똑같은 전력량 요금 적용
// BasicCharge = fmFloor(xmlData01[iUsedAmount_STD+1]); //기본요금 / 원미만 절사
//}else{
BasicCharge = fmFloor(xmlData01[iUsedAmount_STD]); //기본요금 / 원미만 절사
//}
// 사용량 0 일경우 (50% 할인) 10원 미만 절사
if(iUsedAmount == 0 && iEType == "100H") { // 2015.05.12 주택용 0kW 50%감액 제거( 작업지시서 1180505)
BasicCharge = fmFloor(BasicCharge*0.5);
outString_Detail += viewGen01("기본요금(원미만 절사) 0kW는 50% 감액 : " + fmComma(BasicCharge) + "원");
outString_EN_Detail += viewGen01("Demand charge : updating");
}else{
outString_Detail += viewGen01("기본요금(원미만 절사) : " + fmComma(BasicCharge) + "원");
outString_EN_Detail += viewGen01("Demand charge : updating");
}
var iUsedAmount_TMP = iUsedAmount; // 처리중 남은량
var iUsedAmount_TMP2 = 0; // 해당단계 기준량
var iUsedAmount_TMP3 = 0; // 해당단계 적용량
var iUsedAmount_TMP4 = 0; // 해당단계 누적 요금
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
var iUsedAmount_TMP7 = 0; // 슈퍼유저 요금
var iUsedAmount_TMP8 = 0; // 슈퍼유저 요금
var iUsedAmount_TMP9 = 0; // 슈퍼유저 남은 사용량
for(var j=0;j<=iUsedAmount_STD;j++){ //단계별 요금
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP>iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
iUsedAmount_TMP = 0;
}
if(iSuperUserBoolean){ //슈퍼 유저일 경우
if(j != 3){
if(j != 0){
iUsedAmount_TMP5 += "
";
}
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP5 += "·" + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(xmlData02[j]) + "원 = " + fmComma(fmS2Round(iUsedAmount_TMP3 * xmlData02[j])) + "원";
}else if(j == 3){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP6 += "
";
iUsedAmount_TMP6 += "·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 7 || curMonth == 8 || curMonth == 12 || curMonth == 1 || curMonth == 2){
if( iUsedAmount_TMP9 == 0 ){
iUsedAmount_TMP7 += fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j]);
iUsedAmount_TMP9 = fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal);
}else{
iUsedAmount_TMP7 += fmS1Round((iUsedAmount_TMP3-iUsedAmount_TMP9)*xmlData02[j]);
}
iUsedAmount_TMP6 += "(슈퍼유저) : "+fmComma(iUsedAmount_TMP3) + "kWh × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+ fmComma(xmlData02[j]) +"원 = "+fmComma(fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j]))+"원";
//iUsedAmount_TMP6 += "·슈퍼유저 요금 : "+fmComma(iUsedAmount_TMP3) + "kWh × "+ fmComma(xmlData02[j]) +"원 = "+fmComma(fmS1Round(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal*xmlData02[j]))+"원
(7.1~8.31, 12.1~2월말 기준)";
}else{
if( iUsedAmount_TMP9 == 0 ){
iUsedAmount_TMP8 += fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j-1]);
iUsedAmount_TMP9 = fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal);
}else{
iUsedAmount_TMP7 += fmS1Round((iUsedAmount_TMP3-iUsedAmount_TMP9)*xmlData02[j-1]);
}
iUsedAmount_TMP6 += " : "+fmComma(iUsedAmount_TMP3) + "kWh × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+ fmComma(xmlData02[j-1]) +"원 = "+fmComma(fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j-1]))+"원";
}
}
}
console.log("TEST : "+iUsedAmount_TMP9);
iUsedAmount_TMP4 += iUsedAmount_TMP7 + iUsedAmount_TMP8;
}
}else{
if(j != 0){
iUsedAmount_TMP5 += "
";
}
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP5 += "·" + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(xmlData02[j]) + "원 = " + fmComma(fmS2Round(iUsedAmount_TMP3 * xmlData02[j])) + "원";
}
}
UsingCharge = fmFloor(iUsedAmount_TMP4); //전력량요금 / 원미만 절사
outString_Detail += viewGen01("전력량요금(원미만 절사) : " + fmComma(UsingCharge) + "원" + viewGen03(iUsedAmount_TMP5+iUsedAmount_TMP6, true, "Show_Toggle_01"));
outString_EN_Detail += viewGen01("Energy charge : updating" + viewGen03("", true, "Show_Toggle_01"));
return true;
}
//13.03.06 상세계산내역 기본요금 부분
// 일주택수가구 기본/전력량 요금 계산
function fnStepBasic2(){
if(iGubun==2 && iUsedAmount_STD == 0){
BasicCharge = fmFloor(xmlData01[iUsedAmount_STD+1]*iNumHouse); //기본요금 / 원미만 절사
}else{
BasicCharge = fmFloor(xmlData01[iUsedAmount_STD]*iNumHouse); //기본요금 / 원미만 절사
}
if(iUsedAmount == 0){
iOHKwhDcBoolean = true;
}
outString_Detail += viewGen01("기본요금(원미만 절사) : " + fmComma(BasicCharge) + "원
"+viewGen03(fmComma(BasicCharge/iNumHouse)+"원("+(iUsedAmount_STD+1)+"단계) × "+fmComma(iNumHouse)+"가구 = "+fmComma(BasicCharge)+"원", false));
var iUsedAmount_TMP = iUsedAmount; // 처리중 남은량
var iUsedAmount_TMP2 = 0; // 해당단계 기준량
var iUsedAmount_TMP3 = 0; // 해당단계 적용량
var iUsedAmount_TMP4 = 0; // 해당단계 누적 요금
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
var iUsedAmount_TMP7 = 0; // 슈퍼유저 요금
var iUsedAmount_TMP8 = 0; // 슈퍼유저 요금
var iUsedAmount_TMP9 = 0; // 슈퍼유저 남은 사용량
for(var j=0;j<=iUsedAmount_STD2;j++){ //단계별 요금
iUsedAmount_TMP2 = ((xmlData00_STD[j+1] * iNumHouse) - (xmlData00_STD[j] * iNumHouse));
if(iUsedAmount_TMP>iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
iUsedAmount_TMP = 0;
}
if(iSuperUserBoolean){ //슈퍼 유저일 경우
if(j != 3){
if(j != 0){
iUsedAmount_TMP5 += "
";
}
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP5 += "·" + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(xmlData02[j]) + "원 = " + fmComma(fmS2Round(iUsedAmount_TMP3 * xmlData02[j])) + "원";
}else if(j == 3){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP6 += "
";
iUsedAmount_TMP6 += "·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 7 || curMonth == 8 || curMonth == 12 || curMonth == 1 || curMonth == 2){
if( iUsedAmount_TMP9 == 0 ){
iUsedAmount_TMP7 += fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j]);
iUsedAmount_TMP9 = fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal);
}else{
iUsedAmount_TMP7 += fmS1Round((iUsedAmount_TMP3-iUsedAmount_TMP9)*xmlData02[j]);
}
iUsedAmount_TMP6 += "(슈퍼유저) : "+fmComma(iUsedAmount_TMP3) + "kWh × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+ fmComma(xmlData02[j]) +"원 = "+fmComma(fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j]))+"원";
//iUsedAmount_TMP6 += "·슈퍼유저 요금 : "+fmComma(iUsedAmount_TMP3) + "kWh × "+ fmComma(xmlData02[j]) +"원 = "+fmComma(fmS1Round(iUsedAmount_TMP3*fmS2Round(dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j]))+"원
(7.1~8.31, 12.1~2월말 기준)";
}else{
if( iUsedAmount_TMP9 == 0 ){
iUsedAmount_TMP8 += fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j-1]);
iUsedAmount_TMP9 = fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal);
}else{
iUsedAmount_TMP8 += fmS1Round((iUsedAmount_TMP3-iUsedAmount_TMP9)*xmlData02[j-1]);
}
iUsedAmount_TMP6 += " : "+fmComma(iUsedAmount_TMP3) + "kWh × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+ fmComma(xmlData02[j-1]) +"원 = "+fmComma(fmS1Round(fmRound(iUsedAmount_TMP3*dayByMonthCnt[i]/dayByMonthTotal)*xmlData02[j-1]))+"원";
}
}
}
iUsedAmount_TMP4 += iUsedAmount_TMP7 + iUsedAmount_TMP8;
}
}else{
if(j != 0){
iUsedAmount_TMP5 += "
";
}
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP5 += "·" + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(xmlData02[j]) + "원 = " + fmComma(fmS2Round(iUsedAmount_TMP3 * xmlData02[j])) + "원";
}
}
UsingCharge = fmFloor(iUsedAmount_TMP4); //전력량요금 / 원미만 절사
outString_Detail += viewGen01("전력량요금(원미만 절사) : " + fmComma(UsingCharge) + "원" + viewGen03(iUsedAmount_TMP5+iUsedAmount_TMP6, true, "Show_Toggle_01"));
return true;
}
// 월 최저요금
function fnStepMinimum(){
iMinimumBoolean = false;
iMinimumValue = 1000;
if(Demand_Qty < iMinimumValue) {
iMinimumBoolean = true;
Demand_Qty = iMinimumValue;
outString_Detail += viewGen01("월 최저요금 적용 : " + fmComma(Demand_Qty) + "원" + viewGen03("· " + fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원 < " + fmComma(Demand_Qty) + "원 ==> " + fmComma(Demand_Qty) + "원
· (기본요금 + 전력량 요금) 이 월 최저요금 " + fmComma(Demand_Qty) + "원 보다 작을 경우 월 최저요금 적용", false, ""));
}
return true;
}
// 사용량감액 요금
function fnStepUseKwhDc(){
if(UsingCharge == 0){
useKwhDcBoolean = true;
useKwhDcValue = fmFloor(BasicCharge/2);
}
}
// 대가족요금/생명유지장치요금 할인
function fnStepBigFam(){
iBigFamBoolean = false;
iBigFamValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iBigFamValue1 = 0;
var iBigFamValue2 = 0;
var iBigFamValue3 = 0;
var iBigFamValue4 = 0;
var limitValue = 12000;
var limitValuePer = 0.2;
var iBigFamValueGubun = "<";
var iUsedAmount_TMP = iUsedAmount; // 처리중 남은량
var iUsedAmount_TMP2 = 0; // 해당단계 기준량
var iUsedAmount_TMP3 = 0; // 해당단계 적용량
var iUsedAmount_TMP4 = 0; // 해당단계 누적 요금
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
var iUsedAmount_TMP7 = ""; // html 생성
var iUsedAmount_TMP8 = ""; // html 생성
var iUsedAmount_TMP9 = ""; // html 생성
if(iBigFam==1){
if(iUsedAmount>300){ // 사용량 300kWh 이상일 경우만
iBigFamBoolean = true;
iUsedAmount_TMP7 = "";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP5 += "대가족 요금 기본요금 할인액 : ";
if(iUsedAmount<=600){
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원(";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]));
iUsedAmount_TMP5 += "원 - ";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원)";
iBigFamValue1 += fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]);
iUsedAmount_TMP = iUsedAmount; // 최대 적용
}else{
iUsedAmount_TMP = 600; // 최대 적용
iBigFamValue1 = 0; // 최대 적용
iUsedAmount_TMP5 += "0원";
}
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false, "");
iUsedAmount_TMP5 = ""; // html 생성
for(var j=0;j<=iUsedAmount_STD;j++){
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP>iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
}
if(j>=3){
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP9 += "· " + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(fmS2Round(xmlData02[j] - xmlData02[j-1])) + "원(" + fmComma(xmlData02[j]) + "원 - " + fmComma(xmlData02[j-1]) + "원) = " + fmComma(fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]))) + "원
";
iBigFamValue2 += fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]));
}
}
iUsedAmount_TMP5 += "대가족 요금 사용량 할인액 : ";
iUsedAmount_TMP5 += fmComma(iBigFamValue2) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += iUsedAmount_TMP9;
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP7 += fmComma(fmS2Round(iBigFamValue1)) + "원 + " + fmComma(fmS2Round(iBigFamValue2)) + "원 = " + fmComma(fmFloor(iBigFamValue1 + iBigFamValue2)) + "원";
iUsedAmount_TMP7 += "
";
var limitValue = 12000;
if((iBigFamValue1 + iBigFamValue2) >= limitValue){
iBigFamValue = fmFloor(limitValue);
iBigFamValueGubun = ">";
}else{
iBigFamValue = fmFloor(iBigFamValue1 + iBigFamValue2);
iBigFamValueGubun = "<";
}
iUsedAmount_TMP7 += "==> " + fmComma(fmFloor(iBigFamValue)) + "원(";
iUsedAmount_TMP7 += fmComma(fmFloor(iBigFamValue1 + iBigFamValue2)) + "원 " + iBigFamValueGubun + " " + fmComma(fmFloor(limitValue)) + "원)";
outString_Detail += viewGen01("대가족 요금 할인액(원미만 절사, 12천원 한도) : " + fmComma(fmFloor(iBigFamValue)) + "원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8);
}else{
outString_Detail += viewGen01("대가족 요금 할인액 : 0원
※ 대가족 요금 할인은 사용량 300kWh 초과에 대하여 적용됩니다.
한달 사용량이 300kWh 이하인 경우 대가족 요금 할인액이 적용되지 않습니다.");
}
}else if(iBigFam==2){ //3자녀
iBigFamBoolean = true;
iBigFamValue3 = fmFloor(Demand_Qty * limitValuePer);
iUsedAmount_TMP7 = "";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += "※ 3자녀이상 가구 요금할인은 전기요금 20%와 대가족요금 할인 금액 중
할인 금액이 큰 요금 적용(월 12천원 한도)";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 전기요금 20% : ";
if(iMinimumBoolean){
iUsedAmount_TMP7 += "(월 최저요금 " + fmComma(iMinimumValue) + "원)";
}else{
iUsedAmount_TMP7 += "(" + fmComma((fmFloor(BasicCharge))) + "원";
iUsedAmount_TMP7 += " + ";
iUsedAmount_TMP7 += fmComma((fmFloor(UsingCharge))) + "원" + ")";
}
iUsedAmount_TMP7 += " × 0.2 = ";
iUsedAmount_TMP7 += fmComma((fmFloor(iBigFamValue3))) + "원";
if(iUsedAmount>300){ // 사용량 300kWh 이상일 경우만
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP5 += "대가족 요금 기본요금 할인액 : ";
if(iUsedAmount<=600){
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원(";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]));
iUsedAmount_TMP5 += "원 - ";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원)";
iBigFamValue1 += fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]);
iUsedAmount_TMP = iUsedAmount; // 최대 적용
}else{
iUsedAmount_TMP = 600; // 최대 적용
iBigFamValue1 = 0; // 최대 적용
iUsedAmount_TMP5 += "0원";
}
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false, "");
iUsedAmount_TMP5 = ""; // html 생성
for(var j=0;j<=iUsedAmount_STD;j++){
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP > iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
}
if(j>=3){
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP6 += "· " + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(fmS2Round(xmlData02[j] - xmlData02[j-1])) + "원(" + fmComma(xmlData02[j]) + "원 - " + fmComma(xmlData02[j-1]) + "원) = " + fmComma(fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]))) + "원
";
iBigFamValue2 += fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]));
}
}
iUsedAmount_TMP5 += "대가족 요금 사용량 할인액 : ";
iUsedAmount_TMP5 += fmComma(iBigFamValue2) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += iUsedAmount_TMP6;
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP7 += " - 대가족요금 할인 금액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += fmComma(fmS2Round(iBigFamValue1)) + "원 + " + fmComma(fmS2Round(iBigFamValue2)) + "원 = " + fmComma(fmFloor(iBigFamValue1 + iBigFamValue2)) + "원";
}else{
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 대가족요금 할인 금액 : 0원";
}
iUsedAmount_TMP7 += "
";
if(iBigFamValue3 >= (iBigFamValue1 + iBigFamValue2)){
iBigFamValue4 = iBigFamValue3;
}else{
iBigFamValue4 = iBigFamValue1 + iBigFamValue2;
}
if(iBigFamValue4 >= limitValue){
iBigFamValue = fmFloor(limitValue);
iBigFamValueGubun = ">";
}else{
iBigFamValue = fmFloor(iBigFamValue4);
iBigFamValueGubun = "<";
}
iUsedAmount_TMP9 += " - 적용금액 : " + fmComma(fmFloor(iBigFamValue)) + "원 (";
iUsedAmount_TMP9 += fmComma(fmFloor(iBigFamValue4)) + "원 " + iBigFamValueGubun + " " + fmComma(limitValue)+"원)";
outString_Detail += viewGen01("3자녀가구 요금 할인액(원미만 절사, 12천원 한도) : " + fmComma(fmFloor(iBigFamValue)) + "원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8 + " " + iUsedAmount_TMP9);
}else if(iBigFam==3){
if(iUsedAmount>300){ // 사용량 300kWh 이상일 경우만
iBigFamBoolean = true;
iUsedAmount_TMP7 = "";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP5 += "생명유지장치 요금 기본요금 할인액 : ";
if(iUsedAmount<=600){
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원(";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]));
iUsedAmount_TMP5 += "원 - ";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원)";
iBigFamValue1 += fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]);
iUsedAmount_TMP = iUsedAmount; // 최대 적용
}else{
iUsedAmount_TMP = 600; // 최대 적용
iBigFamValue1 = 0; // 최대 적용
iUsedAmount_TMP5 += "0원";
}
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false, "");
iUsedAmount_TMP5 = ""; // html 생성
for(var j=0;j<=iUsedAmount_STD;j++){
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP>iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
}
if(j>=3){
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP9 += "· " + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(fmS2Round(xmlData02[j] - xmlData02[j-1])) + "원(" + fmComma(xmlData02[j]) + "원 - " + fmComma(xmlData02[j-1]) + "원) = " + fmComma(fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]))) + "원
";
iBigFamValue2 += fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]));
}
}
iBigFamValue = fmFloor(iBigFamValue1 + iBigFamValue2);
iUsedAmount_TMP5 += "생명유지장치 요금 사용량 할인액 : ";
iUsedAmount_TMP5 += fmComma(iBigFamValue2) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += iUsedAmount_TMP9;
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP7 += fmComma(fmS2Round(iBigFamValue1)) + "원 + " + fmComma(fmS2Round(iBigFamValue2)) + "원 = " + fmComma(fmFloor(iBigFamValue)) + "원";
outString_Detail += viewGen01("생명유지장치 요금 할인액(원미만 절사) : " + fmComma(fmFloor(iBigFamValue)) + "원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8);
}else{
outString_Detail += viewGen01("생명유지장치 요금 할인액 : 0원
※ 생명유지장치 요금 할인은 사용량 300kWh 초과에 대하여 적용됩니다.
한달 사용량이 300kWh 이하인 경우 생명유지장치 요금 할인액이 적용되지 않습니다.");
}
}else if(iBigFam==4){//없음
iBigFamBoolean = false;
}
}
if(iBigFamBoolean){
Demand_Qty -= iBigFamValue;
}
return true;
}
// 복지할인요금
function fnStepWelfare(){
iWelfareDcBoolean = false;
iWelfareDcValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iWelfareDcValueGubun = ">";
var iUsedAmount_TMP5 = ""; // html 생성
if(iWelfareDc==1){//없음
iWelfareDcBoolean = false;
}else if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8){
iWelfareDcBoolean = true;
var limitValue = 0;
if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7){
limitValue = 8000; //8,000원
}else if(iWelfareDc==8){
limitValue = 2000; //2,000원
}
if(Demand_Qty >= limitValue){
iWelfareDcValue = fmFloor(limitValue);
iWelfareDcValueGubun = ">";
}else{
iWelfareDcValue = fmFloor(Demand_Qty);
iWelfareDcValueGubun = "<";
}
iUsedAmount_TMP5 += "복지할인요금(원미만 절사) :
";
if(iMinimumBoolean){
iUsedAmount_TMP5 += "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP5 += fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP5 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP5 += " " + iWelfareDcValueGubun + " " + fmComma(limitValue) + "원
";
iUsedAmount_TMP5 += " ==> " + fmComma(iWelfareDcValue) + "원 (전기요금 감액, 월 " + fmComma(limitValue) + "원 한도)";
outString_Detail += viewGen01(iUsedAmount_TMP5);
}else if(iWelfareDc==6){
iWelfareDcBoolean = true;
var limitValue = 0.216;
iWelfareDcValue = fmFloor((Demand_Qty) * limitValue);
iUsedAmount_TMP5 += "복지할인요금(원미만 절사) :
";
if(iMinimumBoolean){
iUsedAmount_TMP5 += "(" + "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP5 += "(" + fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP5 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP5 += ") × " + limitValue + " = " + fmComma(iWelfareDcValue) + "원";
outString_Detail += viewGen01(iUsedAmount_TMP5);
}
}
if(iWelfareDcBoolean){
Demand_Qty -= iWelfareDcValue;
}
return true;
}
// 대가족요금/생명유지장치요금 할인 2013.06.13 WJW
function fnStepBigFamWelfare(){
iBigFamBoolean = false;
iBigFamValue = 0;
iB3FamBoolean = false;
iB3FamValue = 0;
//alert("iGubun : " + iGubun + " / iBigFam : " +iBigFam+ " / iWelfareDc : " +iWelfareDc);
if(iGubun==1){ // 주거용일 경우만
var iBigFamValue1 = 0;
var iBigFamValue2 = 0;
var iBigFamValue3 = 0;
var iBigFamValue4 = 0;
var limitValue = 12000;
var limitValuePer = 0.2;
var iBigFamValueGubun = "<";
var iUsedAmount_TMP = iUsedAmount; // 처리중 남은량
var iUsedAmount_TMP2 = 0; // 해당단계 기준량
var iUsedAmount_TMP3 = 0; // 해당단계 적용량
var iUsedAmount_TMP4 = 0; // 해당단계 누적 요금
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
var iUsedAmount_TMP7 = ""; // html 생성
var iUsedAmount_TMP8 = ""; // html 생성
var iUsedAmount_TMP9 = ""; // html 생성
// alert("Demand_Qty : " + Demand_Qty + " / iMinimumValue : " +iMinimumValue+ " / limitValuePer : " +limitValuePer);
if(iBigFam==2){ //대가족요금/생명유지장치요금 선택값 (2: 3자녀)
iBigFamBoolean = true;
iBigFamValue3 = fmFloor(Demand_Qty * limitValuePer); // 3자녀 요금 할인액
iUsedAmount_TMP7 = "";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += "※ 3자녀 요금 + 복지할인 중복시 3자녀이상 가구 요금할인과
대가족할인 + 복지할인 중 할인금액이 큰 요금 적용";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += "1. 3자녀가구 요금 할인액 : ";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " 전기요금 20% = ";
if(iMinimumBoolean){
iUsedAmount_TMP7 += "(월 최저요금 " + fmComma(iMinimumValue) + "원)";
}else{
iUsedAmount_TMP7 += "(" + fmComma((fmFloor(BasicCharge))) + "원";
iUsedAmount_TMP7 += " + ";
iUsedAmount_TMP7 += fmComma((fmFloor(UsingCharge))) + "원" + ")";
}
iUsedAmount_TMP7 += " × 20% = ";
iUsedAmount_TMP7 += fmComma((fmFloor(iBigFamValue3))) + "원";
iUsedAmount_TMP7 += "
";
if (iBigFamValue3 > 12000) { // 3자녀가구 요금 할인 월 12,000원 한도
iBigFamValue3 = 12000;
}
iUsedAmount_TMP7 += " ==> iii_5원 (3자녀가구 요금 할인 월 12,000원 한도)";
if(iUsedAmount>300){ // 사용량 300kWh 이상일 경우만
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP5 += "대가족 요금 기본요금 할인액 : ";
if(iUsedAmount<=600){
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원(";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]));
iUsedAmount_TMP5 += "원 - ";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원)";
iBigFamValue1 += fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]);
iUsedAmount_TMP = iUsedAmount; // 최대 적용
}else{
iUsedAmount_TMP = 600; // 최대 적용
iBigFamValue1 = 0; // 최대 적용
iUsedAmount_TMP5 += "0원";
}
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false, "");
iUsedAmount_TMP5 = ""; // html 생성
for(var j=0;j<=iUsedAmount_STD;j++){
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP > iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
}
if(j>=3){
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP6 += "· " + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(fmS2Round(xmlData02[j] - xmlData02[j-1])) + "원(" + fmComma(xmlData02[j]) + "원 - " + fmComma(xmlData02[j-1]) + "원) = " + fmComma(fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]))) + "원
";
iBigFamValue2 += fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]));
}
}
iUsedAmount_TMP5 += "대가족 요금 사용량 할인액 : ";
iUsedAmount_TMP5 += fmComma(iBigFamValue2) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += iUsedAmount_TMP6;
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP7 += " 2. 대가족할인액 + 복지할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " iii_3원 + iii_1원 = iii_2원";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 대가족할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += fmComma(fmS2Round(iBigFamValue1)) + "원 + " + fmComma(fmS2Round(iBigFamValue2)) + "원 = " + fmComma(fmFloor(iBigFamValue1 + iBigFamValue2)) + "원 (원미만절사)";
}else{
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " 2. 대가족할인액 + 복지할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " iii_3원 + iii_1원 = iii_2원";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 대가족할인액 : 0원";
}
iUsedAmount_TMP7 += "
";
var limitValue = 12000;
if((iBigFamValue1 + iBigFamValue2) >= limitValue){
iBigFamValue = fmFloor(limitValue);
iBigFamValueGubun = ">";
}else{
iBigFamValue = fmFloor(iBigFamValue1 + iBigFamValue2);
iBigFamValueGubun = "<";
}
iUsedAmount_TMP9 += " ==> " + fmComma(fmFloor(iBigFamValue)) + "원 (대가족 요금 할인 월 12,000원 한도)";
iUsedAmount_TMP9 += "
";
iUsedAmount_TMP9 += "iii_4";
iUsedAmount_TMP9 += "
";
}else if(iBigFam==4){//없음
iBigFamBoolean = false;
}
}
iWelfareDcBoolean = false;
iWelfareDcValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iWelfareDcValueGubun = ">";
var iUsedAmount_TMP15 = ""; // html 생성
if(iWelfareDc==1){//없음
iWelfareDcBoolean = false;
}else if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8){
iWelfareDcBoolean = true;
var limitValue = 0;
if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7){
limitValue = 8000; //8,000원
}else if(iWelfareDc==8){
limitValue = 2000; //2,000원
}
if(Demand_Qty >= limitValue){
iWelfareDcValue = fmFloor(limitValue);
iWelfareDcValueGubun = ">";
}else{
iWelfareDcValue = fmFloor(Demand_Qty);
iWelfareDcValueGubun = "<";
}
iUsedAmount_TMP15 += " - 복지할인액 :
";
if(iMinimumBoolean){
iUsedAmount_TMP15 += "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP15 += fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP15 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP15 += " " + iWelfareDcValueGubun + " " + fmComma(limitValue) + "원
";
iUsedAmount_TMP15 += " ==> " + fmComma(iWelfareDcValue) + "원 (전기요금 감액, 월 " + fmComma(limitValue) + "원 한도)";
//outString_Detail += viewGen01(iUsedAmount_TMP15);
}else if(iWelfareDc==6){
iWelfareDcBoolean = true;
var limitValue = 0.216;
iWelfareDcValue = fmFloor((Demand_Qty - iBigFamValue) * limitValue);
iUsedAmount_TMP15 += " - 복지할인액 :
";
if(iMinimumBoolean){
iUsedAmount_TMP15 += "(" + "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP15 += "(" + fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP15 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP15 += ") × " + limitValue + " = " + fmComma(iWelfareDcValue) + "원";
//outString_Detail += viewGen01(iUsedAmount_TMP15);
}
}
// alert("iBigFamValue3 : " + iBigFamValue3 +" / iBigFamValue1 + iBigFamValue2+ iWelfareDcValue :" + (iBigFamValue1 + iBigFamValue2+ iWelfareDcValue) );
if (iBigFamValue3 >= (iBigFamValue1 + iBigFamValue2 + iWelfareDcValue) ) { // 3자녀 > 대가족+ 복지(차상위 : 2000원, 그 외 : 8000원 한도)
iBigFamBoolean = false;
iB3FamBoolean = true;
iB3FamValue = iBigFamValue3;
iUsedAmount_TMP9 += " 3. 적용금액 할인금액(3자녀이상 가구 요금할인) = iii_5원";
outString_Detail += viewGen01("3자녀 요금할인(원미만 절사) :
(3자녀이상 가구 요금할인) = iii_5원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8 + " " + iUsedAmount_TMP9);
} else {
iBigFamBoolean = true;
iB3FamBoolean = false ;
iB3FamValue = 0;
iUsedAmount_TMP9 += " 3. 적용금액 할인금액(대가족 요금할인 + 복지할인) = iii_2원";
outString_Detail += viewGen01("3자녀 요금할인(원미만 절사) :
(대가족 요금할인 + 복지할인) = iii_2원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8 + " " + iUsedAmount_TMP9);
}
if(iB3FamBoolean){
Demand_Qty -= iB3FamValue;
} else {
if(iBigFamBoolean){
Demand_Qty -= iBigFamValue;
}
if(iWelfareDcBoolean){
Demand_Qty -= iWelfareDcValue;
}
}
outString_Detail = outString_Detail.replace(/iii_1/gi, fmComma(iWelfareDcValue));
outString_Detail = outString_Detail.replace(/iii_2/gi, fmComma(iBigFamValue+iWelfareDcValue));
outString_Detail = outString_Detail.replace(/iii_3/gi, fmComma(iBigFamValue));
outString_Detail = outString_Detail.replace(/iii_4/gi, fmComma(iUsedAmount_TMP15));
outString_Detail = outString_Detail.replace(/iii_5/gi, fmComma(iBigFamValue3));
return true;
}
// 초과요금(원미만 절사)
function fnStepExceed(){
iExceedBoolean = false;
iExceedValue = 0;
iExceedSTD = 1350;
if(iUsedAmount > iExceedSTD) {
iExceedBoolean = true;
var iUsedAmount_TMP5 = ""; // html 생성
iExceedValue = (iUsedAmount - iExceedSTD) * xmlData02[1];
iUsedAmount_TMP5 += "· 초과사용량 : " + fmComma(iUsedAmount) + "kWh - " + fmComma(iExceedSTD) + "kWh = " + fmComma(iUsedAmount - iExceedSTD) + "kWh
";
iUsedAmount_TMP5 += "· 초과요금 : " + fmComma(iUsedAmount - iExceedSTD) + "kWh × " + fmComma(fmS2Round(xmlData02[1])) + "원 = " + fmComma(iExceedValue) + "원";
outString_Detail += viewGen01("초과요금(원미만 절사) : " + fmComma(fmFloor(iExceedValue)) + "원
"+viewGen03(iUsedAmount_TMP5, false));
iExceedValue = fmFloor(iExceedValue);
}
if(iExceedBoolean){
Demand_Qty += iExceedValue;
}
return true;
}
// 초과요금(원미만 절사)
function fnStepExceed2(){
iExceedBoolean = false;
iExceedValue = 0;
iExceedSTD = 1350;
if(iUsedAmount > (iExceedSTD*iNumHouse)) {
iExceedBoolean = true;
var iUsedAmount_TMP5 = ""; // html 생성
iExceedValue = (iUsedAmount - (iExceedSTD*iNumHouse)) * xmlData02[1];
iUsedAmount_TMP5 += "· 초과사용량 : " + fmComma(iUsedAmount) + "kWh - " + fmComma((iExceedSTD*iNumHouse)) + "kWh = " + fmComma(iUsedAmount - (iExceedSTD*iNumHouse)) + "kWh
";
iUsedAmount_TMP5 += "· 초과요금 : " + fmComma(iUsedAmount - (iExceedSTD*iNumHouse)) + "kWh × " + fmComma(fmS2Round(xmlData02[1])) + "원 = " + fmComma(fmS2Round(iExceedValue)) + "원";
outString_Detail += viewGen01("초과요금(원미만 절사) : " + fmComma(fmFloor(iExceedValue)) + "원
"+viewGen03(iUsedAmount_TMP5, false));
iExceedValue = fmFloor(iExceedValue);
}
if(iExceedBoolean){
Demand_Qty += iExceedValue;
}
return true;
}
//13.03.06 상세계산내역 전기요금계 부분
// 전기요금계
function fnStepDemandQtyMulti(){
if(true){
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
iUsedAmount_TMP5 += "전기요금계(";
if(false){
iUsedAmount_TMP5 += "월 최저요금";
iUsedAmount_TMP6 += fmComma(iOHMinimumValue*iNumHouse) + "원";
}else{
iUsedAmount_TMP5 += "기본요금 + 전력량요금";
iUsedAmount_TMP6 += fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iOHSupplyBoolean){
iUsedAmount_TMP5 += " - 필수사용량 보장공제";
iUsedAmount_TMP6 += " - " + fmComma(fmFloor(iOHSupplyDcValue)) + "원";
}
if(iOHWelfareBoolean){
iUsedAmount_TMP5 += " - 복지할인";
iUsedAmount_TMP6 += " - " + fmComma(fmFloor(iOHWelfareValue)) + "원";
}
if(iOHFamBoolean){
if(iOHFamValue1 > 0){
iUsedAmount_TMP5 += " - 3자녀/대가족/출산가구";
iUsedAmount_TMP6 += " - " + fmComma(fmFloor(iOHFamValue1)) + "원";
}
if(iOHFamValue2 > 0){
iUsedAmount_TMP5 += " - 생명유지";
iUsedAmount_TMP6 += " - " + fmComma(fmFloor(iOHFamValue2)) + "원";
}
}
if((iOHKwhDcBoolean)){
iUsedAmount_TMP5 += " - 사용량감액요금";
iUsedAmount_TMP6 += " - " + fmComma(fmFloor(iOHKwhDCValue)) + "원";
}
if(iExceedBoolean){
iUsedAmount_TMP5 += " + 초과요금";
iUsedAmount_TMP6 += " + " + fmComma(iExceedValue) + "원";
}
iUsedAmount_TMP5 += ") "
iUsedAmount_TMP6 += " = " + fmComma(Demand_Qty) + "원";
outString_Detail += viewGen01_H(iUsedAmount_TMP5+iUsedAmount_TMP6);
outString_EN_Detail += viewGen01("Total electricity rate : updating");
}
return true;
}
// 전기요금계
function fnStepDemandQty(){
var iUsedAmount_TMP5 = "";
var iUsedAmount_TMP6 = "";
if(true){
var iUsedAmount_TMP5 = ""; // html 생성
iUsedAmount_TMP5 += "전기요금계(";
iUsedAmount_TMP6 += " :";
if(iMinimumBoolean && !iSupplyBoolean){
iUsedAmount_TMP5 += "월 최저요금";
iUsedAmount_TMP6 += fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP5 += "기본요금";
iUsedAmount_TMP6 += fmComma(BasicCharge) + "원";
if(iURateBoolean){
iUsedAmount_TMP5 += " + 역률요금";
if(Urate==0){
iUsedAmount_TMP6 += " + " + fmComma(Urate) + "원";
}else{
iUsedAmount_TMP6 += (UrateCk=="+" || UrateCk=="" ? " + " : " ") + fmComma(Urate) + "원";
}
}
iUsedAmount_TMP5 += " + 전력량요금";
iUsedAmount_TMP6 += " + " + fmComma(UsingCharge) + "원";
if(iSupplyBoolean && !iAmountDcBoolean){
iUsedAmount_TMP5 += " - 필수사용량 보장공제";
iUsedAmount_TMP6 += " - "+fmComma(iSupplyDcValue) + "원";;
}
}
if(iWelfareDcBoolean && (!iRateDcBoolean || (iWelfareDcValue >= iRateDcValue) || iDupDcBoolean)){
iUsedAmount_TMP5 += " - 복지할인";
iUsedAmount_TMP6 += " - " + fmComma(iWelfareDcValue) + "원";
}
if(iRateDcBoolean && ((iRateDcValue > iWelfareDcValue) || (iWelfareDcBoolean && iDupDcBoolean))){
if(iBigFam == 1){
iUsedAmount_TMP5 += " - 대가족 요금할인";
}
if(iBigFam == 2){
iUsedAmount_TMP5 += " - 3자녀 요금할인";
}
if(iBigFam == 3){
iUsedAmount_TMP5 += " - 생명유지장치 요금할인";
}
if(iBigFam == 5){
iUsedAmount_TMP5 += " - 출산가구 요금할인";
}
iUsedAmount_TMP6 += " - " + fmComma(iRateDcValue) + "원";
}
/*
if(iB3FamBoolean){ // 3자녀 + 복지할인
iUsedAmount_TMP6 += " -3자녀 요금할인";
iUsedAmount_TMP6 += " - " + fmComma(iB3FamValue) + "원";
} else {
if(iBigFamBoolean){
iUsedAmount_TMP5 += " - 대가족요금 할인";
iUsedAmount_TMP6 += " - " + fmComma(iBigFamValue) + "원";
}
if(iWelfareDcBoolean){
iUsedAmount_TMP5 += " - 복지할인";
iUsedAmount_TMP6 += " - " + fmComma(iWelfareDcValue) + "원";
}
}
*/
if(iSpecialKs==1){
iUsedAmount_TMP5 += " - 지식서비스산업";
iUsedAmount_TMP6 += " - " + fmComma(infoSale) + "원";
}
if(iExceedBoolean){
iUsedAmount_TMP5 += " + 초과요금";
iUsedAmount_TMP6 += " + " + fmComma(iExceedValue) + "원";
}
iUsedAmount_TMP5 += ")";
iUsedAmount_TMP6 += " = " + fmComma(Demand_Qty) + "원";
outString_Detail += viewGen01_H(iUsedAmount_TMP5+iUsedAmount_TMP6);
outString_EN_Detail += viewGen01("Total electricity rate : updating");
}
return true;
}
//13.03.06 상세계산내역 부가가치세 부분
// 부가가치세 (10%) 원미만 4사5입
function fnStepTax(){
tax = 0;
if(true){
tax = fmRound(Demand_Qty * 0.1);
}
if(true){
outString_Detail += viewGen01("부가가치세(원미만 4사 5입) : " + fmComma(Demand_Qty) + "원 × 0.1 = " + fmComma(fmRound(Demand_Qty * 0.1)) + "원");
outString_EN_Detail += viewGen01("VAT : updating");
}
return true;
}
//13.03.06 상세계산내역 전력산업기반기금 부분
// 전력산업기반기금 (3.7%) 10원 미만 절사
function fnStepBaseFund(){
baseFund = 0;
if(true){
baseFund = fm10Floor(Demand_Qty * 0.037);
}
if(true){
outString_Detail += viewGen01("전력산업기반기금(10원미만 절사) : " + fmComma(Demand_Qty) + "원 × 0.037 = " + fmComma(fm10Floor(Demand_Qty * 0.037)) + "원");
outString_EN_Detail += viewGen01("Electric power industry fund : updating");
}
return true;
}
//13.03.06 상세계산내역 청구금액부분
// 청구금액 10원 미만 절사
function fnStepDemandQty2(){
Demand_Qty2 = 0;
if(true){
Demand_Qty2 = fm10Floor(Demand_Qty + tax + baseFund);
}
if(true){
outString_Detail += viewGen02("청구금액(전기요금계 + 부가가치세 + 전력산업기반기금) : " + fmComma(Demand_Qty) + "원 + " + fmComma(tax) + "원 + " + fmComma(baseFund) + "원 = " + fmComma(fm10Floor(Demand_Qty + tax + baseFund)) + "원(10원미만 절사)");
outString_EN_Detail += viewGen02("Total amount billed : updating");
}
return true;
}
// 2015.09.17 주택용하계할인 안내(저압)
function fnStepSumm_infoL(){
outString_Detail += viewGen05("※ 하계할인제도 미반영(한시제도)☞ 하계할인시 주택용 저압 사용량별 요금표");
return true;
}
// 2015.09.17 주택용하계할인 안내(고압)
function fnStepSumm_infoH(){
outString_Detail += viewGen05("※ 하계할인제도 미반영(한시제도)☞ 하계할인시 주택용 고압 사용량별 요금표");
return true;
}
// 2015.09.17 주택용하계할인 요금표 다운로드용
function getDownNew(sFile1,sFile2){
document.down.target="iframefrm09";
down.atch_file_id.value=sFile1;
down.file_sn.value=sFile2;
down.action = "/ckepco/front/CYCOMM00/jsp/CYDOWN01005.jsp";
down.submit();
}
//13.03.06 상세계산내역 청구금액부분
// 청구금액 10원 미만 절사
function fnStepDemandQty3(){
Demand_Qty2 = 0;
if(true){
Demand_Qty2 = fm10Floor(Demand_Qty + tax + baseFund);
if(iUsedAmount == 0) {
Demand_Qty2 = Math.floor(((Demand_Qty2)*0.5) / 10) * 10;
}
}
if(true){
outString_Detail += viewGen02("청구금액(전기요금계 + 부가가치세 + 전력산업기반기금) : " + fmComma(Demand_Qty) + "원 + " + fmComma(tax) + "원 + " + fmComma(baseFund) + "원 = " + fmComma(Demand_Qty2) + "원(10원미만 절사)");
}
return true;
}
//13.03.06 상세계산내역 월간 타이틀 부분
// 상세계산내역 타이틀
function fnStepShowTitle(){
if(true){
outString_Title += "";
if(iGubun == 1 || iGubun == 2 || iGubun == 3){
outString_Title += "월간 " + fmComma(iUsedAmount) + "kWh 사용시 전기요금 계산";
}
if(iGubun == 4){
outString_Title += "계약전력 " + fmComma(iContractPwr) + "kWh, 월간 " + fmComma(iUsedAmount) + "kWh 사용시 전기요금 계산, 역률(지상:"+iURate+"%, 진상:"+iJURate+"%)";
}
if(iGubun == 5){
outString_Title += "월간 총사용량이 " + fmComma(iUsedAmount) + "kWh, " + fmComma(iNumHouse) + "가구";
var outString_Title_add = "";
var outString_Title_cnt = 0;
if(sale_1_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "장애인/유공자 "+sale_1_cnt+"가구";
outString_Title_cnt++;
}
if(sale_2_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "기초생활(생계,급여) "+sale_2_cnt+"가구";
outString_Title_cnt++;
}
if(sale_3_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "기초생활(주거,교육) "+sale_3_cnt+"가구";
outString_Title_cnt++;
}
if(sale_4_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "차상위계층 "+sale_4_cnt+"가구";
outString_Title_cnt++;
}
if(sale_5_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "사회복지시설 "+sale_5_cnt+"가구";
outString_Title_cnt++;
}
if(sale_6_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "대가족(대가족,3자녀,출산가구) "+sale_6_cnt+"가구";
outString_Title_cnt++;
}
if(sale_7_cnt>0){
if(outString_Title_cnt>0){outString_Title_add += ", ";}
outString_Title_add += "생명유지장치 "+sale_7_cnt+"가구";
outString_Title_cnt++;
}
if(outString_Title_cnt>0){
outString_Title_add = " ("+outString_Title_add+")";
}
outString_Title += outString_Title_add;
}
if(iGubun == 1){
outString_Title += "(주거용)";
}else if(iGubun == 2){
outString_Title += "(비주거용)";
}
// 전기요금 그래프 보기 버튼 생성
if($("#Proc_CODE").val() == "HouseL" || $("#Proc_CODE").val() == "HouseH"){
if(iGubun==1){
outString_Title += " ";
}
}
outString_Title += "
";
}
return true;
}
// 계산결과
function fnStepShowResult(){
if(true){
outString_Result += viewGen00(formatComma(Demand_Qty2));
}
return true;
}
// 출력
function fnStepShowAll(){
if(true){
$("#cal_detail_content").html(outString_Detail);
$("#cal_detail_title").html(outString_Title);
$("#cal_result").html(outString_Result);
}
return true;
}
// 기본요금 요금 계산
function fnStepBasicCharge(){
if ( iEType == "800L" && iContractPwr <= 5 && iUsedAmount <= 0) { //농사용(갑) 저압이며 사용량이 0일 경우에는 기본요금 계산을 하지 않는다.
outString_Detail += viewGen01("기본요금(원미만 절사) : 0원(계약전력 5kW 이하의 저압은 사용량이 0kWh 일때
기본요금 없음");
} else {
BasicCharge = Math.floor(iContractPwr * xmlData01[0]); //기본요금 / 원미만 절사
outString_Detail += viewGen01("기본요금(원미만 절사) : " + formatComma(iContractPwr) + "kW x " + formatComma(xmlData01[0]) + "원 = " + formatComma(BasicCharge) + "원");
}
return true;
}
// 역률(원미만 절사)
function fnStepURate(){
var Std_date = iStartDate.substring(0,4)+ iStartDate.substring(5,7) + iStartDate.substring(8,10);
// alert("시작일 : " + Std_date + " 계약종별 : " + iEType);
if( iEType == "800L" || iEType == "800H" || iEType == "810L" ) { // 농사용(갑), 농사용(을) 저압 인경우 무조건 역륙 0.2%
fnStepURate_02() ;
} else {
if(eval(Std_date) >= 20140701) {
fnStepURate_02() ;
} else {
fnStepURate_01() ;
}
}
}
function fnStepURate_01(){ // 사용기간 시작일이 2014.07.01 이전이면 역률 0.5%
iURateBoolean = true;
if(iContractPwr>=20 && iReactivePwr==1) { //계약전력 20kW 이상이고 무효전력량계가 있을때만 할인/할증 적용
// 지상역률
if(iURate < 90) { // 지상역률 90% 미만
TempUrate = 90-iURate;
TempUrate = TempUrate>30 ? 30 : TempUrate; // 최대 15%(30%)
//UrateCk = "+";
DPUrate = (BasicCharge * TempUrate * 0.5)/100;
DPUrate = Math.floor(DPUrate);
} else if (iURate >= 90) { // 지상역률 90% 이상
//UrateCk = "-";
TempUrate = iURate-90;
TempUrate = TempUrate>5 ? 5 : TempUrate; // 최대 2.5%(5%)
DPUrate = (BasicCharge * TempUrate * 0.5 )/100;
DPUrate = Math.floor(DPUrate);
DPUrate = -DPUrate;
}
// 진상역률
if("200L"!=iEType){ //진상역률은 고압만 계산
if(iJURate < 95) { // 진상역률 계산
JTempUrate = 95-iJURate;
JTempUrate = JTempUrate>35 ? 35 : JTempUrate; // 최대 17.5%(35%)
JDPUrate = (BasicCharge * JTempUrate * 0.5 )/100;
JDPUrate = Math.floor(JDPUrate);
}
}
Urate = DPUrate + JDPUrate;
if(Urate>=0){
UrateCk = "+";
}else{
UrateCk = "-";
}
ifisSale = true; // 역률 적용
}else{
ifisSale = false; // 역률 미적용
}
if(ifisSale){
Demand_Qty += Urate;
var iUsedAmount_TMP6 = "· 지상역률 : "+ (TempUrate * 0.5) + "% x " + formatComma(BasicCharge) + "원 = " + formatComma((DPUrate * 100)/100) + "원";
iUsedAmount_TMP6 += "
";
iUsedAmount_TMP6 += "· 진상역률 : "+ (JTempUrate * 0.5) + "% x " + formatComma(BasicCharge) + "원 = " + formatComma((JDPUrate * 100)/100) + "원";
outString_Detail += viewGen01("역률요금(원미만 절사) : " + formatComma(Urate) + "원" + viewGen03(iUsedAmount_TMP6, false));
}
return true;
}
function fnStepURate_02(){ // 역률(원미만 절사) 2014.08 청구분(사용기간 시작일이 2014.07.01 이후부터 역률 0.5% => 0.2%)
iURateBoolean = true;
if(iContractPwr>=20 && iReactivePwr==1) { //계약전력 20kW 이상이고 무효전력량계가 있을때만 할인/할증 적용
// 지상역률
if(iURate < 90) { // 지상역률 90% 미만
TempUrate = 90-iURate;
TempUrate = TempUrate>30 ? 30 : TempUrate; // 최대 15%(30%)
//UrateCk = "+";
DPUrate = (BasicCharge * TempUrate * 0.2)/100;
DPUrate = Math.floor(DPUrate);
} else if (iURate >= 90) { // 지상역률 90% 이상
//UrateCk = "-";
TempUrate = iURate-90;
TempUrate = TempUrate>5 ? 5 : TempUrate; // 최대 2.5%(5%)
DPUrate = (BasicCharge * TempUrate * 0.2 )/100;
DPUrate = Math.floor(DPUrate);
DPUrate = -DPUrate;
}
// 진상역률
if("200L"!=iEType){ //진상역률은 고압만 계산
if(iJURate < 95) { // 진상역률 계산
JTempUrate = 95-iJURate;
JTempUrate = JTempUrate>35 ? 35 : JTempUrate; // 최대 17.5%(35%)
JDPUrate = (BasicCharge * JTempUrate * 0.2 )/100;
JDPUrate = Math.floor(JDPUrate);
}
}
Urate = DPUrate + JDPUrate;
if(Urate>=0){
UrateCk = "+";
}else{
UrateCk = "-";
}
ifisSale = true; // 역률 적용
}else{
ifisSale = false; // 역률 미적용
}
if(ifisSale){
Demand_Qty += Urate;
var iUsedAmount_TMP6 = "· 지상역률 : "+ Math.floor((TempUrate * 0.2) * 100)/100 + "% x " + formatComma(BasicCharge) + "원 = " + formatComma((DPUrate * 100)/100) + "원";
iUsedAmount_TMP6 += "
";
iUsedAmount_TMP6 += "· 진상역률 : "+ Math.floor((JTempUrate * 0.2) * 100)/100 + "% x " + formatComma(BasicCharge) + "원 = " + formatComma((JDPUrate * 100)/100) + "원";
iUsedAmount_TMP6 += "
※ 사용 시작일이 '14.07.01 부터는 역률 0.2% 적용";
outString_Detail += viewGen01("역률요금(원미만 절사) : " + formatComma(Urate) + "원" + viewGen03(iUsedAmount_TMP6, false));
}
return true;
}
// 월단위 전력량 요금 계산
function fnStepUsingChargeMonth(){
var iUsedAmount_TMP5 = "";
for(var i=0;i";
}
UsingCharge += dayByMonthUsedAmount[i] * xmlData02[check_val];
iUsedAmount_TMP5 += "· "+parseInt((dayByMonth[i]).substring(5,7), 10)+"월 계산분 : "+formatComma(dayByMonthUsedAmount[i]) + "kWh x " + xmlData02[check_val] + "원 = " + formatComma(Math.floor((dayByMonthUsedAmount[i] * xmlData02[check_val])* 100)/100) + "원";
check_val++;
}
UsingCharge = Math.floor(UsingCharge);
outString_Detail += viewGen01("전력량요금(원미만 절사) : " + formatComma(UsingCharge) + "원" + viewGen03(iUsedAmount_TMP5, false));
return true;
}
// 월단위 전력량 요금 계산
function fnStepUsingChargeMonth2(){
var iUsedAmount_TMP5 = "";
var iUsedAmount_TMP6 = "";
var useT1 = 0;var useM1 = 0;var useB1 = 0;
var useT2 = 0;var useM2 = 0;var useB2 = 0;
for(var i=0;i";
iUsedAmount_TMP5 += "· 주간(중간부하)요금 : "+formatComma(dayByMonthUsedAmountM[i]) + "kWh x " + xmlData03[check_val] + "원 = " + formatComma(Math.round((dayByMonthUsedAmountM[i] * xmlData03[check_val])* 10)/10) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += "· 저녁(최대부하)요금 : "+formatComma(dayByMonthUsedAmountT[i]) + "kWh x " + xmlData04[check_val] + "원 = " + formatComma(Math.round((dayByMonthUsedAmountT[i] * xmlData04[check_val])* 10)/10) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += "· 심야(경부하)요금 : "+formatComma(dayByMonthUsedAmountB[i]) + "kWh x " + xmlData02[check_val] + "원 = " + formatComma(Math.round((dayByMonthUsedAmountB[i] * xmlData02[check_val])* 10)/10) + "원";
iUsedAmount_TMP6 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP5 = "";
check_val++;
}
//전력량 요금 계산시 절사(소수둘째반올림(주간1 + 주간2)) + 절사(소수둘째반올림(중간1 + 중간2)) + 절사(소수둘째반올림(심야1 + 심야2) )
if(dayByMonth.length == 2){
UsingCharge = Math.floor(Math.round((useT1+useT2)*100)/100) +
Math.floor(Math.round((useM1+useM2)*100)/100) +
Math.floor(Math.round((useB1+useB2)*100)/100);
}else{
UsingCharge = Math.floor(Math.round((useT1)*100)/100) +
Math.floor(Math.round((useM1)*100)/100) +
Math.floor(Math.round((useB1)*100)/100);
}
//UsingCharge = Math.floor(UsingCharge);
outString_Detail += viewGen01("전력량요금(원미만 절사하여 합산) : " + formatComma(UsingCharge) + "원" + iUsedAmount_TMP6);
return true;
}
// 사용량 0 일경우 (50% 할인) 10원 미만 절사
function fnStepHalfSale(){
if(iUsedAmount == 0) {
Demand_Qty2 = Math.floor(((Demand_Qty2)*0.5) / 10) * 10;
}
return true;
}
// 지식서비스산업 할인 (3%) 원미만 절사
function fnStepInfoSale(){
if(iSpecialKs==1){
// infoSale = Math.floor(Demand_Qty * 0.03); // 지식서비스산업 할인 (3%) 원미만 절사 BasicCharge + UsingCharge
infoSale = Math.floor(( BasicCharge + UsingCharge + Urate) * 0.03); // 지식서비스산업 할인 (3%) 원미만 절사
outString_Detail += viewGen01("지식서비스산업 할인(원미만 절사) : " + formatComma((BasicCharge + UsingCharge + Urate)) + "원 x 0.03 = " + formatComma(infoSale) + "원");
Demand_Qty -= infoSale; //전기요금계 (기본요금 + 전력량 요금)
}
return true;
}
// 일반용 복지할인(30%) 원미만 절사
function fnGenWelfareSale(){
if(iWelfareDc==1){
iWelfareDcBoolean = true;
iWelfareDcValue = Math.floor((BasicCharge + UsingCharge + Urate) * 0.3); // 일반용 사회복지 할인 (20%) 원미만 절사
outString_Detail += viewGen01("사회복지 할인(원미만 절사) : " + formatComma((BasicCharge + UsingCharge + Urate)) + "원 x 0.3 = " + formatComma(iWelfareDcValue) + "원");
Demand_Qty -= iWelfareDcValue; //전기요금계 (기본요금 + 전력량 요금)
}
return true;
}
// 대가족요금/생명유지장치요금 할인
function fnStepBigFamWelfareMulti(){
iBigFamBoolean = false;
iBigFamValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iBigFamValue1 = 0;
var iBigFamValue2 = 0;
var iBigFamValue3 = 0;
var iBigFamValue4 = 0;
var limitValue = 12000;
var limitValuePer = 0.2;
var iBigFamValueGubun = "<";
var iUsedAmount_TMP = iUsedAmount; // 처리중 남은량
var iUsedAmount_TMP2 = 0; // 해당단계 기준량
var iUsedAmount_TMP3 = 0; // 해당단계 적용량
var iUsedAmount_TMP4 = 0; // 해당단계 누적 요금
var iUsedAmount_TMP5 = ""; // html 생성
var iUsedAmount_TMP6 = ""; // html 생성
var iUsedAmount_TMP7 = ""; // html 생성
var iUsedAmount_TMP8 = ""; // html 생성
var iUsedAmount_TMP9 = ""; // html 생성
if(iBigFam==2){
iBigFamBoolean = true;
iBigFamValue3 = fmFloor(Demand_Qty * limitValuePer);
iUsedAmount_TMP7 = "";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += "※ 3자녀 요금 + 복지할인 중복시 3자녀이상 가구 요금할인과
대가족할인 + 복지할인 중 할인금액이 큰 요금 적용";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += "1. 3자녀가구 요금 할인액 : ";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " 전기요금 20% = ";
if(iMinimumBoolean){
iUsedAmount_TMP7 += "(월 최저요금 " + fmComma(iMinimumValue) + "원)";
}else{
iUsedAmount_TMP7 += "(" + fmComma((fmFloor(BasicCharge))) + "원";
iUsedAmount_TMP7 += " + ";
iUsedAmount_TMP7 += fmComma((fmFloor(UsingCharge))) + "원" + ")";
}
iUsedAmount_TMP7 += " × 20% = ";
iUsedAmount_TMP7 += fmComma((fmFloor(iBigFamValue3))) + "원";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " ==> iii_3원 (3자녀가구 요금 할인 월 12,000원 한도)";
if(iUsedAmount>300){ // 사용량 300kWh 이상일 경우만
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP5 += "대가족 요금 기본요금 할인액 : ";
if(iUsedAmount<=600){
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원(";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD]));
iUsedAmount_TMP5 += "원 - ";
iUsedAmount_TMP5 += fmComma(fmFloor(xmlData01[iUsedAmount_STD-1]));
iUsedAmount_TMP5 += "원)";
iBigFamValue1 += fmFloor(xmlData01[iUsedAmount_STD]) - fmFloor(xmlData01[iUsedAmount_STD-1]);
iUsedAmount_TMP = iUsedAmount; // 최대 적용
}else{
iUsedAmount_TMP = 600; // 최대 적용
iBigFamValue1 = 0; // 최대 적용
iUsedAmount_TMP5 += "0원";
}
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false, "");
iUsedAmount_TMP5 = ""; // html 생성
for(var j=0;j<=iUsedAmount_STD;j++){
iUsedAmount_TMP2 = (xmlData00_STD[j+1] - xmlData00_STD[j]);
if(iUsedAmount_TMP > iUsedAmount_TMP2){
iUsedAmount_TMP = iUsedAmount_TMP - iUsedAmount_TMP2;
iUsedAmount_TMP3 = iUsedAmount_TMP2;
}else{
iUsedAmount_TMP3 = iUsedAmount_TMP;
}
if(j>=3){
iUsedAmount_TMP4 += iUsedAmount_TMP3 * xmlData02[j];
iUsedAmount_TMP6 += "· " + (j+1) + "단계 : " + fmComma(iUsedAmount_TMP3) + "kWh × " + fmComma(fmS2Round(xmlData02[j] - xmlData02[j-1])) + "원(" + fmComma(xmlData02[j]) + "원 - " + fmComma(xmlData02[j-1]) + "원) = " + fmComma(fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]))) + "원
";
iBigFamValue2 += fmS2Round(iUsedAmount_TMP3 * (xmlData02[j] - xmlData02[j-1]));
}
}
iUsedAmount_TMP5 += "대가족 요금 사용량 할인액 : ";
iUsedAmount_TMP5 += fmComma(iBigFamValue2) + "원";
iUsedAmount_TMP5 += "
";
iUsedAmount_TMP5 += iUsedAmount_TMP6;
iUsedAmount_TMP8 += viewGen03(iUsedAmount_TMP5, false);
iUsedAmount_TMP7 += " 2. 대가족할인액 + 복지할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " iii_3원 + iii_1원 = iii_2원";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 대가족할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += fmComma(fmS2Round(iBigFamValue1)) + "원 + " + fmComma(fmS2Round(iBigFamValue2)) + "원 = " + fmComma(fmFloor(iBigFamValue1 + iBigFamValue2)) + "원 (원미만절사)";
}else{
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " 2. 대가족할인액 + 복지할인액 :";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " iii_3원 + iii_1원 = iii_2원";
iUsedAmount_TMP7 += "
";
iUsedAmount_TMP7 += " - 대가족할인액 : 0원";
}
iUsedAmount_TMP7 += "
";
var limitValue = 12000;
if((iBigFamValue1 + iBigFamValue2) >= limitValue){
iBigFamValue = fmFloor(limitValue);
iBigFamValueGubun = ">";
}else{
iBigFamValue = fmFloor(iBigFamValue1 + iBigFamValue2);
iBigFamValueGubun = "<";
}
iUsedAmount_TMP9 += " ==> " + fmComma(fmFloor(iBigFamValue)) + "원 (대가족 요금 할인 월 12,000원 한도)";
iUsedAmount_TMP9 += "
";
iUsedAmount_TMP9 += "iii_4";
iUsedAmount_TMP9 += "
";
iUsedAmount_TMP9 += " 3. 적용금액 할인금액(대가족 요금할인 + 복지할인) = iii_2원";
outString_Detail += viewGen01("3자녀 요금 할인(원미만 절사) :
(대가족 요금할인 + 복지할인) = iii_2원" + iUsedAmount_TMP7 + " " + iUsedAmount_TMP8 + " " + iUsedAmount_TMP9);
}else if(iBigFam==4){//없음
iBigFamBoolean = false;
}
}
if(iBigFamBoolean){
Demand_Qty -= iBigFamValue;
}
iWelfareDcBoolean = false;
iWelfareDcValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iWelfareDcValueGubun = ">";
var iUsedAmount_TMP15 = ""; // html 생성
if(iWelfareDc==1){//없음
iWelfareDcBoolean = false;
}else if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8){
iWelfareDcBoolean = true;
var limitValue = 0;
if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7){
limitValue = 8000; //8,000원
}else if(iWelfareDc==8){
limitValue = 2000; //2,000원
}
if(Demand_Qty >= limitValue){
iWelfareDcValue = fmFloor(limitValue);
iWelfareDcValueGubun = ">";
}else{
iWelfareDcValue = fmFloor(Demand_Qty);
iWelfareDcValueGubun = "<";
}
iUsedAmount_TMP15 += " - 복지할인액 :
";
if(iMinimumBoolean){
iUsedAmount_TMP15 += "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP15 += fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP15 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP15 += " " + iWelfareDcValueGubun + " " + fmComma(limitValue) + "원
";
iUsedAmount_TMP15 += " ==> " + fmComma(iWelfareDcValue) + "원 (전기요금 감액, 월 " + fmComma(limitValue) + "원 한도)";
//outString_Detail += viewGen01(iUsedAmount_TMP15);
}else if(iWelfareDc==6){
iWelfareDcBoolean = true;
var limitValue = 0.216;
iWelfareDcValue = fmFloor((Demand_Qty) * limitValue);
iUsedAmount_TMP15 += " - 복지할인액 :
";
if(iMinimumBoolean){
iUsedAmount_TMP15 += "(" + "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP15 += "(" + fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP15 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP15 += ") × " + limitValue + " = " + fmComma(iWelfareDcValue) + "원";
//outString_Detail += viewGen01(iUsedAmount_TMP15);
}
}
if(iWelfareDcBoolean){
Demand_Qty -= iWelfareDcValue;
}
outString_Detail = outString_Detail.replace(/iii_1/gi, fmComma(iWelfareDcValue));
outString_Detail = outString_Detail.replace(/iii_2/gi, fmComma(iBigFamValue+iWelfareDcValue));
outString_Detail = outString_Detail.replace(/iii_3/gi, fmComma(iBigFamValue));
outString_Detail = outString_Detail.replace(/iii_4/gi, fmComma(iUsedAmount_TMP15));
return true;
}
// 복지할인요금
function fnStepWelfareMulti(){
iWelfareDcBoolean = false;
iWelfareDcValue = 0;
if(iGubun==1){ // 주거용일 경우만
var iWelfareDcValueGubun = ">";
var iUsedAmount_TMP5 = ""; // html 생성
if(iWelfareDc==1){//없음
iWelfareDcBoolean = false;
}else if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8){
iWelfareDcBoolean = true;
var limitValue = 0;
if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7){
limitValue = 8000; //8,000원
}else if(iWelfareDc==8){
limitValue = 2000; //2,000원
}
if(Demand_Qty >= limitValue){
iWelfareDcValue = fmFloor(limitValue);
iWelfareDcValueGubun = ">";
}else{
iWelfareDcValue = fmFloor(Demand_Qty);
iWelfareDcValueGubun = "<";
}
iUsedAmount_TMP5 += "복지할인요금(원미만 절사) :
";
if(iMinimumBoolean){
iUsedAmount_TMP5 += "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP5 += fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP5 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP5 += " " + iWelfareDcValueGubun + " " + fmComma(limitValue) + "원
";
iUsedAmount_TMP5 += " ==> " + fmComma(iWelfareDcValue) + "원 (전기요금 감액, 월 " + fmComma(limitValue) + "원 한도)";
outString_Detail += viewGen01(iUsedAmount_TMP5);
}else if(iWelfareDc==6){
iWelfareDcBoolean = true;
var limitValue = 0.216;
iWelfareDcValue = fmFloor((Demand_Qty) * limitValue);
iUsedAmount_TMP5 += "복지할인요금(원미만 절사) :
";
if(iMinimumBoolean){
iUsedAmount_TMP5 += "(" + "월 최저요금 " + fmComma(iMinimumValue) + "원";
}else{
iUsedAmount_TMP5 += "(" + fmComma(BasicCharge) + "원 + " + fmComma(UsingCharge) + "원";
}
if(iBigFamBoolean){
iUsedAmount_TMP5 += " - " + fmComma(iBigFamValue) + "원";
}
iUsedAmount_TMP5 += ") × " + limitValue + " = " + fmComma(iWelfareDcValue) + "원";
outString_Detail += viewGen01(iUsedAmount_TMP5);
}
}
if(iWelfareDcBoolean){
Demand_Qty -= iWelfareDcValue;
}
return true;
}
//정액할인
function fnStepAmount(){
var iUsedAmount_TMP5 = "";
var iUsedAmount_TMP6 = "";
var limitValue = 0;
iDupDcBoolean = false;
//필수 보장 공제 최저요금 적용
var iUsedAmount_TMP1 = "";
var iUsedAmount_TMP2 = "";
limitValue = BasicCharge + UsingCharge;
iSupplyBoolean = false;
iMinimumBoolean = false;
if(!(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8 || iWelfareDc==9)){
if(iUsedAmount <= 200 && iGubun == 1 && !(iEType == "100H" && Demand_Qty < 1000)){
iSupplyBoolean = true;
//iDupDcBoolean = true;
if(limitValue - iSupplyValue > iMinimumValue){
iSupplyDcValue = iSupplyValue;
}else{
iSupplyDcValue = iSupplyValue + (limitValue - iSupplyValue - iMinimumValue);
}
if(!(limitValue - iSupplyValue > iMinimumValue)){
if(iSupplyDcValue < 0){ //할인액이 없을 시 필수사용량보장공제를 적용하지 않는다.
iSupplyDcValue = 0;
iSupplyBoolean = false;
}
if(iEType == "100L") Demand_Qty = 1000;
if(iEType == "100H") Demand_Qty = 1000;
iMinimumBoolean = true;
}
iSupplyOriDcValue = iSupplyDcValue;
/*if(iSupplyValue > limitValue){
iSupplyValue = limitValue;
}*/
//outString_Detail += viewGen01("주택용 필수사용량 보장공제 : " + fmComma(iSupplyDcValue) + "원" + viewGen03(iUsedAmount_TMP1, false, ""));
/*if(iSupplyBoolean){
Demand_Qty -= iSupplyDcValue;
}*/
}
}else{ //할인액만 구한다.
if(iUsedAmount <= 200 && iGubun == 1 && !(iEType == "100H" && Demand_Qty < 1000)){
iSupplyOriBoolean = true;
if(limitValue - iSupplyValue > iMinimumValue){
iSupplyOriDcValue = iSupplyValue;
}else{
iSupplyOriDcValue = iSupplyValue + (limitValue - iSupplyValue - iMinimumValue);
}
if(!(limitValue - iSupplyValue > iMinimumValue)){
if(iSupplyOriDcValue < 0){ //할인액이 없을 시 필수사용량보장공제를 적용하지 않는다.
iSupplyOriDcValue = 0;
iSupplyOriBoolean = false;
}
}
}
}
//정액 복지할인
if(iWelfareDc==1){
iWelfareDcBoolean = false;
iAmountDcBoolean = false;
}else if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7 || iWelfareDc==8 || iWelfareDc==9){
iWelfareDcBoolean = true;
iAmountDcBoolean = true;
var limitValue = 0;
var limitValueNormal = 0;
var limitValueSummer = 0;
var normalCnt = 0;
var summerCnt = 0;
if(iWelfareDc==2 || iWelfareDc==3 || iWelfareDc==4 || iWelfareDc==5 || iWelfareDc==7){
limitValueNormal = 16000;
limitValueSummer = 20000;
}else if(iWelfareDc==9){
limitValueNormal = 10000;
limitValueSummer = 12000;
}else if(iWelfareDc==8){
limitValueNormal = 8000;
limitValueSummer = 10000;
}
if(iWelfareDc==7 || iWelfareDc==8 || iWelfareDc==9){
iDupDcBoolean = true; //정액할인과 정률할인 중복 가능 여부
}
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
summerCnt += dayByMonthCnt[i];
}else{
normalCnt += dayByMonthCnt[i];
}
}
}
limitValue = fmS1Round(limitValueNormal*(normalCnt/(dayByMonthTotal))) + fmS1Round(limitValueSummer*(summerCnt/(dayByMonthTotal)));
if(Demand_Qty >= limitValue){
iWelfareDcValue = fmFloor(limitValue);
}else{
iWelfareDcValue = fmFloor(Demand_Qty);
}
}
}
function fnStepRate(){
var iUsedAmount_TMP1 = 0; //필수 사용량 보장공제 공식 구하기
var limitValue = 0;
if(iBigFam==4){
iRateDcValue = 0;
iRateDcBoolean = false;
}else if(iBigFam==1 || iBigFam==2 || iBigFam==3 || iBigFam==5){
iRateDcBoolean = true;
if(iBigFam==1){ //대가족
limitValue = 16000;
}
if(iBigFam==2){ //3자녀
limitValue = 16000;
}
if(iBigFam==3){ //생명유지
}
if(iBigFam==5){ //출산
limitValue = 16000;
}
}
if(iWelfareDc == 6){
iWelfareRateDcBoolean = true;
iWelfareDcBoolean = true;
iDupDcBoolean = false;
iAmountDcBoolean = false;
}
if(iRateDcBoolean){
if(iSupplyBoolean&&!iMinimumBoolean){
iUsedAmount_TMP1 = iSupplyDcValue;
}else if(iSupplyOriBoolean){
iUsedAmount_TMP1 = iSupplyOriDcValue;
}
iRateDcValue = fmFloor(fmS2Round((Demand_Qty-Math.max(iUsedAmount_TMP1, (iDupDcBoolean?iWelfareDcValue:0)))*0.3));
iRateOriDcValue = iRateDcValue;
if( limitValue != 0 && iRateDcValue > limitValue){
iRateDcValue = limitValue;
}
}
if(iWelfareRateDcBoolean){
if( iMinimumBoolean ){
iWelfareDcValue = fmFloor(fmS2Round((Demand_Qty)*0.3));
}else{
iWelfareDcValue = fmFloor(fmS2Round((Demand_Qty-(iSupplyBoolean?iSupplyDcValue:0))*0.3));
}
}
}
function fnStepDcResult(){
var iUsedAmount_TMP1 = "";
var iUsedAmount_TMP2 = "";
var iUsedAmount_TMP3 = "";
var iUsedAmount_TMP4 = "";
var iUsedAmount_TMP5 = "";
var iUsedAmount_TMP6 = "";
var iUsedAmount_TMP7 = "";
var iUsedAmount_TMP8 = "";
var iUsedAmount_Summer = "";
var iBaseAmountStr = ""; //기본요금 + 전력량 요금 테스트 최저 요금으로 나올 경우 최저 요금으로 변경한다.
var iBaseAmountValue = ""; //기본요금 + 전력량 요금 테스트 최저 요금으로 나올 경우 최저 요금으로 변경한다.
var iWelfareNormalDcLimitValue = 0;
var iWelfareSummerDcLimitValue = 0;
var iWelfareTotalDcLimitValue = 0;
var iRateDcLimitValue = 0;
var iSummerBoolean = false;
var iSummerDayCnt = 0;
var inormalDayCnt
//가장 높은 할인 출력
var tempCompareValue1 = iRateDcBoolean?iRateDcValue:0;
var tempCompareValue2 = (!iMinimumBoolean&&iSupplyBoolean&&!iAmountDcBoolean)?iSupplyDcValue:0;
var tempCompareValue3 = (iRateDcBoolean&&iDupDcBoolean)?iWelfareDcValue:0;
var tempCompareValue4 = (!iMinimumBoolean&&iWelfareDcBoolean&&!iAmountDcBoolean&&iSupplyBoolean)?iSupplyDcValue:0;
var tempCompareValue5 = iWelfareDcBoolean?iWelfareDcValue:0;
var iCompareValue1 = fmFloor(tempCompareValue1 + tempCompareValue2 + tempCompareValue3);
var iCompareValue2 = fmFloor(tempCompareValue5 + tempCompareValue4);
var iNotationValue = false;
var abCompareValue = false;
Demand_Qty = Math.max( Demand_Qty-Math.max(fmFloor(iCompareValue1), fmFloor(iCompareValue2)), 0);
if(iCompareValue1 == 0 && iCompareValue2 == 0 && !iSupplyBoolean){
return false;
}
if(iWelfareDc == 2){
iUsedAmount_TMP2 = "독립유공자";
iWelfareNormalDcLimitValue = 16000;
iWelfareSummerDcLimitValue = 20000;
}
if(iWelfareDc == 3){
iUsedAmount_TMP2 = "국가유공자";
iWelfareNormalDcLimitValue = 16000;
iWelfareSummerDcLimitValue = 20000;
}
if(iWelfareDc == 4){
iUsedAmount_TMP2 = "5.18민주유공자";
iWelfareNormalDcLimitValue = 16000;
iWelfareSummerDcLimitValue = 20000;
}
if(iWelfareDc == 5){
iUsedAmount_TMP2 = "장애인";
iWelfareNormalDcLimitValue = 16000;
iWelfareSummerDcLimitValue = 20000;
}
if(iWelfareDc == 6){
iUsedAmount_TMP2 = "사회복지시설";
}
if(iWelfareDc == 7){
iUsedAmount_TMP2 = "기초생활(생계, 의료)";
iWelfareNormalDcLimitValue = 16000;
iWelfareSummerDcLimitValue = 20000;
}
if(iWelfareDc == 8){
iUsedAmount_TMP2 = "차상위계층";
iWelfareNormalDcLimitValue = 8000;
iWelfareSummerDcLimitValue = 10000;
}
if(iWelfareDc == 9){
iUsedAmount_TMP2 = "기초생활(주거, 교육)";
iWelfareNormalDcLimitValue = 10000;
iWelfareSummerDcLimitValue = 12000;
}
if(iWelfareDc != 6){ //여름에 할인되는 복지할인 구간을 구한다.
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_Summer += "- "+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분 : ";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iSummerBoolean = true;
iSummerDayCnt += dayByMonthCnt[i];
iUsedAmount_Summer += fmComma(iWelfareSummerDcLimitValue)+"원 x ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) = "+fmComma(fmS1Round(iWelfareSummerDcLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원";
iWelfareTotalDcLimitValue += fmS1Round(iWelfareSummerDcLimitValue*(dayByMonthCnt[i]/dayByMonthTotal));
}else{
inormalDayCnt += dayByMonthCnt[i];
iUsedAmount_Summer += fmComma(iWelfareNormalDcLimitValue)+"원 x ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) = "+fmComma(fmS1Round(iWelfareNormalDcLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원";
iWelfareTotalDcLimitValue += fmS1Round(iWelfareNormalDcLimitValue*(dayByMonthCnt[i]/dayByMonthTotal));
}
if(i == 0 && dayByMonth.length == 2){
iUsedAmount_Summer += "
"
}
}
}
iWelfareTotalDcLimitValue = fmFloor(iWelfareTotalDcLimitValue);
}
if(iBigFam == 1){
iRateDcLimitValue = 16000;
iUsedAmount_TMP3 = "대가족 요금";
}
if(iBigFam == 2){
iRateDcLimitValue = 16000;
iUsedAmount_TMP3 = "3자녀 요금";
}
if(iBigFam == 3){
iUsedAmount_TMP3 = "생명유지장치 요금";
}
if(iBigFam == 5){
iRateDcLimitValue = 16000;
iUsedAmount_TMP3 = "출산가구 요금";
}
//고압 처리 필요
if(iEType == "100L"){
if(BasicCharge + UsingCharge < 1000){
iBaseAmountStr = "월 최저요금 1,000원";
iBaseAmountValue = iMinimumValue;
}else{
iBaseAmountStr = fmComma(BasicCharge)+"원 + "+ fmComma(UsingCharge)+"원";
iBaseAmountValue = BasicCharge + UsingCharge;
}
}else if(iEType == "100H"){
if(false){
iBaseAmountStr = "월 최저요금 1,000원";
iBaseAmountValue = iMinimumValue;
}else{
iBaseAmountStr = fmComma(BasicCharge)+"원 + "+ fmComma(UsingCharge)+"원";
iBaseAmountValue = BasicCharge + UsingCharge;
}
}
var iTempComareBoolean = false
if( iCompareValue1 == 0 && iCompareValue2 == 0){ //금액이 0으로 나올 경우 필수사용량 보장공제만 적용된 것이기에 false로 한다.
iTempComareBoolean = false;
}else{
iTempComareBoolean = true;
}
if( true ){
if(iTempComareBoolean && iCompareValue2 >= iCompareValue1){
var tempCnt = 0;
var itempDcValueGubun = ">";
if(!iAmountDcBoolean && iSupplyBoolean){
iUsedAmount_TMP1 += "필수사용량 보장공제 + ";
}
iUsedAmount_TMP1 += "복지할인("+iUsedAmount_TMP2+")(원미만 절사) : "+fmComma(iCompareValue2)+"원";
}else{
if((!iAmountDcBoolean && iSupplyBoolean?iSupplyDcValue:0) > 0) iUsedAmount_TMP1 += "필수사용량 보장공제";
if(iUsedAmount_TMP1 != "" && (iDupDcBoolean?iWelfareDcValue:0) > 0) iUsedAmount_TMP1 += " + ";
if((iDupDcBoolean?iWelfareDcValue:0) > 0) iUsedAmount_TMP1 += "복지할인("+iUsedAmount_TMP2+")";
if(iUsedAmount_TMP1 != "" && iRateDcBoolean) iUsedAmount_TMP1 += " + ";
if(iRateDcBoolean) iUsedAmount_TMP1 += iUsedAmount_TMP3;
/*iUsedAmount_TMP1 += iUsedAmount_TMP3;
if(iUsedAmount_TMP1 != "" && (!iAmountDcBoolean && iSupplyBoolean?iSupplyDcValue:0) > 0) iUsedAmount_TMP1 += " + ";
if((!iAmountDcBoolean && iSupplyBoolean?iSupplyDcValue:0) > 0) iUsedAmount_TMP1 += "필수사용량 보장공제";
if(iUsedAmount_TMP1 != "" && (iDupDcBoolean?iWelfareDcValue:0) > 0) iUsedAmount_TMP1 += " + ";
if((iDupDcBoolean?iWelfareDcValue:0) > 0) iUsedAmount_TMP1 += "복지할인("+iUsedAmount_TMP2+")";*/
var iCompareValue3 = iCompareValue1;
iCompareValue3 = ((iMinimumBoolean&&iSupplyBoolean&&!iAmountDcBoolean)?iSupplyDcValue:0) + iCompareValue1;
if(iUsedAmount_TMP1 != "") iUsedAmount_TMP1 += "(원미만 절사) : "+fmComma(iCompareValue3)+"원";
}
}
//내용 생성
if(iRateDcBoolean && iDupDcBoolean && iWelfareDcBoolean && !iWelfareRateDcBoolean){
iUsedAmount_TMP1 += "
(⒜, ⒝ 금액을 합산하여 감액)";
}else if( iCompareValue1 != 0 && iCompareValue2 != 0 && (iRateDcBoolean || (!iDupDcBoolean && iSupplyBoolean && !iWelfareRateDcBoolean))){
iUsedAmount_TMP1 += "
(⒜, ⒝ 중 감액 요금이 큰 금액 적용)";
abCompareValue = true;
}
if( iWelfareDcBoolean ){
iUsedAmount_TMP1 += "
";
if(iRateDcBoolean || (!iWelfareRateDcBoolean && iSupplyBoolean && !iAmountDcBoolean)){
iUsedAmount_TMP1 += "·⒜ ";
iNotationValue = true;
}
//복지할인 내용 생성
if(!iAmountDcBoolean && iSupplyBoolean){
iUsedAmount_TMP1 += "필수사용량 보장공제 + ";
}
iUsedAmount_TMP1 += iUsedAmount_TMP2+" 할인 : ";
if(!iAmountDcBoolean && iSupplyBoolean){
iUsedAmount_TMP1 += fmComma(iSupplyDcValue)+"원 + ";
}
iUsedAmount_TMP1 += fmComma(iWelfareDcValue)+"원";
if(!iAmountDcBoolean && iSupplyBoolean){
iUsedAmount_TMP1 += " = "+fmComma(iSupplyDcValue+iWelfareDcValue)+"원";
}
if(!iWelfareRateDcBoolean){
if((iSummerBoolean?iWelfareTotalDcLimitValue:iWelfareNormalDcLimitValue) > iBaseAmountValue){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP1 += "("+iBaseAmountStr+" "+itempDcValueGubun+" "+fmComma(iSummerBoolean?iWelfareTotalDcLimitValue:iWelfareNormalDcLimitValue)+"원)";
}
// a 세부 내용 시작 //
if(!iAmountDcBoolean && iSupplyBoolean){
if(iMinimumValue > iBaseAmountValue-iSupplyValue){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP7 += "- 필수사용량 보장공제 : "+fmComma(iSupplyDcValue)+"원 ("+iBaseAmountStr+" - "+fmComma(iSupplyValue)+"원 "+itempDcValueGubun+" "+fmComma(iMinimumValue)+"원 (감액 후 최저요금)";
/*if(iMinimumValue > 0 && iSupplyDcValue < iSupplyValue){
iUsedAmount_TMP6 += ", 월 최저 요금 1,000원 적용";
}*/
iUsedAmount_TMP7 += ")
";
}
if(iWelfareDcBoolean){
if(!iWelfareRateDcBoolean && iSummerBoolean){
iUsedAmount_TMP7 += iUsedAmount_Summer;
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP7, false, "");
}else if(iWelfareRateDcBoolean){
iUsedAmount_TMP7 += "- "+iUsedAmount_TMP2+" 할인 : "+fmComma(iWelfareDcValue)+"원 ";
if(iSupplyBoolean){
iUsedAmount_TMP7 += "(";
}
iUsedAmount_TMP7 += "(("+iBaseAmountStr+")";
if(iSupplyBoolean){
iUsedAmount_TMP7 += " - "+fmComma(iSupplyDcValue)+"원)";
}
iUsedAmount_TMP7 += " × 30% = "+fmComma(iWelfareDcValue)+"원, 한도 없음)";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP7, false, "");
}
}
// a 세부 내용 끝 //
}
if(iRateDcBoolean || (!iWelfareRateDcBoolean && iSupplyBoolean && !iAmountDcBoolean)){
if(iNotationValue){
if(iUsedAmount_TMP7 == "") iUsedAmount_TMP1 += "
"; //세부 내용이 없을시 을 추가한다.
iUsedAmount_TMP1 += "·⒝ ";
}else{
iUsedAmount_TMP1 += "
";
//iUsedAmount_TMP1 += "·⒜ ";
}
//정률할인 + 보장공제 내용 생성
if((iSupplyBoolean && !iAmountDcBoolean) || (iSupplyOriBoolean && !iDupDcBoolean)) iUsedAmount_TMP4 += "필수사용량 보장공제";
if(iUsedAmount_TMP4 != "" && iRateDcBoolean) iUsedAmount_TMP4 += " + ";
if(iRateDcBoolean) iUsedAmount_TMP4 += iUsedAmount_TMP3;
iUsedAmount_TMP4 += " : ";
if((iSupplyBoolean && !iAmountDcBoolean) || (iSupplyOriBoolean && !iDupDcBoolean)) iUsedAmount_TMP5 += fmComma(iSupplyBoolean?iSupplyDcValue:iSupplyOriDcValue)+"원";
tempCnt = 0;
if(iUsedAmount_TMP5 != "" && iRateDcBoolean){
iUsedAmount_TMP5 += " + ";
tempCnt++;
}
if(iRateDcBoolean) iUsedAmount_TMP5 += fmComma(iRateDcValue)+"원";
if(tempCnt > 0)iUsedAmount_TMP5 += " = "+fmComma((iSupplyBoolean?iSupplyDcValue:iSupplyOriDcValue)+iRateDcValue)+"원";
iUsedAmount_TMP1 += iUsedAmount_TMP4+iUsedAmount_TMP5;
/*if(tempCnt != 0 || iBigFam != 3){ //생명유지장치만 계산할 경우 한도를 넣지 않는다. //왜 넣는지 모름
if(iSupplyDcValue+iRateDcValue > iBaseAmountValue){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP1 += " ("+iBaseAmountStr+" "+itempDcValueGubun+" "+fmComma(iSupplyDcValue+iRateDcValue)+"원)";
}*/
// b 세부 내용 시작 //
if(iSupplyBoolean && !iAmountDcBoolean){
if(iMinimumValue > iBaseAmountValue-iSupplyValue){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP6 += "- 필수사용량 보장공제 : "+fmComma(iSupplyDcValue)+"원 ("+iBaseAmountStr+" - "+fmComma(iSupplyValue)+"원 "+itempDcValueGubun+" "+fmComma(iMinimumValue)+"원 (감액 후 최저요금)";
/*if(iMinimumValue > 0 && iSupplyDcValue < iSupplyValue){
iUsedAmount_TMP6 += ", 월 최저 요금 1,000원 적용";
}*/
iUsedAmount_TMP6 += ")
";
}
if(iSupplyOriBoolean && !iDupDcBoolean){
if(iMinimumValue > iBaseAmountValue-iSupplyValue){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP6 += "- 필수사용량 보장공제 : "+fmComma(iSupplyOriDcValue)+"원 ("+iBaseAmountStr+" - "+fmComma(iSupplyValue)+"원 "+itempDcValueGubun+" "+fmComma(iMinimumValue)+"원 (감액 후 최저요금)";
/*if(iMinimumValue > 0 && iSupplyDcValue < iSupplyValue){
iUsedAmount_TMP6 += ", 월 최저 요금 1,000원 적용";
}*/
iUsedAmount_TMP6 += ")
";
}
if(iRateDcBoolean){
iUsedAmount_TMP6 += "- "+iUsedAmount_TMP3+" : "+fmComma(iRateDcValue)+"원 ";
if(!iDupDcBoolean && iSupplyBoolean && !iAmountDcBoolean){
iUsedAmount_TMP6 += "(";
}else if(iDupDcBoolean && iAmountDcBoolean && iWelfareDcBoolean){
iUsedAmount_TMP6 += "(";
}else if(!iDupDcBoolean && (iSupplyOriDcValue > 0)){
iUsedAmount_TMP6 += "(";
}
iUsedAmount_TMP6 += "(("+iBaseAmountStr;
if(!iDupDcBoolean && iSupplyBoolean && !iAmountDcBoolean){
iUsedAmount_TMP6 += " - "+fmComma(iSupplyDcValue)+"원)";
}else if(iDupDcBoolean && iAmountDcBoolean && iWelfareDcBoolean){
iUsedAmount_TMP6 += " - "+fmComma(iWelfareDcValue)+"원)";
}else if(!iDupDcBoolean && (iSupplyOriDcValue > 0)){
iUsedAmount_TMP6 += " - "+fmComma(iSupplyOriDcValue)+"원)";
}
iUsedAmount_TMP6 += ") × 30% = "+fmComma(iRateOriDcValue)+"원";
if(iRateDcLimitValue > 0){
iUsedAmount_TMP6 += ", "+fmComma(iRateDcLimitValue)+"원 한도)";
}else{
iUsedAmount_TMP6 += ", 한도 없음)";
}
}
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP6, false, "");
// b 새부 내용 끝 //
}
if((iCompareValue1 == iCompareValue2) && abCompareValue){
iUsedAmount_TMP1 += "
※⒜와 ⒝의 감액 요금이 같을 경우 복지할인 우선 적용"
}
if((iGubun == 1) && iAmountDcBoolean && (iUsedAmount <= 200)){
iUsedAmount_TMP1 += "
※필수사용량 보장공제는 복지할인요금("+iUsedAmount_TMP2+")과 중복 불가"
}
/*if(!abSumValue && (iCompareValue1 == iCompareValue2) && (iRateDcBoolean && iDupDcBoolean && iWelfareDcBoolean && !iWelfareRateDcBoolean)){
iUsedAmount_TMP1 += "
※⒜와 ⒝의 감액 요금이 같을 경우 복지할인 우선 적용"
}
if(iAmountDcBoolean && iUsedAmount <= 200){
iUsedAmount_TMP1 += "
※필수사용량 보장공제는 복지할인요금(정액할인)과 중복 불가"
}*/
/*if((iWelfareDc == 6 && iSupplyDcValue > 0 && !iAmountDcBoolean && (iWelfareDc!=6||iBigFam!=4?iRateDcValue:0))){
iUsedAmount_TMP1 += "·⒞ ";
//복지할인 내용 생성
iUsedAmount_TMP1 += iUsedAmount_TMP3+" 할인 : "+fmComma(iRateDcValue)+"원";
if(iBigFam != 3){ //생명유지장치만 계산할 경우 한도를 넣지 않는다.
if(iRateDcValue > BasicCharge+UsingCharge){
itempDcValueGubun = "<";
}else{
itempDcValueGubun = ">";
}
iUsedAmount_TMP1 += " ("+fmComma(BasicCharge)+"원 + "+ fmComma(UsingCharge)+"원 "+itempDcValueGubun+" "+fmComma(iRateDcValue)+"원)";
}
// c 새부 내용 시작 //
if(iRateDcValue > 0){
iUsedAmount_TMP8 += "- "+iUsedAmount_TMP3+" : "+fmComma(iRateDcValue)+"원 (("+fmComma(BasicCharge)+"원 + "+ fmComma(UsingCharge)+"원";
if(iSupplyDcValue > 0){
iUsedAmount_TMP8 += " - "+fmComma(iSupplyDcValue)+"원";
}
iUsedAmount_TMP8 += ") × 30% = "+fmComma(iRateDcValue)+"원";
if(iRateDcLimitValue > 0){
iUsedAmount_TMP8 += ", "+fmComma(iRateDcLimitValue)+"원 한도)";
}else{
iUsedAmount_TMP8 += ", 한도 없음)";
}
}
// c 새부 내용 끝 //
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP8, false, "");
iUsedAmount_TMP1 += "
※⒝와 ⒞의 감액 요금이 같을 경우 복지할인 우선 적용";
}*/
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
function fnStepIsSuperUser(){
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 7 || curMonth == 8 || curMonth == 12 || curMonth == 1 || curMonth == 2){
iSuperUserBoolean = true;
}
}
}
}
//일주택수가구 보장공제
function fnStepOHSupply(){
var iTempSumSupplyValue = iOHSupplyValue * supply_cnt;
var iTempMinimumValue = iOHMinimumValue * supply_cnt;
var iTempLimitValue = fmFloor((BasicCharge + UsingCharge) * supply_cnt / iNumHouse);
if((iUsedAmount_Avg * supply_cnt / iNumHouse <= 200 * supply_cnt / iNumHouse) && (supply_cnt > 0)){
iOHSupplyBoolean = true;
//iDupDcBoolean = true;
if(iTempLimitValue - iTempSumSupplyValue > iTempMinimumValue ){
iOHSupplyDcValue = fmFloor(iTempSumSupplyValue);
}else{
iOHSupplyDcValue = fmFloor(iTempLimitValue - iTempMinimumValue);
}
if(!(iTempLimitValue - iTempSumSupplyValue > iTempMinimumValue)){
if(iOHSupplyDcValue < 0){ //할인액이 없을 시 필수사용량보장공제를 적용하지 않는다.
iOHSupplyDcValue = 0;
}
iOHMinimumBoolean = true;
iOHMinimumMinusBlooean = true;
//Demand_Qty = iOHMinimumValue*iNumHouse;
}
}
}
//장애인/유공자
function fnStepOHWelfare1(){
var iUsedAmount_Summer = "";
var iTempNormalLimitValue = 16000;
var iTempSummerLimitValue = 20000;
var iTempTotalLimitValue = 0;
var iTempOriLimitValue = 0;
var iTempDemandQtyValue = Demand_Qty * sale_1_cnt / iNumHouse;
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iSummerBoolean = true;
iTempTotalLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}else{
iTempTotalLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}
}
}
iOHWelfare1OriLimitValue = fmFloor(iTempOriLimitValue);
iOHWelfare1OriValue = fmFloor(iTempTotalLimitValue)*sale_1_cnt;
iOHWelfare1Value = fmFloor(iTempTotalLimitValue)*sale_1_cnt;
iOHWelfare1Value = fmFloor((iOHWelfare1Value>iTempDemandQtyValue)?iTempDemandQtyValue:iOHWelfare1Value);
}
//기초생활(생계,의료)
function fnStepOHWelfare2(){
var iUsedAmount_Summer = "";
var iTempNormalLimitValue = 16000;
var iTempSummerLimitValue = 20000;
var iTempTotalLimitValue = 0;
var iTempOriLimitValue = 0;
var iTempDemandQtyValue = Demand_Qty * sale_2_cnt / iNumHouse;
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iSummerBoolean = true;
iTempTotalLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}else{
iTempTotalLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}
}
}
iOHWelfare2OriLimitValue = fmFloor(iTempOriLimitValue);
iOHWelfare2OriValue = fmFloor(iTempTotalLimitValue)*sale_2_cnt;
iOHWelfare2Value = fmFloor(iTempTotalLimitValue)*sale_2_cnt;
iOHWelfare2Value = fmFloor((iOHWelfare2Value>iTempDemandQtyValue)?iTempDemandQtyValue:iOHWelfare2Value);
}
//기초생활(주거,교육)
function fnStepOHWelfare3(){
var iUsedAmount_Summer = "";
var iTempNormalLimitValue = 10000;
var iTempSummerLimitValue = 12000;
var iTempTotalLimitValue = 0;
var iTempOriLimitValue = 0;
var iTempDemandQtyValue = Demand_Qty * sale_3_cnt / iNumHouse;
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iSummerBoolean = true;
iTempTotalLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}else{
iTempTotalLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}
}
}
iOHWelfare3OriLimitValue = fmFloor(iTempOriLimitValue);
iOHWelfare3OriValue = fmFloor(iTempTotalLimitValue)*sale_3_cnt;
iOHWelfare3Value = fmFloor(iTempTotalLimitValue)*sale_3_cnt;
iOHWelfare3Value = fmFloor((iOHWelfare3Value>iTempDemandQtyValue)?iTempDemandQtyValue:iOHWelfare3Value);
}
//차상위계층
function fnStepOHWelfare4(){
var iUsedAmount_Summer = "";
var iTempNormalLimitValue = 8000;
var iTempSummerLimitValue = 10000;
var iTempTotalLimitValue = 0;
var iTempOriLimitValue = 0;
var iTempDemandQtyValue = Demand_Qty * sale_4_cnt / iNumHouse;
for( var i = 0; i < dayByMonth.length; i++ ){
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iSummerBoolean = true;
iTempTotalLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}else{
iTempTotalLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
iTempOriLimitValue += iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal);
}
}
}
iOHWelfare4OriLimitValue = fmFloor(iTempOriLimitValue);
iOHWelfare4OriValue = fmFloor(iTempTotalLimitValue)*sale_4_cnt;
iOHWelfare4Value = fmFloor(iTempTotalLimitValue)*sale_4_cnt;
iOHWelfare4Value = fmFloor((iOHWelfare4Value>iTempDemandQtyValue)?iTempDemandQtyValue:iOHWelfare4Value);
}
//사회복지시설
function fnStepOHWelfare5(){
var iUsedAmount_Summer = "";
var iTempDemandQtyValue = fmFloor((Demand_Qty));
var iTempWelFareTotalValue = 0;
iOHFam1SupplyValue = 0;
if(sale_5_cnt > 0){
if(iOHSupplyDcValue > 0){
iTempWelFareTotalValue = (Demand_Qty*sale_5_cnt/iNumHouse)-(iOHSupplyDcValue*iOHWelfare5SupplyDupCnt/supply_cnt);
iTempWelFareTotalValue = (iTempWelFareTotalValue>0)?iTempWelFareTotalValue*0.3:0;
}else{
iTempWelFareTotalValue = Demand_Qty*sale_5_cnt/iNumHouse*0.3;
}
}
iOHWelfare5Value= fmS1Round(iTempWelFareTotalValue);
}
//대가족/3자녀/출산가구
function fnStepOHFam1(){
var iUsedAmount_Summer = "";
iOHFam1OnlyCnt = sale_6_cnt-(iOHFam1Welfare2DupCnt+iOHFam1Welfare3DupCnt+iOHFam1Welfare4DupCnt+(iOHSupplyDcValue>0?iOHFam1SupDupCnt:0));
var iTempLimitValue = 16000*iOHFam1OnlyCnt;
var iTempLimitSale2Value = 16000*iOHFam1Welfare2DupCnt;
var iTempLimitSale3Value = 16000*iOHFam1Welfare3DupCnt;
var iTempLimitSale4Value = 16000*iOHFam1Welfare4DupCnt;
var iTempLimitSupplyValue = 16000*iOHFam1SupDupCnt;
var iTempTotalValue = 0;
var iTempDemandQtyValue = fmFloor((Demand_Qty));
var iTempWelFareTotalValue = 0;
var iTempSupplyTotalValue = 0;
iOHFam1Sale2Value = 0;
iOHFam1Sale3Value = 0;
iOHFam1Sale4Value = 0;
iOHFam1SupplyValue = 0;
iOHFam1OnlyValue = 0;
if(iOHFam1Welfare2DupCnt > 0){
iOHFam1Sale2OriValue = (Demand_Qty*iOHFam1Welfare2DupCnt/iNumHouse)-(iOHWelfare2Value*iOHFam1Welfare2DupCnt/sale_2_cnt);
iOHFam1Sale2OriValue = fmS1Round((iOHFam1Sale2OriValue>0)?iOHFam1Sale2OriValue*0.3:0);
iOHFam1Sale2Value = (iOHFam1Sale2OriValue>iTempLimitSale2Value)?iTempLimitSale2Value:iOHFam1Sale2OriValue;
}
if(iOHFam1Welfare3DupCnt > 0){
iOHFam1Sale3OriValue = (Demand_Qty*iOHFam1Welfare3DupCnt/iNumHouse)-(iOHWelfare3Value*iOHFam1Welfare3DupCnt/sale_3_cnt);
iOHFam1Sale3OriValue = fmS1Round((iOHFam1Sale3OriValue>0)?iOHFam1Sale3OriValue*0.3:0);
iOHFam1Sale3Value = (iOHFam1Sale3OriValue>iTempLimitSale3Value)?iTempLimitSale3Value:iOHFam1Sale3OriValue;
}
if(iOHFam1Welfare4DupCnt > 0){
iOHFam1Sale4OriValue = (Demand_Qty*iOHFam1Welfare4DupCnt/iNumHouse)-(iOHWelfare4Value*iOHFam1Welfare4DupCnt/sale_4_cnt);
iOHFam1Sale4OriValue = fmS1Round((iOHFam1Sale4OriValue>0)?iOHFam1Sale4OriValue*0.3:0);
iOHFam1Sale4Value = (iOHFam1Sale4OriValue>iTempLimitSale4Value)?iTempLimitSale4Value:iOHFam1Sale4OriValue;
}
if(iOHFam1SupDupCnt > 0 && (iUsedAmount_Avg * supply_cnt / iNumHouse <= 200 * supply_cnt / iNumHouse) && iOHSupplyDcValue > 0){
iOHFam1SupplyOriValue = (Demand_Qty*iOHFam1SupDupCnt/iNumHouse)-(iOHSupplyDcValue*iOHFam1SupDupCnt/supply_cnt);
iOHFam1SupplyOriValue = fmS1Round((iOHFam1SupplyOriValue>0)?iOHFam1SupplyOriValue*0.3:0);
iOHFam1SupplyValue = (iOHFam1SupplyOriValue>iTempLimitSupplyValue)?iTempLimitSupplyValue:iOHFam1SupplyOriValue;
}
if(iOHFam1OnlyCnt > 0){
iOHFam1OnlyOriValue = fmS1Round(Demand_Qty*iOHFam1OnlyCnt/iNumHouse*0.3);
iOHFam1OnlyValue = (iOHFam1OnlyOriValue>iTempLimitValue)?iTempLimitValue:iOHFam1OnlyOriValue;
}
iTempWelFareTotalValue = iOHFam1Sale2Value + iOHFam1Sale3Value + iOHFam1Sale4Value + iOHFam1SupplyValue + iOHFam1OnlyValue;
iTempTotalValue = fmFloor(iTempWelFareTotalValue);
iOHFamOriValue1 = iTempTotalValue;
iOHFamValue1 = iTempTotalValue;
}
//생명유지장치
function fnStepOHFam2(){
var iUsedAmount_Summer = "";
var iTempTotalValue = 0;
var iTempDemandQtyValue = fmFloor((Demand_Qty));
var iTempWelFareTotalValue = 0;
var iTempSupplyTotalValue = 0;
iOHFam2Sale2Value = 0;
iOHFam2Sale3Value = 0;
iOHFam2Sale4Value = 0;
iOHFam2SupplyValue = 0;
iOHFam2OnlyValue = 0;
iOHFam2OnlyCnt = sale_7_cnt-(iOHFam2Welfare2DupCnt+iOHFam2Welfare3DupCnt+iOHFam2Welfare4DupCnt+(iOHSupplyDcValue>0?iOHFam2SupDupCnt:0));
if(iOHFam2Welfare2DupCnt > 0){
iOHFam2Sale2Value = (Demand_Qty*iOHFam2Welfare2DupCnt/iNumHouse)-(iOHWelfare2Value*iOHFam2Welfare2DupCnt/sale_2_cnt);
iOHFam2Sale2Value = fmS1Round((iOHFam2Sale2Value>0)?iOHFam2Sale2Value*0.3:0);
}
if(iOHFam2Welfare3DupCnt > 0){
iOHFam2Sale3Value = (Demand_Qty*iOHFam2Welfare3DupCnt/iNumHouse)-(iOHWelfare3Value*iOHFam2Welfare3DupCnt/sale_3_cnt);
iOHFam2Sale3Value = fmS1Round((iOHFam2Sale3Value>0)?iOHFam2Sale3Value*0.3:0);
}
if(iOHFam2Welfare4DupCnt > 0){
iOHFam2Sale4Value = (Demand_Qty*iOHFam2Welfare4DupCnt/iNumHouse)-(iOHWelfare4Value*iOHFam2Welfare4DupCnt/sale_4_cnt);
iOHFam2Sale4Value = fmS1Round((iOHFam2Sale4Value>0)?iOHFam2Sale4Value*0.3:0);
}
if(iOHFam2SupDupCnt > 0 && (iUsedAmount_Avg * supply_cnt / iNumHouse <= 200 * supply_cnt / iNumHouse) && iOHSupplyDcValue > 0){
iOHFam2SupplyValue = (Demand_Qty*iOHFam2SupDupCnt/iNumHouse)-(iOHSupplyDcValue*iOHFam2SupDupCnt/supply_cnt);
iOHFam2SupplyValue = fmS1Round((iOHFam2SupplyValue>0)?iOHFam2SupplyValue*0.3:0);
}
if(iOHFam2OnlyCnt > 0){
iOHFam2OnlyValue = fmS1Round(Demand_Qty*iOHFam2OnlyCnt/iNumHouse*0.3);
}
iTempWelFareTotalValue = iOHFam2Sale2Value + iOHFam2Sale3Value + iOHFam2Sale4Value + iOHFam2SupplyValue + iOHFam2OnlyValue;
iTempTotalValue = fmFloor(iTempWelFareTotalValue);
iOHFamValue2 = iTempTotalValue;
}
//사용량감액요금
function fnStepkHwhDc(){
if(iOHKwhDcBoolean){
var iTempAmountCnt = (sale_1_cnt + sale_2_cnt + sale_3_cnt + sale_4_cnt + sale_5_cnt);
var iTempDcBasicCharge = BasicCharge / 2 / iNumHouse;
var iTempTotalDcValue = BasicCharge / 2;
iOHKwhDCCntValue = fmS1Round(iTempDcBasicCharge);
if(iOHWelfare1Value > iOHKwhDCCntValue * sale_1_cnt){
iTempTotalDcValue -= iTempDcBasicCharge * sale_1_cnt;
}
if(iOHWelfare2Value > iOHKwhDCCntValue * sale_2_cnt){
iTempTotalDcValue -= iTempDcBasicCharge * sale_2_cnt;
}
if(iOHWelfare3Value > iOHKwhDCCntValue * sale_3_cnt){
iTempTotalDcValue -= iTempDcBasicCharge * sale_3_cnt;
}
if(iOHWelfare4Value > iOHKwhDCCntValue * sale_4_cnt){
iTempTotalDcValue -= iTempDcBasicCharge * sale_4_cnt;
}
if(iOHWelfare5Value > iOHKwhDCCntValue * sale_5_cnt){
iTempTotalDcValue -= iTempDcBasicCharge * sale_5_cnt;
}
iOHKwhDCValue = fmFloor(iTempTotalDcValue);
}
}
//일주택 수가구 출력
function fnStepOHDcResult(){
var itempDcValueGubun = "";
var iUsedAmount_TMP1 = "";
var iUsedAmount_TMP2 = "";
var iUsedAmount_TMP3 = "";
var iTempSumBoolean = false;
var iTempNormalLimitValue = 0;
var iTempSummerLimitValue = 0;
iOHWelfareValue += (iOHWelfare1Value>0&&iOHWelfare1Value>(iOHKwhDCCntValue*sale_1_cnt)?iOHWelfare1Value:0);
iOHWelfareValue += (iOHWelfare2Value>0&&iOHWelfare2Value>(iOHKwhDCCntValue*sale_2_cnt)?iOHWelfare2Value:0);
iOHWelfareValue += (iOHWelfare3Value>0&&iOHWelfare3Value>(iOHKwhDCCntValue*sale_3_cnt)?iOHWelfare3Value:0);
iOHWelfareValue += (iOHWelfare4Value>0&&iOHWelfare4Value>(iOHKwhDCCntValue*sale_4_cnt)?iOHWelfare4Value:0);
iOHWelfareValue += (iOHWelfare5Value>0&&iOHWelfare5Value>(iOHKwhDCCntValue*sale_5_cnt)?iOHWelfare5Value:0);
iOHWelfareValue = fmFloor(iOHWelfareValue); //복지할인 요금합계
iOHFamValue = (iOHFamValue1>0?iOHFamValue1:0)+(iOHFamValue2>0?iOHFamValue2:0); //대가족 요금 합계
if(iOHWelfareValue > 0) iOHWelfareBoolean = true;
if(iOHFamValue >0 ) iOHFamBoolean = true;
iTempTotalDcValue = (iOHSupplyBoolean?iOHSupplyDcValue:0)+iOHWelfareValue+iOHFamValue+(iOHKwhDCValue?iOHKwhDCValue:0);
Demand_Qty -= iTempTotalDcValue;
var iBaseAmountStr = "";
var iBaseAmountValue = 0;
if(false){
iBaseAmountStr = "월 최저요금 "+fmComma(iMinimumValue*iNumHouse)+"원";
iBaseAmountValue = iMinimumValue*iNumHouse;
}else{
iBaseAmountStr = fmComma(BasicCharge)+"원 + "+fmComma(UsingCharge)+"원";
iBaseAmountValue = BasicCharge + UsingCharge;
}
//필수사용량 보장공제
if(((BasicCharge+UsingCharge)*supply_cnt/iNumHouse)-(iOHMinimumValue*supply_cnt) > 0){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP1 = "필수사용량 보장공제("+supply_cnt+" 가구) : "+fmComma(iOHSupplyDcValue)+"원";
if(iOHMinimumMinusBlooean) iUsedAmount_TMP1 += "
(("+fmComma(BasicCharge)+"원 + "+fmComma(UsingCharge)+"원"+") × "+supply_cnt+"/"+iNumHouse+" - "+fmComma(iOHMinimumValue)+"원 × "+supply_cnt+"가구 "+itempDcValueGubun+" 0원)";
iUsedAmount_TMP1 += "
(가구별 평균 사용량 200kWh 이하)(원미만 절사)"
if(iOHSupplyDcValue > 0){
if((BasicCharge+UsingCharge)*supply_cnt/iNumHouse > iOHSupplyValue*supply_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 += "("+iBaseAmountStr+") × "+supply_cnt+"/"+iNumHouse+" "+itempDcValueGubun+" "+fmComma(iOHSupplyValue)+"원 × "+supply_cnt+"가구";
if(iOHMinimumMinusBlooean) iUsedAmount_TMP2 += "
=> "+fmComma(iOHMinimumValue)+" × "+supply_cnt+"가구 = "+fmComma(iOHMinimumValue*supply_cnt)+"원(감액 후 최저요금)";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}else{
iUsedAmount_TMP2 += "
※기본요금+전력량요금(("+iBaseAmountStr+") × "+supply_cnt+"/"+iNumHouse+")이 최저요금("+fmComma(iOHMinimumValue)+"원 × "+supply_cnt+"가구)보다 적을시 필수사용량 보장공제 적용 불가";
iUsedAmount_TMP1 += iUsedAmount_TMP2
}
if(iOHSupplyBoolean){
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
//복지할인 출력(사용량감액요금은 정액할인은 계산상 포함되지 않기 때문에 정액할인 복지 할인만 사용량감액요금 계산을 한다)
iUsedAmount_TMP1 = "복지할인("+(sale_1_cnt+sale_2_cnt+sale_3_cnt+sale_4_cnt+sale_5_cnt)+" 가구) : "+fmComma(iOHWelfareValue)+"원(원미만 절사)";
if((sale_1_cnt>0?1:0)+(sale_2_cnt>0?1:0)+(sale_3_cnt>0?1:0)+(sale_4_cnt>0?1:0)+(sale_5_cnt>0?1:0)> 1){
iUsedAmount_TMP1 += "
";
iUsedAmount_TMP3 = "";
if(sale_1_cnt > 0) iUsedAmount_TMP3 += fmComma(iOHWelfare1Value)+"원";
if(iUsedAmount_TMP3 != "" && sale_2_cnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(sale_2_cnt > 0) iUsedAmount_TMP3 += fmComma(iOHWelfare2Value)+"원";
if(iUsedAmount_TMP3 != "" && sale_3_cnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(sale_3_cnt > 0) iUsedAmount_TMP3 += fmComma(iOHWelfare3Value)+"원";
if(iUsedAmount_TMP3 != "" && sale_4_cnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(sale_4_cnt > 0) iUsedAmount_TMP3 += fmComma(iOHWelfare4Value)+"원";
if(iUsedAmount_TMP3 != "" && sale_5_cnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(sale_5_cnt > 0) iUsedAmount_TMP3 += fmComma(iOHWelfare5Value)+"원";
if(iTempSumBoolean) iUsedAmount_TMP3 += " = "+fmComma(fmS1Round(iOHWelfare1Value+iOHWelfare2Value+iOHWelfare3Value+iOHWelfare4Value+iOHWelfare5Value))+"원";
iUsedAmount_TMP1 += iUsedAmount_TMP3;
}
//장애인/유공자
if(sale_1_cnt > 0){
iTempNormalLimitValue = 16000;
iTempSummerLimitValue = 20000;
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-장애인/유공자 할인분("+sale_1_cnt+"가구) : "+fmComma(iOHWelfare1Value)+"원";
if(iBaseAmountValue*sale_1_cnt/iNumHouse > iOHWelfare1OriValue*sale_1_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+sale_1_cnt+"/"+iNumHouse+" "+itempDcValueGubun+" "+fmComma(iOHWelfare1OriLimitValue)+"원 × "+sale_1_cnt+"가구";
if(iSummerBoolean){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP2 += "
·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분 : ";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iUsedAmount_TMP2 += fmComma(iTempSummerLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_1_cnt+"가구 = "+fmComma(fmS1Round(iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_1_cnt+"가구";
}else{
iUsedAmount_TMP2 += fmComma(iTempNormalLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_1_cnt+"가구 = "+fmComma(fmS1Round(iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_1_cnt+"가구";
}
/*if(i == 0 && dayByMonth.length == 2){
iUsedAmount_TMP2 += "
"
}*/
}
}
}
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
//기초생활(생계, 의료)
if(sale_2_cnt > 0){
iTempNormalLimitValue = 16000;
iTempSummerLimitValue = 20000;
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-기초생활(생계, 의료) 할인분("+sale_2_cnt+"가구) : "+fmComma(iOHWelfare2Value)+"원";
if(iBaseAmountValue*sale_2_cnt/iNumHouse > iOHWelfare2OriValue*sale_2_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+sale_2_cnt+"/"+iNumHouse+" "+itempDcValueGubun+" "+fmComma(iOHWelfare2OriLimitValue)+"원 × "+sale_2_cnt+"가구";
if(iSummerBoolean){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP2 += "
·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분 : ";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iUsedAmount_TMP2 += fmComma(iTempSummerLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_2_cnt+"가구 = "+fmComma(fmS1Round(iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_2_cnt+"가구";
}else{
iUsedAmount_TMP2 += fmComma(iTempNormalLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_2_cnt+"가구 = "+fmComma(fmS1Round(iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_2_cnt+"가구";
}
/*if(i == 0 && dayByMonth.length == 2){
iUsedAmount_TMP2 += "
"
}*/
}
}
}
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
//기초생활(주거, 교육)
if(sale_3_cnt > 0){
iTempNormalLimitValue = 10000;
iTempSummerLimitValue = 12000;
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-기초생활(주거, 교육) 할인분("+sale_3_cnt+"가구) : "+fmComma(iOHWelfare3Value)+"원";
if(iBaseAmountValue*sale_3_cnt/iNumHouse > iOHWelfare3OriValue*sale_3_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+sale_3_cnt+"/"+iNumHouse+" "+itempDcValueGubun+" "+fmComma(iOHWelfare3OriLimitValue)+"원 × "+sale_3_cnt+"가구";
if(iSummerBoolean){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP2 += "
·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분 : ";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iUsedAmount_TMP2 += fmComma(iTempSummerLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_3_cnt+"가구 = "+fmComma(fmS1Round(iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_3_cnt+"가구";
}else{
iUsedAmount_TMP2 += fmComma(iTempNormalLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_3_cnt+"가구 = "+fmComma(fmS1Round(iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_3_cnt+"가구";
}
/*if(i == 0 && dayByMonth.length == 2){
iUsedAmount_TMP2 += "
"
}*/
}
}
}
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
//차상위
if(sale_4_cnt > 0){
iTempNormalLimitValue = 8000;
iTempSummerLimitValue = 10000;
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-차상위 할인분("+sale_4_cnt+"가구) : "+fmComma(iOHWelfare4Value)+"원";
if(iBaseAmountValue*sale_4_cnt/iNumHouse > iOHWelfare4OriValue*sale_4_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+sale_4_cnt+"/"+iNumHouse+" "+itempDcValueGubun+" "+fmComma(iOHWelfare4OriLimitValue)+"원 × "+sale_4_cnt+"가구";
if(iSummerBoolean){
for( var i = 0; i < dayByMonth.length; i++ ){
iUsedAmount_TMP2 += "
·"+parseInt(dayByMonth[i].substring(5, 7), 10)+"월 계산분 : ";
var curMonth = parseInt(dayByMonth[i].substring(5, 7), 10);
if(curMonth == parseInt(iStartDate.substring(5, 7), 10) || curMonth == parseInt(iEndDate.substring(5, 7), 10)){
if( curMonth == 6 || curMonth == 7 || curMonth == 8 ){
iUsedAmount_TMP2 += fmComma(iTempSummerLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_4_cnt+"가구 = "+fmComma(fmS1Round(iTempSummerLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_4_cnt+"가구";
}else{
iUsedAmount_TMP2 += fmComma(iTempNormalLimitValue)+"원 × ("+ dayByMonthCnt[i]+"일 / "+dayByMonthTotal +"일) × "+sale_4_cnt+"가구 = "+fmComma(fmS1Round(iTempNormalLimitValue*(dayByMonthCnt[i]/dayByMonthTotal)))+"원 × "+sale_4_cnt+"가구";
}
/*if(i == 0 && dayByMonth.length == 2){
iUsedAmount_TMP2 += "
"
}*/
}
}
}
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
//사회복지시설
if(sale_5_cnt > 0){
if(iOHSupplyDcValue > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-사회복지 할인(필수사용량 보장공제 중복분 제외)("+sale_5_cnt+"가구) : "+fmComma(iOHWelfare5Value)+"원";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(sale_5_cnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHSupplyDcValue)+"원 × "+fmComma(iOHWelfare5SupplyDupCnt)+"/"+fmComma(supply_cnt)+")) × 30% = "+fmComma(iOHWelfare5Value)+"원";
}else{
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-사회복지 할인("+sale_5_cnt+"가구) : "+fmComma(iOHWelfare5Value)+"원";;
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+fmComma(sale_5_cnt)+"/"+fmComma(iNumHouse)+" × 30% = "+fmComma(iOHWelfare5Value)+"원";
if((iOHKwhDCCntValue*sale_5_cnt) > iOHWelfare5Value){
iUsedAmount_TMP2 += "
※사회복지 할인분("+fmComma(iOHWelfare5Value)+"원)보다 사회복지가구별 사용량감액요금("+fmComma(iOHKwhDCCntValue*sale_5_cnt)+"원)이 작을 경우 사용량감액요금으로 적용";
}
}
}
if(sale_5_cnt > 0){
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if((sale_1_cnt > 0) || (sale_2_cnt > 0) || (sale_3_cnt > 0) || (sale_4_cnt > 0) || (sale_5_cnt > 0)){
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
//대가족/3자녀
iTempNormalLimitValue = 16000;
iUsedAmount_TMP1 = "대가족/3자녀/출산가구 요금할인("+sale_6_cnt+" 가구) : "+fmComma(iOHFamValue1)+"원(원미만 절사)";
if((iOHFam1OnlyCnt>0?1:0) + (iOHFam1Welfare2DupCnt>0?1:0) + (iOHFam1Welfare3DupCnt>0?1:0) + (iOHFam1Welfare4DupCnt>0?1:0) + ((iOHFam1SupplyValue>0?iOHFam1SupDupCnt:0)>0?1:0) > 1 ){
iUsedAmount_TMP1 += "
";
iUsedAmount_TMP3 = "";
if(iOHFam1OnlyCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam1OnlyValue)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam1Welfare2DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam1Welfare2DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam1Sale2Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam1Welfare3DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam1Welfare3DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam1Sale3Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam1Welfare4DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam1Welfare4DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam1Sale4Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam1SupDupCnt > 0 && iOHFam1SupplyValue > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam1SupDupCnt > 0 && iOHFam1SupplyValue > 0) iUsedAmount_TMP3 += fmComma(iOHFam1SupplyValue)+"원";
if(iTempSumBoolean) iUsedAmount_TMP3 += " = "+fmComma(fmS1Round(iOHFam1OnlyValue + iOHFam1Sale2Value + iOHFam1Sale3Value + iOHFam1Sale4Value + iOHFam1SupplyValue))+"원";
iUsedAmount_TMP1 += iUsedAmount_TMP3;
}
if(iOHFam1OnlyCnt > 0){
if(iOHFam1OnlyOriValue > iTempNormalLimitValue*iOHFam1OnlyCnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인("+iOHFam1OnlyCnt+"가구) : ";
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+fmComma(iOHFam1OnlyCnt)+"/"+fmComma(iNumHouse)+" × 30% = "+fmComma(iOHFam1OnlyOriValue)+"원";
iUsedAmount_TMP2 += "
"+fmComma(iOHFam1OnlyOriValue)+"원 "+itempDcValueGubun+" "+fmComma(iTempNormalLimitValue)+"원 × "+iOHFam1OnlyCnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam1Welfare2DupCnt > 0){
if(iOHFam1Sale2OriValue > iTempNormalLimitValue*iOHFam1Welfare2DupCnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인(기초생활(생계, 의료) 중복분 제외)("+iOHFam1Welfare2DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam1Welfare2DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare2Value)+"원 × "+fmComma(iOHFam1Welfare2DupCnt)+"/"+fmComma(sale_2_cnt)+")) × 30% = "+fmComma(iOHFam1Sale2OriValue)+"원";
iUsedAmount_TMP2 += "
"+fmComma(iOHFam1Sale2OriValue)+"원 "+itempDcValueGubun+" "+fmComma(iTempNormalLimitValue)+"원 × "+iOHFam1Welfare2DupCnt+"가구";
if(iOHFam1Sale2Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam1Welfare3DupCnt > 0){
if(iOHFam1Sale3OriValue > iTempNormalLimitValue*iOHFam1Welfare3DupCnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인(기초생활(주거, 교육) 중복분 제외)("+iOHFam1Welfare3DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam1Welfare3DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare3Value)+"원 × "+fmComma(iOHFam1Welfare3DupCnt)+"/"+fmComma(sale_3_cnt)+")) × 30% = "+fmComma(iOHFam1Sale3OriValue)+"원";
iUsedAmount_TMP2 += "
"+fmComma(iOHFam1Sale3OriValue)+"원 "+itempDcValueGubun+" "+fmComma(iTempNormalLimitValue)+"원 × "+iOHFam1Welfare3DupCnt+"가구";
if(iOHFam1Sale3Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam1Welfare4DupCnt > 0){
if(iOHFam1Sale4OriValue > iTempNormalLimitValue*iOHFam1Welfare4DupCnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인(차상위 중복분 제외)("+iOHFam1Welfare4DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam1Welfare4DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare4Value)+"원 × "+fmComma(iOHFam1Welfare4DupCnt)+"/"+fmComma(sale_4_cnt)+")) × 30% = "+fmComma(iOHFam1Sale4Value)+"원";
iUsedAmount_TMP2 += "
"+fmComma(iOHFam1Sale4OriValue)+"원 "+itempDcValueGubun+" "+fmComma(iTempNormalLimitValue)+"원 × "+iOHFam1Welfare4DupCnt+"가구";
if(iOHFam1Sale4Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam1SupDupCnt > 0 && iOHSupplyDcValue > 0){
if(iOHFam1SupplyOriValue > iTempNormalLimitValue*iOHFam1SupDupCnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인(필수사용량 보장공제 중복분 제외)("+iOHFam1SupDupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam1SupDupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHSupplyDcValue)+"원 × "+fmComma(iOHFam1SupDupCnt)+"/"+fmComma(supply_cnt)+")) × 30% = "+fmComma(iOHFam1SupplyOriValue)+"원";
iUsedAmount_TMP2 += "
"+fmComma(iOHFam1SupplyOriValue)+"원 "+itempDcValueGubun+" "+fmComma(iTempNormalLimitValue)+"원 × "+iOHFam1SupDupCnt+"가구";
if(iOHFam1SupplyValue == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(sale_6_cnt > 0){
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
//생명유지장치
iUsedAmount_TMP1 = "생명유지장치 요금할인("+sale_7_cnt+" 가구) : "+fmComma(iOHFamValue2)+"원(원미만 절사)";
if((iOHFam2OnlyCnt>0?1:0) + (iOHFam2Welfare2DupCnt>0?1:0) + (iOHFam2Welfare3DupCnt>0?1:0) + (iOHFam2Welfare4DupCnt>0?1:0) + ((iOHFam2SupplyValue>0?iOHFam2SupDupCnt:0)>0?1:0) > 1){
iUsedAmount_TMP1 += "
";
iUsedAmount_TMP3 = "";
if(iOHFam2OnlyCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam2OnlyValue)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam2Welfare2DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam2Welfare2DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam2Sale2Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam2Welfare3DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam2Welfare3DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam2Sale3Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam2Welfare4DupCnt > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam2Welfare4DupCnt > 0) iUsedAmount_TMP3 += fmComma(iOHFam2Sale4Value)+"원";
if(iUsedAmount_TMP3 != "" && iOHFam2SupDupCnt > 0 && iOHFam2SupplyValue > 0){
iUsedAmount_TMP3 += " + ";
iTempSumBoolean = true;
}
if(iOHFam2SupDupCnt > 0 && iOHFam2SupplyValue > 0) iUsedAmount_TMP3 += fmComma(iOHFam2SupplyValue)+"원";
if(iTempSumBoolean) iUsedAmount_TMP3 += " = "+fmComma(fmS1Round(iOHFam2OnlyValue + iOHFam2Sale2Value + iOHFam2Sale3Value + iOHFam2Sale4Value + iOHFam2SupplyValue))+"원";
iUsedAmount_TMP1 += iUsedAmount_TMP3;
}
if(iOHFam2OnlyCnt > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-생명유지장치 할인("+iOHFam2OnlyCnt+"가구) : ";
iUsedAmount_TMP2 += "
("+iBaseAmountStr+") × "+fmComma(iOHFam2OnlyCnt)+"/"+fmComma(iNumHouse)+" × 30% = "+fmComma(iOHFam2OnlyValue)+"원";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam2Welfare2DupCnt > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-생명유지장치 할인(기초생활(생계, 의료) 중복분 제외)("+iOHFam2Welfare2DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam2Welfare2DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare2Value)+"원 × "+fmComma(iOHFam2Welfare2DupCnt)+"/"+fmComma(sale_2_cnt)+")) × 30% = "+fmComma(iOHFam2Sale2Value)+"원";
if(iOHFam2Sale2Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam2Welfare3DupCnt > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-생명유지장치 할인(기초생활(주거, 교육) 중복분 제외)("+iOHFam2Welfare3DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam2Welfare3DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare3Value)+"원 × "+fmComma(iOHFam2Welfare3DupCnt)+"/"+fmComma(sale_3_cnt)+")) × 30% = "+fmComma(iOHFam2Sale3Value)+"원";
if(iOHFam2Sale3Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam2Welfare4DupCnt > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-생명유지장치 할인(차상위 중복분 제외)("+iOHFam2Welfare4DupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam2Welfare4DupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHWelfare4Value)+"원 × "+fmComma(iOHFam2Welfare4DupCnt)+"/"+fmComma(sale_4_cnt)+")) × 30% = "+fmComma(iOHFam2Sale4Value)+"원";
if(iOHFam2Sale4Value == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHFam2SupDupCnt > 0 && iOHSupplyDcValue > 0){
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-생명유지장치 할인분(필수사용량 보장공제 중복분 제외)("+iOHFam2SupDupCnt+"가구) : ";
iUsedAmount_TMP2 += "
((("+iBaseAmountStr+") × "+fmComma(iOHFam2SupDupCnt)+"/"+fmComma(iNumHouse)+") - ";
iUsedAmount_TMP2 += "("+fmComma(iOHSupplyDcValue)+"원 × "+fmComma(iOHFam2SupDupCnt)+"/"+fmComma(supply_cnt)+")) × 30% = "+fmComma(iOHFam2SupplyValue)+"원";
if(iOHFam2SupplyValue == 0) iUsedAmount_TMP2 += "
※할인분이 0원 이하일 시 0원 적용";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(sale_7_cnt > 0){
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
//사용량감액요금(복지할인중 사회복지시설만 적용이 되기 때문에 빼지 않는다)
var iTempAmountCnt = iNumHouse-(sale_1_cnt + sale_2_cnt + sale_3_cnt + sale_4_cnt);
var iTempDcBasicCharge = BasicCharge / 2 / iNumHouse;
iUsedAmount_TMP1 = "사용량감액요금할인("+iTempAmountCnt+" 가구) : "+fmComma(iOHKwhDCValue )+"원(원미만 절사)";
iUsedAmount_TMP1 += "
("+fmComma(BasicCharge)+"원 × 50%)"+" × "+iTempAmountCnt+"/"+iNumHouse+" = "+fmComma(iOHKwhDCValue)+"원";
iUsedAmount_TMP1 += "
※사용량 ‘0’ 감액 적용대상 중 복지할인 대상고객은 둘 중 큰 값 적용"
if(iOHWelfare1Value > 0){
if(iOHWelfare1Value > iTempDcBasicCharge * sale_1_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-대가족/3자녀/출산가구 할인분 비교("+sale_1_cnt+"가구) : 대가족/3자녀/출산가구 적용";
iUsedAmount_TMP2 += "
"+fmComma(iOHWelfare1Value)+"원 "+itempDcValueGubun+" "+fmComma(iTempDcBasicCharge)+"원 × "+sale_1_cnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHWelfare2Value > 0){
if(iOHWelfare2Value > iTempDcBasicCharge * sale_2_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-기초생활(생계, 의료) 할인분 비교("+sale_2_cnt+"가구) : 기초생활(생계, 의료) 적용";
iUsedAmount_TMP2 += "
"+fmComma(iOHWelfare2Value)+"원 "+itempDcValueGubun+" "+fmComma(iTempDcBasicCharge)+"원 × "+sale_2_cnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHWelfare3Value > 0){
if(iOHWelfare3Value > iTempDcBasicCharge * sale_3_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-기초생활(주거, 교육) 할인분 비교("+sale_3_cnt+"가구) : 기초생활(주거, 교육) 적용";
iUsedAmount_TMP2 += "
"+fmComma(iOHWelfare3Value)+"원 "+itempDcValueGubun+" "+fmComma(iTempDcBasicCharge)+"원 × "+sale_3_cnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHWelfare4Value > 0){
if(iOHWelfare4Value > iTempDcBasicCharge * sale_4_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-차세대 할인분 비교("+sale_4_cnt+"가구) : 차세대 적용";
iUsedAmount_TMP2 += "
"+fmComma(iOHWelfare4Value)+"원 "+itempDcValueGubun+" "+fmComma(iTempDcBasicCharge)+"원 × "+sale_4_cnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHWelfare5Value > 0){
if(iOHWelfare5Value > iTempDcBasicCharge * sale_5_cnt){
itempDcValueGubun = ">";
}else{
itempDcValueGubun = "<";
}
iUsedAmount_TMP2 = "";
iUsedAmount_TMP2 += "-사회복지 할인분 비교("+sale_5_cnt+"가구) : 사용량감액요금 적용";
iUsedAmount_TMP2 += "
"+fmComma(iOHWelfare5Value)+"원 "+itempDcValueGubun+" "+fmComma(iTempDcBasicCharge)+"원 × "+sale_5_cnt+"가구";
iUsedAmount_TMP1 += viewGen03(iUsedAmount_TMP2, false, "");
}
if(iOHKwhDCValue > 0){
outString_Detail += viewGen01(iUsedAmount_TMP1);
}
}