Reopen de factura: tratar 204 sin cuerpo como exito y mostrar el motivo de SAP. Versión 2.1.3.0
PostReOpen deserializaba el cuerpo vacio del 204 a null y fallaba al marcar Exito, devolviendo "La Factura no se puede reabrir" aunque SAP la reabria. Picking ahora agrega el mensaje real de SAP a ese error. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e475b7f48c
commit
6386070f4e
3 files changed
+11
-7
No files matched your search
@@ -3,9 +3,9 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AssemblyName>ITCA_API_SAP_WMS</AssemblyName>
|
||||
<Version>2.1.2</Version>
|
||||
<AssemblyVersion>2.1.2.0</AssemblyVersion>
|
||||
<FileVersion>2.1.2.0</FileVersion>
|
||||
<Version>2.1.3</Version>
|
||||
<AssemblyVersion>2.1.3.0</AssemblyVersion>
|
||||
<FileVersion>2.1.3.0</FileVersion>
|
||||
<UserSecretsId>24763424-3300-4c85-87e3-503f8fdebd14</UserSecretsId>
|
||||
<!-- Antes solo estaba condicionado a Debug|AnyCPU - un "dotnet publish -c Release"
|
||||
(lo normal para IIS) se quedaba sin este archivo, y Startup.cs revienta con
|
||||
|
||||
@@ -568,7 +568,11 @@ namespace Net.Connection.ServiceLayer
|
||||
if (response_.StatusCode == System.Net.HttpStatusCode.OK || response_.StatusCode == System.Net.HttpStatusCode.Created || response_.StatusCode == HttpStatusCode.NoContent) // 200 or Created
|
||||
{
|
||||
// DESERIALIZAMOS Content DEL RESPONSE
|
||||
dynamic responseBody = JsonConvert.DeserializeObject<T>(responseText_);
|
||||
// Reopen responde 204 sin cuerpo: DeserializeObject devuelve null, asi que
|
||||
// se crea una instancia vacia para poder marcar el exito.
|
||||
dynamic responseBody = string.IsNullOrWhiteSpace(responseText_)
|
||||
? Activator.CreateInstance<T>()
|
||||
: JsonConvert.DeserializeObject<T>(responseText_);
|
||||
responseBody.Exito = true;
|
||||
var estado = (int)response_.StatusCode;
|
||||
responseBody.CodigoHttp = estado.ToString();
|
||||
@@ -638,7 +642,7 @@ namespace Net.Connection.ServiceLayer
|
||||
}
|
||||
finally
|
||||
{
|
||||
// NO UTILIZAMOS CATCH,
|
||||
// NO UTILIZAMOS CATCH,
|
||||
// PASAMOS LA EXCEPCIÓN A LA APP.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Net.Data.WMS.Picking
|
||||
var Response_Reopen = invoicestRepository.ReOpen(_invoices.DocEntry).Result;
|
||||
if (Response_Reopen.DocEntry == -1)
|
||||
{
|
||||
return resultadoTransaccion.GetInformacionResultado("SAP: La Factura no se puede reabrir", entidad);
|
||||
return resultadoTransaccion.GetInformacionResultado("SAP: La Factura no se puede reabrir. " + Response_Reopen.Message, entidad);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ namespace Net.Data.WMS.Picking
|
||||
var Response_Reopen = invoicestRepository.ReOpen(_invoices.DocEntry).Result;
|
||||
if (Response_Reopen.DocEntry == -1)
|
||||
{
|
||||
return resultadoTransaccion.GetInformacionResultado("SAP: La Factura no se puede reabrir", entidad);
|
||||
return resultadoTransaccion.GetInformacionResultado("SAP: La Factura no se puede reabrir. " + Response_Reopen.Message, entidad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user