1>找出相应的发票;

SELECT DISTINCT ai.invoice_id, ai.invoice_num invoice_num,

pv.segment1 vendor_num, pv.vendor_name vendor_name,

'The fully Paid invoice should be closed!' status

FROM ap.ap_invoices_all ai,

po.po_vendors pv,

ap.ap_payment_schedules_all aps

WHERE ai.invoice_id = aps.invoice_id

AND ai.set_of_books_id = &sob

AND ai.invoice_amount = ai.amount_paid

AND ai.cancelled_date IS NULL

AND ai.vendor_id = pv.vendor_id

AND (   ai.payment_status_flag <> 'Y'

OR aps.payment_status_flag <> 'Y'

)

2>更新相应flag以符合实际业务;

update ap_invoices_all

set payment_status_flag='Y'

where invoice_id=&invoice_id;

update ap_payment_schedules_all

set payment_status_flag='Y'

where invoice_id=&invoice_id;

结论: 测试发现

1>两表中的payment_status_flag任一一个为Y,另一个取值N或P,在付款工作台会选择不到发票;

2>两表中的payment_status_flag均不为Y,两者不管取N或P,在付款工作台上都能选择到发票.

Metalink反馈[SR:7571908.994]

CAUSE DETERMINATION

====================

The cause of the issue is invalid / incorrect data in AP_PAYMENT_SCHEDULES_ALL and AP_Invoices_All tables

Extra row(s) with AMOUNT_REMAINING, BATCH_ID, DUE_DATE ,GROSS_AMOUNT fields should not be null in

AP_PAYMENT_SCHEDULES_ALL table PAYMENT_STATUS_ FLAG should not be P in AP_Invoices_All table

SOLUTION / ACTION PLAN

======================

To implement the solution, please execute the following steps:

1. Ensure that you have taken a backup of your system before applying the recommended s

olution.

2. Run the following scripts in a TEST environment first:

Create table TAR_7571908_994_APSA as

Select * from ap_payment_schedules_all

Where amount_remaining is null and

batch_id is null and

due_date is null and

gross_amount is null and

payment_status_flag='P';

Create table TAR_7571908_994_AIA as

Select * from AP_Invoices_All

Where INVOICE_ID in (485237, 492065) and

PAYMENT_STATUS_FLAG = 'P';

Delete from ap_payment_schedules_all

Where amount_remaining is null and

batch_id is null and

due_date is null and

gross_amount is null and

payment_status_flag='P';

--This should delete all extra row(s) rows with null values fields in ap_payment_schedules_all

Update AP_Invoices_All

Set PAYMENT_STATUS_FLAG = 'Y'

Where INVOICE_ID in (485237, 492065);

--This should update PAYMENT_STATUS_FLAG field in the invoices specified

最新文章

  1. webstorm node 3000端口被占用
  2. Ubuntu 手工挂载硬盘
  3. GridView 和DataGrid区别
  4. AYUI快速开发2016-6-29 ,全部免费,WPF普遍之路梦想开启
  5. WP主题制作常用标签代码
  6. Eclipse Ctrl+Tab Alt+/ 快捷键
  7. [AngularJS+ GSAP] Greensock TimelineLite Animation Sequences
  8. 百度分享 ajax 或分页后显示不出问题解决方案
  9. Android添加桌面快捷方式的简单实现
  10. 转载 LayoutInflater的inflate函数用法详解
  11. H5单张、多张图片保存续篇
  12. Windows Internals 笔记——CreateProcess
  13. String、StringBuilder和StringBuffer的区别
  14. Netty实现简单UDP服务器
  15. MySQL--Profiling和Trace使用
  16. Web轻量级扫描工具Skipfish
  17. 读书笔记《Spring Boot实战 —— Java EE 开发的颠覆者》
  18. 用XPath精确定位节点元素&amp;selenium使用Xpath定位之完整篇
  19. Day24-Ajax操作、图片验证码、KindEditor使用-转
  20. SpringMVC整合kaptcha(验证码功能)

热门文章

  1. android学习-进程/线程管理-完整
  2. Hadoop网站日志数据清洗——正则表达式实现
  3. 用java做操作系统内核:软盘读写
  4. rails中常用的插件
  5. VF
  6. 微信小程序登录方案
  7. github上老外做的jQuery虚拟键盘
  8. [android] 手机卫士来电显示号码归属地
  9. 线程10--NSOperation的基本操作
  10. 关于Java中语句符号及格式的理解