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/


2020年2月10日 星期一

RPA

RPA:


1.淺談目前最流行的8種RPA工具
https://kknews.cc/zh-tw/tech/kl3omxb.html


2.兩個免費RPA介紹: RPA Press , UiPath
https://www.51rpa.net/rpaedu/511.html


3.免費RPA工具UiPath簡單教學
https://www.18hall.com/uipath1-rpa-20190913/


4.WorkFusion: RPA
https://kb.workfusion.com/
https://kb.workfusion.com/pages/viewpage.action?pageId=81396263


5.5大免費RPA自動化工具大比拼
https://www.18hall.com/rpa-tools-20190913/


6.Sikulix: 圖形辨識自動化測試開發工具
https://tpu.thinkpower.com.tw/tpu/articleDetails/876
http://sikulix.com/
https://raiman.github.io/SikuliX1/downloads.html


Oracle EBS: 重新開啟已關閉之inventory期間

由於疫情問題造成大陸的廠還沒結一月帳, 過完年回來開工, 為了intercompany資料, 要把HQ的一月期間打開.

Forms上的 [Change Status] 按鈕反灰, 不能作, 在Oracle網站找到相關文章.


步驟:

1.備份以下table:
  org_acct_periods
  mtl_period_summary
  mtl_period_cg_summary
  mtl_per_close_dtls
  cst_period_close_summary

2.
  SELECT acct_period_id period, open_flag, period_name name,
  period_start_date, schedule_close_date, period_close_date
  FROM org_acct_periods
  WHERE organization_id = &org_id
  order by 1,2;

3.
  UPDATE org_acct_periods
  SET open_flag = 'Y',
  period_close_date = NULL,
  summarized_flag = 'N'
  WHERE organization_id = &&org_id
  AND acct_period_id >= &&acct_period_id;

  DELETE mtl_period_summary
  WHERE organization_id = &org_id
  AND acct_period_id >= &acct_period_id;

  DELETE mtl_period_cg_summary
  WHERE organization_id = &org_id
  AND acct_period_id >= &acct_period_id;

  DELETE mtl_per_close_dtls
  WHERE organization_id = &org_id
  AND acct_period_id >= &acct_period_id;

  DELETE cst_period_close_summary
  WHERE organization_id = &org_id
  AND acct_period_id >= &acct_period_id;

4. commit

5.從有問題的期間開始, 依序重新執行 'Period Close Reconciliation Report'.


Ref:
1.Re-Open a Closed Inventory Accounting Period (Doc ID 472631.1)

2.HOW TO RE-OPEN A CLOSED INVENTORY ACCOUNTING PERIOD
http://www.oracleerpappsguide.com/2012/01/how-to-re-open-closed-inventory.html

2020年2月9日 星期日

Windows 7中svchost.exe耗用過多記憶體問題

問題: 記憶體可用量極少, 常出現即將耗盡的訊息, 查看發現是svchost.exe耗用過多



解法: 網路上有多篇文章提到, 是自動更新有問題, 要針對Windows update(Automatic Updates)及Background Intelligent Transfer Service (BITS) 的服務先處理, 再重新註冊DLL:

  REGSVR32 WUAUENG.DLL
  REGSVR32 WUAUENG1.DLL
  REGSVR32 ATL.DLL
  REGSVR32 WUCLTUI.DLL
  REGSVR32 WUPS.DLL
  REGSVR32 WUPS2.DLL
  REGSVR32 WUWEB.DLL


但尷尬了, 有三項出現無法載入模組的錯誤訊息:

  WUAUENG1.DLL
  WUCLTUI.DLL
  WUWEB.DLL



再找了篇文章, 提到可能是系統的檔案毀損, 要執行 sfc /scannow , 結果如下:

  C:\Windows\system32>sfc /scannow

  正在開始系統掃描。這將需要一些時間。

  開始系統掃描的驗證階段。
  驗證 100% 完成。
  Windows 資源保護發現受損檔案,但無法修復其中某些檔案。
  詳細資料請見 CBS.Log windir\Logs\CBS\CBS.log。For example
  C:\Windows\Logs\CBS\CBS.log

  系統檔案修復變更將在下次重新開機後生效。


但CBS.log無法開啟, 看不到內容.

重開機後, 那三個模組還是有相同問題, 再觀察.


Ref:
1.Windows 7
https://answers.microsoft.com/zh-hant/windows/forum/all/window-7/9f4cf084-20ca-49e4-942c-467084ebeb06