U8 业务单据编码 相关表
Select * From VoucherNumber Where CardNumber='26' -- 单据规则设置表
Select * from VoucherPrefabricateview Where CardNumber='26' -- 可用类型前缀表
Select cValue from AccInformation Where cSysID='AA' and cName='cID' -- 帐套参数表
Select cCode,* from Vouchercontrapose Where cContent='PurchaseType' and cSeed='10' -- 单据前缀对照表
Select CODINGRULE,* from GradeDef Where KEYWORD='Department' -- 编码规则表
Select cCode from Vouchercontrapose Where cContent='Department' and cSeed='1002' -- 单据前缀对照表
select cNumber as Maxnumber From VoucherHistory with (NOLOCK) Where CardNumber='26' and cContent='远程号|采购类型' and cSeed='00CG' -- 单据流水号历史表
取编码规则
Select * from VoucherPrefabricateview Where CardNumber='0302'
Select * From VoucherNumber Where CardNumber='0302'
select cNumber as Maxnumber From VoucherHistory with (ROWLOCK) Where CardNumber='0302' and cContent='日期' and cSeed='2020'
取ID
declare @p5 int
declare @p6 int
exec sp_GetId N'',N'001',N'rd',2,@p5 output,@p6 output,default
select @p5, @p6
select * from UFSystem..UA_Identity --ID保存表
ia_accountload 加载未记账记录到核算数据源临时表
ia_addaccountarea 将选择的需要记账的数据插入核算区
ia_sp_monthacc 全月平均成本核算
ia_sp_monthmoveacc 移动平均法成本核算
ia_sp_fifoass 先进先出/后进先出成本核算
ia_sp_specificprice 个别计价成本核算
ia_sp_planacc 计划价成本核算
ia_roll 卷积核算存货主存储过程
--查看数据库中所有的触发器
select * from sysobjects where xtype='TR'
exec sp_helptext 'TR_Ap_CloseBills' --查看触发器内容
--科目锁定的解决
select ccode as 科目编码, cauth as 功能名称, cuser as 用户名, cmachine as 机器名 from GL_mccontrol
delete from GL_mccontrol
EXEC sp_password NULL, 'newpassword', 'User' -- 通过SQL语句来更改用户的密码
select * from ufsystem.dbo.ua_version 查询用友ERP版本号
select cAcc_Id as 账套号,iYear as 账套年度,cSub_Id as 模块标识,bClosing as 是否关闭,iModiPeri as 会计期间 from ufsystem.dbo.ua_account_sub 帐套子表
select cAcc_Id as 账套号,cAcc_Name as 账套名称,cAcc_Path as 账套路径,iYear as 启用会计期年,iMonth as 启用会计期月,cUnitName as 单位名称,iSysID as 账套内部标识 from ufsystem.dbo.ua_account 帐套主表
select cUser_Id as 操作员编码,cUser_Name as 操作员名称 from ufsystem.dbo.UA_User where nState=1; 查看被停用的操作员 iAdmin=1为主管
select cUser_Id as 操作员编码,cUser_Name as 操作员名称,nState as 是否停用 ,iAdmin as 是否帐套主管理,cDept as 所属部门,cBelongGrp as 所在组,nState as 是否停用 from ufsystem.dbo.UA_User 查看系统用户信息表
delete from ufsystem.dbo.ua_tasklog 清除异常任务及单据锁定1
delete from ufsystem.dbo.ua_task 清除异常任务及单据锁定2
SELECT cacc_id 账套号,cacc_name 账套名称,iyear 启用年度 FROM ufsystem.dbo.ua_account 数据库查账套信息
主表:
RdRecord01 采购入库单主表
RdRecord08 其他入库单主表
RdRecord10 产成品入库单主表
Vendor 供应商表
customer 客户档案表
Department 部门档案
Inventory 存货目录
PayCondition 付款条件
PurBillVouch 采购发票主表
SalePrice 销售价目表
SettleStyle 结算方式
SO_SODetails 销售订单子表
SO_SOMain 销售订单主表
ST_TotalAccount 库存总帐
Warehouse 仓库档案
WA_psn 人员表
WA_GZBName 表名称表
lockvouch 单据锁定表
bom_parent BOM母件
bas_part BOM子件
gl_accsum 总账表
gl_accass 辅助账表
gl_accvouch 凭证表/明细账
gl_accmultiass 多辅助账表
字表:
RdRecords01 采购入库单主表
RdRecords08 其他入库单主表
RdRecords10 产成品入库单主表
PurBillVouchs 采购发票子表
采购订单查询SQL
Select cpoid as 订单号码,dpodate 采购日期,cbustype as 业务类型,cvencode as 供应单位,cvenname as 供应商名称,
cinvcode 存货编码,
cinvname 存货名称,
cinvstd 规格型号,
iquantity as 数量,
inum as 件数,
iarrqty as 累计到货数量,
iarrqty as 累计到货数量,
ireceivedqty as 累计入库数量,
iinvqty as 累计开票数量,
iunitprice as 单价,
imoney as 原币金额,
itax as 税额,
isum as 价税合计,
darrivedate as 计划到货日期,
cmemo as 备注,cexch_name as 币种,cmaker as 创建人,cverifier as 审批人,cptname as 采购类型,cvenaddress as 地址
From zpurpoheader
left join zPurpotail on zpurpoheader.POID=zPurpotail.POID
Where 1=1 and ( 1=1 And ((dPODate >= N'2020-06-01') And (dPODate <= N'2020-12-05')))
BOM SQL:
select b.InvCode as 'PInvCode',a.InvCode ,a.Define24
from (
select bo.bomid,bp.invCode,bo.Define24
from bas_part bp , bom_opcomponent bo
where bp.PartId=bo.ComponentId ) a,
(Select a.BomId, a.ParentId,b.InvCode
From bom_parent a
join bas_part b on a.ParentId=b.PartId) b
where a.BomId=b.BomId
uap自定义参照,需要像数据库bd_refinfo 插入一条数据
select * from bd_refinfo where name like '%招标%' for update;
uap判断元数据是否是最新版本:单据----版本号
select * from md_component where displayname like '%项目信息%';