------------------------------------------------------------
IF 0 = (SELECT count(*) from [sysobjects] where ([xtype] = 'U' or [xtype] = 'V') and [name] = 'ut_MwstKennzeichen')
BEGIN
CREATE TABLE [dbo].[ut_MwstKennzeichen]
(
   [RecId]  integer NOT NULL
  ,[MandId] integer DEFAULT 1
  ,[KzMwst] char(3) DEFAULT ' '
  ,[AbYMD] char(8) DEFAULT ' '
  ,[BuchGrp] char(10) DEFAULT ' '
  ,[Satz] float DEFAULT 0
  ,[SchlDatev] char(10) DEFAULT ' '
  ,[CodeXRng] char(10) DEFAULT ' '
  ,[DrkNull] tinyint DEFAULT 0
  ,[KtoUSt] char(8) DEFAULT ' '
  ,[KtoMat] char(8) DEFAULT ' '
  ,[KtoLohn] char(8) DEFAULT ' '
  ,[KtoFremd] char(8) DEFAULT ' '
  ,[KtoRab] char(8) DEFAULT ' '
  ,[KtoSonst] char(8) DEFAULT ' '
  ,[KtoAbzug] char(8) DEFAULT ' '
  ,[KtoTeilr] char(8) DEFAULT ' '
  ,[KtoAnzah] char(8) DEFAULT ' '
  ,[MWStKateg] char(3) DEFAULT ' '
  ,[SchlTRDat] char(10) DEFAULT ' '
  ,[KtoTRUSt] char(8) DEFAULT ' '
  ,[SchlAZDat] char(10) DEFAULT ' '
  ,[KtoAZUSt] char(8) DEFAULT ' '
  ,[KzDebSoll] tinyint DEFAULT 0
  CONSTRAINT [Pk_MwstKennzeichen]  PRIMARY KEY NONCLUSTERED ( [RecId] )
)
END
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'TR'   and [name] = 'tr_MwstKennzeichen_KeyDel')
  DROP TRIGGER [dbo].[tr_MwstKennzeichen_KeyDel]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'TR'   and [name] = 'tr_MwstKennzeichen_KeyUpd')
  DROP TRIGGER [dbo].[tr_MwstKennzeichen_KeyUpd]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'U' and [name] = 'ut_MwstKennzeichen_Keys')
  DROP TABLE [dbo].[ut_MwstKennzeichen_Keys]
GO

IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KzMwst')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KzMwst] char(3) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'AbYMD')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [AbYMD] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'BuchGrp')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [BuchGrp] char(10) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'Satz')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [Satz] float NOT NULL DEFAULT 0
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlDatev')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [SchlDatev] char(10) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'CodeXRng')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [CodeXRng] char(10) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'DrkNull')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [DrkNull] tinyint NOT NULL DEFAULT 0
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoUSt] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoMat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoMat] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoLohn')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoLohn] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoFremd')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoFremd] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoRab')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoRab] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoSonst')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoSonst] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAbzug')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoAbzug] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoTeilr')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoTeilr] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAnzah')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoAnzah] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'MWStKateg')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [MWStKateg] char(3) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlTRDat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [SchlTRDat] char(10) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoTRUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoTRUSt] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlAZDat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [SchlAZDat] char(10) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAZUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KtoAZUSt] char(8) NOT NULL DEFAULT ' '
END
GO
IF 0 = (select count(*) from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KzDebSoll')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ADD [KzDebSoll] tinyint NOT NULL DEFAULT 0
END
GO
IF 3 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KzMwst')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KzMwst] char(3)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'AbYMD')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [AbYMD] char(8)
END
GO
IF 10 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'BuchGrp')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [BuchGrp] char(10)
END
GO
IF 10 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlDatev')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [SchlDatev] char(10)
END
GO
IF 10 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'CodeXRng')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [CodeXRng] char(10)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoUSt] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoMat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoMat] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoLohn')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoLohn] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoFremd')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoFremd] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoRab')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoRab] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoSonst')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoSonst] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAbzug')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoAbzug] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoTeilr')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoTeilr] char(8)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAnzah')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoAnzah] char(8)
END
GO
IF 3 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'MWStKateg')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [MWStKateg] char(3)
END
GO
IF 10 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlTRDat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [SchlTRDat] char(10)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoTRUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoTRUSt] char(8)
END
GO
IF 10 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'SchlAZDat')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [SchlAZDat] char(10)
END
GO
IF 8 > (select length from syscolumns sc inner join sysobjects so
        on sc.[id] = so.[id] and so.[name] = 'ut_MwstKennzeichen' and sc.[name] = 'KtoAZUSt')
