from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
from .models import *

###############################################################################
# class is form creatin and def are functions used in class
class SignUpForm(UserCreationForm):
    email = forms.EmailField(label="", widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'Email Address'}))
    first_name = forms.CharField(label="", max_length=100, widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'First Name'}))
    last_name = forms.CharField(label="", max_length=100, widget=forms.TextInput(attrs={'class':'form-control', 'placeholder':'Last Name'}))

    class Meta:
        model = User
        fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2')

    def __init__(self, *args, **kwargs):
        super(SignUpForm, self).__init__(*args, **kwargs)

        self.fields['username'].widget.attrs['class'] = 'form-control'
        self.fields['username'].widget.attrs['placeholder'] = 'User Name'
        self.fields['username'].label = ''
        self.fields['username'].help_text = '<span class="form-text text-muted"><small>Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.</small></span>'

        self.fields['password1'].widget.attrs['class'] = 'form-control'
        self.fields['password1'].widget.attrs['placeholder'] = 'Password'
        self.fields['password1'].label = ''
        self.fields['password1'].help_text = '<ul class="form-text text-muted small"><li>Your password can\'t be too similar to your other personal information.</li><li>Your password must contain at least 8 characters.</li><li>Your password can\'t be a commonly used password.</li><li>Your password can\'t be entirely numeric.</li></ul>'

        self.fields['password2'].widget.attrs['class'] = 'form-control'
        self.fields['password2'].widget.attrs['placeholder'] = 'Confirm Password'
        self.fields['password2'].label = ''
        self.fields['password2'].help_text = '<span class="form-text text-muted"><small>Enter the same password as before, for verification.</small></span>'

class forms_add_contacts(forms.ModelForm):

    id_contact = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"ID", "class":"form-control"}), label="ID") #label is to get description above the field when used in template html like {{form.field }}
    language = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Language", "class":"form-control"}), label="Language")
    gender = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Gender", "class":"form-control"}), label="Gender")
    last_name = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"Last Name", "class":"form-control"}), label="Nom")
    first_name = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"First Name", "class":"form-control"}), label="Prénom")
    phone_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Phone_1", "class":"form-control"}), label="Tel_1")
    phone_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Phone_2", "class":"form-control"}), label="Tel_2")
    email_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Email_1", "class":"form-control"}), label="Email_1")
    email_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder":"Email_2", "class":"form-control"}), label="Email_2")
    test = forms.MultipleChoiceField(required=False,widget=forms.HiddenInput(), label="test")# pour le reglege du .choices voir dans le def __init__ section


    class Meta:
        model = models_add_contacts
        exclude = ("user",)#usefull in every class
        fields = '__all__'

###############################################################################
def get_all_contact_id_list():
    list_all_contact_id = list((item.id_contact , item.contact_last_name+' '+item.contact_first_name) for item in models_contacts.objects.all())
    list_all_contact_id.append(('','')) # to prevent selectbox to choose the first option by default when data in DB is '' with editable.select
    return sorted(list_all_contact_id, key=lambda x: (x[0] == '', *x)) #to put the ('','') at the end of the list

class forms_contacts(forms.ModelForm):
    # this section is to get the ID or PK (primary key) and pass it to a queryset filter to have sales_documents numbers in listbox. it is passed on views.py form = (... pk=pk)
    def __init__(self, *args, **kwargs):
        self.storage_pk = kwargs.pop('pk') #pk is the id of the selected contact
        super(forms_contacts, self).__init__(*args, **kwargs)
        queryset = models_projects.objects.filter(project_last_modification_date=self.storage_pk).values_list('project_denomination', flat=True).exclude(id_project='0') #flat=true to get rid of brackets and comma when populate the widget
        choices = [(var, var) for var in queryset]
        self.fields['test'].choices=choices # populate test if match found in queryset



    id_contact = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id": "id_contact","placeholder":"id_contact", "class":"form-control"}), label="id_contact") #label is to get description above the field when used in template html like {{form.field }}
    contact_last_modification_date = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id': 'contact_last_modification_date', "placeholder": "contact_last_modification_date", "class": "form-control"}), label="contact_last_modification_date")
    contact_last_modification_user = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id': 'contact_last_modification_user', "placeholder": "contact_last_modification_user", "class": "form-control"}), label="contact_last_modification_user")

    contact_all_contact_id = forms.ChoiceField(required=False, choices=get_all_contact_id_list, widget=forms.Select(attrs={'id':'contact_all_contact_id','style': 'width:200px','class': 'my-select'}))
    contact_language = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_language","placeholder":"contact_language", "class":"form-control"}), label="contact_language")
    contact_gender = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_gender","placeholder":"contact_gender", "class":"form-control"}), label="contact_gender")
    contact_last_name = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id": "contact_last_name","placeholder":"contact_last_name", "class":"form-control"}), label="contact_last_name")
    contact_first_name = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_first_name","placeholder":"contact_first_name", "class":"form-control"}), label="contact_first_name")
    contact_phone_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_phone_1","placeholder":"contact_phone_1", "class":"form-control"}), label="contact_phone_1")
    contact_phone_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_phone_2","placeholder":"contact_phone_2", "class":"form-control"}), label="contact_phone_2")
    contact_email_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_email_1","placeholder":"contact_email_1", "class":"form-control"}), label="contact_email_1")
    contact_email_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "contact_email_2","placeholder":"contact_email_2", "class":"form-control"}), label="contact_email_2")
    #regarde = forms.CharField(required=False, widget=forms.widgets.Select(choices=FRUIT_CHOICES), label="regarde")
    # check if there are some sales_documents available in sales_documents DB by searching the pk id of contact in id ref in sales_documents db and if so display checkbox
    test = forms.MultipleChoiceField(required=False,widget=forms.widgets.CheckboxSelectMultiple())# pour le reglege du .choices voir dans le def __init__ section
    #test = forms.ModelMultipleChoiceField(widget=forms.widgets.SelectMultiple, queryset=None) # pour le reglege du queryset voir dans le def __init__ section

    class Meta:
        model = models_contacts
        exclude = ("user",)#usefull in every class
        fields = '__all__'
        widgets = {'test': forms.SelectMultiple}

