From 305a69667db1a3e86287dc2c68b61f2bf13bf782 Mon Sep 17 00:00:00 2001 From: javiermengual Date: Fri, 6 Feb 2026 18:47:39 +0100 Subject: [PATCH] bug: arreglado de perdida de precision en amount , y ajuste de la fecha devuelta de pagos. --- DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs | 4 ++-- DoliMiddlewareApi/Mappers/InvoiceMapper.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs b/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs index f751820..5f3765b 100644 --- a/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs +++ b/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs @@ -3,8 +3,8 @@ namespace DoliMiddlewareApi.Dtos.query; public class InvoicePaymentDto { public required string @Ref { get; set; } - public DateTime PaymentDate { get; set; } + public DateOnly PaymentDate { get; set; } public string? Type { get; set; } public string? TransactionNum { get; set; } - public int Amount { get; set; } + public decimal Amount { get; set; } } \ No newline at end of file diff --git a/DoliMiddlewareApi/Mappers/InvoiceMapper.cs b/DoliMiddlewareApi/Mappers/InvoiceMapper.cs index fb2d612..3197dd9 100644 --- a/DoliMiddlewareApi/Mappers/InvoiceMapper.cs +++ b/DoliMiddlewareApi/Mappers/InvoiceMapper.cs @@ -118,11 +118,11 @@ public static class InvoiceMapper { Ref = response.@ref ?? "", PaymentDate = DateTime.TryParseExact(response.date, "yyyy-MM-dd HH:mm:ss", - CultureInfo.InvariantCulture, DateTimeStyles.None, out var date) ? date : DateTime.MinValue, + CultureInfo.InvariantCulture, DateTimeStyles.None, out var date) ? DateOnly.FromDateTime(date) : DateOnly.MinValue, Type = response.type ?? "", TransactionNum = response.num ?? "", Amount = decimal.TryParse(response.amount, NumberStyles.Any, CultureInfo.InvariantCulture, - out decimal amount) ? (int)Math.Round(amount, 0) : 0 + out decimal amount) ? Math.Round(amount, 2) : 0 }; } } \ No newline at end of file