BEGIN
  ALTER TABLE [dbo].[ut_MwstKennzeichen] ALTER COLUMN [KtoAZUSt] char(8)
END
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'V' and [name] = 'MwstKennzeichen')
  DROP VIEW [dbo].[MwstKennzeichen]
GO
CREATE VIEW [dbo].[MwstKennzeichen] AS
  SELECT * FROM [dbo].[ut_MwstKennzeichen]
GO
CREATE TABLE [dbo].[ut_MwstKennzeichen_Keys]
(
   [DataRecId]  integer NOT NULL
  ,[DataMandId] integer DEFAULT 1
  ,[Key00_Value] CHAR(31) NOT NULL
  ,[Key01_Filter] TINYINT NOT NULL
  ,[Key01_Value] CHAR(21) NOT NULL
  ,[Key02_Value] CHAR(31) NOT NULL
  CONSTRAINT [Pk_ut_MwstKennzeichen_Keys]  PRIMARY KEY NONCLUSTERED ( [DataRecId] )
)
GO
CREATE TRIGGER [dbo].[tr_MwstKennzeichen_KeyDel] ON [dbo].[ut_MwstKennzeichen]
FOR DELETE
AS
  SET NOCOUNT ON
  DELETE FROM [dbo].[ut_MwstKennzeichen_Keys] WITH (SERIALIZABLE)
  WHERE [DataRecId] IN (SELECT [RecId] FROM DELETED)
GO

CREATE TRIGGER [dbo].[tr_MwstKennzeichen_KeyUpd] ON [dbo].[ut_MwstKennzeichen]
FOR INSERT, UPDATE
AS
  SET NOCOUNT ON
  IF UPDATE([RecId]) OR UPDATE([MandId])
  BEGIN
    DELETE FROM [dbo].[ut_MwstKennzeichen_Keys] WITH (SERIALIZABLE)
    WHERE [DataRecId] IN (SELECT [RecId] FROM DELETED)

    INSERT INTO [dbo].[ut_MwstKennzeichen_Keys] WITH (SERIALIZABLE)
    ([DataRecId],[DataMandId],[Key00_Value],[Key01_Filter],[Key01_Value],[Key02_Value])
    (SELECT [RecId],[MandId]
     ,UPPER(convert(char(3),[KzMwst])+convert(char(10),[BuchGrp])+convert(char(8),[AbYMD])+STR(RecId,10))
     ,CASE WHEN (1 =  KzDebSoll) THEN 1 ELSE 0 END
     ,UPPER(convert(char(3),[MWStKateg])+convert(char(8),[AbYMD])+STR(RecId,10))
     ,UPPER(convert(char(3),[MWStKateg])+convert(char(10),[BuchGrp])+convert(char(8),[AbYMD])+STR(RecId,10))

    FROM INSERTED)
  END
  ELSE
  BEGIN
    UPDATE [dbo].[ut_MwstKennzeichen_Keys] WITH (SERIALIZABLE) SET
    [Key00_Value] = UPPER(convert(char(3),[KzMwst])+convert(char(10),[BuchGrp])+convert(char(8),[AbYMD])+STR([RecId],10))
   ,[Key01_Value] = UPPER(convert(char(3),[MWStKateg])+convert(char(8),[AbYMD])+STR([RecId],10))
   ,[Key01_Filter] = CASE WHEN (1 =  KzDebSoll) THEN 1 ELSE 0 END
   ,[Key02_Value] = UPPER(convert(char(3),[MWStKateg])+convert(char(10),[BuchGrp])+convert(char(8),[AbYMD])+STR([RecId],10))
    FROM INSERTED WHERE [DataRecId] = [RecId]
  END
