abirama62

fix data journal

Mar 1st, 2021
774
134 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Prepare script
  2. -- 1. check jurnal item yang butuh OU RC, tapi nilainya -99
  3.     SELECT LEFT(A.journal_date, 6) as month_periode, B.main_acc, B.sub_acc, B.coa_desc, C.group_coa_code, C.flg_sub_rc, C.flg_sub_ou, A.amount
  4.     FROM gl_journal_trx_item A
  5.     INNER JOIN gl_journal_trx X ON A.journal_trx_id = X.journal_trx_id
  6.     INNER JOIN m_coa B ON A.coa_id = B.coa_id
  7.     INNER JOIN m_group_coa C ON B.group_coa_id = C.group_coa_id
  8.     WHERE C.flg_sub_rc = 'Y'
  9.     AND C.flg_sub_rc = 'Y'
  10.     --AND A.journal_date BETWEEN '20210101' AND '20210330'
  11.     AND A.ou_rc_id = -99
  12.     --AND C.group_coa_id NOT IN (28, 62)
  13.     ORDER BY A.journal_date, B.coa_desc;
  14. -- note: di gl_journal_trx_mapping dan gl_journal_trx_fx tidak ada datanya
  15.  
  16. -- 2. Update data -> SET ou_rc_id =  91 (ouId ADMIN dan UMUM)
  17. BEGIN;
  18.     UPDATE gl_journal_trx_item A SET ou_rc_id = 91
  19.     WHERE EXISTS (
  20.         SELECT 1
  21.         FROM gl_journal_trx X
  22.         INNER JOIN m_coa B ON A.coa_id = B.coa_id
  23.         INNER JOIN m_group_coa C ON B.group_coa_id = C.group_coa_id
  24.         WHERE A.journal_trx_id = X.journal_trx_id
  25.         AND C.flg_sub_rc = 'Y'
  26.     )
  27.     --AND A.journal_date BETWEEN '20210101' AND '20210330'
  28.     AND A.ou_rc_id = -99;
  29. END;
  30. --ROLLBACK;
  31.  
  32. -- 3. cek kembali data hasil perbaikan, coba download Report Trial Balance
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×