



CREATE VIEW [dbo].[ApiDefinitionsView]
AS

  SELECT [ID] Id , 
 [ID] ErpId ,0 ConfigId,0 [Type], [Symbol] ,[Nazwa] Name ,
 CAST (0 as bit) [Default], [NumeracjaWzor] Pattern
      ,case when([KontrahentWymagany]>0) then 1 else 0 end NeedCustomer --!!
      ,case when ([KierunekPlatnosci]<>0) then 1 else 0 end HasPayment --!!
      ,case when ([KierunekMagazynu]<>0) then CAST (1 as bit) else CAST (0 as bit) end ChangeItemState -- !! 
      ,CAST (0 as bit) OnlyQuantity ,[LiczonaOd] NettoBrutto , 0 Template  , 0 Behaviour , 0 ExportState
      , '' FiltrItems,'' FiltrCustomers,'' SecoundDateName,0 PrintDoc,0 UseLocalization,[KierunekMagazynu] FlowDirection, 0 ChooseBach , 0 HasDevice
      , CAST (0 as bit) AllowNewItem,0 AutoSave, 0 DefaultCust, '' Sequence , '' Parms
	  ,CAST (0 as bit) LocDesc, '' PrintoutsParms
  FROM [dbo].[DefDokHandlowych]
  where Blokada =0  
  /*
  and Kategoria in ( 
  2,-- sprzedaz
  107, -- inw
  302, -- zamal
   106, --MM
   109, --MMW MMP etc
   102, --DPW
   303, -- ZD
   310
  )
  */






GO