GO

UPDATE [dbo].[ut_MwstKennzeichen] SET RecId = RecId
GO


------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Add_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Add_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Add_MwstKennzeichen] AS
  DECLARE @NeueId integer
  SET @NeueId = (SELECT MAX(RecId) from [dbo].[ut_MwstKennzeichen])
  IF @NeueId IS NULL SET @NeueId = 0
  SET @NeueId = @NeueId + 1
  INSERT INTO [dbo].[ut_MwstKennzeichen] (RecId) VALUES( @NeueId )
  IF @@ERROR = 0
  BEGIN
    SELECT @NeueId AS RecId
    RETURN
  END
  SELECT 0 AS RecId
GO

------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Upd_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Upd_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Upd_MwstKennzeichen]
  @RI integer
 ,@Parm_KzMwst char(3)
 ,@Parm_AbYMD char(8)
 ,@Parm_BuchGrp char(10)
 ,@Parm_Satz float
 ,@Parm_SchlDatev char(10)
 ,@Parm_CodeXRng char(10)
 ,@Parm_DrkNull tinyint
 ,@Parm_KtoUSt char(8)
 ,@Parm_KtoMat char(8)
 ,@Parm_KtoLohn char(8)
 ,@Parm_KtoFremd char(8)
 ,@Parm_KtoRab char(8)
 ,@Parm_KtoSonst char(8)
 ,@Parm_KtoAbzug char(8)
 ,@Parm_KtoTeilr char(8)
 ,@Parm_KtoAnzah char(8)
 ,@Parm_MWStKateg char(3)
 ,@Parm_SchlTRDat char(10)
 ,@Parm_KtoTRUSt char(8)
 ,@Parm_SchlAZDat char(10)
 ,@Parm_KtoAZUSt char(8)
 ,@Parm_KzDebSoll tinyint
AS
--BEGIN TRANSACTION
UPDATE [dbo].[ut_MwstKennzeichen] SET
     [KzMwst] = RTRIM(@Parm_KzMwst)
    ,[AbYMD] = RTRIM(@Parm_AbYMD)
    ,[BuchGrp] = RTRIM(@Parm_BuchGrp)
    ,[Satz] = @Parm_Satz
    ,[SchlDatev] = RTRIM(@Parm_SchlDatev)
    ,[CodeXRng] = RTRIM(@Parm_CodeXRng)
    ,[DrkNull] = @Parm_DrkNull
    ,[KtoUSt] = RTRIM(@Parm_KtoUSt)
    ,[KtoMat] = RTRIM(@Parm_KtoMat)
    ,[KtoLohn] = RTRIM(@Parm_KtoLohn)
    ,[KtoFremd] = RTRIM(@Parm_KtoFremd)
    ,[KtoRab] = RTRIM(@Parm_KtoRab)
    ,[KtoSonst] = RTRIM(@Parm_KtoSonst)
    ,[KtoAbzug] = RTRIM(@Parm_KtoAbzug)
    ,[KtoTeilr] = RTRIM(@Parm_KtoTeilr)
    ,[KtoAnzah] = RTRIM(@Parm_KtoAnzah)
    ,[MWStKateg] = RTRIM(@Parm_MWStKateg)
    ,[SchlTRDat] = RTRIM(@Parm_SchlTRDat)
    ,[KtoTRUSt] = RTRIM(@Parm_KtoTRUSt)
    ,[SchlAZDat] = RTRIM(@Parm_SchlAZDat)
    ,[KtoAZUSt] = RTRIM(@Parm_KtoAZUSt)
    ,[KzDebSoll] = @Parm_KzDebSoll
  WHERE RecId = @RI
--COMMIT TRANSACTION
GO

------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Sel_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Sel_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Sel_MwstKennzeichen]
  @RI integer
