<commit_before>from pprint import pprint

from django import forms

from o2.forms.widget_attrs import FormWidgetAttrs

from utils.functions.strings import is_only_digits

from systextil.models.base import Empresa


class BuscaNFRecebidaForm(forms.Form):
    a = FormWidgetAttrs()

    empresa = forms.ChoiceField(
        required=True,
        initial=None
    )

    CHOICES = [
        ('0', "0-Nota Calculada"),
        ('1', "1-Nota Emitida"),
        ('2', "2-Nota Cancelada"),
        ('3', "3-Nota Incompleta"),
        ('4', "4-Nota de Fornecedor"),
        ('5', "5-Nota Incompleta"),
    ]
    sit_entr = forms.ChoiceField(
        label='Situação da entrada',
        choices=CHOICES,
        initial='4'
    )

    dt_de = forms.DateField(
        label='Data recebimento: De',
        required=False,
        widget=forms.DateInput(
            attrs={'type': 'date'})
    )

    dt_ate = forms.DateField(
        label='Até', required=False,
        widget=forms.DateInput(
            attrs={'type': 'date'})
    )

    niv = forms.IntegerField(
        label='Nível',
        min_value=1,
        max_value=9,
        required=False,
        widget=forms.TextInput(
            attrs={
                'size': 1,
                **a.number,
            }<commit_msg>BuscaNFRecebidaForm sit_entr passa a ser opcional<commit_after>from pprint import pprint

from django import forms

from o2.forms.widget_attrs import FormWidgetAttrs

from utils.functions.strings import is_only_digits

from systextil.models.base import Empresa


class BuscaNFRecebidaForm(forms.Form):
    a = FormWidgetAttrs()

    empresa = forms.ChoiceField(
        required=True,
        initial=None
    )

    CHOICES = [
        ('', "-- Não filtra --"),
        ('0', "0-Nota Calculada"),
        ('1', "1-Nota Emitida"),
        ('2', "2-Nota Cancelada"),
        ('3', "3-Nota Incompleta"),
        ('4', "4-Nota de Fornecedor"),
        ('5', "5-Nota Incompleta"),
    ]
    sit_entr = forms.ChoiceField(
        label='Situação da entrada',
        required=False,
        choices=CHOICES,
        initial='4'
    )

    dt_de = forms.DateField(
        label='Data recebimento: De',
        required=False,
        widget=forms.DateInput(
            attrs={'type': 'date'})
    )

    dt_ate = forms.DateField(
        label='Até', required=False,
        widget=forms.DateInput(
            attrs={'type': 'date'})
    )

    niv = forms.IntegerField(
        label='Nível',
        min_value=1,
        max_value=9,
        required=False,
        widget=forms.TextInput(
            attrs={
                'size': 1,
                **a.number,
            }
{'fraction_non_alphanumeric': 0.1293233082706767, 'fraction_numerical': 0.012781954887218045, 'mean_word_length': 2.0238636363636364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5812359', 'n_tokens_mistral': 883, 'n_tokens_neox': 863, 'n_words': 172}