--核算账簿
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、辅助信息的“结算信息”中的“票据日期”,默认取该条分录的“业务日期”,可编辑。”