AS
SELECT
     [KzMwst]
    ,[AbYMD]
    ,[BuchGrp]
    ,[Satz]
    ,[SchlDatev]
    ,[CodeXRng]
    ,[DrkNull]
    ,[KtoUSt]
    ,[KtoMat]
    ,[KtoLohn]
    ,[KtoFremd]
    ,[KtoRab]
    ,[KtoSonst]
    ,[KtoAbzug]
    ,[KtoTeilr]
    ,[KtoAnzah]
    ,[MWStKateg]
    ,[SchlTRDat]
    ,[KtoTRUSt]
    ,[SchlAZDat]
    ,[KtoAZUSt]
    ,[KzDebSoll]
  FROM [dbo].[ut_MwstKennzeichen]
  WHERE RecId = @RI
GO
------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Del_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Del_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Del_MwstKennzeichen]
  @RI integer
AS
  DELETE FROM [dbo].[ut_MwstKennzeichen] WHERE RecId = @RI
GO
------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Reorg_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Reorg_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Reorg_MwstKennzeichen]
  @bDbcc integer,@bRecId integer
AS
  IF (@bRecId = 1)
  BEGIN
    DECLARE  C        CURSOR FOR SELECT RecId FROM [dbo].[ut_MwstKennzeichen] ORDER BY RecId
    DECLARE  @CurrId  integer
    DECLARE  @NextId  integer
    --BEGIN TRANSACTION
    OPEN C
    SET @NextId = 1
    FETCH NEXT FROM C INTO @CurrId
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
      IF @CurrId <> @NextId
      UPDATE [dbo].[ut_MwstKennzeichen] SET RecId=@NextId WHERE CURRENT OF C
      SET @NextId = @NextId + 1
      FETCH NEXT FROM C INTO @CurrId
    END
    CLOSE C
    --COMMIT TRANSACTION
    DEALLOCATE C
  END

  IF (@bDbcc = 1)
  BEGIN
    DBCC DBREINDEX ( [ut_MwstKennzeichen] )
  END

GO

------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Append_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_Append_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_Append_MwstKennzeichen]
  @Parm_KzMwst char(3)
 ,@Parm_AbYMD char(8)
 ,@Parm_BuchGrp char(10)
 ,@Parm_Satz float
 ,@Parm_SchlDatev char(10)
 ,@Parm_CodeXRng char(10)
 ,@Parm_DrkNull tinyint
 ,@Parm_KtoUSt char(8)
 ,@Parm_KtoMat char(8)
 ,@Parm_KtoLohn char(8)
 ,@Parm_KtoFremd char(8)
 ,@Parm_KtoRab char(8)
 ,@Parm_KtoSonst char(8)
 ,@Parm_KtoAbzug char(8)
 ,@Parm_KtoTeilr char(8)
 ,@Parm_KtoAnzah char(8)
 ,@Parm_MWStKateg char(3)
 ,@Parm_SchlTRDat char(10)
 ,@Parm_KtoTRUSt char(8)
 ,@Parm_SchlAZDat char(10)
 ,@Parm_KtoAZUSt char(8)
 ,@Parm_KzDebSoll tinyint
AS
  DECLARE @NeueId    integer
  SET     @NeueId = (SELECT MAX(RecId) FROM [dbo].[ut_MwstKennzeichen])
  IF @NeueId IS NULL SET @NeueId = 0
  SET @NeueId = @NeueId + 1
  INSERT INTO [dbo].[ut_MwstKennzeichen] (
    RecId
   ,[KzMwst]
   ,[AbYMD]
   ,[BuchGrp]
   ,[Satz]
   ,[SchlDatev]
   ,[CodeXRng]
   ,[DrkNull]
   ,[KtoUSt]
   ,[KtoMat]
   ,[KtoLohn]
   ,[KtoFremd]
   ,[KtoRab]
   ,[KtoSonst]
   ,[KtoAbzug]
   ,[KtoTeilr]
   ,[KtoAnzah]
   ,[MWStKateg]
   ,[SchlTRDat]
   ,[KtoTRUSt]
   ,[SchlAZDat]
   ,[KtoAZUSt]
   ,[KzDebSoll]
     ) VALUES (
    @NeueId
   ,RTRIM(@Parm_KzMwst)
   ,RTRIM(@Parm_AbYMD)
   ,RTRIM(@Parm_BuchGrp)
   ,@Parm_Satz
   ,RTRIM(@Parm_SchlDatev)
   ,RTRIM(@Parm_CodeXRng)
   ,@Parm_DrkNull
   ,RTRIM(@Parm_KtoUSt)
   ,RTRIM(@Parm_KtoMat)
   ,RTRIM(@Parm_KtoLohn)
   ,RTRIM(@Parm_KtoFremd)
   ,RTRIM(@Parm_KtoRab)
   ,RTRIM(@Parm_KtoSonst)
   ,RTRIM(@Parm_KtoAbzug)
   ,RTRIM(@Parm_KtoTeilr)
   ,RTRIM(@Parm_KtoAnzah)
   ,RTRIM(@Parm_MWStKateg)
   ,RTRIM(@Parm_SchlTRDat)
   ,RTRIM(@Parm_KtoTRUSt)
   ,RTRIM(@Parm_SchlAZDat)
   ,RTRIM(@Parm_KtoAZUSt)
   ,@Parm_KzDebSoll
       )
  IF @@ERROR = 0
  BEGIN
    SELECT @NeueId AS RecId
    RETURN
  END
  SELECT 0 AS RecId
