用友U8数据库插入存货明细账语句

适用于【库存管理】与【收发存汇总表】结存不一致,且财务账无误,只有数量差异的情况。

INSERT INTO [dbo].[IA_Subsidiary]

( [bRdFlag] ,

[cBusType] ,

[cBusCode] ,

[cVouCode] ,

[ID] ,

[ValueID] ,

[JustID] ,

[dVouDate] ,

[dKeepDate] ,

[iMonth] ,

[iPZID] ,

[iPZDate] ,

[cPZtype] ,

[cPZdigest] ,

[cInvHead] ,

[cDifHead] ,

[cOppHead] ,

[cVouType] ,

[cPTCode] ,

[cSTCode] ,

[cWhCode] ,

[cAccDep] ,

[cInvCode] ,

[cRdCode] ,

[cVenCode] ,

[cCusCode] ,

[cOrderCode] ,

[cARVCode] ,

[cBillCode] ,

[cDLCode] ,

[cPSPCode] ,

[cProCode] ,

[cDepCode] ,

[cPersonCode] ,

[cHandler] ,

[iAInQuantity] ,

[iAOutQuantity] ,

[iInCost] ,

[iOutCost] ,

[iAInPrice] ,

[iAOutPrice] ,

[cBatchCode] ,

[iDebitDifCost] ,

[iCreditDifCost] ,

[cAccounter] ,

[cMaker] ,

[bFlag] ,

[bMoneyFlag] ,

[bSale] ,

[cMemo] ,

[cDefine1] ,

[cDefine2] ,

[cDefine3] ,

[cDefine4] ,

[cDefine5] ,

[cDefine6] ,

[cDefine7] ,

[cDefine8] ,

[cDefine9] ,

[cDefine10] ,

[cFree1] ,

[cFree2] ,

[cPZID] ,

[cDefine22] ,

[cDefine23] ,

[cDefine24] ,

[cDefine25] ,

[cDefine26] ,

[cDefine27] ,

[cItem_class] ,

[cItemCode] ,

[cName] ,

[cItemCName] ,

[noJustQuantity] ,

[cFree3] ,

[cFree4] ,

[cFree5] ,

[cFree6] ,

[cFree7] ,

[cFree8] ,

[cFree9] ,

[cFree10] ,

[cDefine11] ,

[cDefine12] ,

[cDefine13] ,

[cDefine14] ,

[cDefine15] ,

[cDefine16] ,

[cDefine28] ,

[cDefine29] ,

[cDefine30] ,

[cDefine31] ,

[cDefine32] ,

[cDefine33] ,

[cDefine34] ,

[cDefine35] ,

[cDefine36] ,

[cDefine37] ,

[psvsid] ,

[cCXHDcode] ,

[cCXFScode] ,

[cBatchia] ,

[dMadeDateia] ,

[iMassDateia] ,

[cMassUnit] ,

[dVDateia] ,

[cproordercode] ,

[iproorderid] ,

[iproorderids] ,

[cworkprocode] ,

[cworkprocodedis] ,

[cworkcentercode] ,

[cworkcentername] ,

[cendcode] ,

[csaleordercode] ,

[isaleorderid] ,

[isaleordersid] ,

[isaleorderids] ,

[centrustordercode] ,

[ientrustorderid] ,

[ientrustordersid] ,

[cpurordercode] ,

[ipurordersid] ,

[idlsid] ,

[strContractCode] ,

[inum] ,

[cAssUnit] ,

[exoCode] ,

[iExRowno] ,

[consignMentCode] ,

[iconsignmentautoid] ,

[iTrans] ,

[iLevel] ,

[BakID] ,

[iBG_Ctrl] ,

[cIMOrdercode] ,

[imaterialfee] ,

[iProcessFee] ,

[cMaterialHead] ,

[cProcessHead] ,

[cSRcVoutype] ,

[fLaborStdCostE] ,

[fManuFixStdCostE] ,

[fManuVarStdCostE] ,

[fOmCostE] ,

[cdemandcode] ,

[cdemandmemo] ,

[imaterialfeeDif] ,

[fLaborCostEffRateDif] ,

[fLaborCostRateDif] ,

[fManuFixCostEffRateDif] ,

[fManuFixCostRateDif] ,

[fManuVarCostEffRateDif] ,

[fManuVarCostRateDif] ,

[fOmCostEDif] ,

[cbMemo] ,

[msdetailsid] ,

[dtAudit] ,

[iYMonth] ,

[iYear] ,

[dCreateDate] ,

[GUID] ,

[MoneySrc] ,

[costsource] ,

[exorderid]

)

