Пример запроса по названию товара для проверки, является ли товар изготавливаемым или закупаемым. Если закупаемый - выдача пустая, если изготавливаемый - не пустая
SELECT mstd.*, inv.InventoryName, inv.Manufacturer FROM [ArtAlyans].[dbo].[mysklad_transferDocs] as mstd left join dbo.inventories as inv on mstd.inventoriesGUID = inv.GUID where [DocType] = 'processing' and [positionProcessingType]='production' and InventoryName='22013PE Наконечники Verge Flat 9F'
Пример запроса по номеру документа, показывающего материалы по выбранной тех. операции:
SELECT mstd.*, inv.InventoryName, inv.Manufacturer, inv.CurrentBuyPriceValue FROM [ArtAlyans].[dbo].[mysklad_transferDocs] as mstd left join dbo.inventories as inv on mstd.inventoriesGUID = inv.GUID where [DocType] = 'processing' and docName='00999' and [positionProcessingType]='material'