Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Late Fee Functionality for Invoices #359

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Dec 24, 2024

This pull request was created by Sweep to resolve the following request by @curtisdelicata:

Description: Add automatic calculation of late fees for overdue invoices.

Tasks:
Modify Invoice model to include late fee settings.
Implement automated calculation of late fees.
Display late fees on overdue invoices.
Acceptance Criteria:
Late fees are calculated and applied to overdue invoices.
Users can configure late fee settings per invoice.

Continue chatting at https://sweep-chat-demo.vercel.app/c/adf9001e-104c-4862-a1b8-4360819185e8.

Purpose

Implement a comprehensive late fee system for invoices to automatically calculate and track additional charges for overdue payments, improving financial management and incentivizing timely payments.

Description

This pull request introduces a robust late fee mechanism for invoices with the following key features:

  • Added new database columns to support late fee calculations
  • Implemented methods in the Invoice model to calculate and manage late fees
  • Created a console command to automatically calculate late fees for overdue invoices
  • Updated Filament resource form to include late fee configuration options
  • Added scheduled task to run daily late fee calculations

The new functionality allows businesses to:

  • Set a late fee percentage
  • Define a grace period for payments
  • Automatically calculate late fees based on invoice due dates
  • Track and apply late fee amounts to outstanding invoices

Summary

  • Added migration 2024_02_24_000000_add_late_fee_columns_to_invoices.php with new invoice columns
  • Updated app/Models/Invoice.php with late fee calculation methods
  • Created app/Console/Commands/CalculateLateFees.php for automated late fee processing
  • Modified app/Filament/App/Resources/InvoiceResource.php to include late fee configuration
  • Updated app/Console/Kernel.php to schedule daily late fee calculations
  • New methods added:
    • calculateLateFee()
    • isOverdue()
    • getTotalWithTaxAndLateFees()

@curtisdelicata curtisdelicata merged commit ffa4f48 into main Dec 24, 2024
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant