问题现象: |
我在999演示账套里输入开票日期2003-10-31至2003-10-31,结算日期也为2003-10-31至2003-10-31,过滤结果显示的却是2003年10月25日与2003年11月14日,这两笔业务应都不是过滤的范围.是否正常? |
问题原因: |
销售明细账查询时,结算日期指的是存货系统中销售出库单(销售发票)的记帐时间,演示帐套是否正确。 1、2003年11月14日,分期收款发票fqxszp002,单据记帐日期2003-10-31,可查询发出商品委托代销存货明细账IA_EnSubsidiary; 该发票对应分期收款发货单fqxsfh001,单据日期2003-10-24,记帐日期为2003-10-31,开票日期是2003-11-14号。(是在发出商品记帐-发出商品-发货单中进行记帐操作的) select * from ia_ensubsidiary where imonth='10' and cvoucode='fqxszp001' 2、2003年10月25日,直运销售专用发票zyxszp004,单据记帐日期2003-10-31,可查询存货明细帐ia_subsidiary: select * from ia_subsidiary where imonth='10' and cvoucode='zyxszp004'。 |
解决方案: |
(以下供参考) 结算日期指的是存货系统中销售出库单/销售发票的记帐时间,跟踪销售明细帐存储过程,其主要进行如下3个部分查询:
a)根据发票日期查询销售发票主子表
select ... ...
FROM SaleBillVouchs
LEFT JOIN SaleBillVouch ON SaleBillVouchs.SBVID = SaleBillVouch.SBVID
LEFT JOIN Customer ON SaleBillVouch.cCusCode = Customer.cCusCode
LEFT JOIN Inventory ON SaleBillVouchs.cInvCode = Inventory.cInvCode
Where isnull(Salebillvouch.cInvalider,'')=''
and isnull(Salebillvouch.cSTCode,'') <> ''
and SalebillVouch.dDate>='2003-10-01'
and ddate>='2003-10-31' and ddate<='2003-10-31'
b)根据结算日期查询存货明细帐
select ... ...
FROM IA_Subsidiary
LEFT JOIN Warehouse ON IA_Subsidiary.cWhCode=Warehouse.cWhCode
LEFT JOIN Customer On IA_Subsidiary.cCusCode=Customer.cCusCode
LEFT JOIN Inventory On A_SubSidiary.cInvCode= Inventory.cInvCode
WHERE iMonth<>0 and bRdFlag=0
AND (cVouType in ('26','27','28','29','32') or (cVoutype='21' and Ia_subsidiary.bSale=1 ) )
and dKeepDate>='2003-10-31'
and dKeepDate<='2003-10-31'
c)根据结算日期查询发出商品委托代销存货明细账
select ... ...
FROM IA_EnSubsidiary a
LEFT JOIN Warehouse ON a.cWhCode=Warehouse.cWhCode
LEFT JOIN Customer On a.cCusCode=Customer.cCusCode
LEFT JOIN Inventory On a.cInvCode=Inventory.cInvCode
WHERE isnull(a.outid,0)<>0
and dKeepDate>='2003-10-31'
and dKeepDate<='2003-10-31' |
相关补丁: |
|
版本: |
8.52 |
模块: |
销售管理 |
产品: |
U852----销售管理 |
问题名称: |
销售明细账查询问题 |
最后更新: |
2005-06-28 00:00:00 |