-
-
Notifications
You must be signed in to change notification settings - Fork 94
Add support for configurable invoice sequence scopes #395
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
base: 2.1
Are you sure you want to change the base?
Conversation
3404493 to
3ca816e
Compare
3ca816e to
3353c9a
Compare
| <field name="year" type="integer" nullable="true"/> | ||
| <field name="month" type="integer"/> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not having a sequence_type and an enum of possibilities? If we want to improve this or change the behavior we would be obliged to add one or more columns.
WDYT?
| sylius_invoicing.invoice_save_path: "%kernel.project_dir%/private/invoices/" | ||
| sylius_invoicing.filesystem_adapter.invoice: "sylius_invoicing_invoice" | ||
| sylius_invoicing.sequence_scope: '%env(default::SYLIUS_INVOICING_SEQUENCE_SCOPE)%' | ||
| env(SYLIUS_INVOICING_SEQUENCE_SCOPE): 'global' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with the (anything else or empty): one global sequence.
Either it's global or empty, but "anything else" could lead to future issues with custom developments.
| 'year' => (int) $now->format('Y'), | ||
| 'month' => (int) $now->format('m'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why you have values here.
You wrote "monthly" or "yearly". You didn't specify that we could chose when it happens precisely.
I feel strange about this.
3982118 to
2f4c991
Compare
2f4c991 to
efd462a
Compare
Introduced InvoiceSequenceScopeEnum (monthly, annually, global)
Modified SequentialInvoiceNumberGenerator to support:
Added ENV parameter:
SYLIUS_INVOICING_SEQUENCE_SCOPE=monthlyKept backward compatibility — global behavior is preserved unless explicitly configured