Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"

Expand Down
5 changes: 4 additions & 1 deletion 0-Nine.Core/Entities/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public class Invoice : BaseModel
public virtual ICollection<Payment> Payments { get; set; } = new List<Payment>();

// Computed properties
public decimal BalanceDue => Amount + (LateFeeAmount ?? 0) - AmountPaid;
//public decimal BalanceDue => Amount + (LateFeeAmount ?? 0) - AmountPaid;

// Late fee should be already included in the Amount from scheduled tasks or manual run.
public decimal BalanceDue => Amount - AmountPaid;
public bool IsOverdue => Status != "Paid" && DueOn < DateTime.Now;
public int DaysOverdue => IsOverdue ? (DateTime.Now - DueOn).Days : 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
nullable: false,
defaultValue: false);

migrationBuilder.Sql("UPDATE Leases SET IsActive = 1 WHERE Status IN ('Active', 'Pending', 'Notice Given')");

migrationBuilder.CreateIndex(
name: "IX_Leases_IsActive",
table: "Leases",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "");
defaultValue: "Term");
}

/// <inheritdoc />
Expand Down
1 change: 1 addition & 0 deletions 1-Nine.Infrastructure/Nine.Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
<PackageReference Include="SendGrid" Version="9.29.3" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.11" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="3.53.4.1-pre1" />
<PackageReference Include="Twilio" Version="7.14.0" />
<PackageReference Include="QuestPDF" Version="2025.12.1" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.0" />
Expand Down
7 changes: 7 additions & 0 deletions 2-Nine.Application/Services/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,13 @@ private async Task UpdateInvoiceAfterPaymentChangeAsync(Guid invoiceId)
/// </summary>
private async Task ApplyLateFeeIfEligibleAsync(Invoice invoice, Guid? organizationId)
{
// if the late fee has already been applied, skip
if (invoice.LateFeeApplied.HasValue && invoice.LateFeeApplied.Value == true)
{
// Late fee already applied
return;
}

try
{
// Get organization settings
Expand Down
1 change: 1 addition & 0 deletions 2-Nine.Application/Services/ScheduledTaskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ private async Task ProcessOverdueInvoices(
invoice.LateFeeAmount = lateFee;
invoice.LateFeeApplied = true;
invoice.LateFeeAppliedOn = DateTime.UtcNow;
invoice.Amount += lateFee; // Update the total invoice amount to include the late fee
invoice.Notes = string.IsNullOrEmpty(invoice.Notes)
? $"Late fee of {lateFee:C} applied on {DateTime.Now:MMM dd, yyyy}"
: $"{invoice.Notes}\nLate fee of {lateFee:C} applied on {DateTime.Now:MMM dd, yyyy}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@
</div>
</div>

<div class="d-flex gap-2">
<div class="d-flex gap-2 text-align-end justify-content-end">
<button type="button" class="btn btn-secondary" @onclick="() => OnCancel.InvokeAsync()">Cancel</button>
<button type="submit" class="btn btn-primary" disabled="@IsSubmitting">
@if (IsSubmitting)
{
<span class="spinner-border spinner-border-sm me-2" role="status"></span>
}
@SubmitButtonText
</button>
<button type="button" class="btn btn-secondary" @onclick="() => OnCancel.InvokeAsync()">Cancel</button>
</div>
</EditForm>
@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ else
{
<div class="col-md-3">
<div class="mb-3">
<label class="text-muted small">Late Fee</label>
<label class="text-muted small">Includes Late Fee</label>
<div class="fw-bold fs-4 text-warning">@invoice.LateFeeAmount.Value.ToString("C")</div>
</div>
</div>
}
<div class="col-md-3">
<div class="mb-3">
<label class="text-muted small">Paid Amount</label>
<label class="text-muted small">Amount Paid</label>
<div class="fw-bold fs-4 text-success">@invoice.AmountPaid.ToString("C")</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@
</div>
</div>

<div class="d-flex gap-2">
<div class="d-flex gap-2 justify-content-end">
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
<button type="submit" class="btn btn-primary" disabled="@isSubmitting">
@if (isSubmitting)
{
<span class="spinner-border spinner-border-sm me-2" role="status"></span>
}
Create Lease
Save
</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
</div>
</Microsoft.AspNetCore.Components.Forms.EditForm>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ else

@* NotesTimeline removed - product-specific component *@

<div class="d-flex gap-2">
<div class="d-flex gap-2 text-align-right justify-content-end">
<button type="button" class="btn btn-outline-secondary" @onclick="Cancel">Cancel</button>
<button type="button" class="btn btn-secondary" @onclick="ViewLease">View Lease</button>
<button type="submit" class="btn btn-primary" disabled="@isSubmitting">
@if (isSubmitting)
{
<span class="spinner-border spinner-border-sm me-2" role="status"></span>
}
Update Lease
</button>
<button type="button" class="btn btn-secondary" @onclick="ViewLease">View Lease</button>
<button type="button" class="btn btn-outline-secondary" @onclick="Cancel">Cancel</button>
</div>
</Microsoft.AspNetCore.Components.Forms.EditForm>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PropertyForm
Model="@propertyModel"
FormName="create-property"
SubmitButtonText="Create Property"
SubmitButtonText="Save"
IsSubmitting="@isSubmitting"
ErrorMessage="@errorMessage"
OnValidSubmit="@SaveProperty"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else
<PropertyForm
Model="@propertyModel"
FormName="edit-property"
SubmitButtonText="Update Property"
SubmitButtonText="Save"
IsSubmitting="@isSubmitting"
ErrorMessage="@errorMessage"
OnValidSubmit="UpdatePropertyAsync"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ else
}
<div class="mt-2">
<button class="btn btn-sm btn-outline-secondary w-100" @onclick="ViewAllMaintenanceRequests">
<i class="bi bi-list-ul"></i> View All Maintenance Requests
<i class="bi bi-list-ul"></i> View All Repairs
</button>
</div>
}
else
{
<div class="text-center text-muted py-3">
<i class="bi bi-tools" style="font-size: 2rem;"></i>
<p class="mb-0 mt-2">No maintenance requests for this property</p>
<p class="mb-0 mt-2">No repair requests for this property</p>
<button class="btn btn-sm btn-primary mt-2" @onclick="CreateMaintenanceRequest">
<i class="bi bi-plus-circle"></i> Create First Request
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
</div>
</div>

<div class="d-flex gap-2">
<div class="d-flex gap-2 text-align-right justify-content-end">
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
<button type="submit" class="btn btn-primary" disabled="@isSubmitting">
@if (isSubmitting)
{
<span class="spinner-border spinner-border-sm me-2" role="status"></span>
}
Create Tenant
Save
</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
</div>
</Microsoft.AspNetCore.Components.Forms.EditForm>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ else
</div>
</div>

<div class="d-flex gap-2">
<div class="d-flex gap-2 text-align-right justify-content-end">
<button type="button" class="btn btn-outline-secondary" @onclick="Cancel">Cancel</button>
<button type="button" class="btn btn-secondary" @onclick="ViewTenant">View Tenant</button>
<button type="submit" class="btn btn-primary" disabled="@isSubmitting">
@if (isSubmitting)
{
<span class="spinner-border spinner-border-sm me-2" role="status"></span>
}
Update Tenant
</button>
<button type="button" class="btn btn-secondary" @onclick="ViewTenant">View Tenant</button>
<button type="button" class="btn btn-outline-secondary" @onclick="Cancel">Cancel</button>
</div>
</Microsoft.AspNetCore.Components.Forms.EditForm>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ else

private void CreateTenant()
{
Navigation.NavigateTo("/propertymanagement/prospectivetenants");
Navigation.NavigateTo("/propertymanagement/tenants/create");
}

private void ViewTenant(Guid id)
Expand Down
2 changes: 1 addition & 1 deletion 3-Nine.Shared.UI/Nine.Shared.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.13" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion 4-Nine/Features/Administration/Settings/Pages/Licenses.razor
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@
new[] { new LicenseText("License", "licenses/dotnet/LICENSE.txt") }),
new("SQLCipher", "via SQLitePCLRaw 2.1.11", "BSD-style", "Database encryption",
new[] { new LicenseText("License", "licenses/SQLCipher-LICENSE.txt") }),
new("SQLitePCLRaw", "2.1.11", "Apache-2.0", "SQLite / SQLCipher bindings",
new("SQLitePCLRaw.bundle_e_sqlcipher", "2.1.11", "Apache-2.0", "SQLite / SQLCipher bindings",
new[] { new LicenseText("License", "licenses/SQLitePCLRaw-LICENSE.txt") }),
new ComponentLicense(Name:"SQLitePCLRaw.lib.e_sqlite3", Version:"3.53.4.1-pre1", License:"Apache-2.0", Purpose:"SQLite / SQLCipher core library",
new[] { new LicenseText("License", "licenses/SQLitePCLRaw-LICENSE.txt") }),
new("Electron", "30.4.0", "MIT", "Desktop shell (with Chromium)", Array.Empty<LicenseText>()),
new("Electron.NET (ElectronNET.Core)", "0.4.1", "MIT", "Connects the application to Electron",
Expand Down
Loading