# -*- coding: utf-8 -*-
#
# django-codenerix-vending
#
# Codenerix GNU
#
# Project URL : http://www.codenerix.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from django import forms
from django.utils.translation import gettext_lazy as _

from codenerix.forms import GenModelForm
from codenerix_extensions.helpers import get_external_model
from codenerix.widgets import MultiStaticSelect

from codenerix_invoicing.models_sales import SalesBasket, Customer


class BudgetForRegiterUserForm(GenModelForm):
    class Meta:
        model = SalesBasket
        fields = ['customer', ]
        # autofill = {
        #     'address_delivery': ['select', 3, Customer.foreignkey_external_delivery()['related'], 'customer'],
        # }

    def __groups__(self):
        return [
            (
                _('Customer'), 12,
                ['customer', 12],
            )
        ]


class BudgetForEmployeesUserForm(GenModelForm):
    class Meta:
        model = SalesBasket
        fields = ['customer', ]
        # autofill = {
        #     'address_delivery': ['select', 3, Customer.foreignkey_external_delivery()['related'], 'customer'],
        # }

    def __groups__(self):
        return [
            (
                _('Customer'), 12,
                ['customer', 12],
            )
        ]
