---从当前卡片恢复余额表
insert into t_fa_faaccountbalance
select newbosid('B719F3F3'),c.fassetValue,0,0,c.fassetValue,
c.faccuDepr,0,0,c.faccuDepr,c.faccuDeprTYear,
0,0,c.fdecValue,c.fdecValue,
0,case when c.fInitEvalValue is null then c.fassetValue else c.fInitEvalValue end ,0,case when c.fInitEvalValue is null then c.fassetValue else c.fInitEvalValue end,
c.fauditorid,c.flastupdatetime,c.fauditorid,c.flastupdatetime,
'3pcAAAAIozOCOIxM',c.fcurrencyid,c.fcompanyid,c.fid,0,c.fcontrolunitid
from t_fa_facurcard c
inner join t_bd_period per on c.FPERIODID = per.fid
where c.fcheckedStatus = 2
and c.FCOMPANYID = (select fid from t_org_company where fnumber='YROSH')
and c.fbizstatus<>'0399' and c.fbizstatus<>'0499' and c.fbizstatus<>'0599'
and c.fperiodid in(select fid from t_bd_period where fnumber <=202212)
and c.fid not in(
select ffacurcardid from t_fa_faaccountbalance where FcompanyOrgUnitid =(select fid from t_org_company where fnumber ='YROSH')
and fperiodid in (select fid from t_bd_period where fnumber =202212))