###############################################################################

class forms_projects(forms.ModelForm):
    id_project = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"id_project", "class":"form-control"}), label="id_project")
    project_last_modification_date = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"project_last_modification_date", "class":"form-control"}), label="project_last_modification_date")
    project_last_modification_user = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"project_last_modification_user", "class":"form-control"}), label="project_last_modification_user")
    project_denomination = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder":"project_denomination", "class":"form-control"}), label="project_denomination")
    project_sales_document = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"project_sales_document","placeholder":"project_sales_document", "class":"form-control"}), label="project_sales_document")
    project_maturity = forms.ChoiceField(required=False, choices=[('', '--'), ('Short', 'Court terme'), ('Middle', 'Moyen terme'), ('Long', 'Long terme'), ('Validated', 'Validé !')], widget=forms.Select(attrs={'id': 'project_maturity','class': 'my-select'}))
    project_credibility = forms.ChoiceField(required=False, choices=[('', '--'), ('High', 'Très crédible'), ('Middle', 'Moyennement crédible'), ('Low', 'Peu crédible'), ('Validated', 'Validé !')], widget=forms.Select(attrs={'id': 'project_credibility','class': 'my-select'}))

    class Meta:
        model = models_projects
        exclude = ("user",)#usefull in every class

###############################################################################

def get_all_company_id_list():
    # to get all existing company in a selectbox (in company_mobile.html for instance)
    list_all_company_id = list((item.id_company , item.company_name) for item in models_companies.objects.all() if not item.id_company =='0')
    list_all_company_id.append(('','')) # to prevent selectbox to choose the first option by default when data in DB is '' with editable.select
    return sorted(list_all_company_id, key=lambda x: (x[0] == '', *x)) #to put the ('','') at the end of the list

class forms_companies(forms.ModelForm):

    id_company = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id':'id_company',"placeholder":"id", "class":"form-control"}), label="id")
    company_last_modification_date = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id':'company_last_modification_date',"placeholder":"company_last_modification_date", "class":"form-control"}), label="company_last_modification_date")
    company_last_modification_user =forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id':'company_last_modification_user',"placeholder":"company_last_modification_user", "class":"form-control"}), label="company_last_modification_user")
    company_all_company_id = forms.ChoiceField(required=False, choices=get_all_company_id_list, widget=forms.Select(attrs={'id':'company_all_company_id','style': 'width:200px','class': 'my-select'})) # to get all existing company in a selectbox (in company_mobile.html for instance)
    company_name = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={'id':'company_name',"placeholder":"company_name", "class":"form-control"}), label="company_name")
    company_members_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={'id':'company_members_id',"placeholder":"company_members_id", "class":"form-control"}), label="company_members_id")
    company_projects_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={'id':'company_projects_id',"placeholder": "company_projects_id", "class": "form-control"}), label="company_projects_id")
    company_addresses_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={'id':'company_addresses_id',"placeholder": "company_addresses_id", "class": "form-control"}), label="company_addresses_id")
    company_vat_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={'id':'company_vat_number',"placeholder":"company_vat_number", "class":"form-control"}), label="company_vat_number")
    company_type = forms.ChoiceField(required=True, choices=[('private','Particulier'),('company','Société')], widget=forms.RadioSelect(attrs={'id': 'company_type','class': 'toggle-button'}))
    company_head_quarter_address_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={'id':'company_head_quarter_address_id',"placeholder":"company_head_quarter_address_id", "class":"form-control"}), label="company_head_quarter_address_id")

    class Meta:
        model = models_companies
        exclude = ("user",)#usefull in every class

###############################################################################

def get_product_denomination_list():# deprecated
    list_product_denomination = list((item.id_product , item.product_denomination) for item in models_products.objects.all())
    list_product_denomination.append(('','')) # to prevent selectbox to choose the first option by default when data in DB is '' with editable.select
    return sorted(list_product_denomination, key=lambda x: (x[0] == '', *x)) #to put the ('','') at the end of the list

class forms_products(forms.ModelForm):

    id_product = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id": "id_product","placeholder":"id_product", "class":"form-control"}), label="id_product")
    product_category = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_category","placeholder":"product_category", "class":"form-control"}), label="product_category")
    product_reference = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_reference","placeholder":"product_reference", "class":"form-control"}), label="product_reference")
    product_denomination = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_denomination","placeholder":"product_denomination", "class":"form-control"}), label="product_denomination")
    product_prix_achat = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_prix_achat","placeholder":"product_prix_achat", "class":"form-control"}), label="product_prix_achat")
    product_prix_vente = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_prix_vente","placeholder": "product_prix_vente", "class": "form-control"}), label="product_prix_vente")
    product_prix_location = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_prix_location","placeholder": "product_prix_location", "class": "form-control"}), label="product_prix_location")
    product_poids = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_poids","placeholder": "product_poids", "class": "form-control"}), label="product_poids")
    product_volume = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_volume","placeholder": "product_volume", "class": "form-control"}), label="product_volume")
    product_dimensions = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_dimensions","placeholder": "product_dimensions", "class": "form-control"}), label="product_dimensions")
    product_consommation = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_consommation","placeholder": "product_consommation", "class": "form-control"}), label="product_consommation")
    product_quantite_colis = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_quantite_colis","placeholder": "product_quantite_colis", "class": "form-control"}), label="product_quantite_colis")
    product_sous_traitant = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "product_sous_traitant","placeholder": "product_sous_traitant", "class": "form-control"}), label="product_sous_traitant")
    product_vat = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'product_vat', 'class': 'my-select'}))


    class Meta:
        model = models_products
        exclude = ("user",)#usefull in every class

