protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { DateTime AwalBlnIni = new DateTime(_Tahun, (int)_Bulan, 1); DateTime AkhirBlnIni = AwalBlnIni.AddMonths(1) .AddDays(-1); BaseGL.RingkasanAkun.Update(AkhirBlnIni); string strNilai1 = Dp.GetSqlCoalesce("SaldoAwal", 0); string strNilai2 = Dp.GetSqlCoalesce("MutasiDebit", 0); string strNilai3 = Dp.GetSqlCoalesce("MutasiKredit", 0); Parameters.Add(new FieldParam("0", _Level)); DataSource = string.Concat( "SELECT NoAkun,NamaAkun,LevelAkun,UrutanCetak,Posting,", strNilai1, " as SaldoAwal,", strNilai2, " as MutasiDebit,", strNilai3, " as MutasiKredit,(", strNilai1, "+", strNilai2, "-", strNilai3, ") AS SaldoAkhir FROM (SELECT UrutanCetak,NoAkun,NamaAkun,LevelAkun,Posting,Aktif,(SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(AwalBlnIni, false, "1", Parameters), ") a WHERE a.IdAkun=b.IdAkun OR a.IdAkun LIKE b.IdAkun+'.%') as SaldoAwal,(SELECT SUM(Debit) FROM (", BaseGL.RingkasanAkun.SqlMutasiAkun(AwalBlnIni, AkhirBlnIni, false, "2", Parameters), ") a WHERE a.IdAkun=b.IdAkun OR a.IdAkun LIKE b.IdAkun+'.%') as MutasiDebit,(SELECT SUM(Kredit) FROM (", BaseGL.RingkasanAkun.SqlMutasiAkun(AwalBlnIni, AkhirBlnIni, false, "3", Parameters), ") a WHERE a.IdAkun=b.IdAkun OR a.IdAkun LIKE b.IdAkun+'.%') as MutasiKredit", " FROM Akun b WHERE LevelAkun<=@0) X WHERE Aktif<>0"); DataSourceOrder = "UrutanCetak"; }
protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { BaseGL.RingkasanAkun.Update(_TglNeraca2 > _TglNeraca1 ? _TglNeraca2 : _TglNeraca1); string NilaiNeraca1 = Dp.GetSqlCoalesce("Neraca1", 0); string NilaiNeraca2 = Dp.GetSqlCoalesce("Neraca2", 0); DataSource = string.Concat( "SELECT NoAkun,NamaAkun,JenisAkun,UrutanKelompok,KelompokAkun,", NilaiNeraca1, " as Neraca1,", NilaiNeraca2, " as Neraca2,", NilaiNeraca2, "-", NilaiNeraca1, " as Selisih,", Dp.GetSqlIifNoFormat(NilaiNeraca1 + "=0", Dp.GetSqlIifNoFormat(NilaiNeraca2 + "<0", "-100", Dp.GetSqlIifNoFormat(NilaiNeraca2 + ">0", "100", "null")), string.Concat("(", NilaiNeraca2, "-", NilaiNeraca1, ")*100/", Dp.GetSqlAbs(NilaiNeraca1))), @" as [% Selisih] FROM (SELECT JenisAkun,UrutanKelompok,KelompokAkun,NoAkun,NamaAkun,Aktif, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca1, false, "1", Parameters), @") p WHERE p.IdAkun=q.IdAkun ) as Neraca1, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca2, false, "2", Parameters), @") r WHERE r.IdAkun=q.IdAkun ) as Neraca2 FROM Akun q WHERE Posting<>0 AND JenisAkun<>", FormatSqlValue(enJenisAkun.Laba__Rugi), ") XX WHERE Aktif<>0"); DataSourceOrder = "UrutanKelompok,NoAkun"; }
protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { DataSource = string.Concat( @"SELECT NoAkun,NamaAkun,LevelAkun,UrutanCetak,Posting,", Dp.GetSqlCoalesce("Saldo", 0), @" as Saldo FROM (SELECT UrutanCetak, NoAkun,NamaAkun,LevelAkun,Posting,Aktif,(SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca, "1", Parameters), @") pp WHERE pp.IdAkun=qq.IdAkun OR pp.IdAkun LIKE qq.IdAkun +'.%') as Saldo FROM Akun qq WHERE LevelAkun<=@0 AND JenisAkun<>", Dp.FormatSqlValue(enJenisAkun.Laba__Rugi), ") zz WHERE Aktif<>0"); Parameters.Add(new FieldParam("0", _LevelCetak)); DataSourceOrder = "UrutanCetak"; }
protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { if (_LevelCetak == 3) { AddError("LevelCetak", "xxx"); } DataSource = string.Concat( "SELECT NoAkun,NamaAkun,LevelAkun,UrutanCetak,Posting,JenisAkun,", Dp.GetSqlCoalesce("Saldo", 0), " AS Saldo FROM (SELECT NoAkun,NamaAkun,LevelAkun,UrutanCetak,Posting,Aktif,JenisAkun,", "(SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglPosisiAkun, "1", Parameters), ") pp WHERE pp.IdAkun=gg.IdAkun OR pp.IdAkun LIKE gg.IdAkun+'.%') as Saldo FROM Akun gg WHERE LevelAkun<=@0) ll WHERE Aktif<>0"); DataSourceOrder = "UrutanCetak,NoAkun"; Parameters.Add(new FieldParam("0", _LevelCetak)); }
protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { DataSource = string.Concat( @"SELECT JenisAkun,UrutanKelompok,KelompokAkun,NoAkun,NamaAkun,", Dp.GetSqlCoalesce("Saldo", 0), @" as Saldo FROM ( SELECT JenisAkun,UrutanKelompok,KelompokAkun,NoAkun,NamaAkun,Aktif, ( SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca, "1", Parameters), @") pp WHERE pp.IdAkun=qq.IdAkun ) as Saldo FROM Akun qq WHERE Posting<>0 AND JenisAkun<>", FormatSqlValue(enJenisAkun.Laba__Rugi), ") rr WHERE Aktif<>0"); DataSourceOrder = "UrutanKelompok,NoAkun"; }
protected override void GetDataSource(out string DataSource, out string DataSourceOrder, List <FieldParam> Parameters) { BaseGL.RingkasanAkun.Update(GetTglMaksimum()); DataSource = string.Concat( @"SELECT NoAkun,NamaAkun,LevelAkun,UrutanCetak,Posting,", Dp.GetSqlCoalesce("Neraca1", 0), " as Neraca1,", Dp.GetSqlCoalesce("Neraca2", 0), " as Neraca2,", Dp.GetSqlCoalesce("Neraca3", 0), " as Neraca3,", Dp.GetSqlCoalesce("Neraca4", 0), " as Neraca4", @" FROM (SELECT UrutanCetak,NoAkun,NamaAkun,LevelAkun,Posting,Aktif, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca1, false, "1", Parameters), @") k WHERE k.IdAkun=g.IdAkun OR k.IdAkun LIKE g.IdAkun+'.%' ) as Neraca1, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca2, false, "2", Parameters), @") l WHERE l.IdAkun=g.IdAkun OR l.IdAkun LIKE g.IdAkun+'.%' ) as Neraca2, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca3, false, "3", Parameters), @") m WHERE m.IdAkun=g.IdAkun OR m.IdAkun LIKE g.IdAkun+'.%' ) as Neraca3, (SELECT SUM(Debit-Kredit) FROM (", BaseGL.RingkasanAkun.SqlPosisiAkun(_TglNeraca4, false, "4", Parameters), @") n WHERE n.IdAkun=g.IdAkun OR n.IdAkun LIKE g.IdAkun+'.%' ) as Neraca4 FROM Akun g WHERE LevelAkun<=@0 AND JenisAkun<>", FormatSqlValue(enJenisAkun.Laba__Rugi), ") XX WHERE Aktif<>0"); Parameters.Add(new FieldParam("0", _LevelCetak)); DataSourceOrder = "UrutanCetak"; }