Added the created At in advance payment
This commit is contained in:
parent
07c4e420e9
commit
bd296f3fa8
@ -567,7 +567,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
{
|
||||
Id = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
Name = "Review Pending",
|
||||
DisplayName = "Submit",
|
||||
DisplayName = "Submit for Review",
|
||||
Description = "Reviewer is currently reviewing the expense.",
|
||||
Color = "#696cff",
|
||||
IsSystem = true,
|
||||
@ -1163,7 +1163,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
new RecurringPaymentStatus
|
||||
{
|
||||
Id = Guid.Parse("da462422-13b2-45cc-a175-910a225f6fc8"),
|
||||
Name = "Activated"
|
||||
Name = "Active"
|
||||
},
|
||||
new RecurringPaymentStatus
|
||||
{
|
||||
|
||||
7462
Marco.Pms.DataAccess/Migrations/20251106033822_Added_CreatedAt_In_Advance_Payment_Table.Designer.cs
generated
Normal file
7462
Marco.Pms.DataAccess/Migrations/20251106033822_Added_CreatedAt_In_Advance_Payment_Table.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Marco.Pms.DataAccess.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Added_CreatedAt_In_Advance_Payment_Table : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "PaidAt",
|
||||
table: "AdvancePaymentTransactions",
|
||||
type: "datetime(6)",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "ExpensesStatusMaster",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
column: "DisplayName",
|
||||
value: "Submit for Review");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "RecurringPaymentStatus",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("da462422-13b2-45cc-a175-910a225f6fc8"),
|
||||
column: "Name",
|
||||
value: "Active");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaidAt",
|
||||
table: "AdvancePaymentTransactions");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "ExpensesStatusMaster",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
column: "DisplayName",
|
||||
value: "Submit");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "RecurringPaymentStatus",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("da462422-13b2-45cc-a175-910a225f6fc8"),
|
||||
column: "Name",
|
||||
value: "Activated");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2121,6 +2121,9 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTime>("PaidAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid?>("ProjectId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
@ -2829,7 +2832,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
new
|
||||
{
|
||||
Id = new Guid("da462422-13b2-45cc-a175-910a225f6fc8"),
|
||||
Name = "Activated"
|
||||
Name = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
@ -3413,7 +3416,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
Id = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
Color = "#696cff",
|
||||
Description = "Reviewer is currently reviewing the expense.",
|
||||
DisplayName = "Submit",
|
||||
DisplayName = "Submit for Review",
|
||||
IsActive = true,
|
||||
IsSystem = true,
|
||||
Name = "Review Pending"
|
||||
|
||||
@ -24,6 +24,7 @@ namespace Marco.Pms.Model.Expenses
|
||||
public Employee? Employee { get; set; }
|
||||
public double Amount { get; set; }
|
||||
public double CurrentBalance { get; set; }
|
||||
public DateTime PaidAt { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
|
||||
@ -11,8 +11,9 @@ namespace Marco.Pms.Model.ViewModels.Expenses
|
||||
public BasicProjectVM? Project { get; set; }
|
||||
public BasicEmployeeVM? Employee { get; set; }
|
||||
public double Amount { get; set; }
|
||||
public double CurrentBalance { get; set; }
|
||||
public DateTime PaidAt { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public BasicEmployeeVM? CreatedBy { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
|
||||
@ -772,7 +772,8 @@ namespace Marco.Pms.Services.Service
|
||||
EmployeeId = expense.PaidById,
|
||||
Amount = 0 - expense.Amount,
|
||||
CurrentBalance = lastBalance - expense.Amount,
|
||||
CreatedAt = expense.TransactionDate,
|
||||
PaidAt = expense.TransactionDate,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
CreatedById = loggedInEmployee.Id,
|
||||
IsActive = true,
|
||||
TenantId = tenantId
|
||||
@ -1889,7 +1890,8 @@ namespace Marco.Pms.Services.Service
|
||||
EmployeeId = paymentRequest.CreatedById,
|
||||
Amount = paymentRequest.Amount,
|
||||
CurrentBalance = lastBalance + paymentRequest.Amount,
|
||||
CreatedAt = model.PaidAt!.Value,
|
||||
PaidAt = model.PaidAt!.Value,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
CreatedById = loggedInEmployee.Id,
|
||||
IsActive = true,
|
||||
TenantId = tenantId
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user