Страница 1 из 1

SGL - версия не отображаются документы в долгах

СообщениеДобавлено: Сб июл 12, 2014 9:37 am
Paul
В долгах, когда установлен фильтр по счету. При просмотре клиента подробно не отображаются документы в которых кредитовые проводки по выбранному клиенту. Когда фильтр убрать отображается все нормально. Никто с таким не сталкивался?????

Re: SGL - версия не отображаются документы в долгах

СообщениеДобавлено: Пн июл 14, 2014 8:50 am
dmitry
Исправить так:
- Скопировать текст ниже.
- Нажать в программе Ctrl+F10.
- Вставить текст, нажать "ОК".

DB.Execute("ALTER FUNCTION Data_Person_filter (@paramID int) RETURNS TABLE AS Return SELECT Documents.ID, Documents.DocDate, Documents.Num, Documents.NumStr, Documents.TypeID, Documents.TmplID, Documents.Text, Documents.Memo, Documents.UserName, Documents.State, DocumentRows.DbID AS AccID, DocumentRows.Quantity, DocumentRows.PriceReport, DocumentRows.OfficeID, DocumentRows.RowID, 1 as Sign FROM (Documents INNER JOIN DocumentRows ON Documents.ID = DocumentRows.DocID) INNER JOIN Accounts ON DocumentRows.DbID = Accounts.ID WHERE Accounts.Tag=2 AND DocumentRows.FlagDb=1 AND DocumentRows.PersonID=@paramID UNION SELECT Documents.ID, Documents.DocDate, Documents.Num, Documents.NumStr, Documents.TypeID, Documents.TmplID, Documents.Text, Documents.Memo, Documents.UserName, Documents.State, DocumentRows.CrID AS AccID, DocumentRows.Quantity, DocumentRows.PriceReport, DocumentRows.OfficeID, DocumentRows.RowID, -1 as Sign FROM (Documents INNER JOIN DocumentRows ON Documents.ID = DocumentRows.DocID) INNER JOIN Accounts ON DocumentRows.CrID = Accounts.ID WHERE Accounts.Tag=2 AND DocumentRows.FlagCr=1 AND DocumentRows.PersonID=@paramID")