GO

------------------------------------------------------------
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_TrSel_MwstKennzeichen')
  DROP PROCEDURE [dbo].[up_TrSel_MwstKennzeichen]
GO
CREATE PROCEDURE [dbo].[up_TrSel_MwstKennzeichen]
AS
  SELECT   RecId,
      LTRIM(RTRIM([KzMwst]))
      +LTRIM(RTRIM([AbYMD]))
      +LTRIM(RTRIM([BuchGrp]))
      +LTRIM(RTRIM([SchlDatev]))
      +LTRIM(RTRIM([CodeXRng]))
      +LTRIM(RTRIM([KtoUSt]))
      +LTRIM(RTRIM([KtoMat]))
      +LTRIM(RTRIM([KtoLohn]))
      +LTRIM(RTRIM([KtoFremd]))
      +LTRIM(RTRIM([KtoRab]))
      +LTRIM(RTRIM([KtoSonst]))
      +LTRIM(RTRIM([KtoAbzug]))
      +LTRIM(RTRIM([KtoTeilr]))
      +LTRIM(RTRIM([KtoAnzah]))
      +LTRIM(RTRIM([MWStKateg]))
      +LTRIM(RTRIM([SchlTRDat]))
      +LTRIM(RTRIM([KtoTRUSt]))
      +LTRIM(RTRIM([SchlAZDat]))
      +LTRIM(RTRIM([KtoAZUSt]))
    AS Data
  FROM     [dbo].[ut_MwstKennzeichen]
  WHERE    RecId > 0
  ORDER BY RecId
GO

CREATE INDEX [Ik_Key00] ON [dbo].[ut_MwstKennzeichen_Keys]
( [Key00_Value],[DataRecId] )
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_First_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_First_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Last_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior50_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next50_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindL_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key00]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindF_MwstKennzeichen_Key00')
  DROP PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key00]
GO

CREATE PROCEDURE [dbo].[up_First_MwstKennzeichen_Key00]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys] ORDER BY [Key00_Value]
GO

CREATE PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key00]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys] ORDER BY [Key00_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key00] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key00_Value] > (SELECT [Key00_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key00_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key00] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key00_Value] < (SELECT [Key00_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key00_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key00] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key00_Value] > (SELECT [Key00_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key00_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key00] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key00_Value] < (SELECT [Key00_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key00_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key00] @xKey char(128),@xLen integer
AS
  SELECT a.[DataRecId] FROM
    ( SELECT TOP 1 [DataRecId],[Key00_Value] AS Key_Value FROM [dbo].[ut_MwstKennzeichen_Keys]
      WHERE [Key00_Value] >= SUBSTRING(@xKey,1,@xLen)
      ORDER BY [Key00_Value]
    ) a
  WHERE a.Key_Value like SUBSTRING(@xKey,1,@xLen)+'%'
GO

CREATE PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key00] @xKey char(128),@xLen integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key00_Value] like SUBSTRING(@xKey,1,@xLen)+'%'
  ORDER BY [Key00_Value] DESC
