—-金蝶系统凭证信息查询SQL
select V.FDate As [凭证日期] , V.FYear As [会计年度] , V.FPeriod As [会计期间] , VG.FName As [凭证字名称] , V.FNumber As [凭证号] , t_Account.FNumber As [科目代码] , t_Account.FName As [科目名称] , VE.FEntryID As [分录号] , VE.FExplanation As [摘要]
,(case VE.FDC when 1 then ‘借’ else ‘贷’ end ) As [借贷方向] , VE.FAmount As [本位币金额] , V.FPreparerID As [制单人ID] , t_user.FName As [制单人名称]
, V.FReference As [参考信息] , V.FDebitTotal As [借方金额合计] , V.FCreditTotal As [贷方金额合计] , V.FChecked As [是否审核] , V.FPosted As [是否过账], V.FSerialNum As [凭证序号] , V.FTranType As [单据类型] , V.FExplanation As [备注] , V.FAttachments As [附件张数] , V.FInternalInd As [机制凭证_凭证表] , V.FTransDate As [业务日期] , V.FBrNo As [公司代码_凭证表] , V.FVoucherID As [凭证内码_凭证表] , V.FGroupID As [凭证字内码_凭证表] , V.FEntryCount As [分录数] , V.FCheckerID As [审核人] , V.FPosterID As [记账人] , V.FCashierID As [出纳员] , V.FHandler As [会计主管] , V.FOwnerGroupID As [制单人所属工作组] , V.FObjectName As [对象接口] , V.FParameter As [接口参数] , V.FFrameWorkID As [集团组织机构内码] , V.FApproveID As [审批] , V.FFootNote As [批注] , V.UUID As [UUID_凭证表] , V.FModifyTime As [修改时间] , VE.FDetailID As [核算项目使用状况内码_凭证分录表] , VE.FCurrencyID As [币别] , VE.FExchangeRate As [汇率_凭证分录表] , VE.FAmountFor As [原币金额], VE.FAccountID2 As [对方科目] , VE.FSettleTypeID As [结算方式] , VE.FSettleNo As [结算号] , VE.FCashFlowItem As [现金流量] , VE.FBrNo As [公司代码_凭证分录表] , VE.FVoucherID As [凭证内码_凭证分录表] , VE.FAccountID As [科目内码_凭证分录表] , VE.FQuantity As [数量] , VE.FMeasureUnitID As [单位内码_凭证分录表] , VE.FUnitPrice As [单价] , VE.FInternalInd As [机制凭证_凭证分录表] , VE.FTransNo As [业务号] , VE.FTaskID As [项目任务内码] , VE.FResourceID As [项目资源内码] , t_Account.FLevel As [科目级次] , t_Account.FDetail As [明细科目_1是_0否] , t_Account.FParentID As [顶级_即1级科目内码] , t_Account.FDC As [借贷方向_1借_负1贷] , t_Account.FHelperCode As [助记码] , t_Account.FDelete As [是否禁用_科目表] , t_Account.FFullName As [科目全名] , t_Currency.FNumber As [币别代码] , t_Currency.FName As [币别名称] , t_Currency.FExchangeRate As [汇率_币别表] , VG.FGroupID As [凭证字内码_凭证字]
from t_Voucher as V–凭证表
left outer join t_VoucherEntry as VE on V.FVoucherID = VE.FVoucherID –凭证分录表
left outer join t_VoucherGroup as VG on V.FGroupID = VG.FGroupID –凭证字表
left outer join t_user on V.FPreparerID = t_user.FUserID –系统用户信息表
left outer join t_Account on VE.FAccountID = t_Account.FAccountID –科目表
left outer join t_Currency on VE.FCurrencyID = t_Currency.FCurrencyID–币别表
where
V.FYear = 2018 and V.FPeriod = 9
order by V.FYear , V.FPeriod , VG.FName , V.FNumber , VE.FEntryID
原文发布时间:2020/5/7 15:48:12
暂无评论