Saya tidak bisa menampilkan data cabang pada sebuah menu dengan error '80020009'

ketika saya klik menu 'simulasi diskon' akan muncul frame pilihan 'branch, company, date & nama' kemudian submit. saat submit akan muncul data berupa tabel. pada data tersebut, ada kolom yang berjudul 'channelling custcode', saat saya klik nomor channelling custcode, maka harusnya akan muncul data berupa tabel lagi untuk detail resume si channelling custcode yang saya klik tadi. tapi ini masih error dan belum bisa muncul tabelnya.

<%Response.Buffer = false%>
<html>
<!--#Include file="include/ASP/GLOBAL.ASP"-->
<!--#Include file="include/ASP/CONN.ASP"-->
<%
Server.ScriptTimeout = 600
v_strchanneling_custcode=request.QueryString("channeling_custcode")
v_strCustcode=request.QueryString("custcode")
v_strKodeCabang = Request.QueryString("v_strKodeCabang")
xcompany = Request.QueryString("v_strxcompany")
v_strseldate = Request.QueryString("v_strTgl")
v_strTglterminasi  = Request.QueryString("v_strTglterminasi")

if left(xcompany,3) = "037" or left(xcompany,3) = "311" then
	v_strTglProsesSMMF="dateadd(d,cast(toleransiJmlHari as numeric),'" & v_strseldate & "')" '===Untuk SMMF, ada kebijakan toleransi 5 hari u/ kolektibilitas & PPAP.===
else
	v_strTglProsesSMMF= "'" & v_strseldate & "'"
end if

