解决方案: |
作调整数据操作前敬请做好数据备份工作!!!
--调整6-15号的销售发票对应的出库单,使销售出库单日期与销售发票日期匹配;
--专用发票的情况同普通发票,只需要更改csource=‘专用发票‘即可;
update rdrecord
set ddate=select ddate from salebillvouch where salebillvouch.csbvcode=rdrecord.cbuscode
where cvouchtype=‘32‘ and csource=‘普通发票‘
and cbuscode in select distinct csbvcode
from salebillvouch where ddate=‘2003-06-15‘
以下语句仅供参考。
--查询所有普通发票开票直接发货生成的销售出库单信息
select *
from rdrecord
where cvouchtype=‘32‘ and csource=‘普通发票‘
and cbuscode in select distinct csbvcode from salebillvouch
--查询已直接生成销售出库单的普通发票信息
select *
from salebillvouch
where csbvcode in select distinct cbuscode from rdrecord where cvouchtype=‘32‘ and csource=‘普通发票‘
--调整使所有的销售出库单日期与销售发票日期匹配
update rdrecord
set ddate=select ddate from salebillvouch where salebillvouch.csbvcode=rdrecord.cbuscode
where cvouchtype=‘32‘ and csource=‘普通发票‘
and cbuscode in select distinct csbvcode from salebillvouch
--需调整数据表存货明细账ia_subsidiary,调整单据日期、及单据记账日期.
update ia_subsidiary
set dvoudate=‘2003-6-15‘,dkeepdate=‘2003-6-15‘
where id in select b.autoid
from rdrecord a join rdrecords b on a.id=b.id
where a.ddate=‘2003-06-15‘ and a.csource=‘普通发票‘ and cvouchtype=‘32‘
执行操作前做好数据备份工作。
专用发票的情况同普通发票,只需要更改csource=‘专用发票‘即可. |