diff --git a/project/customer/forms.py b/project/customer/forms.py index 248730d..c05094e 100644 --- a/project/customer/forms.py +++ b/project/customer/forms.py @@ -110,7 +110,7 @@ class IpUserProfileForm(UserProfileForm): # фио главбуха 'glavbuh_surname', 'glavbuh_name', 'glavbuh_midname', # контактная информация - адреса, телефон, факс, почта, сайт - 'address', 'real_address', 'phone_code', 'phone', 'fax_code', 'fax', 'email', 'site', + 'address', 'jur_address', 'real_address', 'phone_code', 'phone', 'fax_code', 'fax', 'email', 'site', # подписи, печать и логотип 'boss_sign', 'glavbuh_sign', 'stamp', 'logo', 'tmb_logo', 'tmb_boss_sign', 'tmb_glavbuh_sign', 'tmb_stamp', @@ -286,6 +286,7 @@ class UserProfileFiltersForm(MyBaseModelForm): new_initial['show_ogrn'] = bool(profile.ogrn) new_initial['show_okpo'] = bool(profile.okpo) new_initial['show_glavbuh'] = bool(profile.get_glavbuh_fio()) + new_initial['show_jur_address'] = bool(profile.jur_address) new_initial['show_real_address'] = bool(profile.real_address) new_initial['show_phone'] = bool(profile.get_full_phone()) new_initial['show_fax'] = bool(profile.get_full_fax()) @@ -301,12 +302,12 @@ class UserProfileFiltersForm(MyBaseModelForm): new_initial['show_full_name'] = bool(profile.full_name) new_initial['show_kpp'] = bool(profile.kpp) new_initial['show_na_osnovanii'] = bool(profile.na_osnovanii) - new_initial['show_jur_address'] = bool(profile.jur_address) else: new_initial['show_inn'] = bool(profile.inn) new_initial['show_ogrn'] = bool(profile.ogrn) new_initial['show_okpo'] = bool(profile.okpo) new_initial['show_glavbuh'] = bool(profile.get_glavbuh_fio()) + new_initial['show_jur_address'] = bool(profile.jur_address) new_initial['show_real_address'] = bool(profile.real_address) new_initial['show_phone'] = bool(profile.get_full_phone()) new_initial['show_fax'] = bool(profile.get_full_fax()) @@ -322,7 +323,6 @@ class UserProfileFiltersForm(MyBaseModelForm): new_initial['show_full_name'] = bool(profile.full_name) new_initial['show_kpp'] = bool(profile.kpp) new_initial['show_na_osnovanii'] = bool(profile.na_osnovanii) - new_initial['show_jur_address'] = bool(profile.jur_address) if initial: initial.update(new_initial) @@ -356,6 +356,7 @@ class UserProfileFiltersForm(MyBaseModelForm): if not profile.ogrn: f['show_ogrn'].widget.attrs['disabled'] = 'disabled' if not profile.okpo: f['show_okpo'].widget.attrs['disabled'] = 'disabled' if not profile.get_glavbuh_fio(): f['show_glavbuh'].widget.attrs['disabled'] = 'disabled' + if not profile.jur_address: f['show_jur_address'].widget.attrs['disabled'] = 'disabled' if not profile.real_address: f['show_real_address'].widget.attrs['disabled'] = 'disabled' if not profile.get_full_phone(): f['show_phone'].widget.attrs['disabled'] = 'disabled' if not profile.get_full_fax(): f['show_fax'].widget.attrs['disabled'] = 'disabled' @@ -373,7 +374,6 @@ class UserProfileFiltersForm(MyBaseModelForm): if not profile.kpp: f['show_kpp'].widget.attrs['disabled'] = 'disabled' if not profile.boss_title: f['show_org_boss_title_and_fio'].widget.attrs['disabled'] = 'disabled' if not profile.na_osnovanii: f['show_na_osnovanii'].widget.attrs['disabled'] = 'disabled' - if not profile.jur_address: f['show_jur_address'].widget.attrs['disabled'] = 'disabled' # блокировать чекбоксы, т.к.эти реквизиты юзеру выключать нельзя if self._profile_type == consts.IP_PROFILE: @@ -389,7 +389,6 @@ class IpUserProfileFiltersForm(UserProfileFiltersForm): change_labels = { 'show_profile_type': dict(consts.PROFILE_TYPES)[_profile_type], 'show_ogrn': u'ОГРНИП', - 'show_real_address': u'Адрес', } class Meta(UserProfileFiltersForm.Meta): @@ -405,6 +404,7 @@ class IpUserProfileFiltersForm(UserProfileFiltersForm): 'show_bank_account', 'bank_account', 'show_contact_info', + 'show_jur_address', 'show_real_address', 'show_phone', 'show_fax', diff --git a/project/customer/models.py b/project/customer/models.py index df12ac9..b95521d 100644 --- a/project/customer/models.py +++ b/project/customer/models.py @@ -62,9 +62,13 @@ class UserProfile(models.Model): glavbuh_name = models.CharField(u'Имя', max_length=30, blank=True, default='') glavbuh_midname = models.CharField(u'Отчество', max_length=30, blank=True, default='') - address = models.CharField(u'Адрес для документов', max_length=256, default='', + address = models.CharField(u'Фактический адрес', max_length=256, default='', help_text=u'Будет подставляться в создаваемые счета, акты и накладные.') - real_address = models.CharField(u'Фактический адрес', max_length=256, blank=True, default='', + + jur_address = models.CharField(u'Юридический адрес', max_length=256, blank=True, default='', + help_text=u'Как в учредительных документах.') + + real_address = models.CharField(u'Почтовый адрес', max_length=256, blank=True, default='', help_text=u'Используется только для карточки компании.') phone_code = models.CharField(u'Код города', max_length=10, blank=True, default='') @@ -90,9 +94,6 @@ class UserProfile(models.Model): kpp = models.CharField(u'КПП', max_length=9, default='') - jur_address = models.CharField(u'Юридический (почтовый) адрес', max_length=256, blank=True, default='', - help_text=u'Как в учредительных документах.') - boss_title = models.CharField(u'Должность руководителя', max_length=256, blank=True, default='') na_osnovanii = models.CharField(u'Действует на основании', max_length=256, blank=True, default='') @@ -371,7 +372,8 @@ class UserProfileFilters(models.Model): null=True, default=None) show_contact_info = models.BooleanField(u'Контактная информация', default=True) - show_real_address = models.BooleanField(u'Фактический адрес', default=True) + show_jur_address = models.BooleanField(u'Юридический адрес', default=True) + show_real_address = models.BooleanField(u'Почтовый адрес', default=True) show_phone = models.BooleanField(u'Телефон', default=True) show_fax = models.BooleanField(u'Факс', default=True) show_email = models.BooleanField(u'Электронная почта', default=True) @@ -390,7 +392,6 @@ class UserProfileFilters(models.Model): show_kpp = models.BooleanField(u'КПП', default=True) show_org_boss_title_and_fio = models.BooleanField(u'Руководитель (Должность, ФИО)', default=True) show_na_osnovanii = models.BooleanField(u'Действует на основании', default=True) - show_jur_address = models.BooleanField(u'Юридический адрес', default=True) objects = managers.UserProfileFiltersManager() diff --git a/project/templates/customer/profile/as_pdf.html b/project/templates/customer/profile/as_pdf.html index e9f68ff..28c2596 100644 --- a/project/templates/customer/profile/as_pdf.html +++ b/project/templates/customer/profile/as_pdf.html @@ -73,13 +73,9 @@ {% if filters.show_contact_info %}