2019年12月31日 星期二

事業處合併

SELECT * FROM C_AllocaHead
應收應付款沖銷
單頭裡面有事業處(AD_DeptOrg_ID) 必須修正
依據付款單號(C_Payment_ID )

UPDATE C_AllocaHead SET AD_DeptOrg_ID=1000058       --  C_Payment_ID,Ref_Payment_ID, ValutaDate
  WHERE C_Payment_ID IN
(SELECT  C_Payment_ID FROM C_Payment
  WHERE DateTrx BETWEEN  TO_DATE('2019/10/01','YYYY/mm/dd') AND  TO_DATE('2019/12/31','YYYY/mm/dd')
  AND C_BankAccount_ID IN
   ( SELECT C_BankAccount_ID FROM C_BankAccount
      WHERE C_Bank_ID IN
        (SELECT C_Bank_ID FROM C_Bank
          WHERE  RoutingNo IN ('1103.502','1101.405現金-SO','1103.503','1102.409現金SH-(SO)','1103.509','1103.508')
         )
    )
 )

 SELECT * FROM C_Allocation
應收應付款沖銷
單身裡面有事業處(AD_DeptOrg_ID) 必須修正
依據付款單號(C_Payment_ID ) 

UPDATE C_Allocation SET AD_DeptOrg_ID=1000058       --  C_Payment_ID,Ref_Payment_ID, ValutaDate
WHERE C_Payment_ID IN
(SELECT  C_Payment_ID FROM C_Payment
  WHERE DateTrx BETWEEN  TO_DATE('2019/10/01','YYYY/mm/dd') AND  TO_DATE('2019/12/31','YYYY/mm/dd')
  AND C_BankAccount_ID IN
   ( SELECT C_BankAccount_ID FROM C_BankAccount
      WHERE C_Bank_ID IN
        (SELECT C_Bank_ID FROM C_Bank
          WHERE  RoutingNo IN ('1103.502','1101.405現金-SO','1103.503','1102.409現金SH-(SO)','1103.509','1103.508')
         )
    )
 )