﻿set xact_abort on;
go

begin transaction;
go

set ANSI_NULLS on;
go

/*************************************
* STORED PROCEDURE sp_delRow
* 	elimina un set di dati a partire dalla riga di una commessa
*
* modif.:	S.E.L.
* il:		2008.10.23
**************************************/
alter PROCEDURE sp_delRow
(
	@Original_Cod VARCHAR(50)
)
AS

BEGIN TRAN

	-- cancello ULP child
	DELETE FROM IstObj
	WHERE     (IdxObjMamma = @Original_Cod) 

	-- cancello riga...
	DELETE FROM IstObj
	WHERE     (IdxObj = @Original_Cod) 

COMMIT TRAN

RETURN
go

/*************************************
* STORED PROCEDURE sp_schedaIdent
*       restituisce i dati x stampare 1 scheda di identificazione
*
* modif.:       S.E.L.
* il:           2012.02.13
**************************************/
alter PROCEDURE sp_schedaIdent
(
       @IdxObj VARCHAR(50)
)
AS

SELECT	Cod AS IdxObj, CodCliente + ' - ' + Cliente AS Cliente, DDT, DataDDT AS DDT_del, DataArrivo, descrizione AS CodProdotto, DataPrevista AS ConsegnaPrevista, Peso,
		CASE CodCli WHEN 'Fosf' THEN 'X' ELSE ' ' END AS FosfManganese, CASE CodCli WHEN 'Brun' THEN 'X' ELSE ' ' END AS Brunitura, 
		CASE CodCli WHEN 'Fosf_Tefl' THEN 'X' ELSE ' ' END AS FosfTeflon, CASE CodCli WHEN 'Sabb' THEN 'X' ELSE ' ' END AS Sabbiatura, ' ' AS F1, ' ' AS F2, 
        ' ' AS FosfZinco, ' ' AS Teflon, ' ' AS FosfPreVern, ' ' AS PzRoto, ' ' AS Zinchlorex, ' ' AS PeekVicote, CodCli
FROM    v_ULP
WHERE   (Cod = @IdxObj)

RETURN
go

commit;
go




-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(131, GETDATE())
GO