###############################################################################

class forms_sales_documents_infos(forms.ModelForm):

    id_sales_documents = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id": "id_sales_documents", 'style': 'text-align:center', "placeholder": "id_sales_documents", "class": "form-control"}), label="id_sales_documents")


    sales_documents_rent_or_sale = forms.ChoiceField(required=False,choices=[('rent', 'Location'),('sale', 'Vente')],widget=forms.RadioSelect(attrs={"id":"sales_documents_rent_or_sale",'class': 'toggle-button'}),label="sales_documents_rent_or_sale")
    sales_documents_expiration_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_expiration_date"}), label="sales_documents_expiration_date")
    sales_documents_denomination = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_denomination"}), label="sales_documents_denomination")
    sales_documents_last_modification_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_last_modification_date"}), label="sales_documents_last_modification_date")

    sales_documents_quote_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quote_number"}), label="sales_documents_quote_number")
    sales_documents_purchase_order_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_purchase_order_number"}), label="sales_documents_purchase_order_number")
    sales_documents_delivery_note_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_delivery_note_number"}), label="sales_documents_delivery_note_number")
    sales_documents_invoice_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_invoice_number"}), label="sales_documents_invoice_number")

    #sales_documents_timeline_step = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_timeline_step"}), label="sales_documents_timeline_step")
    class Meta:
        model = models_sales_documents
        fields = [
            "id_sales_documents",
            "sales_documents_rent_or_sale",
            "sales_documents_expiration_date",
            "sales_documents_denomination",
            "sales_documents_last_modification_date",
            "sales_documents_quote_number",
            "sales_documents_purchase_order_number",
            "sales_documents_delivery_note_number",
            "sales_documents_invoice_number"

        ]
        exclude = ("user",) #usefull in every class

class forms_sales_documents_billing(forms.ModelForm):
    #sales_documents_ref_contact_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_ref_contact_id"}), label="sales_documents_ref_contact_id")
    sales_documents_billing_address_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_billing_address_id", "placeholder": "sales_documents_billing_address", "class": "form-control"}), label="sales_documents_billing_address")
    class Meta:
        model = models_sales_documents
        fields = ["sales_documents_billing_address_id",
                  ]
        exclude = ("user",) #usefull in every class

class forms_sales_documents_delivery(forms.ModelForm):
    sales_documents_delivery_address_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_delivery_address_id", "placeholder": "sales_documents_delivery_address", "class": "form-control"}), label="sales_documents_delivery_address")
    class Meta:
        model = models_sales_documents
        fields = ["sales_documents_delivery_address_id"]
        exclude = ("user",) #usefull in every class

