改換到這一個囉
Catton IT Career
應該不會再這個 blog發表文章了。
以後先會把學習放在 mongoDB上,有任何收獲會與大家分享
2014年7月16日 星期三
2014年5月30日 星期五
如何讓 Procedure的 Concurrent Status可以變成 Warning 或 Error
參考文章:ERRBUF and RETCODE in Concurrent Program
因為是 Concurrent是呼叫 Procedure的話,第一個、第二個參數為
errbuf out varchar2 ,retcode out varchar2
所以可以利用 retcode
retcode := 1 ERP Request Status就會是 Warning,
retcode := 2 就會是 Error
因為是 Concurrent是呼叫 Procedure的話,第一個、第二個參數為
errbuf out varchar2 ,retcode out varchar2
所以可以利用 retcode
retcode := 1 ERP Request Status就會是 Warning,
retcode := 2 就會是 Error
2014年5月28日 星期三
Doc ID 1489862.1 R12 Generic Data Fix (GDF) Patch for COMMONLY OCCURING INVOICE ISSUES 無法解決 Mat 3
前一陣子有用 single_trx.sql找出一筆 invoice需要作 data fix,使用 ap_one_off_scripts_sel(fix).sql來解決,於更新了 patch也執行了 fix程式,但此筆的問題還是存在,而且重新執行 single_trx.sql還是會建議你用相同的 datafix 解決,後來可行的作法就是
1.先請使用者先將 invoice line作 discard後存檔
2.我再跑一次 single_trx.sql,結果發現另一個 datafix的建議 R12: Generic Data Fix (GDF) Patch - Unable to Discard PO Matched Invoice Lines [ID 982072.1]
3.執行 ap_sync_po_qty_amt_sel(fix).sql後
4.重新 match就正常了。
1.先請使用者先將 invoice line作 discard後存檔
2.我再跑一次 single_trx.sql,結果發現另一個 datafix的建議 R12: Generic Data Fix (GDF) Patch - Unable to Discard PO Matched Invoice Lines [ID 982072.1]
3.執行 ap_sync_po_qty_amt_sel(fix).sql後
4.重新 match就正常了。
Spring Security OAuth2 Client anonymous 存取 Oauth2 resource
spring-projects/spring-security-oauth 在這個專案有 OAuth1, OAuth2的 Server, Client實作,在 OAuth1 Client 存取 Server resource時是可以直接存取的,但在 OAuth2 Client的設計是要先登入才能存取 Server resource,如果要直接存取的話,則會出現錯誤如下
org.springframework.security.authentication.InsufficientAuthenticationException: Authentication is required to obtain an access token (anonymous not allowed)
這邊有一邊文章 (Integrating Google Calendar into a Wicket Application) 可以達到直接存取的目的,
作法大約如下:
1.實作一 class extends AbstractAuthenticationProcessingFilter, 最主要是在
attemptAuthentication 內產生一個 TestingAuthenticationToken,只要是作為 anonymous登入用
public class AnoAuthenicationProcessingFilter extends AbstractAuthenticationProcessingFilter {
private static java.util.logging.Logger log1 = java.util.logging.Logger.getLogger("");
protected AnoAuthenicationProcessingFilter() {
//super內的參數不可為空白
super("/login.jsp");
}
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {
//Authentication authentication = new TestingAuthenticationToken(request.getRemoteAddr(), request.getRemoteAddr(), "ROLE_ANONYMOUS");
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if ( authentication == null) {
log1.log(Level.WARNING,".........establish a new tem Test token for "+ request.getRemoteAddr());
authentication = new TestingAuthenticationToken(request.getRemoteAddr(), request.getRemoteAddr(), "ROLE_ANONYMOUS");
authentication.setAuthenticated(true);
}
return getAuthenticationManager().authenticate(authentication);
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
if (SecurityContextHolder.getContext().getAuthentication() == null) {
SecurityContextHolder.getContext().setAuthentication(attemptAuthentication((HttpServletRequest) req, (HttpServletResponse) res));
if (logger.isDebugEnabled()) {
logger.debug("Populated SecurityContextHolder with dummy token: '"
+ SecurityContextHolder.getContext().getAuthentication() + "'");
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("SecurityContextHolder not populated with dummy token, as it already contained: '"
+ SecurityContextHolder.getContext().getAuthentication() + "'");
}
}
chain.doFilter(req, res);
}
}
2.實作 implements AuthenticationProvider
我希望使用者部份功能需要帳號密碼才能使用,所以在這邊有判斷 Authentication是那一種類
別,在實作 support時就要加上可允許的 token類別
public class CattonOAuthClientProvider implements AuthenticationProvider{
private static java.util.logging.Logger log1 = java.util.logging.Logger.getLogger("");
public CattonOAuthClientProvider() {
super();
}
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
log1.log(Level.WARNING,"authentication class type............. " +authentication.getClass().toString());
if (authentication instanceof UsernamePasswordAuthenticationToken) {
‧‧‧‧‧
‧‧‧‧
log1.log(Level.WARNING, "...login by account password...................");
System.out.println("...login by account password...................");
}else if (authentication instanceof TestingAuthenticationToken ) {
log1.log(Level.WARNING, "...anonymous..............");
} else {
log1.log(Level.WARNING, "faile to authenicate in provder..............");
}
return authentication;
}
public boolean supports(Class authentication) {
return TestingAuthenticationToken.class.isAssignableFrom(authentication)
|| UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication);
}
}
3.修改 spring-servlet.xml
在 custom-filter after="EXCEPTION_TRANSLATION_FILTER" ref="oauth2ClientFilter" 之前加上
custom-filter before="ANONYMOUS_FILTER" ref="authProcessingFilter"
之後再加上
bean class="com.catton.spring.security.AnoAuthenicationProcessingFilter" id="authProcessingFilter"
property name="authenticationManager" ref="defaultAuthenticationManager"
bean id="authenticationProvider" class="com.catton.spring.security.provider.CattonOAuthClientProvider"
最後再修改 authentication-manager 設定為 authentication-provider ref="authenticationProvider" 即
可
org.springframework.security.authentication.InsufficientAuthenticationException: Authentication is required to obtain an access token (anonymous not allowed)
這邊有一邊文章 (Integrating Google Calendar into a Wicket Application) 可以達到直接存取的目的,
作法大約如下:
1.實作一 class extends AbstractAuthenticationProcessingFilter, 最主要是在
attemptAuthentication 內產生一個 TestingAuthenticationToken,只要是作為 anonymous登入用
public class AnoAuthenicationProcessingFilter extends AbstractAuthenticationProcessingFilter {
private static java.util.logging.Logger log1 = java.util.logging.Logger.getLogger("");
protected AnoAuthenicationProcessingFilter() {
//super內的參數不可為空白
super("/login.jsp");
}
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {
//Authentication authentication = new TestingAuthenticationToken(request.getRemoteAddr(), request.getRemoteAddr(), "ROLE_ANONYMOUS");
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if ( authentication == null) {
log1.log(Level.WARNING,".........establish a new tem Test token for "+ request.getRemoteAddr());
authentication = new TestingAuthenticationToken(request.getRemoteAddr(), request.getRemoteAddr(), "ROLE_ANONYMOUS");
authentication.setAuthenticated(true);
}
return getAuthenticationManager().authenticate(authentication);
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
if (SecurityContextHolder.getContext().getAuthentication() == null) {
SecurityContextHolder.getContext().setAuthentication(attemptAuthentication((HttpServletRequest) req, (HttpServletResponse) res));
if (logger.isDebugEnabled()) {
logger.debug("Populated SecurityContextHolder with dummy token: '"
+ SecurityContextHolder.getContext().getAuthentication() + "'");
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("SecurityContextHolder not populated with dummy token, as it already contained: '"
+ SecurityContextHolder.getContext().getAuthentication() + "'");
}
}
chain.doFilter(req, res);
}
}
2.實作 implements AuthenticationProvider
我希望使用者部份功能需要帳號密碼才能使用,所以在這邊有判斷 Authentication是那一種類
別,在實作 support時就要加上可允許的 token類別
public class CattonOAuthClientProvider implements AuthenticationProvider{
private static java.util.logging.Logger log1 = java.util.logging.Logger.getLogger("");
public CattonOAuthClientProvider() {
super();
}
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
log1.log(Level.WARNING,"authentication class type............. " +authentication.getClass().toString());
if (authentication instanceof UsernamePasswordAuthenticationToken) {
‧‧‧‧‧
‧‧‧‧
log1.log(Level.WARNING, "...login by account password...................");
System.out.println("...login by account password...................");
}else if (authentication instanceof TestingAuthenticationToken ) {
log1.log(Level.WARNING, "...anonymous..............");
} else {
log1.log(Level.WARNING, "faile to authenicate in provder..............");
}
return authentication;
}
public boolean supports(Class authentication) {
return TestingAuthenticationToken.class.isAssignableFrom(authentication)
|| UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication);
}
}
3.修改 spring-servlet.xml
在 custom-filter after="EXCEPTION_TRANSLATION_FILTER" ref="oauth2ClientFilter" 之前加上
custom-filter before="ANONYMOUS_FILTER" ref="authProcessingFilter"
之後再加上
bean class="com.catton.spring.security.AnoAuthenicationProcessingFilter" id="authProcessingFilter"
property name="authenticationManager" ref="defaultAuthenticationManager"
bean id="authenticationProvider" class="com.catton.spring.security.provider.CattonOAuthClientProvider"
最後再修改 authentication-manager 設定為 authentication-provider ref="authenticationProvider" 即
可
AP Invoice Hold Troubleshooting
可參考如下連結:12: Invoice HOLDS: Causes and Troubleshooting [Video] (Doc ID 1472606.1)
今天有碰到使用者問我一張 invoice有一個 Matching Required的 hold,但我沒遇過,所以找到這篇文件,上面有寫到 supplier site設定上有一個參數 Unmatched Invoices 如果有打勾,代表 invoice line一定都要經過 match產生才可以,如果手動增加且沒有match就會出現這個 hold。 如果還有其它 hold的問題可以來這邊找找看如何解決。
今天有碰到使用者問我一張 invoice有一個 Matching Required的 hold,但我沒遇過,所以找到這篇文件,上面有寫到 supplier site設定上有一個參數 Unmatched Invoices 如果有打勾,代表 invoice line一定都要經過 match產生才可以,如果手動增加且沒有match就會出現這個 hold。 如果還有其它 hold的問題可以來這邊找找看如何解決。
2014年3月17日 星期一
大批付款一直無法捉取負項 AP Invoice
一般可能都是銀行帳戶沒有維護好的問題,可以先檢查 Reject Report看看被 Reject的有那些,
再來查詢 Selected Payment Schedules Report內 Unselected Scheduled Payments and Credits,
如果有出現 Credit reduces payment amount below zero的話,請先檢查該供應商所有該付的 Invoice,不管正、負,
Schedule Payment內銀行帳號是否都有值或是正確的,如果沒有的話,請先維護正確,再重新跑一次看看是否問題解決了沒。
2014年2月11日 星期二
為何更改 AP Invoice date但 due date確不會自動更新
請至 supplier設定功能先檢查 Invoice Management ==> Term ==> Terms Date Basis是不是有設定正確,如果想要更改 invoice date後 due date就會自動更新的話,請把它設為 Invoice,其它值的話,請就參考下列的文章
參考文件:R12: How is a Payables Invoice Due Date Calculated? (Doc ID 1136143.1)
訂閱:
文章 (Atom)