N65总账凭证管理凭证查询(sql)

2024-01-30 16:52

本文主要是介绍N65总账凭证管理凭证查询(sql),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

--核算账簿
select code , name , pk_setofbook from org_setofbook where ( pk_setofbook in ( select pk_setofbook from org_accountingbook where 1 = 1 and ( pk_group = N'0001A11000000000037X' ) and ( accountenablestate = 2 ) ) ) order by code;--核算账簿
select code , name , pk_financeorg , pk_fatherorg , pk_accountingbook , pk_relorg , pk_group , pk_setofbook , accountenablestate , assetenablestate , materialenablestate , accounttype from ( SELECT org_accountingbook.creationtime , org_accountingbook.creator , org_accountingbook.modifiedtime , org_accountingbook.modifier , org_accountingbook.isconvert , org_accountingbook.materialenablestate , org_accountingbook.accountenablestate , org_accountingbook.accounttype , org_accountingbook.assetenablestate , org_accountingbook.code , org_accountingbook.name , org_accountingbook.name2 , org_accountingbook.name3 , org_accountingbook.name4 , org_accountingbook.name5 , org_accountingbook.name6 , org_accountingbook.mnecode , org_accountingbook.pk_accountingbook , org_accountingbook.pk_accountperiod , org_accountingbook.pk_assetperiod , org_accountingbook.pk_curraccchart , org_accountingbook.pk_exratescheme , org_accountingbook.pk_group , org_accountingbook.pk_materialperiod , org_accountingbook.pk_org , org_accountingbook.pk_relorg , org_accountingbook.pk_setofbook , org_accountingbook.shortname , org_accountingbook.shortname2 , org_accountingbook.shortname3 , org_accountingbook.shortname4 , org_accountingbook.shortname5 , org_accountingbook.shortname6 , org_accountingbook.dataoriginflag , org_accountingbook.dr , org_accountingbook.pk_taxperiod , org_accountingbook.taxenablestate , org_accountingbook.pk_setofbook + financeorg.pk_financeorg as pk_financeorg , org_accountingbook.pk_setofbook + financeorg.pk_fatherorg as pk_fatherorg FROM org_accountingbook LEFT outer JOIN ( SELECT org_corp.code , org_corp.name , org_corp.name2 , org_corp.name3 , org_corp.name4 , org_corp.name5 , org_corp.name6 , org_corp.pk_corp AS pk_financeorg , org_corp.pk_fatherorg , org_corp.pk_corp , org_corp.pk_group , org_financeorg.enablestate FROM org_corp LEFT outer JOIN org_financeorg ON org_corp.pk_corp = org_financeorg.pk_financeorg WHERE org_corp.pk_corp IN ( SELECT pk_org FROM org_orgs WHERE orgtype5 = N'Y' ) UNION SELECT org_financeorg.code , org_financeorg.name , org_financeorg.name2 , org_financeorg.name3 , org_financeorg.name4 , org_financeorg.name5 , org_financeorg.name6 , org_financeorg.pk_financeorg , org_orgs.pk_corp as pk_fatherorg , org_orgs.pk_corp , org_financeorg.pk_group , org_financeorg.enablestate FROM org_financeorg LEFT outer JOIN org_orgs ON org_financeorg.pk_financeorg = org_orgs.pk_org WHERE orgtype5 = N'Y' AND org_financeorg.pk_financeorg <> org_orgs.pk_corp ) financeorg ON org_accountingbook.pk_relorg = financeorg.pk_financeorg ) org_accountingbook where ( 1 = 1 ) and ( ( accountenablestate = 2 ) ) and ( ( pk_group = N'0001A11000000000037X' ) ) and ( pk_setofbook = N'1001A11000000001OLU9' ) order by code;--根据核算账簿以及以及相关查询条件查询凭证(制单列表数据)
select gl_voucher.pk_voucher , gl_voucher.pk_group , gl_voucher.addclass , gl_voucher.attachment , gl_voucher.checkeddate , gl_voucher.contrastflag , gl_voucher.deleteclass , gl_voucher.detailmodflag , gl_voucher.discardflag , gl_voucher.errmessage , gl_voucher.explanation , gl_voucher.adjustperiod , gl_voucher.free10 , gl_voucher.free2 , gl_voucher.free3 , gl_voucher.free4 , gl_voucher.free5 , gl_voucher.free6 , gl_voucher.free7 , gl_voucher.free8 , gl_voucher.free9 , gl_voucher.modifyclass , gl_voucher.modifyflag , gl_voucher.num , gl_voucher.period , gl_voucher.pk_casher , gl_voucher.pk_checked , gl_voucher.pk_org , gl_voucher.pk_manager , gl_voucher.pk_prepared , gl_voucher.pk_system , gl_voucher.pk_vouchertype , gl_voucher.prepareddate , gl_voucher.signdate , gl_voucher.signflag , gl_voucher.tallydate , gl_voucher.totalcredit , gl_voucher.totaldebit , gl_voucher.totaldebitgroup , gl_voucher.totalcreditgroup , gl_voucher.totaldebitglobal , gl_voucher.totalcreditglobal , gl_voucher.voucherkind , gl_voucher.year , gl_voucher.pk_accountingbook , gl_voucher.pk_sourcepk , gl_voucher.convertflag , gl_voucher.offervoucher , gl_voucher.isdifflag , gl_voucher.errmessageh , gl_voucher.billmaker , gl_voucher.approver , gl_voucher.creator , gl_voucher.tempsaveflag , gl_voucher.pk_org , gl_voucher.pk_org_v , gl_voucher.modifier , gl_voucher.modifiedtime , gl_voucher.creationtime , gl_voucher.ts from gl_voucher where ( gl_voucher.pk_accountingbook = N'1001A11000000001TSW4' ) and ( ( gl_voucher.year = N'2023' ) and ( gl_voucher.adjustperiod = N'12' ) ) and ( gl_voucher.num >= 725 ) and ( gl_voucher.num <= 725 ) and voucherkind <> 2 and voucherkind <> 255 and dr = 0 and ( voucherkind = 5 and gl_voucher.adjustperiod <> N'00' or voucherkind <> 5 );--凭证详情
select gl_detail.pk_detail , gl_detail.assid , gl_detail.bankaccount , gl_detail.checkdate , gl_detail.checkno , gl_detail.checkstyle , gl_detail.contrastflag , gl_detail.creditamount , gl_detail.creditquantity , gl_detail.debitamount , gl_detail.debitquantity , gl_detail.detailindex , gl_detail.errmessage , gl_detail.excrate1 , gl_detail.excrate2 , gl_detail.excrate3 , gl_detail.excrate4 , gl_detail.explanation , gl_detail.fraccreditamount , gl_detail.fracdebitamount , gl_detail.verifyno , gl_detail.verifydate 核销日期即业务日期, gl_detail.prepareddatev 制单日期, gl_detail.signdatev 签字日期, gl_detail.billtype , gl_detail.innerbusno , gl_detail.innerbusdate , gl_detail.localcreditamount , gl_detail.localdebitamount , gl_detail.modifyflag , gl_detail.oppositesubj , gl_detail.pk_accasoa , gl_detail.pk_org , gl_detail.pk_currtype , gl_detail.pk_innerorg , gl_detail.pk_innersob , gl_detail.pk_voucher , gl_detail.price , gl_detail.recieptclass , gl_detail.pk_accountingbook , gl_detail.pk_sourcepk , gl_detail.convertflag , gl_detail.DIRECTION ,  gl_detail.YEARV , gl_detail.adjustperiod , gl_detail.PERIODV , gl_detail.PK_VOUCHERTYPEV , gl_detail.NOV , gl_detail.PK_MANAGERV , gl_detail.VOUCHERKINDV , gl_detail.ERRMESSAGE2 , gl_detail.DISCARDFLAGV ,gl_detail.pk_systemv , gl_detail.pk_offerdetail , gl_detail.isdifflag , gl_detail.busireconno , gl_detail.errmessageh , gl_detail.pk_othercorp , gl_detail.pk_otherorgbook , gl_detail.free7 , gl_detail.free8 , gl_detail.free9 , gl_detail.free10 , gl_detail.pk_group , gl_detail.groupdebitamount , gl_detail.groupcreditamount , gl_detail.globaldebitamount , gl_detail.globalcreditamount , gl_detail.pk_org , gl_detail.pk_org_v , gl_detail.pk_unit , gl_detail.unitname , gl_detail.pk_unit_v , gl_detail.netbankflag , gl_detail.tempsaveflag , gl_dtlfreevalue.freevalue1 , gl_dtlfreevalue.freevalue2 , gl_dtlfreevalue.freevalue3 , gl_dtlfreevalue.freevalue4 , gl_dtlfreevalue.freevalue5 , gl_dtlfreevalue.freevalue6 , gl_dtlfreevalue.freevalue7 , gl_dtlfreevalue.freevalue8 , gl_dtlfreevalue.freevalue9 , gl_dtlfreevalue.freevalue10 , gl_dtlfreevalue.freevalue11 , gl_dtlfreevalue.freevalue12 , gl_dtlfreevalue.freevalue13 , gl_dtlfreevalue.freevalue14 , gl_dtlfreevalue.freevalue15 , gl_dtlfreevalue.freevalue16 , gl_dtlfreevalue.freevalue17 , gl_dtlfreevalue.freevalue18 , gl_dtlfreevalue.freevalue19 , gl_dtlfreevalue.freevalue20 , gl_dtlfreevalue.freevalue21 , gl_dtlfreevalue.freevalue22 , gl_dtlfreevalue.freevalue23 , gl_dtlfreevalue.freevalue24 , gl_dtlfreevalue.freevalue25 , gl_dtlfreevalue.freevalue26 , gl_dtlfreevalue.freevalue27 , gl_dtlfreevalue.freevalue28 , gl_dtlfreevalue.freevalue29 , gl_dtlfreevalue.freevalue30 , gl_detail.ts from gl_detail left outer join gl_dtlfreevalue on gl_detail.pk_detail = gl_dtlfreevalue.pk_detail where pk_voucher in ( N'1001A1100000000C5O4U' ) and gl_detail.dr = 0;

