2020年2月24日 星期一

多個JPG檔轉為單一PDF檔

有些資料是圖檔格式, 有多張時不好查看, 找到個工具可以合併.

Image To PDF or XPS

http://www.compulsivecode.com/Project_ImageToPDF.aspx


2020年2月18日 星期二

Python: UnicodeDecodeError

問題: 要以python合併多個html檔, 程式執行讀取檔案內容時, 出現UnicodeDecodeError:

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    v_line = f1.readline()
UnicodeDecodeError: 'cp950' codec can't decode byte 0xe6 in position 2351: illegal multibyte sequence


原因: 從server下載的文字檔是以UTF-8編碼, 當python以local電腦上的編碼讀取就出現error

解法: 開啟檔案時註記UTF-8

  f1 = open('c:/temp/ss.htm', 'r', encoding ='UTF-8')


Ref:
1.[Python]-字串編碼錯誤UnicodeDecodeError
https://dotblogs.com.tw/chris0920/2010/10/22/18513


2020年2月17日 星期一

Oracle EBS: 用於查詢INV期間是否關閉之SQL

SELECT ood.organization_id "Organization ID" ,
       ood.organization_code "Organization Code" ,
       ood.organization_name "Organization Name" ,
       oap.period_name "Period Name" ,
       oap.period_start_date "Start Date" ,
       oap.period_close_date "Closed Date" ,
       oap.schedule_close_date "Scheduled Close" ,
       DECODE(oap.open_flag, 'P','P - Period Close is processing' ,
                        'N','N - Period Close process is completed' ,
                        'Y','Y - Period is open if Closed Date is NULL' ,'Unknown') "Period Status"
  FROM org_acct_periods oap ,
       org_organization_definitions ood
 WHERE oap.organization_id = ood.organization_id
   AND (TRUNC(SYSDATE) -- Comment line if a a date other than SYSDATE is being tested.
   --AND ('01-DEC-2014' -- Uncomment line if a date other than SYSDATE is being tested.
       BETWEEN TRUNC(oap.period_start_date) AND TRUNC (oap.schedule_close_date))
 ORDER BY ood.organization_id,
       oap.period_start_date;
   -- If Period Status is 'Y' and Closed Date is not NULL then the closing of the INV period failed.
  

Ref:
1.SQL Query to find Status of Inventory Accounting Periods
https://oracleappsdna.com/2014/12/sql-query-to-find-status-of-inventory-accounting-periods/

2020年2月11日 星期二

Oracle EBS: 開啟/關閉R12中的期間

PO:
  Purchasing SuperUser -> Setup -> Financials -> Accounting -> Control Purchasing Periods

AP:
  Payables Super User -> Accounting -> Control Payables Periods

GL:
  General Ledger Super User -> Setup -> Open/Close

INV:
  Inventory SuperUser -> Accounting Close Cycle -> Inventory Accounting Periods


Ref:
1.Open or Close Periods in R12
https://govoracleapps.wordpress.com/2013/11/24/open-or-close-periods-in-r12/