class forms_sales_documents_products(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Déclaration des 25 selectbox 'sales_documents_description_(x)' SANS ID car ils sont definit en html.
        # pour leur assigner un required=false car ils sont créés direct en html dans sales_documents_products.html
        # pour eviter que le form.is_valid() dans la view sales_documents_all_forms_save_without_refresh renvoi des erreur
        # on pourrait aussi les declarer un par un dans chaque bloc
        for i in range(1, 26):
            field_name = f"sales_documents_description_{i}"
            self.fields[field_name] = forms.CharField(required=False)


    #sales_documents_quote_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quote_number",'style':'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder":"sales_documents_quote_number", "class":"form-control"}), label="sales_documents_quote_number") # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    #sales_documents_purchase_order_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_purchase_order_number",'style':'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder":"sales_documents_purchase_order_number", "class":"form-control"}), label="sales_documents_purchase_order_number") # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    #sales_documents_delivery_note_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_delivery_note_number",'style':'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder":"sales_documents_delivery_note_number", "class":"form-control"}), label="sales_documents_delivery_note_number") # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    #sales_documents_invoice_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_invoice_number",'style':'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder":"sales_documents_invoice_number", "class":"form-control"}), label="sales_documents_invoice_number") # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified


    sales_documents_index_line_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_1", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_1")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_1", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_1")
    #sales_documents_description_1 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_1', 'style': 'width:200px'}))
    sales_documents_description_free_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_1", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(1,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(1,"regular")', 'oninput': 'sales_documents_limit_free_description_length(1)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_1")
    sales_documents_price_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_1", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_1")
    sales_documents_discount_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_1", 'style': 'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_1")
    sales_documents_calculated_price_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_1", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_1")
    sales_documents_discounted_price_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_1", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_1")
    sales_documents_vat_1 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id':'sales_documents_vat_1','class': 'my-select'}))

    sales_documents_index_line_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_2", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_2")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_2", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_2")
    #sales_documents_description_2 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_2', 'style': 'width:200px'}))
    sales_documents_description_free_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_2", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(2,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(2,"regular")', 'oninput': 'sales_documents_limit_free_description_length(2)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_2")
    sales_documents_price_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_2", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_2")
    sales_documents_discount_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_2", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder": "", "class": "form-control"}), label="sales_documents_discount_2")
    sales_documents_calculated_price_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_2", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_2")
    sales_documents_discounted_price_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_2", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_2")
    sales_documents_vat_2 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_2', 'class': 'my-select'}))

    sales_documents_index_line_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_3", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_3")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_3", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_3")
    #sales_documents_description_3 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_3', 'style': 'width:200px'}))
    sales_documents_description_free_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_3", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(3,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(3,"regular")', 'oninput': 'sales_documents_limit_free_description_length(3)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_3")
    sales_documents_price_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_3", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_3")
    sales_documents_discount_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_3", 'style': 'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_3")
    sales_documents_calculated_price_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_3", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_3")
    sales_documents_discounted_price_3 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_3", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_3")
    sales_documents_vat_3 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_3', 'class': 'my-select'}))

    sales_documents_index_line_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_4", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_4")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_4", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_4")
    #sales_documents_description_4 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_4', 'style': 'width:200px'}))
    sales_documents_description_free_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_4", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(4,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(4,"regular")', 'oninput': 'sales_documents_limit_free_description_length(4)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_4")
    sales_documents_price_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_4", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_4")
    sales_documents_discount_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_4", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_4")
    sales_documents_calculated_price_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_4", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_4")
    sales_documents_discounted_price_4 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_4", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_4")
    sales_documents_vat_4 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_4', 'class': 'my-select'}))

    sales_documents_index_line_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_5", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_5")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_5", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_5")
    #sales_documents_description_5 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_5', 'style': 'width:200px'}))
    sales_documents_description_free_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_5", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(5,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(5,"regular")', 'oninput': 'sales_documents_limit_free_description_length(5)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_5")
    sales_documents_price_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_5", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_5")
    sales_documents_discount_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_5", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_5")
    sales_documents_calculated_price_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_5", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_5")
    sales_documents_discounted_price_5 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_5", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_5")
    sales_documents_vat_5 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_5', 'class': 'my-select'}))

    sales_documents_index_line_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_6", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_6")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_6", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_6")
    #sales_documents_description_6 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_6', 'style': 'width:200px'}))
    sales_documents_description_free_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_6", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(6,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(6,"regular")', 'oninput': 'sales_documents_limit_free_description_length(6)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_6")
    sales_documents_price_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_6", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_6")
    sales_documents_discount_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_6", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_6")
    sales_documents_calculated_price_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_6", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_6")
    sales_documents_discounted_price_6 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_6", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_6")
    sales_documents_vat_6 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_6', 'class': 'my-select'}))

    sales_documents_index_line_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_7",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder": "", "class": "form-control"}),label="sales_documents_index_line_7")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_7", 'style': 'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder": "", "class": "form-control"}),label="sales_documents_quantity_7")
    #sales_documents_description_7 = forms.ChoiceField(required=False, choices=get_product_denomination_list,widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_7','style': 'width:200px'}))
    sales_documents_description_free_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_7", 'style': 'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(7,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(7,"regular")', 'oninput': 'sales_documents_limit_free_description_length(7)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_7")
    sales_documents_price_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_7", 'style': 'text-align:center','onchange': 'calculate_sales_documents_product_price(this.id,this.value)',"placeholder": "", "class": "form-control"}), label="sales_documents_price_7")
    sales_documents_discount_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_7", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}),label="sales_documents_discount_7")
    sales_documents_calculated_price_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_7", 'style': 'text-align:center', "placeholder": "","class": "form-control"}), label="sales_documents_calculated_price_7")
    sales_documents_discounted_price_7 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_7", 'style': 'text-align:center', "placeholder": "","class": "form-control"}), label="sales_documents_discounted_price_7")
    sales_documents_vat_7 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_7', 'class': 'my-select'}))

    sales_documents_index_line_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_8",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_8")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_8", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_8")
    #sales_documents_description_8 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_8', 'style': 'width:200px'}))
    sales_documents_description_free_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_8", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(8,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(8,"regular")', 'oninput': 'sales_documents_limit_free_description_length(8)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_8")
    sales_documents_price_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_8", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_8")
    sales_documents_discount_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_8", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_8")
    sales_documents_calculated_price_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_8", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_8")
    sales_documents_discounted_price_8 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_8", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_8")
    sales_documents_vat_8 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_8', 'class': 'my-select'}))

    sales_documents_index_line_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_9",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_9")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_9", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_9")
    #sales_documents_description_9 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_9', 'style': 'width:200px'}))
    sales_documents_description_free_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_9", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(9,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(9,"regular")', 'oninput': 'sales_documents_limit_free_description_length(9)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_9")
    sales_documents_price_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_9", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_9")
    sales_documents_discount_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_9", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_9")
    sales_documents_calculated_price_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_9", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_9")
    sales_documents_discounted_price_9 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_9", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_9")
    sales_documents_vat_9 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_9', 'class': 'my-select'}))

    sales_documents_index_line_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_10",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_10")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_10", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_10")
    #sales_documents_description_10 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_10', 'style': 'width:200px'}))
    sales_documents_description_free_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_10", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(10,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(10,"regular")', 'oninput': 'sales_documents_limit_free_description_length(10)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_10")
    sales_documents_price_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_10", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_10")
    sales_documents_discount_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_10", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_10")
    sales_documents_calculated_price_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_10", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_10")
    sales_documents_discounted_price_10 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_10", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_10")
    sales_documents_vat_10 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_10', 'class': 'my-select'}))

    sales_documents_index_line_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_11",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_11")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_11", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_11")
    #sales_documents_description_11 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_11', 'style': 'width:200px'}))
    sales_documents_description_free_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_11", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(11,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(11,"regular")', 'oninput': 'sales_documents_limit_free_description_length(11)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_11")
    sales_documents_price_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_11", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_11")
    sales_documents_discount_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_11", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_11")
    sales_documents_calculated_price_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_11", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_11")
    sales_documents_discounted_price_11 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_11", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_11")
    sales_documents_vat_11 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_11', 'class': 'my-select'}))

    sales_documents_index_line_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_12",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_12")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_12", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_12")
    #sales_documents_description_12 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_12', 'style': 'width:200px'}))
    sales_documents_description_free_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_12", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(12,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(12,"regular")', 'oninput': 'sales_documents_limit_free_description_length(12)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_12")
    sales_documents_price_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_12", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_12")
    sales_documents_discount_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_12", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_12")
    sales_documents_calculated_price_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_12", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_12")
    sales_documents_discounted_price_12 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_12", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_12")
    sales_documents_vat_12 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_12', 'class': 'my-select'}))

    sales_documents_index_line_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_13",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_13")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_13", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_13")
    #sales_documents_description_13 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_13', 'style': 'width:200px'}))
    sales_documents_description_free_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_13", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(13,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(13,"regular")', 'oninput': 'sales_documents_limit_free_description_length(13)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_13")
    sales_documents_price_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_13", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_13")
    sales_documents_discount_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_13", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_13")
    sales_documents_calculated_price_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_13", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_13")
    sales_documents_discounted_price_13 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_13", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_13")
    sales_documents_vat_13 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_13', 'class': 'my-select'}))

    sales_documents_index_line_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_14", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_14")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_14", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_14")
    #sales_documents_description_14 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_14', 'style': 'width:200px'}))
    sales_documents_description_free_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_14", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(14,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(14,"regular")', 'oninput': 'sales_documents_limit_free_description_length(14)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_14")
    sales_documents_price_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_14", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_14")
    sales_documents_discount_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_14", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_14")
    sales_documents_calculated_price_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_14", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_14")
    sales_documents_discounted_price_14 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_14", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_14")
    sales_documents_vat_14 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_14', 'class': 'my-select'}))

    sales_documents_index_line_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_15",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_15")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_15", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_15")
    #sales_documents_description_15 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_15', 'style': 'width:200px'}))
    sales_documents_description_free_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_15", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(15,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(15,"regular")', 'oninput': 'sales_documents_limit_free_description_length(15)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_15")
    sales_documents_price_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_15", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_15")
    sales_documents_discount_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_15", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_15")
    sales_documents_calculated_price_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_15", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_15")
    sales_documents_discounted_price_15 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_15", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_15")
    sales_documents_vat_15 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_15', 'class': 'my-select'}))

    sales_documents_index_line_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_16",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_16")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_16", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_16")
    #sales_documents_description_16 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_16', 'style': 'width:200px'}))
    sales_documents_description_free_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_16", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(16,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(16,"regular")', 'oninput': 'sales_documents_limit_free_description_length(16)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_16")
    sales_documents_price_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_16", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_16")
    sales_documents_discount_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_16", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_16")
    sales_documents_calculated_price_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_16", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_16")
    sales_documents_discounted_price_16 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_16", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_16")
    sales_documents_vat_16 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_16', 'class': 'my-select'}))

    sales_documents_index_line_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_17",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_17")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_17", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_17")
    #sales_documents_description_17 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_17', 'style': 'width:200px'}))
    sales_documents_description_free_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_17", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(17,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(17,"regular")', 'oninput': 'sales_documents_limit_free_description_length(17)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_17")
    sales_documents_price_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_17", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_17")
    sales_documents_discount_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_17", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_17")
    sales_documents_calculated_price_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_17", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_17")
    sales_documents_discounted_price_17 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_17", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_17")
    sales_documents_vat_17 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_17', 'class': 'my-select'}))

    sales_documents_index_line_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_18",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_18")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_18", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_18")
    #sales_documents_description_18 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_18', 'style': 'width:200px'}))
    sales_documents_description_free_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_18", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(18,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(18,"regular")', 'oninput': 'sales_documents_limit_free_description_length(18)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_18")
    sales_documents_price_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_18", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_18")
    sales_documents_discount_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_18", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_18")
    sales_documents_calculated_price_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_18", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_18")
    sales_documents_discounted_price_18 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_18", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_18")
    sales_documents_vat_18 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_18', 'class': 'my-select'}))

    sales_documents_index_line_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_19",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_19")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_19", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_19")
    #sales_documents_description_19 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_19', 'style': 'width:200px'}))
    sales_documents_description_free_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_19", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(19,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(19,"regular")', 'oninput': 'sales_documents_limit_free_description_length(19)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_19")
    sales_documents_price_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_19", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_19")
    sales_documents_discount_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_19", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_19")
    sales_documents_calculated_price_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_19", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_19")
    sales_documents_discounted_price_19 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_19", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_19")
    sales_documents_vat_19 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_19', 'class': 'my-select'}))

    sales_documents_index_line_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_20",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_20")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_20", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_20")
    #sales_documents_description_20 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_20', 'style': 'width:200px'}))
    sales_documents_description_free_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_20", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(20,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(20,"regular")', 'oninput': 'sales_documents_limit_free_description_length(20)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_20")
    sales_documents_price_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_20", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_20")
    sales_documents_discount_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_20", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_20")
    sales_documents_calculated_price_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_20", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_20")
    sales_documents_discounted_price_20 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_20", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_20")
    sales_documents_vat_20 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_20', 'class': 'my-select'}))

    sales_documents_index_line_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_21",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_21")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_21", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_21")
    #sales_documents_description_21 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_21', 'style': 'width:200px'}))
    sales_documents_description_free_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_21", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(21,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(21,"regular")', 'oninput': 'sales_documents_limit_free_description_length(21)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_21")
    sales_documents_price_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_21", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_21")
    sales_documents_discount_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_21", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_21")
    sales_documents_calculated_price_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_21", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_21")
    sales_documents_discounted_price_21 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_21", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_21")
    sales_documents_vat_21 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_21', 'class': 'my-select'}))

    sales_documents_index_line_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_22", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_22")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_22", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_22")
    #sales_documents_description_22 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_22', 'style': 'width:200px'}))
    sales_documents_description_free_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_22", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(22,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(22,"regular")', 'oninput': 'sales_documents_limit_free_description_length(22)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_22")
    sales_documents_price_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_22", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_22")
    sales_documents_discount_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_22", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_22")
    sales_documents_calculated_price_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_22", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_22")
    sales_documents_discounted_price_22 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_22", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_22")
    sales_documents_vat_22 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_22', 'class': 'my-select'}))

    sales_documents_index_line_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_23",'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_23")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_23", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_23")
    #sales_documents_description_23 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_23', 'style': 'width:200px'}))
    sales_documents_description_free_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_23", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(23,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(23,"regular")', 'oninput': 'sales_documents_limit_free_description_length(23)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_23")
    sales_documents_price_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_23", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_23")
    sales_documents_discount_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_23", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_23")
    sales_documents_calculated_price_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_23", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_23")
    sales_documents_discounted_price_23 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_23", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_23")
    sales_documents_vat_23 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_23', 'class': 'my-select'}))

    sales_documents_index_line_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_24", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_24")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_24", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_24")
    #sales_documents_description_24 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_24', 'style': 'width:200px'}))
    sales_documents_description_free_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_24", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', 'onfocus': 'sales_documents_free_description_edit_mode(24,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(24,"regular")', 'oninput': 'sales_documents_limit_free_description_length(24)',  "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_24")
    sales_documents_price_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_24", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_24")
    sales_documents_discount_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_24", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_24")
    sales_documents_calculated_price_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_24", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_24")
    sales_documents_discounted_price_24 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_24", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_24")
    sales_documents_vat_24 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_24', 'class': 'my-select'}))

    sales_documents_index_line_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_index_line_25", 'readonly': 'readonly','tabindex': '-1', 'style': 'pointer-events: none;text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_index_line_25")  # be carefull, if setting id in attrs, id name must beggin with 'id_rest_of_name' like it does when no id is specified
    sales_documents_quantity_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_quantity_25", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_quantity_25")
    #sales_documents_description_25 = forms.ChoiceField(required=False, choices=get_product_denomination_list, widget=forms.Select(attrs={'id': 'sales_documents_editable_select_description_25', 'style': 'width:200px'}))
    sales_documents_description_free_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_description_free_25", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)',  'onfocus': 'sales_documents_free_description_edit_mode(25,"wide")', 'onblur': 'sales_documents_free_description_edit_mode(25,"regular")', 'oninput': 'sales_documents_limit_free_description_length(25)', "placeholder": "", "class": "form-control"}), label="sales_documents_description_free_25")
    sales_documents_price_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_price_25", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_price_25")
    sales_documents_discount_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discount_25", 'style': 'text-align:center', 'onchange': 'calculate_sales_documents_product_price(this.id,this.value)', "placeholder": "", "class": "form-control"}), label="sales_documents_discount_25")
    sales_documents_calculated_price_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_calculated_price_25", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_calculated_price_25")
    sales_documents_discounted_price_25 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_discounted_price_25", 'style': 'text-align:center', "placeholder": "", "class": "form-control"}), label="sales_documents_discounted_price_25")
    sales_documents_vat_25 = forms.ChoiceField(required=False, choices=[('', ''),('0', '0%'),('5', '5%'),('10', '10%'),('20', '20%')], widget=forms.Select(attrs={'id': 'sales_documents_vat_25', 'class': 'my-select'}))

    class Meta:
        model = models_sales_documents
        fields = [  # liste explicite de tous les champs que tu veux gérer
            #"sales_documents_quote_number",
            #"sales_documents_purchase_order_number",
            #"sales_documents_delivery_note_number",
            #"sales_documents_invoice_number",
            "sales_documents_index_line_1", "sales_documents_quantity_1", "sales_documents_description_free_1", "sales_documents_price_1", "sales_documents_discount_1", "sales_documents_calculated_price_1", "sales_documents_discounted_price_1","sales_documents_vat_1",
            "sales_documents_index_line_2", "sales_documents_quantity_2", "sales_documents_description_free_2", "sales_documents_price_2", "sales_documents_discount_2", "sales_documents_calculated_price_2", "sales_documents_discounted_price_2",
            "sales_documents_index_line_3", "sales_documents_quantity_3", "sales_documents_description_free_3", "sales_documents_price_3", "sales_documents_discount_3", "sales_documents_calculated_price_3", "sales_documents_discounted_price_3",
            "sales_documents_index_line_4", "sales_documents_quantity_4", "sales_documents_description_free_4", "sales_documents_price_4", "sales_documents_discount_4", "sales_documents_calculated_price_4", "sales_documents_discounted_price_4",
            "sales_documents_index_line_5", "sales_documents_quantity_5", "sales_documents_description_free_5", "sales_documents_price_5", "sales_documents_discount_5", "sales_documents_calculated_price_5", "sales_documents_discounted_price_5",
            "sales_documents_index_line_6", "sales_documents_quantity_6", "sales_documents_description_free_6", "sales_documents_price_6", "sales_documents_discount_6", "sales_documents_calculated_price_6", "sales_documents_discounted_price_6",
            "sales_documents_index_line_7", "sales_documents_quantity_7", "sales_documents_description_free_7", "sales_documents_price_7", "sales_documents_discount_7", "sales_documents_calculated_price_7", "sales_documents_discounted_price_7",
            "sales_documents_index_line_8", "sales_documents_quantity_8", "sales_documents_description_free_8", "sales_documents_price_8", "sales_documents_discount_8", "sales_documents_calculated_price_8", "sales_documents_discounted_price_8",
            "sales_documents_index_line_9", "sales_documents_quantity_9", "sales_documents_description_free_9", "sales_documents_price_9", "sales_documents_discount_9", "sales_documents_calculated_price_9", "sales_documents_discounted_price_9",
            "sales_documents_index_line_10", "sales_documents_quantity_10", "sales_documents_description_free_10", "sales_documents_price_10", "sales_documents_discount_10", "sales_documents_calculated_price_10", "sales_documents_discounted_price_10",
            "sales_documents_index_line_11", "sales_documents_quantity_11", "sales_documents_description_free_11", "sales_documents_price_11", "sales_documents_discount_11", "sales_documents_calculated_price_11", "sales_documents_discounted_price_11",
            "sales_documents_index_line_12", "sales_documents_quantity_12", "sales_documents_description_free_12", "sales_documents_price_12", "sales_documents_discount_12", "sales_documents_calculated_price_12", "sales_documents_discounted_price_12",
            "sales_documents_index_line_13", "sales_documents_quantity_13", "sales_documents_description_free_13", "sales_documents_price_13", "sales_documents_discount_13", "sales_documents_calculated_price_13", "sales_documents_discounted_price_13",
            "sales_documents_index_line_14", "sales_documents_quantity_14", "sales_documents_description_free_14", "sales_documents_price_14", "sales_documents_discount_14", "sales_documents_calculated_price_14", "sales_documents_discounted_price_14",
            "sales_documents_index_line_15", "sales_documents_quantity_15", "sales_documents_description_free_15", "sales_documents_price_15", "sales_documents_discount_15", "sales_documents_calculated_price_15", "sales_documents_discounted_price_15",
            "sales_documents_index_line_16", "sales_documents_quantity_16", "sales_documents_description_free_16", "sales_documents_price_16", "sales_documents_discount_16", "sales_documents_calculated_price_16", "sales_documents_discounted_price_16",
            "sales_documents_index_line_17", "sales_documents_quantity_17", "sales_documents_description_free_17", "sales_documents_price_17", "sales_documents_discount_17", "sales_documents_calculated_price_17", "sales_documents_discounted_price_17",
            "sales_documents_index_line_18", "sales_documents_quantity_18", "sales_documents_description_free_18", "sales_documents_price_18", "sales_documents_discount_18", "sales_documents_calculated_price_18", "sales_documents_discounted_price_18",
            "sales_documents_index_line_19", "sales_documents_quantity_19", "sales_documents_description_free_19", "sales_documents_price_19", "sales_documents_discount_19", "sales_documents_calculated_price_19", "sales_documents_discounted_price_19",
            "sales_documents_index_line_20", "sales_documents_quantity_20", "sales_documents_description_free_20", "sales_documents_price_20", "sales_documents_discount_20", "sales_documents_calculated_price_20", "sales_documents_discounted_price_20",
            "sales_documents_index_line_21", "sales_documents_quantity_21", "sales_documents_description_free_21", "sales_documents_price_21", "sales_documents_discount_21", "sales_documents_calculated_price_21", "sales_documents_discounted_price_21",
            "sales_documents_index_line_22", "sales_documents_quantity_22", "sales_documents_description_free_22", "sales_documents_price_22", "sales_documents_discount_22", "sales_documents_calculated_price_22", "sales_documents_discounted_price_22",
            "sales_documents_index_line_23", "sales_documents_quantity_23", "sales_documents_description_free_23", "sales_documents_price_23", "sales_documents_discount_23", "sales_documents_calculated_price_23", "sales_documents_discounted_price_23",
            "sales_documents_index_line_24", "sales_documents_quantity_24", "sales_documents_description_free_24", "sales_documents_price_24", "sales_documents_discount_24", "sales_documents_calculated_price_24", "sales_documents_discounted_price_24",
            "sales_documents_index_line_25", "sales_documents_quantity_25", "sales_documents_description_free_25", "sales_documents_price_25", "sales_documents_discount_25", "sales_documents_calculated_price_25", "sales_documents_discounted_price_25",
        ]

        exclude = ("user",) #usefull in every class
        # company_interactions_history = forms.CharField(required=False, widget=forms.widgets.Textarea(attrs={"style": "height:300px" , "placeholder": "company_interactions_history", "class": "form-control"}), label="company_interactions_history")

