# Reversión TOT en DMS

**PROCESO PARA REVERSION DE TOT**

1. Crear en el módulo 0103 los tipos de documentos para reversión de la misma manera como fueron creadas las TOT, pero con SW=31

![](/files/-M_MokJA0orRQC534Vpl)

![](/files/-M_MokJBY98nVx-aKoiz)

1. Correr el siguiente trigger sobre la tabla documentos:

CREATE TRIGGER co\_devol\_tot ON documentos FOR INSERT,UPDATE AS

BEGIN

\--Julián Ocampo - Septiembre 18/2008

\--Este trigger aplica para sw 31 que se realicen por el módulo 1607

\--La condición obligatoria ES HACER CRUCE RAPIDO CON LA TOT DE INMEDIATO

DECLARE @sw smallint

DECLARE @tipo varchar(4)

DECLARE @numero int

DECLARE @prefijo varchar(10)

DECLARE @documento varchar(10)

DECLARE @tipo\_tot varchar(4)

DECLARE @numero\_tot int

DECLARE @orden int

SELECT @sw=sw, @tipo=tipo, @numero=numero, @prefijo=prefijo, @documento=documento FROM inserted

\--Aca deben incluirse los tipos de documentos SW 31 que podrán reversar las TOT

IF (@tipo in ('DORC','DORS'))

&#x20;     BEGIN

&#x20;     \--Obtener el tipo y el numero de la TOT que están reversando

&#x20;     SELECT @tipo\_tot=prefijo, @numero\_tot=convert(int,documento) FROM documentos WHERE tipo=@tipo and numero=@numero

&#x20;     \--Obtener la orden de servicio a la cual pertenece la TOT

&#x20;     SELECT @orden=convert(int,documento) FROM documentos where tipo=@tipo\_tot and numero=@numero\_tot

&#x20;     \--Borrar la TOT de la orden de servicio

&#x20;     DELETE FROM tall\_detalle\_orden WHERE numero=@orden and tipo\_sal=@tipo\_tot and numero\_sal=@numero\_tot

&#x20;     END

END

1. Realizar la TOT por el módulo 4109 como normalmente se realiza:

![](/files/-M_MokJChzDjy8dQjvce)

1. Vemos el efecto en el programa 4103:

![](/files/-M_MokJDqtSrUD_nYmrQ)

1. Supongamos que ahora requerimos realizar una reversión porque estamos en otro mes, la idea es manejar el módulo 1607:

Lo primero que se debe hacer es seleccionar el tipo de devolución de la TOT que se requiere según el caso

![](/files/-M_MokJE9lC5bDghlJdd)

Sin indicar ningún otro dato dentro del programa, hacer click en el botón **REVERTIR UN 1608,** nos abre la siguiente pantalla donde debemos digitar el tipo y el número de la TOT a reversar:

![](/files/-M_MokJFBQO0-26ipPmN)

Es indispensable que SIEMPRE ESTÉ MARCADA LA OPCION DE CRUCE RAPIDO DESPUÉS DE ACTUALIZAR. Luego se hace click en el botón Hacer Documento de Reversión:

![](/files/-M_MokJGv3q1NYqS_v6E)

![](/files/-M_MokJHhI5wnZzVgNZr)

![](/files/-M_MokJIyNcgTv4IZBtP)

Se selecciona la TOT y se cruza.

El sistema produce el siguiente documento:

![](/files/-M_MokJJzVjEoz7vw1tO)

Con los mismos valores de la TOT pero contabilizados inversamente

![](/files/-M_MokJKZk7hDXoEJ6lq)

Analizando el tercero en cartera:

![](/files/-M_MokJLLfWROM9H_4jm)

Y lo mejor del tema y la conclusión última:

![](/files/-M_MokJMXXlb-28ubKhO)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://desarrollo-ti.gitbook.io/enlaces-ti/dms/reversion-tot-en-dms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
