管家婆分销ERPV3A8应收查询->往来对账->显示业务凭证摘要
--特殊处理会计凭证 INSERT INTO #BillIndex SELECT DISTINCT A.BillCode, A.BillNumberId, A.BillDate, A.ETypeid, A.DTypeId, A.ktypeid, L.BTypeid, A.BillType, L.Total, L.NTotal, 0 AS totalinmoney, 0 AS ntotalinmoney, C.Comment, L.ATypeid, A.TeamNo, A.RedWord, A.preferencemoney, A.npreferencemoney, A.ifmulaccount, AC.fullname AS cfullname, AC.rate FROM BillIndex A INNER JOIN ListTable L ON A.BillNumberID=L.BillNumberID and a.BillType=l.BillType INNER JOIN AC_currency AC ON L.CID=AC.CID INNER JOIN #stype S ON A.Stypeid=s.typeid INNER JOIN #Dtype D ON D.typeid = A.DTypeId INNER JOIN AC_Items ACI ON L.AtypeId