GO

CREATE INDEX [Ik_Key01] ON [dbo].[ut_MwstKennzeichen_Keys]
( [Key01_Filter],[Key01_Value],[DataRecId] )
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_First_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_First_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Last_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior50_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next50_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindL_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key01]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindF_MwstKennzeichen_Key01')
  DROP PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key01]
GO

CREATE PROCEDURE [dbo].[up_First_MwstKennzeichen_Key01]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 ORDER BY [Key01_Value]
GO

CREATE PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key01]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 ORDER BY [Key01_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key01] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 AND [Key01_Value] > (SELECT [Key01_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key01_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key01] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 AND [Key01_Value] < (SELECT [Key01_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key01_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key01] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 AND [Key01_Value] > (SELECT [Key01_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key01_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key01] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 AND [Key01_Value] < (SELECT [Key01_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key01_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key01] @xKey char(128),@xLen integer
AS
  SELECT a.[DataRecId] FROM
    ( SELECT TOP 1 [DataRecId],[Key01_Value] AS Key_Value FROM [dbo].[ut_MwstKennzeichen_Keys]
      WHERE [Key01_Filter] = 1 AND [Key01_Value] >= SUBSTRING(@xKey,1,@xLen)
      ORDER BY [Key01_Value]
    ) a
  WHERE a.Key_Value like SUBSTRING(@xKey,1,@xLen)+'%'
GO

CREATE PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key01] @xKey char(128),@xLen integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key01_Filter] = 1 AND [Key01_Value] like SUBSTRING(@xKey,1,@xLen)+'%'
  ORDER BY [Key01_Value] DESC
GO

CREATE INDEX [Ik_Key02] ON [dbo].[ut_MwstKennzeichen_Keys]
( [Key02_Value],[DataRecId] )
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_First_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_First_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Last_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Prior50_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_Next50_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindL_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key02]
GO
IF 0 < (SELECT count(*) from [sysobjects] where [xtype] = 'P'   and [name] = 'up_FindF_MwstKennzeichen_Key02')
  DROP PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key02]
GO

CREATE PROCEDURE [dbo].[up_First_MwstKennzeichen_Key02]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys] ORDER BY [Key02_Value]
GO

CREATE PROCEDURE [dbo].[up_Last_MwstKennzeichen_Key02]
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys] ORDER BY [Key02_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next_MwstKennzeichen_Key02] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key02_Value] > (SELECT [Key02_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key02_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior_MwstKennzeichen_Key02] @mRecNo integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key02_Value] < (SELECT [Key02_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key02_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_Next50_MwstKennzeichen_Key02] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key02_Value] > (SELECT [Key02_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key02_Value]
GO

CREATE PROCEDURE [dbo].[up_Prior50_MwstKennzeichen_Key02] @mRecNo integer
AS
  SELECT TOP 50 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key02_Value] < (SELECT [Key02_Value] FROM [dbo].[ut_MwstKennzeichen_Keys] WHERE [DataRecId] = @mRecNo)
  ORDER BY [Key02_Value] DESC
GO

CREATE PROCEDURE [dbo].[up_FindF_MwstKennzeichen_Key02] @xKey char(128),@xLen integer
AS
  SELECT a.[DataRecId] FROM
    ( SELECT TOP 1 [DataRecId],[Key02_Value] AS Key_Value FROM [dbo].[ut_MwstKennzeichen_Keys]
      WHERE [Key02_Value] >= SUBSTRING(@xKey,1,@xLen)
      ORDER BY [Key02_Value]
    ) a
  WHERE a.Key_Value like SUBSTRING(@xKey,1,@xLen)+'%'
GO

CREATE PROCEDURE [dbo].[up_FindL_MwstKennzeichen_Key02] @xKey char(128),@xLen integer
AS
  SELECT TOP 1 [DataRecId] FROM [dbo].[ut_MwstKennzeichen_Keys]
  WHERE [Key02_Value] like SUBSTRING(@xKey,1,@xLen)+'%'
  ORDER BY [Key02_Value] DESC
GO

