NC: guardar en ITCA_LOG_INTEGRACION el JSON enviado al Service Layer cuando SAP rechaza. Versión 2.1.5.0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ded1638cd0
commit
1ce0da7735
4 files changed
+66
-3
No files matched your search
@@ -6,6 +6,7 @@ using Net.Business.Entities.ServicesLayer.CreditNotes;
|
||||
using Net.Connection;
|
||||
using Net.Connection.ServiceLayer;
|
||||
using Net.CrossCotting;
|
||||
using Net.Data.HelperData.Log;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
@@ -50,6 +51,8 @@ namespace Net.Data.ServicesLayer.CreditNotes
|
||||
|
||||
if (!data.Exito)
|
||||
{
|
||||
// Solo si SAP rechaza: guarda el JSON enviado al Service Layer para poder revisarlo
|
||||
HelperLogServiceLayer.AddError("NotaCredito Error", DocEntryOrigen(entidad), entidad, data.Mensaje);
|
||||
return resultadoTransaccion.GetInformacionResultado(-1, -1, data.Mensaje);
|
||||
}
|
||||
|
||||
@@ -57,10 +60,17 @@ namespace Net.Data.ServicesLayer.CreditNotes
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HelperLogServiceLayer.AddError("NotaCredito Error", DocEntryOrigen(entidad), entidad, ex.Message);
|
||||
return resultadoTransaccion.GetInformacionResultado(-1, -1, ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// DocEntry del documento base (factura o solicitud de devolucion) de la primera linea
|
||||
private static string DocEntryOrigen(BE_CreditNotesNotes entidad)
|
||||
{
|
||||
return entidad?.DocumentLines?.Count > 0 ? entidad.DocumentLines[0].BaseEntry?.ToString() : null;
|
||||
}
|
||||
|
||||
|
||||
public async Task<BE_ResultadoTransaccion<BE_BaseResponseSap>> UpdateCreateCreditNotes(dynamic entidad, int DocEntry)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user