allow to filter for canceled invoices (#3415)
This commit is contained in:
@@ -14,9 +14,6 @@ use Symfony\Component\Form\AbstractType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom form field type to select an invoice template.
|
|
||||||
*/
|
|
||||||
class InvoiceStatusType extends AbstractType
|
class InvoiceStatusType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -31,6 +28,7 @@ class InvoiceStatusType extends AbstractType
|
|||||||
'status.' . Invoice::STATUS_NEW => Invoice::STATUS_NEW,
|
'status.' . Invoice::STATUS_NEW => Invoice::STATUS_NEW,
|
||||||
'status.' . Invoice::STATUS_PENDING => Invoice::STATUS_PENDING,
|
'status.' . Invoice::STATUS_PENDING => Invoice::STATUS_PENDING,
|
||||||
'status.' . Invoice::STATUS_PAID => Invoice::STATUS_PAID,
|
'status.' . Invoice::STATUS_PAID => Invoice::STATUS_PAID,
|
||||||
|
'status.' . Invoice::STATUS_CANCELED => Invoice::STATUS_CANCELED,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class InvoiceArchiveQuery extends BaseQuery
|
|||||||
|
|
||||||
public function addStatus(string $status): void
|
public function addStatus(string $status): void
|
||||||
{
|
{
|
||||||
if (!\in_array($status, [Invoice::STATUS_NEW, Invoice::STATUS_PENDING, Invoice::STATUS_PAID])) {
|
if (!\in_array($status, [Invoice::STATUS_NEW, Invoice::STATUS_PENDING, Invoice::STATUS_PAID, Invoice::STATUS_CANCELED])) {
|
||||||
throw new \InvalidArgumentException('Unknown invoice status given.');
|
throw new \InvalidArgumentException('Unknown invoice status given.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user