用友软件各种单据最大单据号的解决方法!

本文来源 : 胡照臣 发布时间:2012年09月11日 阅读:

 

用友软件各种单据最大单据号的解决方法

 

1、发货单

* dbo.UA_Identity
set ifatherid=(* Max(Cast(right(isnull(DLid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..
dispatchlist),
ICHILDID=(* Max(Cast(right(isnull(aoutoid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..dispatchlists) WHERE

(CVOUCHTYPE=*dispatch* AND CACC_ID=*006*)

2、委托代销结算单

* dbo.UA_Identity
set ifatherid=(* Max(Cast(right(isnull(id,0),7) AS INT))AS ID FROM
UFDATA_006_2012..
SA_SETTLEVOUCH),
ICHILDID=(* Max(Cast(right(isnull(AUTOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..SA_SETTLEVOUCHS) WHERE

(CVOUCHTYPE=*SETTLEVOUCH* AND CACC_ID=*006*)

3、调拨单

* dbo.UA_Identity
set ifatherid=(* Max(Cast(right(isnull(id,0),7) AS INT))AS ID FROM
UFDATA_006_2012..
transvouch),
ICHILDID=(* Max(Cast(right(isnull(AUTOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..transvouchs) WHERE (CVOUCHTYPE=*tr*

AND CACC_ID=*006*)

4,出入库单

 * dbo.UA_Identity
set ifatherid=(* Max(Cast(right(isnull(id,0),7) AS INT))AS ID FROM
UFDATA_006_2012..
rdrecord32),
ICHILDID=(* Max(Cast(right(isnull(AUTOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..rdrecords32) WHERE (CVOUCHTYPE=*rd*

AND CACC_ID=*006*)

5、销售发票


* dbo.UA_Identity
set ifatherid=(* Max(Cast(right(isnull(sbvid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..
salebillvouch),
ICHILDID=(* Max(Cast(right(isnull(AUTOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..salebillvouchs) WHERE

(CVOUCHTYPE=*billvouch* AND CACC_ID=*006*)

6、销售订单

* UA_Identity
set ifatherid=(* Max(Cast(right(isnull(id,0),7) AS INT))AS ID FROM
UFDATA_006_2012..SO_SOMAIN),
ICHILDID=(* Max(Cast(right(isnull(AUTOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..SO_SODetails) WHERE

(CVOUCHTYPE=*SOMAIN* AND CACC_ID=*006*)

7、采购订单


* UA_Identity
set ifatherid=(* Max(Cast(right(isnull(cPOid,0),7) AS INT))AS ID FROM
UFDATA_006_2012..PO_POMAIN),
ICHILDID=(* Max(Cast(right(isnull(id,0),7) AS INT))AS ID FROM
UFDATA_006_2012..PO_PODetails) WHERE (CVOUCHTYPE=*POMAIN*

AND CACC_ID=*006*)