Author Topic: Saldo Akhir Dan Saldo Awal Tidak Cocok ?  (Read 1410 times)

0 Members and 1 Guest are viewing this topic.

Offline deni_msmsulsel

  • Junior Member
  • *
  • Posts: 339
Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« on: May 28, 2013, 12:06:02 PM »
Para MAster Saya Mau tanya . Kenapa Antara Saldo Akhir Bulan ini Tidak Cocok Dengan Saldo Awal Bulan Depan yaaaa. Setelah saya cek masalahnya ada pada nasabahmutasilalutargetharian . apa ada yang salah dengan coding yaaa. Tolong Di bantu master

SELECT SUM(target) AS tar FROM ms_register WHERE idresort=cskpd AND tglpinjaman<dtgl1 AND usp='PRIMAHARIAN' INTO CURSOR ctargetmasuklaluharian
targetmasuklaluharian = IIF(ISNULL(ctargetmasuklaluharian.tar), 0, ctargetmasuklaluharian.tar)

SELECT SUM(reg.target) AS tar FROM ms_register reg WHERE reg.noregister IN(SELECT noregister FROM ms_angsurannasabah WHERE idresort=cskpd AND tanggal<dtgl1 AND pelunasan='L' AND usp='PRIMAHARIAN' AND status='LC') INTO CURSOR ctargetkeluarlaluharian
targetkeluarlaluharian = IIF(ISNULL(ctargetkeluarlaluharian.tar), 0, ctargetkeluarlaluharian.tar)

SELECT c.baris, a.noregister,a.target as regis, a.saldoawal, b.jumlah, a.saldoawal-b.jumlah AS sisa FROM ms_register a, (SELECT noregister, SUM(jumlah) AS jumlah FROM ms_angsurannasabah WHERE idresort=cskpd AND status='LC' AND usp='PRIMAHARIAN' ;
GROUP BY noregister) as b, (SELECT noregister, COUNT(noregister) AS baris FROM ms_register WHERE idresort=cskpd AND tglmacet<dtgl1 AND usp='PRIMAHARIAN' GROUP BY noregister) as c WHERE a.noregister=b.noregister AND a.noregister=c.noregister AND saldoawal<>jumlah INTO CURSOR mutasilalutargetharian READWRITE
   
nasabahmutasilaluutargetharian = IIF(ISNULL(mutasilalutargetharian.regis), 0, mutasilalutargetharian.regis)
SUM nasabahmutasilaluutargetharian TO nasabahmutasilalutargetharian FOR  .NOT. DELETED()
saldotargetharian = targetmasuklaluharian-nasabahmutasilalutargetharian-targetkeluarlaluharian


SELECT SUM(target) AS baris FROM ms_register WHERE idresort=cskpd AND BETWEEN(tglpinjaman, dtgl1, dtgl2) AND usp='PRIMAHARIAN' INTO CURSOR ctargetmasukharian
targetmasukajaharian = IIF(ISNULL(ctargetmasukharian.baris), 0, ctargetmasukharian.baris)

SELECT SUM(reg.target) AS tar FROM ms_register reg WHERE reg.noregister in (SELECT noregister  FROM ms_angsurannasabah reg WHERE idresort=cskpd AND usp='PRIMAHARIAN' AND BETWEEN(reg.tanggal, dtgl1, dtgl2) AND reg.pelunasan='L' AND reg.status='LC') INTO CURSOR ctargetkeluarharian
targetkeluarajaharian = IIF(ISNULL(ctargetkeluarharian.tar), 0, ctargetkeluarharian.tar)

SELECT c.baris, a.noregister,a.target as regis, a.saldoawal, b.jumlah, a.saldoawal-b.jumlah AS sisa FROM ms_register a, (SELECT noregister, SUM(jumlah) AS jumlah FROM ms_angsurannasabah WHERE status='LC' AND idresort=cskpd AND usp='PRIMAHARIAN' ;
GROUP BY noregister) as b, (SELECT noregister, COUNT(noregister) AS baris FROM ms_register WHERE idresort=cskpd AND BETWEEN(tglmacet, dtgl1, dtgl2) AND usp='PRIMAHARIAN' GROUP BY noregister) as c WHERE a.noregister=b.noregister AND a.noregister=c.noregister AND saldoawal<>jumlah INTO CURSOR baruajaharian

nasabahmutasiiharian = IIF(ISNULL(baruajaharian.regis), 0, baruajaharian.regis)   
SUM nasabahmutasiiharian TO mutasihariantarget FOR  .NOT. DELETED()

akhirharian = (saldotargetharian+targetmasukajaharian)-(targetkeluarajaharian+mutasihariantarget)

Offline Dian_Sastro

  • Hero Member
  • *
  • Posts: 1.067
  • Kecantikan, Bukan Modal Utama Saya
    • http://www.irenk.com
Re: Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« Reply #1 on: May 28, 2013, 12:19:34 PM »
Habis select....from...atau proses transaksi di BROWSE aja pak...ntar jg kelihatan dibagian proses mana yg ngacau hehehe

Btw...kayak-e lagi kenceng nih pesanan programnya  :thumbsup:


Offline davidmustakim

  • Fox-id M.V.P
  • Hero Member
  • *
  • Posts: 14.053
  • Awas ya...
Re: Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« Reply #2 on: May 30, 2013, 10:57:59 PM »
tinggal dibaca ulang baik2 kodingnya, kan udah lengkap tuh... aku mau bobo dulu, bilang kalo udah ya

Offline pwiwing

  • Hero Member
  • *
  • Posts: 793
  • Belajar agar kita mengerti dan memahami
Re: Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« Reply #3 on: June 03, 2013, 09:33:58 AM »
Habis select....from...atau proses transaksi di BROWSE aja pak...ntar jg kelihatan dibagian proses mana yg ngacau hehehe

Btw...kayak-e lagi kenceng nih pesanan programnya  :thumbsup:

Kalo sudah di browse silahkan di upload picture hasil browse nya, nnti kita coba bantu. kalo baca koding sebanyak itu keliatanya om DM jadi lupa kopinya  :icon_king: :icon_biggrin:
Belajar tidak memandang usia......
Semangat kawan

Offline Subiyantoro

  • Senior Member
  • *
  • Posts: 594
  • Selesaikan codingmu dulu baru pake FB
Re: Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« Reply #4 on: June 03, 2013, 09:45:56 AM »
Sungguh punyeng baca scriptnya...udah baca sampai tengah...eh..harus baca lagi dari atas lagi karena lupa. Sebab penamaan cursornya panjang amat.....

Offline davidmustakim

  • Fox-id M.V.P
  • Hero Member
  • *
  • Posts: 14.053
  • Awas ya...
Re: Saldo Akhir Dan Saldo Awal Tidak Cocok ?
« Reply #5 on: June 03, 2013, 10:06:09 AM »
Sungguh punyeng baca scriptnya...udah baca sampai tengah...eh..harus baca lagi dari atas lagi karena lupa. Sebab penamaan cursornya panjang amat.....
pake komputer lah, biar prosessornya aja yang baca