1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01:00

amounts are positive always

This commit is contained in:
Kyle Spearrin 2019-02-23 07:53:47 -05:00
parent e2df614cd5
commit b0c90bc4b3

View File

@ -93,25 +93,8 @@ namespace Bit.Core.Models.Business
Type = transaction.Type; Type = transaction.Type;
PaymentMethodType = transaction.PaymentMethodType; PaymentMethodType = transaction.PaymentMethodType;
Details = transaction.Details; Details = transaction.Details;
Amount = transaction.Amount;
if(transaction.RefundedAmount.HasValue) RefundedAmount = transaction.RefundedAmount;
{
RefundedAmount = Math.Abs(transaction.RefundedAmount.Value);
}
switch(transaction.Type)
{
case TransactionType.Charge:
case TransactionType.Credit:
case TransactionType.PromotionalCredit:
case TransactionType.ReferralCredit:
Amount = -1 * Math.Abs(transaction.Amount);
break;
case TransactionType.Refund:
Amount = Math.Abs(transaction.Amount);
break;
default:
break;
}
} }
public DateTime CreatedDate { get; set; } public DateTime CreatedDate { get; set; }