VALUES ( N'1' ,

NULL ,

NULL ,

N'-1050325' ,

N'-1050325' ,

NULL ,

NULL ,

N'2022-12-31 00:00:00.000' ,

N'2023-01-01 00:00:00.000' ,

N'0' ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

N'34' ,

NULL ,

NULL ,

N'334' ,

NULL ,

N'存货编码' ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

N'人名' ,

N'4' ,

NULL ,

N'1769.5125' ,

NULL ,

N'7078.05' ,

NULL ,

NULL ,

NULL ,

NULL ,

N'人名' ,

N'人名' ,

N'0' ,

N'1' ,

N'0' ,

N'调整负库存,只调整数量,不动金额,2023-06-08' ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

N'0' ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

NULL ,

N'2023' ,

N'2023-06-08 00:00:00.000' ,

NULL ,

NULL ,

NULL ,

NULL

);

GO

---UPDATE IA_Subsidiary SET iInCost='1769.5125',iAInPrice='7078.05' WHERE AutoID='1130539'

--DELETE FROM IA_Subsidiary WHERE AutoID='1142407'

SELECT iInCost FROM IA_Subsidiary WHERE AutoID='1130538'

SELECT [AutoID]

,[bRdFlag]

,[cBusType]

,[cBusCode]

,[cVouCode]

,[ID]

,[ValueID]

,[JustID]

,[dVouDate]

,[dKeepDate]

,[iMonth]

,[iPZID]

,[iPZDate]

,[cPZtype]

,[cPZdigest]

,[cInvHead]

,[cDifHead]

,[cOppHead]

,[cVouType]

,[cPTCode]

,[cSTCode]

,[cWhCode]

,[cAccDep]

,[cInvCode]

,[cRdCode]

,[cVenCode]

,[cCusCode]

,[cOrderCode]

,[cARVCode]

,[cBillCode]

,[cDLCode]

,[cPSPCode]

,[cProCode]

,[cDepCode]

,[cPersonCode]

,[cHandler]

,[iAInQuantity]

,[iAOutQuantity]

,[iInCost]

,[iOutCost]

,[iAInPrice]

,[iAOutPrice]

,[cBatchCode]

,[iDebitDifCost]

,[iCreditDifCost]

,[cAccounter]

,[cMaker]

,[bFlag]

,[bMoneyFlag]

,[bSale]

,[cMemo]

,[cDefine1]

,[cDefine2]

,[cDefine3]

,[cDefine4]

,[cDefine5]

,[cDefine6]

,[cDefine7]

,[cDefine8]

,[cDefine9]

,[cDefine10]

,[cFree1]

,[cFree2]

,[cPZID]

,[cDefine22]

,[cDefine23]

,[cDefine24]

,[cDefine25]

,[cDefine26]

,[cDefine27]

,[cItem_class]

,[cItemCode]

,[cName]

,[cItemCName]

,[noJustQuantity]

,[cFree3]

,[cFree4]

,[cFree5]

,[cFree6]

,[cFree7]

,[cFree8]

,[cFree9]

,[cFree10]

,[cDefine11]

,[cDefine12]

,[cDefine13]

,[cDefine14]

,[cDefine15]

,[cDefine16]

,[cDefine28]

,[cDefine29]

,[cDefine30]

,[cDefine31]

,[cDefine32]

,[cDefine33]

,[cDefine34]

,[cDefine35]

,[cDefine36]

,[cDefine37]

,[psvsid]

,[cCXHDcode]

,[cCXFScode]

,[cBatchia]

,[dMadeDateia]

,[iMassDateia]

,[cMassUnit]

,[dVDateia]

,[cproordercode]

,[iproorderid]

,[iproorderids]

,[cworkprocode]

,[cworkprocodedis]

,[cworkcentercode]

,[cworkcentername]

,[cendcode]

,[csaleordercode]

,[isaleorderid]

,[isaleordersid]

,[isaleorderids]

,[centrustordercode]

,[ientrustorderid]

,[ientrustordersid]

,[cpurordercode]

,[ipurordersid]

,[idlsid]

,[strContractCode]

,[inum]

,[cAssUnit]

,[exoCode]

,[iExRowno]

,[consignMentCode]

,[iconsignmentautoid]

,[iTrans]

,[iLevel]

,[BakID]

,[iBG_Ctrl]

,[cIMOrdercode]

,[imaterialfee]

,[iProcessFee]

,[cMaterialHead]

,[cProcessHead]

,[cSRcVoutype]

,[fLaborStdCostE]

,[fManuFixStdCostE]

,[fManuVarStdCostE]

,[fOmCostE]

,[cdemandcode]

,[cdemandmemo]

,[imaterialfeeDif]

,[fLaborCostEffRateDif]

,[fLaborCostRateDif]

,[fManuFixCostEffRateDif]

,[fManuFixCostRateDif]

,[fManuVarCostEffRateDif]

,[fManuVarCostRateDif]

,[fOmCostEDif]

,[cbMemo]

,[msdetailsid]

,[dtAudit]

,[iYMonth]

,[iYear]

,[dCreateDate]

,[GUID]

,[MoneySrc]

,[costsource]

,[exorderid]

FROM [dbo].[IA_Subsidiary]

WHERE (iYear = '2023') AND (iMonth = '0') AND (cVouCode IN ('-1050325', '-1050324'))

