fix
This commit is contained in:
@@ -18,8 +18,8 @@ public class AccountMotionRequest
|
||||
public DateTime Date { get; set; }
|
||||
public string Motion { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public decimal Plus { get; set; }
|
||||
public decimal Minus { get; set; }
|
||||
public decimal? Plus { get; set; }
|
||||
public decimal? Minus { get; set; }
|
||||
}
|
||||
|
||||
public static class AccountMotionViewModelExtension
|
||||
@@ -34,8 +34,8 @@ public static class AccountMotionRequestExtension
|
||||
{
|
||||
Date = input.Date,
|
||||
Motion = input.Motion,
|
||||
Minus = input.Minus,
|
||||
Plus = input.Plus,
|
||||
Minus = input.Minus ?? 0,
|
||||
Plus = input.Plus ?? 0,
|
||||
Description = input.Description,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace MyOffice.Web.Models.Currency;
|
||||
|
||||
public class CurrencyEditModel
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string ShortName { get; set; } = null!;
|
||||
public int Quantity { get; set; }
|
||||
public decimal Rate { get; set; }
|
||||
public DateTime RateDate { get; set; }
|
||||
}
|
||||
@@ -8,7 +8,9 @@
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public string Code { get; set; } = null!;
|
||||
public string Symbol { get; set; } = null!;
|
||||
public string Name { get; set; } = null!;
|
||||
public string ShortName { get; set; } = null!;
|
||||
public decimal? Rate { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public DateTime? RateDate { get; set; }
|
||||
@@ -22,7 +24,9 @@
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Code = input.CurrencyGlobal!.Id,
|
||||
Symbol = input.CurrencyGlobal!.Symbol,
|
||||
Name = input.Name,
|
||||
ShortName = input.ShortName,
|
||||
Quantity = rate?.Quantity,
|
||||
Rate = rate?.Rate,
|
||||
RateDate = rate?.DateTime,
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace MyOffice.Web.Models.Motion
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
using MyOffice.Data.Models.Motions;
|
||||
|
||||
public class AccountMotionViewModel
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public DateTime Date { get; set; }
|
||||
public string Motion { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public decimal Plus { get; set; }
|
||||
public decimal Minus { get; set; }
|
||||
}
|
||||
|
||||
public static class AccountMotionViewModelExtensions
|
||||
{
|
||||
public static AccountMotionViewModel ToModel(this AccountMotion input)
|
||||
{
|
||||
return new AccountMotionViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Date = input.DateTime,
|
||||
Motion = input.Motion.MotionGlobal.Name,
|
||||
Description = input.Description,
|
||||
Plus = input.AmountPlus,
|
||||
Minus = input.AmountMinus,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace MyOffice.Web.Models.Motion
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
public class AccountMotionsGetModel
|
||||
{
|
||||
[Required]
|
||||
public DateTime From { get; set; }
|
||||
[Required]
|
||||
public DateTime To { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace MyOffice.Web.Models.WeatherForecast;
|
||||
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string? Summary { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user