1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +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;
PaymentMethodType = transaction.PaymentMethodType;
Details = transaction.Details;
if(transaction.RefundedAmount.HasValue)
{
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;
}
Amount = transaction.Amount;
RefundedAmount = transaction.RefundedAmount;
}
public DateTime CreatedDate { get; set; }