on 05-17-2016 8:26 PM
BUEN DIA,
Quiero solicitar su ayuda de como puedo generar un bloqueo a través del transaction notification que no se puedan crear notas de crédito relacionadas a facturas que han sido parcialmente pagadas. la idea es dar un mensaje al usuario de que debe cancelar primeramente el pago parcial para después aplicar la nota de crédito pero por el total de la factura.
AGRADEZCO DE ANTEMANO SU AYUDA
SALUDOS.
Espero que te ayude.. saludos
DECLARE @totalNC NUMERIC(15,2)
DECLARE @totalFC NUMERIC(15,2)
IF @object_type in ('14') AND @transaction_type in ('A')
BEGIN
SET @totalFC=(
SELECT DISTINCT
T3.DocTotal 'TotalFac'
FROM
[dbo].[ORIN] T0 INNER JOIN
[dbo].[RIN1] T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN
[dbo].[INV1] T2 ON T1.BaseEntry = T2.DocEntry AND T1.BaseLine = T2.LineNum AND T1.BaseType = 13 INNER JOIN
[dbo].[OINV] T3 ON T2.DocEntry = T3.DocEntry WHERE T0.DocEntry=@list_of_cols_val_tab_del)
SET @totalNC=(
SELECT DISTINCT
T0.DocTotal 'TotalNC'
FROM
[dbo].[ORIN] T0 INNER JOIN
[dbo].[RIN1] T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN
[dbo].[INV1] T2 ON T1.BaseEntry = T2.DocEntry AND T1.BaseLine = T2.LineNum AND T1.BaseType = 13 INNER JOIN
[dbo].[OINV] T3 ON T2.DocEntry = T3.DocEntry WHERE T0.DocEntry=@list_of_cols_val_tab_del )
IF (@totalNC < > @totalFC)
BEGIN
SET @error = 14
SET @error_message ='No se puede crear la Nota de Credito porque no tiene el mismo valor que la Factura'
END
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Puedes usar como base para el transaction el campo PaidToDate.
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.