%>
<link href="Include/simas.css" rel="stylesheet" type="text/css">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
a {  font-family: Tahoma, Verdana; color: #154210; text-decoration: none}
a:hover {  font-family: Tahoma, Verdana; color: #5fc452; text-decoration: none}

-->
</style>
<SCRIPT language=javascript src="include/JavaScript/datepicker.js"></script>
<script language="JavaScript">
<!--
function CariData(){
	var getID;
	getID = "ref_outstanding_printer.asp?sel_date=" + document.frmOustanding.txtSelDate.value + "&xcabang=" + document.frmOustanding.optCabang.value + "&xcompany=" + document.frmOustanding.optCompany.value + "&xjenis_kendaraan=" + document.frmOustanding.optTypeAgunan.value + "&sel_date_end=" + document.frmOustanding.txtSelDate_End.value + "&sel_date_start=" + document.frmOustanding.txtSelDate_Start.value + "&vkolek=" + document.frmOustanding.optKolek.value;
	document.location = (getID);
}
function viewDetails(txtCode){
	window.open("COLL_CUSTOMER_DETAIL.ASP?ccode=" + txtCode, "winDetails", "height=360, width=540, location=0, menubar=0,scrollbars=1,resizable=0");
}

function tampil(something){
	something.style.display = "";
	something.style.backgroundcolor="salmon";
	something.borderColorLight="";
	something.borderColordark="";
}

function tidaktampil(something){
	something.style.display = "none";
	something.style.backgroundcolor="salmon";
	something.borderColorLight="";
	something.borderColordark="";
}

function Cek(something){
	if(document.frmOustanding.optCompany.value.substr(document.frmOustanding.optCompany.value.indexOf("@")+1,1) == "2") {
		tampil(something);
	} else {
		tidaktampil(something);
	}
}

//-->
</script>
</head>

<body onLoad="Body_onload()" bgcolor="#FFFFFF" text="#000000" topmargin=0 marginheight=0>
<form method="POST" action="ref_outstanding_printer.asp" name="frmOustanding">
<table width="100%" border="0" cellspacing="1" cellpadding="0" valign=top>
<tr><td colspan=17 align="center" style="FONT-FAMILY: Tahoma, Verdana; FONT-SIZE: 10px"> </td>
</tr>
<%
	Dim urut,Totalrental,Totalinterest,TotalPrinciple
	dim MaxPerPage
	dim CurPageRec
	CurPageRec = 0
	MaxPerPage = 10000000
	tot_page=0
	v_strseldate2 = dateadd("m",-1,v_strseldate)

	call CloseRs
		if (month(v_strseldate) = "1" or month(v_strseldate) = "3" or month(v_strseldate) = "5" or month(v_strseldate) = "7" or month(v_strseldate) = "8" or month(v_strseldate) = "10" or month(v_strseldate) = "12") and day(v_strseldate) = "31" then
			v_strvariable = "0"
		else
			if month(v_strseldate) = "2" and year(v_strseldate) mod 4 = 0 and day(v_strseldate) = "29" then
				v_strvariable = "2"
			else
				if month(v_strseldate) = "2" and year(v_strseldate) mod 4 <> 0 and day(v_strseldate) = "28" then
					v_strvariable = "3"
				else
					v_strvariable = "1"
				end if
			end if
		end if
		mycommand = "select P.channeling_custcode,P.name,P.End_balance, T.JML_UNEARNED, P.payment_date, P.due_date, P.Accrued, R.maks_payment from " & _
					"( select a.channeling_custcode,A.custcode, A.name,F.End_balance, F.counter, F.payment_date, F.due_date, Accrued = case " & _
					"when (a.channeling_company <> 'SMMF' and a.channeling_company <> 'SMMF_Multijasa') and  tanggal_jual is NULL  and (tanggal_beli is NULL or tanggal_BELI NOT BETWEEN F.due_date and '" & _
					gm_strformatdate(v_strseldate) & "' ) then round(((((F.End_balance*(round(e.interest_effective,5))))*(" & _
					"(DATEDIFF(day,F.due_date,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _
					"when (a.channeling_company = 'SMMF' or a.channeling_company = 'SMMF_Multijasa') and tanggal_jual is NULL  and (tanggal_beli is NULL or tanggal_BELI NOT BETWEEN F.due_date and '" & _
					gm_strformatdate(v_strseldate) & "' ) then round(((((F.End_balance*(round(a.interest_effective,5))))*(" & _
					"(DATEDIFF(day,F.due_date,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _
					"when (a.channeling_company <> 'SMMF' and a.channeling_company <> 'SMMF_Multijasa') and tanggal_jual is NULL and tanggal_BELI BETWEEN F.due_date and '" & _
					gm_strformatdate(v_strseldate) & "' then round(((((F.End_balance*(round(e.interest_effective,5))))*(" & _
					"(DATEDIFF(day,tanggal_beli,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _
					"when (a.channeling_company = 'SMMF' or a.channeling_company = 'SMMF_Multijasa') and tanggal_jual is NULL and tanggal_BELI BETWEEN F.due_date and '" & _
					gm_strformatdate(v_strseldate) & "' then round(((((F.End_balance*(round(a.interest_effective,5))))*(" & _
					"(DATEDIFF(day,tanggal_beli,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _
					"when (a.channeling_company <> 'SMMF' and a.channeling_company <> 'SMMF_Multijasa') and tanggal_jual is not NULL then round(((((F.End_balance*(round(e.interest_effective,5))))*("  & _
					"(DATEDIFF(day,F.Due_date,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _

					"when (a.channeling_company = 'SMMF' or a.channeling_company = 'SMMF_Multijasa') and tanggal_jual is not NULL then round(((((F.End_balance*(round(a.interest_effective,5))))*(" & _
					"(DATEDIFF(day,F.Due_date,'" & gm_strformatdate(v_strseldate) & "'))))/36000),0) " & _
					"END " & _
					", V.jenis_kredit from customer_data_tab A " & _
					"inner join Loan_Data_tab E on A.custcode=E.custcode  " & _
					"inner join skala_rental_tab F on A.custcode=F.custcode " & _
					"inner join mst_company_tab V on substring(a.custcode,4,3) = V.company_code " &_
					"inner join mst_jenis_kredit W on V.jenis_kredit = W.code " & _
					"left join mst_toleransi_hari_smmf AA on right('00'+cast(month('" & v_strseldate & "') as varchar(2)),2) = right(AA.bulan,2) " & _
					"and right('00'+cast(year('" & v_strseldate & "') as varchar(4)),4) = left(AA.bulan,4)" & _
					"where E.branch='" & v_strKodeCabang & "' and  a.approval_status <> 9 and A.custcode='" & v_strCustcode & "' and  " & _
					"((a.dijual_ke is null and a.tanggal_jual is null) or a.tanggal_jual > '" & gm_strformatdate(v_strseldate) & "')" & _
					"and (a.tanggal_beli is null or a.tanggal_beli <= '" & gm_strformatdate(v_strseldate) & "') " & _
					"and F.payment_date <= '" & gm_strformatdate(v_strseldate) & "' " & _
					"and substring(A.CUSTCODE,4,3)='" & xcompany & "' " &  _
					") P inner join  " & _
					"(select custcode as kode, max(counter) as maks from skala_rental_tab f where F.payment_date is not null  " & _
					"and F.payment_date <= '" & gm_strformatdate(v_strseldate) & "' and F.custcode='" & v_strCustcode & "' group by custcode) Q on P.custcode = Q.kode and P.counter = Q.maks " & _
					"inner join " & _
					"(select custcode as kode2, max(payment_date) as maks_payment from skala_rental_tab f where F.payment_date is not null  " & _
					"and F.custcode='" & v_strCustcode & "' group by custcode) R on P.custcode = R.kode2 " & _
					"LEFT join ( " & _
					"select p.custcode,p.Unearned_final as JML_UNEARNED  from ( select A.custcode,isnull(sum(F.interest),0) as Unearned_final " & _
                    "from customer_data_tab A " & _
                    "inner join Loan_Data_tab E on A.custcode=E.custcode " & _
                    "inner join skala_rental_tab F on A.custcode=F.custcode " & _
    				"where E.branch='" & v_strKodeCabang & "' and a.approval_status <> 9 and A.custcode='" & v_strCustcode & "' and " & _
					"((a.dijual_ke is null and a.tanggal_jual is null) or a.tanggal_jual > '" & gm_strformatdate(v_strseldate) & "')" & _
					"and (a.tanggal_beli is null or a.tanggal_beli <= '" & gm_strformatdate(v_strseldate) & "') " & _
					"and (F.payment_date is Null or F.payment_date > '" & gm_strformatdate(v_strseldate) & "') and  " & _
					"substring(A.CUSTCODE,4,3)='" & xcompany & "' group by A.custcode ) P " & _
					")T on T.custcode = P.custcode "

	'response.write mycommand
	'response.end
	RSDet.Open MyCommand,RSConn,1
%>
<%
	if v_strTglterminasi <> "" then
		response.write "Debitur Ini Fasilitasnya Sudah Lunas atau Sudah Tidak Aktif...."
		response.End
	end if

	if Cdate(v_strseldate)  < Cdate(RSDet("maks_payment")) then
		response.write "Maaf, tanggal terminasi tidak boleh kurang dari tanggal payment terakhir nasabah. Tanggal peyment terakhir = '" & gm_strformatdate(RSDet("maks_payment")) & "'"
		response.end
	end if

    'response.write 3
    'response.end

	if not RSDet.eof then
		sub_os = 0
		sub_rent = 0
		sub_princ = 0
		sub_int = 0
		sub_os_before = 0
		sub_tunggakan_pokok = 0
		sub_tunggakan_bunga = 0
		sub_Unearned = 0
		sub_LoanAmount = 0
		col = 0
		jumlahasli2 = 0

		TotRec = RSDet.RecordCount
		tot_page=(totrec - 1) \ MaxPerPage


		RSDet.Movefirst
		RSDet.Move ctr
		ctrPage = 1

		Response.Write "<tr bgcolor=#5fc452>"
		Response.Write "<td  align=Center rowspan=2><font size=2 face=Tahoma, Verdana, Arial color=#154210>No.</font></td>"
		Response.Write "<td  align=Center rowspan=2><font size=2 face=Tahoma, Verdana, Arial color=#154210>Custcode </font></td>"
		Response.Write "<td  rowspan=2 ><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Nama </font></div> </td>"
		Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Outstanding Pokok </font></div> </td>"
		Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Unearned </font></div> </td>"
    if RSDet("jenis_kredit")="4" or RSDet("jenis_kredit")="6" then
        Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Bagi Hasil Yang Harus Dibayar </font></div> </td>"
    elseif RSDet("jenis_kredit")="2" or RSDet("jenis_kredit")="3" or RSDet("7") then
        Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Ujroh Yang Harus Dibayar </font></div> </td>"
    elseif RSDet("jenis_kredit")="5" then
        Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Fee Yang Harus Dibayar </font></div> </td>"
    else
		Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Margin Yang Harus Dibayar </font></div> </td>"
    end if
		Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210>Diskon</font></div> </td>"
		Response.Write "<td  rowspan=2><div align=Center><font size=2 face=Tahoma, Verdana, Arial color=#154210> Jml Yang Harus Dibayar</font></div> </td>"
		Response.Write "</tr>"
		Response.Write "<tr bgcolor=#5fc452>"
		Response.Write "</tr>"

		While not RSDet.EOF and ( ctrPage <= MaxPerPage )

			'Interest = RsDet("interest")
			'Principle = RsDet("principle")
			EBalance = RSDet("End_balance")
			Unearned = RsDet("JML_UNEARNED")
			Accrued = RsDet("Accrued")

			if Cdate(v_strseldate) <= Cdate(RSDet("due_date")) then
				Accrued = 0
			end if

			'LoanAmount = RSDet("Loan_Amount")
			'rental = interest + principle
			'tunggakan_pokok = RSDet("tunggakan_pokok")
			'tunggakan_bunga = RSDet("tunggakan_bunga")

			if ctrPage mod 2 = 0 then
				Response.Write "<tr bgcolor=#d0eecc>"
			else
				Response.Write "<tr bgcolor=#FFFFFF>"
			end if



			'if RsDet("accrued") < 0 then
			'	accrued_now = 0
			'else
			'	accrued_now = RsDet("accrued")
			'end if

			Response.Write "<td align=right><font size=2 face=Tahoma, Verdana, Arial>" & ctr+ctrPage & "</font></td>"
			Response.Write "<td ><div align=center><font size=2 face=Tahoma, Verdana, Arial>" & RSDet("channeling_custcode") & "</font></div> </td>"
			Response.Write "<td ><font size=2 face=Tahoma, Verdana, Arial> " & RSDet("Name") & "</font></td>"
			Response.Write "<td ><div align=right><font size=2 face=Tahoma, Verdana, Arial>" & formatnumber(EBalance,0) & "</font></div> </td>"
			Response.Write "<td ><div align=right><font size=2 face=Tahoma, Verdana, Arial>" & formatnumber(Unearned,0) & "</font></div> </td>"
			Response.Write "<td ><div align=right><font size=2 face=Tahoma, Verdana, Arial>" & formatnumber(Accrued,0) & "</font></div> </td>"
			Response.Write "<td ><div align=right><font size=2 face=Tahoma, Verdana, Arial>" & formatnumber(Unearned-Accrued,0) & "</font></div> </td>"
			Response.Write "<td><div align=right><font size=2 face=Tahoma, Verdana, Arial>" & formatnumber(EBalance+Accrued,0) & "</font></div> </td>"
			Response.Write "</tr>"

			ctrpage=ctrpage+1
			RSDet.MoveNext
		wend
		Response.Write "</tr>"

	end if
RSDet.Close
set RSDet = nothing
  %>

</table>
 </form>
 </body>
</html>

avatar ainimarifah
@ainimarifah

1 Kontribusi 0 Poin

Diperbarui 4 tahun yang lalu

1 Jawaban:

Halo ainimarifah,

Mohon izin menjawab,

ada error line 160 terdapat pada: <pre> if Cdate(v_strseldate) &lt; Cdate(RSDet("maks_payment")) then </pre>

kemungkinan ada gagal saat: <pre> RSDet("maks_payment") </pre>

coba untuk di check dulu apakah "maks_payment" tersebut sesuai dengan value nya. Bisa jadi ada salah parsing atau data kosong/null atau salah format sehingga error.

Semoga dapat terjawab,

avatar keccikun
@keccikun

364 Kontribusi 196 Poin

Dipost 4 tahun yang lalu

Login untuk ikut Jawaban