|
解决方法
1、根据ar_receivable_applications_all和ar_cash_receipts_all中的cash_receipt_id关联。查出
ar_receivable_applications_all 表中的applied_customer_trx_id为6698。与ra_customer_trx_all中
的customer_trx_id=7362不符,先按以下语句处理将两个ID值改为一致。
select * from ar_receivable_applications_all where cash_receipt_id=9067
update ar_receivable_applications_all set applied_customer_trx_id=7362 (原来6698)
where cash_receipt_id=9067 and status="APP"(如果不指定状态,会出现最后第5点的问题)
2、在存放事务处理客户余额信息的表 ar_payment_schedules_all表中的payment_schedule_id=19612,
但ar_receivable_applications_all表中的applied_payment_schedule_id=18206,两个值不一样
(通过ar_receivable_applications_all.applied_customer_trx_id
与ar_payment_schedules_all. customer_trx_id相关联,需要运行完第1步后),因此将两个
不同的ID更新为一样.
select * from ar_receivable_applications_all where cash_receipt_id=9067
update ar_receivable_applications_all set applied_payment_schedule_id=19612 (原来18206)
where applied_payment_schedule_id=18206
3、由于记录是核销的,因此把表中的状态改为已完成核销的状态。可以通过与一条正常的记录对比得出该结论。
select * from ar_payment_schedules_all where customer_trx_id=7362
update ar_payment_schedules_all set status='CL' (原来是OP)
where customer_trx_id=7362
4、由于是直接对数据库进行后台操作。一些记录没有完全进行运算和更新,所以通过与一些正常的记录对
比,把相关的字段进行更新。
select * from ar_payment_schedules_all where customer_trx_id=7362
UPDATE ar_payment_schedules_all SET amount_due_remaining=0 (原来1020)
where customer_trx_id=7362
UPDATE ar_payment_schedules_all SET amount_line_items_remaining=0 (原来871.8)
where customer_trx_id=7362
UPDATE ar_payment_schedules_all SET amount_applied=1020 (原来为 空)
where customer_trx_id=7362
UPDATE ar_payment_schedules_all SET tax_remaining=0 (原来为148.2)
where customer_trx_id=7362
UPDATE ar_payment_schedules_all set ACTUAL_DATE_CLOSED=to_date('2004-8-30','YYYY-MM-DD') (原来时间为4172-12-31)
WHERE customer_trx_id=7362
UPDATE AR_PAYMENT_SCHEDULES_ALL SET DISCOUNT_REMAINING=0,discount_taken_earned=0,discount_taken_unearned=0
where customer_trx_id=7362 (以上字段值原来为 空)
UPDATE AR_PAYMENT_SCHEDULES_ALL SET program_application_id=-1,program_id=-1,request_id=-1
where customer_trx_id=7362 (以上字段值原来为 空)
update ar_payment_schedules_all set acctd_amount_due_remaining=0 (原来为1020)
WHERE customer_trx_id=7362
5、以上处理完后在“收款”的查看会计方法中会多出两个事务处理ID号。
原因: 在第一步更新ar_receivable_applications_all 表中的applied_customer_trx_id为7362时,有三条记录被更新了,实际上如果
STATUS的状态为UNAPP时applied_customer_trx_id是为空的,只有STATUS的状态是APP是applied_customer_trx_id才有记录,因此
只要把状态是UNAPP的applied_customer_trx_id 清为空就可以了. |
|