class forms_sales_documents_payment_conditions(forms.ModelForm):
    sales_documents_payment_conditions = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_payment_conditions", "placeholder": "sales_documents_payment_conditions", "class": "form-control"}), label="sales_documents_payment_conditions")
    sales_documents_payment_due_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_payment_due_date", "placeholder": "sales_documents_payment_due_date", "class": "form-control"}), label="sales_documents_payment_due_date")

    #sales_documents_deposit_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_deposit_id"}), label="sales_documents_deposit_id")
    #sales_documents_deposit_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_deposit_date"}), label="sales_documents_deposit_date")
    #sales_documents_deposit_amount = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_deposit_amount"}), label="sales_documents_deposit_amount")
    #sales_documents_deposit_method = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "sales_documents_deposit_method"}), label="sales_documents_deposit_method")
    class Meta:
        model = models_sales_documents
        fields = ["sales_documents_payment_conditions",
                  "sales_documents_payment_due_date",]
        exclude = ("user",) #usefull in every class

###############################################################################

class forms_interactions(forms.ModelForm):
        id_interaction = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id": "id_interaction","placeholder": "id_interaction", "class": "form-control"}), label="id_interaction")
        interaction_full_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_full_date","placeholder": "interaction_full_date", "class": "form-control"}), label="interaction_full_date")
        interaction_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_date","placeholder": "interaction_date", "class": "form-control"}), label="interaction_date")
        interaction_time = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_time","placeholder": "interaction_time", "class": "form-control"}), label="interaction_time")
        interaction_user = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_user","placeholder": "interaction_user", "class": "form-control"}), label="interaction_user")
        interaction_contact_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_contact_id","placeholder": "interaction_contact_id", "class": "form-control"}), label="interaction_contact_id")
        interaction_company_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_company_id","placeholder": "interaction_company_id", "class": "form-control"}), label="interaction_company_id")
        interaction_project_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id": "interaction_project_id","placeholder": "interaction_project_id", "class": "form-control"}), label="interaction_project_id")
        interaction_content = forms.CharField(required=True, widget=forms.widgets.Textarea(attrs={"id": "interaction_content","style": "width:300px; height:300px; resize: none; line-height: 1.2;", "placeholder": "interaction_content"}), label="interaction_content")
        interaction_type = forms.ChoiceField(required=True, choices=[('Entrant','Entrant'),('Sortant','Sortant')], widget=forms.RadioSelect(attrs={'id': 'interaction_type','class': 'radio-compact'}))
        interaction_mode = forms.ChoiceField(required=True, choices=[('Appel','Appel'),('Rdv','Rdv'),('Email','Email'),('Sms','Sms'),('WhatsApp','WhatsApp')], widget=forms.RadioSelect(attrs={'id': 'interaction_mode','class': 'radio-compact'}))
        class Meta:
            model = models_interactions
            exclude = ("user",)  # usefull in every class

