在功能 销售发出管理 90206 中,删除重复单据

由于系统错误,有可能90206 有 没生成传票,的待传数据,要删除这些数据,需要看 手工生成销售发票传票3208 的视图 , 手工生成销售发出传票 3206

--3208
SELECT A.*,A.rowid FROM srqr_bms_cert_sa_tmp_v A WHERE 1=1;
--3206

SELECT A.*,A.rowid FROM bms_cert_sa_send_tmp_v A WHERE 1=1;

其中的 b表 临时表都是  bms_cert_dtl_tmp
select * from bms_cert_dtl_tmp c  where c.sourcetable = 'ZX_SA_SENDOUT_DOC' and c.sourceid in( 3438069,3438070)

按时间3208 中查询 按需要删除

按时间3206 中查询 按需要删除

查询收入确认重复的SQL

select sarecdtlid
  from bms_sa_rec_dtl a, bms_sa_rec_doc b, pub_settle_account_v c
 where a.sarecid = b.sarecid
   and b.usestatus = 1
   and nvl(a.invalidflag, 0) = 0
   and b.recmethod = 1
   and a.certid is null
   and b.entryid = 2003
   and b.credate <= c.enddate
   and b.credate >= c.startdate - 100
   and c.usemm = 20402
   and not exists (select 1
          from bms_cert_dtl_tmp c
         where a.sarecdtlid = c.sourceid
           and c.sourcetable = 'BMS_SA_REC_DTL'
           and c.acctype = 4) 
文档更新时间: 2025-06-05 17:22   作者:周骏