Ara
6
2015

Muhasebe Hesabı Oluşturma Örnek Script

Merhaba,

Aşağıdaki örnek scripti kullanarak yeni muhasebe hesapları oluşturabilirsiniz. XX_ACCOUNT adında ACCOUNT ve CODE_COMBINATION_ID alanlarını içeren bir tablo oluşturarak aşağıdaki script ile yeni hesap birleşimlerinin sistemde oluşmasını sağlayabilirsiniz.

 

 

DECLARE
   l_chart_of_accounts_id   NUMBER;
   v_code_combination_id    NUMBER;
   l_set_of_books_id        NUMBER := fnd_profile.VALUE ('GL_SET_OF_BKS_ID');
   l_true                   NUMBER := 0;
 
   CURSOR acct
   IS
      SELECT account FROM xx_account;
BEGIN
   SELECT chart_of_accounts_id
     INTO l_chart_of_accounts_id
     FROM gl_sets_of_books
    WHERE set_of_books_id = l_set_of_books_id;
 
   FOR rec IN acct
   LOOP
      v_code_combination_id := '';
 
      BEGIN
         SELECT gcc.code_combination_id
           INTO v_code_combination_id
           FROM gl_code_combinations_kfv gcc
          WHERE concatenated_segments = rec.account;
 
         UPDATE xx_account zfd
            SET code_combination_id = v_code_combination_id
          WHERE zfd.account = rec.account;
 
          l_true := l_true + 1;
      EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
            v_code_combination_id :=
               fnd_flex_ext.get_ccid (
                  'SQLGL',
                  'GL#',
                  l_chart_of_accounts_id,
                  TO_CHAR (SYSDATE - 100, fnd_flex_ext.DATE_FORMAT),
                  rec.account);
 
            IF v_code_combination_id = 0
            THEN
               v_code_combination_id := 0;
               DBMS_OUTPUT.PUT_LINE (rec.account || ' hesap konbinasyonu tanimli degil');
            ELSE
               UPDATE xx_account zfd
                  SET code_combination_id = v_code_combination_id
                WHERE zfd.account = rec.account;
                l_true := l_true + 1;
            END IF;
      END;
   END LOOP;
 
   COMMIT;
 
   DBMS_OUTPUT.PUT_LINE('Basarili kayit sayisi --> ' || l_true);
END;

Kaan Sertaç Bozatlı

Blog yöneticisi ve aynı zamanda yazardır. 10 yılı aşkın bir süredir
profesyonel kariyerine Oracle ERP Developer olarak devam etmektedir.
Mail: kbozatli@gmail.com
LinkedIn: Profili Görüntüleyin
Kaan Sertaç Bozatlı

Latest posts by Kaan Sertaç Bozatlı (see all)



Yorum yapın

*