GO

SELECT * FROM [dbo].[IA_Subsidiary] WHERE iYear ='2023' AND cVouCode = '-1050325';

SELECT *

FROM IA_Subsidiary

WHERE (iYear = '2023') AND (iMonth = '0') AND (cVouCode IN ('-1050325', '-1050324'))

SELECT [AutoID]

,[bRdFlag]

,[cBusType]

,[cBusCode]

,[cVouCode]

,[ID]

,[ValueID]

,[JustID]

,[dVouDate]

,[dKeepDate]

,[iMonth]

,[iPZID]

,[iPZDate]

,[cPZtype]

,[cPZdigest]

,[cInvHead]

,[cDifHead]

,[cOppHead]

,[cVouType]

,[cPTCode]

,[cSTCode]

,[cWhCode]

,[cAccDep]

,[cInvCode]

,[cRdCode]

,[cVenCode]

,[cCusCode]

,[cOrderCode]

,[cARVCode]

,[cBillCode]

,[cDLCode]

,[cPSPCode]

,[cProCode]

,[cDepCode]

,[cPersonCode]

,[cHandler]

,[iAInQuantity]

,[iAOutQuantity]

,[iInCost]

,[iOutCost]

,[iAInPrice]

,[iAOutPrice]

,[cBatchCode]

,[iDebitDifCost]

,[iCreditDifCost]

,[cAccounter]

,[cMaker]

,[bFlag]

,[bMoneyFlag]

,[bSale]

,[cMemo]

,[cDefine1]

,[cDefine2]

,[cDefine3]

,[cDefine4]

,[cDefine5]

,[cDefine6]

,[cDefine7]

,[cDefine8]

,[cDefine9]

,[cDefine10]

,[cFree1]

,[cFree2]

,[cPZID]

,[cDefine22]

,[cDefine23]

,[cDefine24]

,[cDefine25]

,[cDefine26]

,[cDefine27]

,[cItem_class]

,[cItemCode]

,[cName]

,[cItemCName]

,[noJustQuantity]

,[cFree3]

,[cFree4]

,[cFree5]

,[cFree6]

,[cFree7]

,[cFree8]

,[cFree9]

,[cFree10]

,[cDefine11]

,[cDefine12]

,[cDefine13]

,[cDefine14]

,[cDefine15]

,[cDefine16]

,[cDefine28]

,[cDefine29]

,[cDefine30]

,[cDefine31]

,[cDefine32]

,[cDefine33]

,[cDefine34]

,[cDefine35]

,[cDefine36]

,[cDefine37]

,[psvsid]

,[cCXHDcode]

,[cCXFScode]

,[cBatchia]

,[dMadeDateia]

,[iMassDateia]

,[cMassUnit]

,[dVDateia]

,[cproordercode]

,[iproorderid]

,[iproorderids]

,[cworkprocode]

,[cworkprocodedis]

,[cworkcentercode]

,[cworkcentername]

,[cendcode]

,[csaleordercode]

,[isaleorderid]

,[isaleordersid]

,[isaleorderids]

,[centrustordercode]

,[ientrustorderid]

,[ientrustordersid]

,[cpurordercode]

,[ipurordersid]

,[idlsid]

,[strContractCode]

,[inum]

,[cAssUnit]

,[exoCode]

,[iExRowno]

,[consignMentCode]

,[iconsignmentautoid]

,[iTrans]

,[iLevel]

,[BakID]

,[iBG_Ctrl]

,[cIMOrdercode]

,[imaterialfee]

,[iProcessFee]

,[cMaterialHead]

,[cProcessHead]

,[cSRcVoutype]

,[fLaborStdCostE]

,[fManuFixStdCostE]

,[fManuVarStdCostE]

,[fOmCostE]

,[cdemandcode]

,[cdemandmemo]

,[imaterialfeeDif]

,[fLaborCostEffRateDif]

,[fLaborCostRateDif]

,[fManuFixCostEffRateDif]

,[fManuFixCostRateDif]

,[fManuVarCostEffRateDif]

,[fManuVarCostRateDif]

,[fOmCostEDif]

,[cbMemo]

,[msdetailsid]

,[dtAudit]

,[iYMonth]

,[iYear]

,[dCreateDate]

,[GUID]

,[MoneySrc]

,[costsource]

,[exorderid]

FROM [dbo].[IA_Subsidiary]

-- WHERE (iYear = '2023') AND (iMonth = '0') AND (cVouCode IN ('-1050325', '-1050324'))

--DELETE FROM IA_Subsidiary WHERE AutoID='1142407'

--SELECT iInCost FROM IA_Subsidiary WHERE AutoID='1142407'

WHERE cWhCode='31502' AND cInvCode='8003-0101-000119' AND iYear='2023'

GO

-- UPDATE IA_Subsidiary SET cWhCode='334' WHERE cWhCode='31502' AND cInvCode='存货编码' AND iYear='2023'

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值