1、凭证业务日期是指哪个日期?刚刚发现12月725号凭证离退休这张,业务日期有问题,应该都是2023-12-31,但是出现了其他日期值。
在这里插入图片描述

答:凭证分录上记录的业务日期是反映分录所核算的业务的实际发生日期,即是核销日期而不是制单日期。

2、凭证业务日期生成规则是什么样的?
答:“业务日期显示规则是:A、新增第一条分录的业务日期默认为制单日期,其它分录默认为与上一条分录业务日期相同;B、辅助信息的 “核销信息”中的“业务日期”,默认取该条分录的“业务日期”,可编辑,编辑后同步更改分录业务日期;C、辅助信息的“结算信息”中的“票据日期”,默认取该条分录的“业务日期”,可编辑。”

这篇关于N65总账凭证管理凭证查询(sql)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/660913

相关文章

SQL注入漏洞扫描之sqlmap详解

《SQL注入漏洞扫描之sqlmap详解》SQLMap是一款自动执行SQL注入的审计工具,支持多种SQL注入技术,包括布尔型盲注、时间型盲注、报错型注入、联合查询注入和堆叠查询注入... 目录what支持类型how---less-1为例1.检测网站是否存在sql注入漏洞的注入点2.列举可用数据库3.列举数据库

Oracle查询优化之高效实现仅查询前10条记录的方法与实践

