You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-36Lines changed: 63 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,15 @@
1
-
# Manage invoices in your Laravel App
1
+
# Everything You Need to Manage Invoices in Laravel
2
2
3
3
[](https://packagist.org/packages/finller/laravel-invoices)
This package provides a robust, easy-to-use system for managing invoices within a Laravel application, with options for database storage, serial numbering, and PDF generation.
This package provides a simple and reliable way to generate serial numbers automatically, such as "INV240001."
194
198
195
-
This package provid an easy way to generate explicite serial number like "INV-0001" in a safe and automatic way.
199
+
You can configure the format of your serial numbers in the configuration file. The default format is `PPYYCCCC`, where each letter has a specific meaning (see the config file for details).
196
200
197
-
You can configure the format of your serial numbers in the config file. The default format is `PPYYCCCC` (see config to understand the meaning of each letters).
201
+
When `invoices.serial_number.auto_generate` is set to `true`, a unique serial number is assigned to each new invoice automatically.
198
202
199
-
Each time you create a new invoice, and if `invoices.serial_number.auto_generate` is set to `true`, the invoice will be given a unique serial number.
203
+
Serial numbers are generated sequentially, with each new serial number based on the latest available one. To define what qualifies as the `previous` serial number, you can extend the `Finller\Invoice\Invoice` class and override the `getPreviousInvoice` method.
200
204
201
-
Serial number are generated one after the other, the new generated serial number is based on the `previous` one available.
202
-
To determine which is the `previous` serial number you can extends `Finller\Invoice\Invoice`
203
-
and override the `getPreviousInvoice` method.
205
+
By default, the previous invoice is determined based on criteria such as prefix, series, year, and month for accurate, scoped numbering.
204
206
205
-
By default the previous invoice is scoped by prefix, serie, year and month as you would expect.
207
+
## Managing Multiple Prefixes and Series
206
208
207
-
## Managing multiple prefix and multiple series
209
+
In more complex applications, you may need to use different prefixes and/or series for your invoices.
208
210
209
-
In more complex app, you might need to have different prefix and/or series for your invoices.
211
+
For instance, you might want to define a unique series for each user, creating serial numbers that look like: `INV0001-2400X`, where `0001` represents the user’s ID, `24` the year and `X` the index of the invoice.
210
212
211
-
For example, you might want to define a serie for each of your user and having serial numbers looking like: INV0001-00X where 1 is the id of the user.
213
+
> [!NOTE]
214
+
> When using IDs for series, it's recommended to plan for future growth to avoid overflow.
215
+
> Even if you have a limited number of users now, ensure that the ID can accommodate the maximum number of digits allowed by the serial number format.
212
216
213
-
When creating an invoice, you can define the prefix and the serie on the fly like that;
217
+
When creating an invoice, you can dynamically specify the prefix and series as follows:
0 commit comments