Added the created At in advance payment

This commit is contained in:
ashutosh.nehete 2025-11-06 09:16:42 +05:30
parent 07c4e420e9
commit bd296f3fa8
7 changed files with 7534 additions and 7 deletions

View File

@ -567,7 +567,7 @@ namespace Marco.Pms.DataAccess.Data
{ {
Id = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), Id = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
Name = "Review Pending", Name = "Review Pending",
DisplayName = "Submit", DisplayName = "Submit for Review",
Description = "Reviewer is currently reviewing the expense.", Description = "Reviewer is currently reviewing the expense.",
Color = "#696cff", Color = "#696cff",
IsSystem = true, IsSystem = true,
@ -1163,7 +1163,7 @@ namespace Marco.Pms.DataAccess.Data
new RecurringPaymentStatus new RecurringPaymentStatus
{ {
Id = Guid.Parse("da462422-13b2-45cc-a175-910a225f6fc8"), Id = Guid.Parse("da462422-13b2-45cc-a175-910a225f6fc8"),
Name = "Activated" Name = "Active"
}, },
new RecurringPaymentStatus new RecurringPaymentStatus
{ {

File diff suppressed because one or more lines are too long

View File

@ -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");
}
}
}

View File

@ -2121,6 +2121,9 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)"); .HasColumnType("tinyint(1)");
b.Property<DateTime>("PaidAt")
.HasColumnType("datetime(6)");
b.Property<Guid?>("ProjectId") b.Property<Guid?>("ProjectId")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
@ -2829,7 +2832,7 @@ namespace Marco.Pms.DataAccess.Migrations
new new
{ {
Id = new Guid("da462422-13b2-45cc-a175-910a225f6fc8"), Id = new Guid("da462422-13b2-45cc-a175-910a225f6fc8"),
Name = "Activated" Name = "Active"
}, },
new new
{ {
@ -3413,7 +3416,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), Id = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
Color = "#696cff", Color = "#696cff",
Description = "Reviewer is currently reviewing the expense.", Description = "Reviewer is currently reviewing the expense.",
DisplayName = "Submit", DisplayName = "Submit for Review",
IsActive = true, IsActive = true,
IsSystem = true, IsSystem = true,
Name = "Review Pending" Name = "Review Pending"

View File

@ -24,6 +24,7 @@ namespace Marco.Pms.Model.Expenses
public Employee? Employee { get; set; } public Employee? Employee { get; set; }
public double Amount { get; set; } public double Amount { get; set; }
public double CurrentBalance { get; set; } public double CurrentBalance { get; set; }
public DateTime PaidAt { get; set; }
public DateTime CreatedAt { get; set; } public DateTime CreatedAt { get; set; }
public Guid CreatedById { get; set; } public Guid CreatedById { get; set; }

View File

@ -11,8 +11,9 @@ namespace Marco.Pms.Model.ViewModels.Expenses
public BasicProjectVM? Project { get; set; } public BasicProjectVM? Project { get; set; }
public BasicEmployeeVM? Employee { get; set; } public BasicEmployeeVM? Employee { get; set; }
public double Amount { get; set; } public double Amount { get; set; }
public double CurrentBalance { get; set; }
public DateTime PaidAt { get; set; }
public DateTime CreatedAt { get; set; } public DateTime CreatedAt { get; set; }
public BasicEmployeeVM? CreatedBy { get; set; } public BasicEmployeeVM? CreatedBy { get; set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }

View File

@ -772,7 +772,8 @@ namespace Marco.Pms.Services.Service
EmployeeId = expense.PaidById, EmployeeId = expense.PaidById,
Amount = 0 - expense.Amount, Amount = 0 - expense.Amount,
CurrentBalance = lastBalance - expense.Amount, CurrentBalance = lastBalance - expense.Amount,
CreatedAt = expense.TransactionDate, PaidAt = expense.TransactionDate,
CreatedAt = DateTime.UtcNow,
CreatedById = loggedInEmployee.Id, CreatedById = loggedInEmployee.Id,
IsActive = true, IsActive = true,
TenantId = tenantId TenantId = tenantId
@ -1889,7 +1890,8 @@ namespace Marco.Pms.Services.Service
EmployeeId = paymentRequest.CreatedById, EmployeeId = paymentRequest.CreatedById,
Amount = paymentRequest.Amount, Amount = paymentRequest.Amount,
CurrentBalance = lastBalance + paymentRequest.Amount, CurrentBalance = lastBalance + paymentRequest.Amount,
CreatedAt = model.PaidAt!.Value, PaidAt = model.PaidAt!.Value,
CreatedAt = DateTime.UtcNow,
CreatedById = loggedInEmployee.Id, CreatedById = loggedInEmployee.Id,
IsActive = true, IsActive = true,
TenantId = tenantId TenantId = tenantId