// Total Bulanan

function StepTotal() {
	this.name = "TotalBulanan";
}

StepTotal.prototype.getTotal = function() {
	
	this.total = parseInt(GetValueById("txtPengeluaran"));
	
	for (xx=0; xx < 6; xx++)
	{
		SetDocText("totBulanan[" + xx + "]", DecimalAsString(DecimalValue(this.total)));	
		
		if(xx == 0) {
			SetDocText("totDarurat[" + xx + "]", DecimalAsString(DecimalValue(this.total * 4)));	
		} else if(xx == 1) {
			SetDocText("totDarurat[" + xx + "]", DecimalAsString(DecimalValue(this.total * 6)));	
		} else if(xx == 2) {
			SetDocText("totDarurat[" + xx + "]", DecimalAsString(DecimalValue(this.total * 9)));	
		} else {
			SetDocText("totDarurat[" + xx + "]", DecimalAsString(DecimalValue(this.total * 12)));	
		}
	}
}

var Step_Total = new StepTotal;

function CalculateTotal() {
	Step_Total.getTotal();
}