《Oracle查询优化之高效实现仅查询前10条记录的方法与实践》:本文主要介绍Oracle查询优化之高效实现仅查询前10条记录的相关资料,包括使用ROWNUM、ROW_NUMBER()函数、FET... 目录1. 使用 ROWNUM 查询2. 使用 ROW_NUMBER() 函数3. 使用 FETCH FI

数据库oracle用户密码过期查询及解决方案

《数据库oracle用户密码过期查询及解决方案》:本文主要介绍如何处理ORACLE数据库用户密码过期和修改密码期限的问题,包括创建用户、赋予权限、修改密码、解锁用户和设置密码期限,文中通过代码介绍... 目录前言一、创建用户、赋予权限、修改密码、解锁用户和设置期限二、查询用户密码期限和过期后的修改1.查询用

Mysql虚拟列的使用场景

《Mysql虚拟列的使用场景》MySQL虚拟列是一种在查询时动态生成的特殊列,它不占用存储空间,可以提高查询效率和数据处理便利性,本文给大家介绍Mysql虚拟列的相关知识,感兴趣的朋友一起看看吧... 目录1. 介绍mysql虚拟列1.1 定义和作用1.2 虚拟列与普通列的区别2. MySQL虚拟列的类型2

mysql数据库分区的使用

《mysql数据库分区的使用》MySQL分区技术通过将大表分割成多个较小片段,提高查询性能、管理效率和数据存储效率,本文就来介绍一下mysql数据库分区的使用,感兴趣的可以了解一下... 目录【一】分区的基本概念【1】物理存储与逻辑分割【2】查询性能提升【3】数据管理与维护【4】扩展性与并行处理【二】分区的

MySQL中时区参数time_zone解读

《MySQL中时区参数time_zone解读》MySQL时区参数time_zone用于控制系统函数和字段的DEFAULTCURRENT_TIMESTAMP属性,修改时区可能会影响timestamp类型... 目录前言1.时区参数影响2.如何设置3.字段类型选择总结前言mysql 时区参数 time_zon

Python MySQL如何通过Binlog获取变更记录恢复数据

《PythonMySQL如何通过Binlog获取变更记录恢复数据》本文介绍了如何使用Python和pymysqlreplication库通过MySQL的二进制日志(Binlog)获取数据库的变更记录... 目录python mysql通过Binlog获取变更记录恢复数据1.安装pymysqlreplicat

使用SQL语言查询多个Excel表格的操作方法

《使用SQL语言查询多个Excel表格的操作方法》本文介绍了如何使用SQL语言查询多个Excel表格,通过将所有Excel表格放入一个.xlsx文件中,并使用pandas和pandasql库进行读取和... 目录如何用SQL语言查询多个Excel表格如何使用sql查询excel内容1. 简介2. 实现思路3

高效管理你的Linux系统: Debian操作系统常用命令指南

《高效管理你的Linux系统:Debian操作系统常用命令指南》在Debian操作系统中,了解和掌握常用命令对于提高工作效率和系统管理至关重要,本文将详细介绍Debian的常用命令,帮助读者更好地使... Debian是一个流行的linux发行版,它以其稳定性、强大的软件包管理和丰富的社区资源而闻名。在使用

Mysql DATETIME 毫秒坑的解决

《MysqlDATETIME毫秒坑的解决》本文主要介绍了MysqlDATETIME毫秒坑的解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着... 今天写代码突发一个诡异的 bug,代码逻辑大概如下。1. 新增退款单记录boolean save = s