2013年5月2日 星期四

GL Journal Document Number為空值如何解決 ?

如果使用者在維護 Document Sequence沒有作好的話,在產生傳票 (Journal)時 , document number可能就會空白,這樣的話要如何補上呢 ?

1.至 document assign找出這個 category 是使用那一個 document  (FND_DOCUMENT_SEQUENCES)

2. SELECT *   FROM FND_DOCUMENT_SEQUENCES
      WHERE (NAME = 'document name') order by name

    找出 DB_SEQUENCE_NAME 使用系統的那一個 DB Sequence

3.找出來之後,把傳票欄位 DOC_SEQUENCE_ID 填入 , DOC_SEQUENCE_VALUE 填入 DB Sequence最大值

4. 更改 DB Sequence 的 next number的值 (+1)

step 3,4可以直接使用如下 SQL (要先確定好 doc_sequence_id 和DOC_SEQUENCE_VALUE )
     update gl_je_headers
         set doc_sequence_id = 2848
              ,DOC_SEQUENCE_VALUE = FND_DOC_SEQ_*****_S.nextval
      where ledger_id =p_ledger_id
         and period_name = p_period_name
         and doc_sequence_id is null




2013年4月28日 星期日

glassfish domain 無法啟動 - CLI156 Could not start the domain

我使用的是 Glassfish 2 V1的版本,已經跑了3年以上了,不過今天發生如下的錯誤訊息,一直無法開啟。

上網查了一下,有的人建議動新建立一個新的 domain, 不過有人建議如下

Glassfish hangs on OS X 10.5/Java 6
先檢查目錄 /glassfish/domains/domain1/imq/instances/imqbroker/ 是否有個檔案叫 lock(要把隱藏檔顯示),如果有,請把它刪除後再重新啟動看看。

很幸運的,我有這個檔案而且刪除之後就可以正常啟動了。


Timeout waiting for domain domain1 to go to starting state.
CLI156
Could not start the domain domain1.

2013年4月18日 星期四

MongoDB 和 Asp.Net MVC

A MONGODB TUTORIAL USING C# AND ASP.NET MVC 使用 ASP.NET MVC 3和 MONGODB實作了一個 BLOG網站,大家可以試試看,我自己還在消化,有幾點可以和大家分享

我使用是 APS.NET MVC 4 和 MONGODB C# DRIVER 1.8.1.20和一個 MONGODB 是放在 SERVER上,所以使用宓碼連結

連結 MONGO的寫法要改成如下

var client = new MongoClient("mongodb://userName:passWord@ipaddress/dbName");
var server = client.GetServer();
var db = server.GetDatabase("dbName");

可以成功執行後,我想要讓 CKEDITOR 可以上傳圖片,就 ASP.NET MVC來說,還是要使用 CK FINDER FOR ASP.NET的版本

可以在 CKEDITOR 的 config.js 內加上
config.filebrowserImageBrowseUrl = '/Scripts/ckfinder/ckfinder.html?type=Images';
config.filebrowserUploadUrl= '/Scripts/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl= '/UploadImage/Upload';  //controller/actionName

在 CKFINDER的 config.ascx

public override bool CheckAuthentication() 依權限 return true;

public override void SetConfig()
我的 CKFINDER是放在 Scripts的目錄,所以 BaseUrl = "~/Scripts/ckfinder/userfiles/";


客制的 UPLOAD CONTROLLER
public ActionResult Upload(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
    {
        string url; // url to return
        string message; // message to display (optional)
        //CODE FOR SAVE IMAGE HERE
        url =  "/" + path + "/" + filename;
      string output = @"";

            return Content(output);
        }
參數有三個CKEditor=editor1&CKEditorFuncNum=1&langCode=en

CK Finder for asp.net V2.3.1 download


參考網址
A MONGODB TUTORIAL USING C# AND ASP.NET MVC

CSharp Driver Tutorial

Authenticate to MongoDB with the C# Driver

Integration of CkFinder with Ckeditor failed in my Asp.net mvc3.How can i successfully integrate it?

Integrating CKEditor with a Custom File Browser

Splitting DateTime - Unit Testing ASP.NET MVC Custom Model Binders

ASP.NET MVC Model Binding and Data Annotation

MongoDB实战开发

PHP實作 Ckeditor+Ckfinder檔案上傳 動態指定儲存位置


其它..

在 Global.asax.cs 的 protected void Application_Start() 加上

 ModelBinders.Binders.Add(typeof(ObjectId), new ObjectIdBinder());  //自動產生 mongoID

monogo基本指令

show dbs
show collections
use --dbName  

db.--collectionsName.find()

mogodb C# driver 請直接用 negut就可以找的到



2013年4月11日 星期四

Oracle EBS R12 GL 會科節段(Segment) 的 Account Type選錯了怎麼辦

如果一開始在維護會科節段(Segment)時, Account Type如果選錯的話,比如正確的為 Asset,但選成 Expense,如果已經有產生一個 code combination,其 Type應該為 Expense,但如果後來又再去改會科節段(Segment)的Account Type變成 Asset,這時 已產生code combination的 Type是不會變的,新產生的code combination的 Type才會是正確的,解決的方式如下

You can open a new account with the required account type and then transfer the balance from the previous account to the new account.
Alternatively you can follow the steps to correct a misclassified account to change the account type.

可以參考
R12: Troubleshooting Misclassified Accounts in General Ledger [ID 872162.1]

2013年2月24日 星期日

Build Payments 出現 ORA-06502

使用者在作大批付款 Payment Process Request,當執行到 Build Payments出現錯誤
view log 如下

Exception occured when building payments. Payment creation will be aborted and no payments will be committed for payment request 146440
SQLCODE: -6502
SQLERRM: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Build program error: Exception occured when attempting to create payments from the documents payable of the provided payment service request.

可能是 bug所造成的,但這一次不是
我的作法如下
1.啟用 FND Log机制
2.請使用者再作一次 Payment Process Request
3.檢示 FND Log 出現 ORA-06502的地方,找出 party id,再利用 party id找出是那一個 supplier
4.至 supplier維護畫面,看看 bank detail是否有些問題

最後被我找到是使用者把 bank account number和 bank account name的值相反了,而 account number太長了,所以造成錯誤。  請使用者把資料改成正確即可。



2013年2月19日 星期二

Oracle EBS R12 主帳本(Primary ledger) reversed 的Journal是否會自動拋至次帳本(Secondary Ledger)

如果是使用版本 12.1.3的話,應該預設就會有這個功能,如果是之前的版本的話,就要根據參考文件,更新 patch

更新完之後,請至 Accounting Setup Manager內,找出主帳本的 Setup
將 Synchronize Reversals between Primary and Secondary Ledger(s) 打勾即可。



參考文件
R12: Posting Reversal Journal in Primary Ledger not Creating the Reversal Journal in Secondary Ledger [ID 428196.1]