USEGEAR

导航

高格发票勾稽之BUG

       select (INVNO) AS INVCODE, SDATE ,*
       FROM STKSALE1 WHERE LEN(INVSCODE) > 0 
       AND  INVSCODE = '3100000000'   AND INVNO= 'Z0825269'

场景:用户增加销售发票,把发票号码加进了字母。由于增值税发票8位数字。所以在发票勾稽保存后。再新增加发票,会导致发票号出错。

原因:由于勾稽导致该发票号在销售出货单中残留。再次勾稽时,没有做对应修改(BUG)

       select MAX(CODE) AS INVCODE, MAX(SDATE) SDATE FROM INVNEWSAL1 
       WHERE INVSCODE = '3100000000'      
       UNION      
       select MAX(INVNO) AS INVCODE, MAX(SDATE) SDATE FROM BILRCV WHERE LEN(INVSCODE) > 0 
       AND  INVSCODE = '3100000000'      
       UNION      
       select MAX(INVNO) AS INVCODE, MAX(SDATE) SDATE 
       FROM STKSALE1 WHERE LEN(INVSCODE) > 0 
       AND  INVSCODE = '3100000000'      
       UNION      select MAX(INVNO) AS INVCODE, 
       MAX(SDATE) SDATE FROM STKBADDEAL1 WHERE LEN(INVSCODE) > 0 AND  INVSCODE = '3100000000' 
--查找出错的销售出货单
       select (INVNO) AS INVCODE, SDATE ,*
       FROM STKSALE1 WHERE LEN(INVSCODE) > 0 
       AND  INVSCODE = '3100000000'   AND INVNO= 'Z0825269'

--修改则真正的勾稽发票号
              UPDATE STKSALE1 SET INVNO = '20825264'
            --  SELECT *
       FROM STKSALE1 WHERE LEN(INVSCODE) > 0
       AND  INVSCODE = '3100000000'   AND INVNO= 'Z0825269'
再到后台修改当前发票号

ok,

goodluck!

posted on 2022-01-05 14:42  USEGEAR  阅读(89)  评论(0编辑  收藏  举报