রবিবার, ২৬ জানুয়ারী, ২০২০

Package Body to add and end responsibility from Stage in Table

/* Formatted on 1/26/2020 11:12:57 AM (QP5 v5.287) */
CREATE OR REPLACE PACKAGE BODY USER_UPDATE
AS
   PROCEDURE update_responsibility
   IS
      CURSOR cur_update_responsibility
      IS
         SELECT user_name u_name,
                responsibility_name resp_name,
                purpose ppose
           FROM xxdbl.xxdbl_update_responsibilities xur
          WHERE xur.flag IS NULL;
   BEGIN
      FOR c_upd_resp IN cur_update_responsibility
      LOOP
         BEGIN
            IF c_upd_resp.ppose = 'ADD'
            THEN
               DECLARE
                  v_user_add   VARCHAR2 (30) := c_upd_resp.u_name; -- User Name
                  v_resp_add   VARCHAR2 (200) := c_upd_resp.resp_name; -- Responsibility Name

                  -- List of responsibilities to be added automatically
                  CURSOR cur_get_responsibilities
                  IS
                     SELECT resp.responsibility_key,
                            resp.responsibility_name,
                            app.application_short_name
                       FROM fnd_responsibility_vl resp, fnd_application app
                      WHERE     resp.application_id = app.application_id
                            AND resp.responsibility_name = v_resp_add;
               BEGIN
                  ----------------------------------------------------------------------------- add responsibiltiy
                  FOR c_get_resp IN cur_get_responsibilities
                  LOOP
                     fnd_user_pkg.addresp (
                        username         => v_user_add,
                        resp_app         => c_get_resp.application_short_name,
                        resp_key         => c_get_resp.responsibility_key,
                        security_group   => 'STANDARD',
                        description      => NULL,
                        start_date       => SYSDATE,
                        end_date         => NULL);
                     DBMS_OUTPUT.put_line (
                           'responsibility '
                        || c_get_resp.responsibility_name
                        || ' added !!!!!!');

                     UPDATE xxdbl.xxdbl_update_responsibilities xur
                        SET xur.flag = 'Y' WHERE c_upd_resp.ppose='ADD' AND xur.RESPONSIBILITY_NAME=c_get_resp.responsibility_name AND xur.flag IS NULL;
                  END LOOP;
               END;

               COMMIT;
            ELSE
               DECLARE
                  v_user_end   VARCHAR2 (30) := c_upd_resp.u_name; -- User Name
                  v_resp_end   VARCHAR2 (200) := c_upd_resp.resp_name; -- Responsibility Name


                  -- List of responsibilities to be end date automatically
                  CURSOR cur_end_responsibilities
                  IS
                     SELECT a.start_date strt_dt,
                            c.responsibility_key res_key,
                            c.responsibility_name res_name,
                            d.application_short_name app_short_name
                       FROM apps.fnd_user_resp_groups_direct a,
                            apps.fnd_user b,
                            fnd_responsibility_vl c,
                            fnd_application_vl d
                      WHERE     a.user_id = b.user_id
                            AND b.user_name = v_user_end
                            AND a.responsibility_id = c.responsibility_id
                            AND a.responsibility_application_id =
                                   c.application_id
                            AND c.application_id = d.application_id
                            AND c.responsibility_name = v_resp_end;
               BEGIN


                  ----------------------------------------------------------------------------- End Responsibiltiy
                  FOR c_end_resp IN cur_end_responsibilities
                  LOOP
                     fnd_user_pkg.addresp (
                        username         => v_user_end,
                        resp_app         => c_end_resp.app_short_name,
                        resp_key         => c_end_resp.res_key,
                        security_group   => 'STANDARD',
                        description      => NULL,
                        start_date       => c_end_resp.strt_dt,
                        end_date         => SYSDATE);
                     DBMS_OUTPUT.put_line (
                           'Responsibility '
                        || c_end_resp.res_name
                        || ' has been terminated !!!!!!');

                       
                     UPDATE xxdbl.xxdbl_update_responsibilities xur
                        SET xur.flag = 'N' WHERE c_upd_resp.ppose='END' AND xur.RESPONSIBILITY_NAME=c_end_resp.res_name AND xur.flag IS NULL;

                  END LOOP;

                  COMMIT;
               EXCEPTION
                  WHEN OTHERS
                  THEN
                     DBMS_OUTPUT.put_line (
                        'Exception : ' || SUBSTR (SQLERRM, 1, 500));
                     ROLLBACK;
               END;
            END IF;
         END;
      END LOOP;
   END;
