tomatophp/filament-invoices

Generate and manage your invoices / payments using multi currencies and multi types in FilamentPHP

Fund package maintenance!
3x1io

v1.0.4 2024-09-17 16:39 UTC

This package is auto-updated.

Last update: 2024-11-14 13:24:49 UTC


README

Screenshot

Filament Invoices Manager

Latest Stable Version License Downloads

Generate and manage your invoices / payments using multi currencies and multi types in FilamentPHP

Features

  • Generate Invoices
  • Manage Invoices
  • Print Invoices
  • Invoices Facade Class
  • Invoices Morph From/For
  • Invoices Payments
  • Support Multi Type
  • Support Multi Currency
  • Support Multi Status
  • Status Manager
  • Invoices Widgets
  • Send Invoice using Email
  • Export Invoice as PDF
  • Invoices Templates
  • Invoices Settings

Screenshots

Home Create Edit View Print Logs Status Payments Payment Amount

Installation

composer require tomatophp/filament-invoices

after install your package please run this command

php artisan filament-invoices:install

finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentInvoices\FilamentInvoicesPlugin::make())

Using

to start use this plugin you need to allow 2 types of users or table to fill the invoices from / for after you prepare your models use this Facade class like this on your AppServiceProvider or any other service provider

use TomatoPHP\FilamentInvoices\Facades\FilamentInvoices;
use TomatoPHP\FilamentInvoices\Services\Contracts\InvoiceFor;
use TomatoPHP\FilamentInvoices\Services\Contracts\InvoiceFrom;

public function boot()
{
    FilamentInvoices::registerFor([
        InvoiceFor::make(Account::class)
            ->label('Account')
    ]);
    FilamentInvoices::registerFrom([
        InvoiceFrom::make(Company::class)
            ->label('Company')
    ]);
}

after that you can use the plugin on your filament admin panel

Use Facade Class To Create Invoice

you can use this Facade class to create invoice like this

\TomatoPHP\FilamentInvoices\Facades\FilamentInvoices::create()
    ->for(\App\Models\Account::find(1))
    ->from(\App\Models\Account::find(2))
    ->dueDate(now()->addDays(7))
    ->date(now())
    ->items([
        \TomatoPHP\FilamentInvoices\Services\Contracts\InvoiceItem::make('Item 1')
            ->description('Description 1')
            ->qty(2)
            ->price(100),
        \TomatoPHP\FilamentInvoices\Services\Contracts\InvoiceItem::make('Item 2')
            ->description('Description 2')
            ->qty(1)
            ->discount(10)
            ->vat(10)
            ->price(200),
    ])->save();            

Publish Assets

you can publish config file by use this command

php artisan vendor:publish --tag="filament-invoices-config"

you can publish views file by use this command

php artisan vendor:publish --tag="filament-invoices-views"

you can publish languages file by use this command

php artisan vendor:publish --tag="filament-invoices-lang"

you can publish migrations file by use this command

php artisan vendor:publish --tag="filament-invoices-migrations"

Other Filament Packages

Checkout our Awesome TomatoPHP