###############################################################################

class forms_addresses(forms.ModelForm):
    id_address = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id":"id_address","placeholder": "id_address", "class": "form-control"}), label="id_address")
    address_last_modification_date = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id":"address_last_modification_date","placeholder": "address_last_modification_date", "class": "form-control"}), label="address_last_modification_date")
    address_last_modification_user = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id":"address_last_modification_user","placeholder": "address_last_modification_user", "class": "form-control"}), label="address_last_modification_user")
    address_title = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"id":"address_title","placeholder": "address_title", "class": "form-control"}), label="address_title")
    address_type = forms.ChoiceField(required=False, choices=[('', '--'), ('Billing', 'Facturation'), ('Delivery', 'Livraison'), ('Both', 'Facturation + Livraison')], widget=forms.Select(attrs={'id': 'address_type','class': 'my-select'}))
    address_number = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_number","placeholder": "address_number", "class": "form-control"}), label="address_number")
    address_street_name_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_street_name_1","placeholder": "address_street_name_1", "class": "form-control"}), label="address_street_name_1")
    address_street_name_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_street_name_2","placeholder": "address_street_name_2", "class": "form-control"}), label="address_street_name_2")
    address_floor = forms.ChoiceField(required=False, choices=[('', '--'), ('Ground floor', 'RDC'), ('1', '1'), ('2', '2')], widget=forms.Select(attrs={'id': 'address_floor','class': 'my-select'}))
    address_postal_code = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_postal_code","placeholder": "address_postal_code", "class": "form-control"}), label="address_postal_code")
    address_city = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_city","placeholder": "address_city", "class": "form-control"}), label="address_city")
    address_country = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_country","placeholder": "address_country", "class": "form-control"}), label="address_country")
    address_digicode_1 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_digicode_1","placeholder": "address_digicode_1", "class": "form-control"}), label="address_digicode_1")
    address_digicode_2 = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"id":"address_digicode_2","placeholder": "address_digicode_2", "class": "form-control"}), label="address_digicode_2")

    class Meta:
        model = models_addresses
        exclude = ("user",)  # usefull in every class

###############################################################################

class forms_alerts(forms.ModelForm):
    id_alert = forms.CharField(required=True, widget=forms.widgets.TextInput(attrs={"placeholder": "id", "class": "form-control"}), label="id")
    alert_date = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder": "company_name", "class": "form-control"}), label="company_name")
    alert_content = forms.CharField(required=False, widget=forms.widgets.Textarea(attrs={"style": "width:200px; height:500px; resize: none", "placeholder": "content here"}), label="content")
    alert_contact_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder": "company_name", "class": "form-control"}), label="company_name")
    alert_project_id = forms.CharField(required=False, widget=forms.widgets.TextInput(attrs={"placeholder": "company_name", "class": "form-control"}), label="company_name")

    class Meta:
        model = models_alerts
        exclude = ("user",)  # usefull in every class