END USER_UPDATE;
/

শনিবার, ৪ জানুয়ারী, ২০২০

opening xml file field properties not change in BI publisher Solution in rtf template


Step 1:
Open a Microsoft Word document

Step 2:
Go to ‘BI Publisher’ tab


Step 3:
Click on ‘Options’ and Open ‘Options’

                                   


Step 4:
Move to ‘Build’ tab

Step 5:
Choose option ‘Form field size’ for ‘Backward Compatible’
                        


Step 6:
Finally click ‘OK’

বৃহস্পতিবার, ২ জানুয়ারী, ২০২০

Gain/Loss on Foreign Currency Voucher and Payment


Realized Gain/Loss on Foreign Currency Voucher and Payment
In this example, a French company enters a voucher in Canadian dollars (foreign currency) and pays it in CAD (foreign currency).
Because of the exchange rate risk, the potential exists for one gain or loss based on the fluctuation of exchange rates between the domestic currency and the foreign currency at the time of payment.
Description
Currency
Amount
Exchange Rate January 1
Exchange Rate February 1
Voucher (domestic)
EUR
717.61


Voucher (foreign)
CAD
1,000.00
1 CAD = 0.71761 EUR

Payment (foreign)
CAD
1,000.00

1 CAD = 0.71767 EUR
Standard gain/loss
EUR
–0.06



The foreign currency voucher on January 1 is 1,000.00 CAD, which is 717.61 EUR in the domestic currency.
1,000.00 CAD × 0.71761 = 717.61 EUR
The foreign currency payment on February 1 is 1,000.00 CAD
Standard Gain/Loss
The standard gain/loss is –0.06 EUR. This amount is based on the exchange rate fluctuations from the voucher date to the payment date.
1,000.00 CAD × 0.71761 (exchange rate on voucher date) = 717.61 EUR
1,000.00 CAD × 0.71767 (exchange rate on payment date) = 717.67 EUR
717.61 − 717.67 = – 0.06 EUR
Realized Gain/Loss on Foreign Voucher and Alternate Currency Payment
In this example, a Canadian company enters a voucher in U.S. dollars (foreign currency) and pays the voucher in the euro (alternate currency).
Because of the exchange rate risk, the potential exists for two gains or losses - one between Canadian dollar (CAD) and U.S. dollar (USD) and the other between EUR, USD, and CAD.
Description
Currency
Amount
Exchange Rate January 1
Exchange Rate February 1
Voucher (domestic)
CAD
794.30







Voucher (foreign)
USD
500.00
1 USD = 1.58860 CAD

Payment (alternate)
EUR
575.07

1 USD = 1.58798 CAD
1 EUR = 1.38176 CAD
1 EUR = 0.86980 USD
Standard gain/loss
CAD
+ 0.31


Alternate currency gain/loss
CAD
+ 0.30



The foreign currency voucher on January 1 is 500.00 USD, which is 794.30 CAD in the domestic currency.
500.00 USD × 1.58860 = 794.30 CAD
The alternate currency payment on February 1 is 575.07 EUR
The foreign currency amount applied to the voucher is 500.20 USD.
575.07 EUR × 0.86980 = 500.20 USD
The domestic currency amount applied to the voucher is 793.99 CAD.
500.00 USD × 1.58798 = 793.99 CAD
The domestic currency amount of the payment is 728.20 CAD.
575.07 EUR × 1.38176 = 794.61 CAD
Standard Gain/Loss
The standard gain/loss is + 0.31 CAD. This amount is based on the exchange rate fluctuations from the voucher date to the payment date:
500.00 USD × 1.58860 (exchange rate on voucher date) = 794.30 CAD
500.00 USD × 1.58798 (exchange rate on payment date) = 793.99 CAD
794.30 − 793.99 = + 0.31 CAD
Alternate Currency Gain/Loss
The alternate currency gain/loss is + 0.30 CAD. This amount is calculated using exchange rates on the payment date. It is based on the difference between converting the alternate currency directly to the domestic currency and converting the alternate currency to the foreign currency to the domestic currency.
575.07 EUR × 1.38176 = 794.61 CAD
(575.07 EUR × 0.86980 = 500.20 USD) × 1.58798 = 794.31 CAD
794.61 − 794.31 = + 0.30 CAD