【问题】
1、采购发票已经完全核销,但是查询到期债权列表时综合本位币下还显示?
2、某两张发票在到期债权列表中显示,但是查询发票找不到?
【概述】
1、部分人民币单据,价税合计和价税合计本位币不一致,相差几分钱,执行语句修复;
部分外币单据,本位币还有余额是由于汇率差导致的,建议手工录入期末调汇类型的其他应付单进行调整;
2、往来表有记录,发票表没有记录,客户表示可执行删除,执行语句删除。 具体修复语句请查看附件。12.sql
【注意】
执行语句前请备份好.
update a set a.FStdTaxAmount =a.FTaxAmount,a.FStdamountincludetax=a.famountincludetax
--select a.FTaxAmount,a.FStdTaxAmount,a.FStdamountincludetax,a.famountincludetax,a.FAmount,*
from ICPurchaseEntry a
inner join ICPurchase b
on a.FInterID=b.FInterID
and b.FCurrencyID=1
and a.FTaxAmount <>a.FStdTaxAmount
select a.FTaxAmount,a.FStdTaxAmount,a.FStdamountincludetax,a.famountincludetax,a.FAmount,*
from ICPurchaseEntry a
inner join ICPurchase b
on a.FInterID=b.FInterID
and b.FCurrencyID=1
and a.FTaxAmount <>a.FStdTaxAmount
--1、修改发票表
update a set a.FTotalCost=b.amountsum,FTotalCostFor=b.amountsum,FRemainAmount=0,FRemainAmountFor=0
--select FRemainAmountFor,FRemainAmount,*
from icpurchase a inner join
(select FInterID, sum(famountincludetax) as amountsum from ICPurchaseEntry where FInterID in (4381,3053,2132,5074,4885,00161046,3716,3913) group by FInterID)b
on b.FInterID=a.finterid
and a.FCurrencyID=1
--2、修改往来计划表
update a set a.FAmount=b.amountsum,FAmountFor=b.amountsum,FRemainAmount=0,FRemainAmountFor=0
--select FRemainAmountFor,FRemainAmount,*
from t_rp_contact a inner join
(select FInterID, sum(famountincludetax) as amountsum from ICPurchaseEntry where FInterID in (4381,3053,2132,5074,4885,00161046,3716,3913)group by FInterID )b
on b.FInterID=a.FInvoiceID
and a.FCurrencyID=1
and a.FType=4
--3、修改付款计划表
update a set a.famountfor =b.amountsum ,a.FAmount=b.amountsum,a.FRemainAmountFor= 0,a.FRemainAmount=0
--select a.famountfor ,a.FAmount ,a.FRemainAmountFor,a.FRemainAmount,*
from t_RP_Plan_Ap a
inner join
(select FInterID, sum(famountincludetax) as amountsum from ICPurchaseEntry where FInterID in (4381,3053,2132,5074,4885,00161046,3716,3913)group by FInterID )b
on b.FInterID=a.FInterID
--4、修改发票体
update a set a.FStdTaxAmount =a.FTaxAmount,a.FStdamountincludetax=a.famountincludetax
--select a.FTaxAmount,a.FStdTaxAmount,a.FStdamountincludetax,a.famountincludetax,a.FAmount,a.FRemainAmountFor,a.FRemainAmount,*
from ICPurchaseEntry a
inner join ICPurchase b
on a.FInterID=b.FInterID
and b.FCurrencyID=1
and a.FTaxAmount <>a.FStdTaxAmount
--5、删除异常表
delete from
--select * from
t_RP_Contact where FNumber in ('PPOFP150','PPOFP149')
--6、04730903和0445719未剩余金额异常
select FTotalCost,FTotalCostFor,FCheckAmount,FCheckAmountFor,FRemainAmount,FRemainAmountFor,* from ICPurchase where FBillNo='04730903'
select FAmountincludetax,FStdAmountincludetax ,FCheckAmount,FCheckAmountFor,FRemainAmount,FRemainAmountFor,* from ICPurchaseEntry where FInterID=16651
select FAmount,FAmountFor,FRemainAmount,FRemainAmountFor,* from t_RP_Contact where FNumber='04730903'
select FTotalCost,FTotalCostFor,FCheckAmount,FCheckAmountFor,FRemainAmount,FRemainAmountFor,* from ICPurchase where FBillNo='04457190'
select FAmount,FAmountFor, FRemainAmount,FRemainAmountFor,* from t_RP_Contact where FNumber='04457190'
update ICPurchase set FRemainAmount=FTotalCost,FRemainAmountFor=FTotalCostFor where FBillNo in ('04730903','04457190')
update ICPurchaseEntry set FRemainAmount=FStdAmountincludetax where FInterID in (16651,16376)
update t_RP_Contact set FRemainAmount=FAmount where FNumber in ('04730903','04457190')
推荐阅读
您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!
请选择打赏金币数 *