bug: arreglado de perdida de precision en amount , y ajuste de la fecha devuelta de pagos.
This commit is contained in:
parent
0b098376c5
commit
305a69667d
|
|
@ -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; }
|
||||
}
|
||||
|
|
@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue