import django_filters
from waldur_core.core import filters as core_filters

from . import models


class InvoiceFilter(django_filters.FilterSet):
    customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
    customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
    state = django_filters.MultipleChoiceFilter(choices=models.Invoice.States.CHOICES)

    class Meta(object):
        model = models.Invoice
        fields = ('year', 'month')

import django_filters
from waldur_core.core import filters as core_filters

from . import models


class InvoiceFilter(django_filters.FilterSet):
    customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
    customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
    state = django_filters.MultipleChoiceFilter(choices=models.Invoice.States.CHOICES)
    o = django_filters.OrderingFilter(fields=(('year', 'month'),))

    class Meta(object):
        model = models.Invoice
        fields = ('year', 'month')

Allow to filter invoices by date
Allow to filter invoices by date [WAL-2340]

  import django_filters
  from waldur_core.core import filters as core_filters
  
  from . import models
  
  
  class InvoiceFilter(django_filters.FilterSet):
      customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
      customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
      state = django_filters.MultipleChoiceFilter(choices=models.Invoice.States.CHOICES)
+     o = django_filters.OrderingFilter(fields=(('year', 'month'),))
  
      class Meta(object):
          model = models.Invoice
          fields = ('year', 'month')
  
Allow to filter invoices by date
## Code Before:
import django_filters
from waldur_core.core import filters as core_filters

from . import models


class InvoiceFilter(django_filters.FilterSet):
    customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
    customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
    state = django_filters.MultipleChoiceFilter(choices=models.Invoice.States.CHOICES)

    class Meta(object):
        model = models.Invoice
        fields = ('year', 'month')

## Instruction:
Allow to filter invoices by date
## Code After:
import django_filters
from waldur_core.core import filters as core_filters

from . import models


class InvoiceFilter(django_filters.FilterSet):
    customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
    customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
    state = django_filters.MultipleChoiceFilter(choices=models.Invoice.States.CHOICES)
    o = django_filters.OrderingFilter(fields=(('year', 'month'),))

    class Meta(object):
        model = models.Invoice
        fields = ('year', 'month')
