tomatophp / filament-invoices
使用 FilamentPHP 生成和管理您的发票/付款,支持多货币和多类型
v1.0.4
2024-09-17 16:39 UTC
Requires
- php: ^8.1|^8.2
- filament/filament: ^3.0.0
- tomatophp/console-helpers: ^1.1
- tomatophp/filament-locations: ^1.0
- tomatophp/filament-types: ^1.0
README
Filament Invoices 管理器
使用 FilamentPHP 生成和管理您的发票/付款,支持多货币和多类型
特性
- 生成发票
- 管理发票
- 打印发票
- 发票外观类
- 发票形态转换/转换自
- 发票付款
- 支持多类型
- 支持多货币
- 支持多状态
- 状态管理器
- 发票小部件
- 通过电子邮件发送发票
- 将发票导出为 PDF
- 发票模板
- 发票设置
屏幕截图
安装
composer require tomatophp/filament-invoices
安装您的包后,请运行以下命令
php artisan filament-invoices:install
最后,在 /app/Providers/Filament/AdminPanelProvider.php
上注册插件
->plugin(\TomatoPHP\FilamentInvoices\FilamentInvoicesPlugin::make())
使用
要开始使用此插件,您需要允许两种用户或表来填充发票(从/到),在您准备好模型后,在您的 AppServiceProvider
或任何其他服务提供者中使用此外观类,如下所示
use TomatoPHP\FilamentInvoices\Facades\FilamentInvoices; public function boot() { FilamentInvoices::registerFor([ InvoiceFor::make(Account::class) ->label('Account') ]); FilamentInvoices::registerFrom([ InvoiceFrom::make(Company::class) ->label('Company') ]); }
之后,您可以在 Filament 管理面板中使用此插件
使用外观类创建发票
您可以使用此外观类创建发票,如下所示
\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();
发布资产
您可以通过使用此命令发布配置文件
php artisan vendor:publish --tag="filament-invoices-config"
您可以通过使用此命令发布视图文件
php artisan vendor:publish --tag="filament-invoices-views"
您可以通过使用此命令发布语言文件
php artisan vendor:publish --tag="filament-invoices-lang"
您可以通过使用此命令发布迁移文件
php artisan vendor:publish --tag="filament-invoices-migrations"
其他 Filament 包
查看我们的 Awesome TomatoPHP