本文整理汇总了Python中lucterios.CORE.parameters.Params.getvalue方法的典型用法代码示例。如果您正苦于以下问题:Python Params.getvalue方法的具体用法?Python Params.getvalue怎么用?Python Params.getvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.CORE.parameters.Params
的用法示例。
在下文中一共展示了Params.getvalue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: conf_wizard_member
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def conf_wizard_member(wizard_ident, xfer):
if isinstance(wizard_ident, list) and (xfer is None):
wizard_ident.append(("member_season", 11))
wizard_ident.append(("member_subscriptiontype", 12))
wizard_ident.append(("member_category", 13))
wizard_ident.append(("member_params", 14))
elif (xfer is not None) and (wizard_ident == "member_season"):
xfer.add_title(_("Diacamma member"), _('Season'), _('Configuration of season'))
xfer.fill_grid(5, Season, "season", Season.objects.all())
elif (xfer is not None) and (wizard_ident == "member_subscriptiontype"):
xfer.add_title(_("Diacamma member"), _('Subscriptions'), _('Configuration of subscription'))
xfer.fill_grid(15, SubscriptionType, "subscriptiontype", SubscriptionType.objects.all())
xfer.get_components("subscriptiontype").colspan = 6
fill_params(xfer, ["member-subscription-mode", "member-subscription-message"], True)
elif (xfer is not None) and (wizard_ident == "member_category"):
xfer.add_title(_("Diacamma member"), _("Categories"), _('Configuration of categories'))
xfer.new_tab(_('Parameters'))
fill_params(xfer, ["member-team-enable", "member-team-text", "member-activite-enable", "member-activite-text", "member-age-enable"], True)
if Params.getvalue("member-age-enable") == 1:
xfer.new_tab(_('Age'))
xfer.fill_grid(1, Age, "age", Age.objects.all())
if Params.getvalue("member-team-enable") == 1:
xfer.new_tab(Params.getvalue("member-team-text"))
xfer.fill_grid(1, Team, "team", Team.objects.all())
if Params.getvalue("member-activite-enable") == 1:
xfer.new_tab(Params.getvalue("member-activite-text"))
xfer.fill_grid(1, Activity, "activity", Activity.objects.all())
elif (xfer is not None) and (wizard_ident == "member_params"):
xfer.add_title(_("Diacamma member"), _('Parameters'), _('Configuration of main parameters'))
fill_params(xfer, ["member-licence-enabled", "member-filter-genre", "member-numero", "member-birth", "member-connection"], True)
示例2: before_save
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def before_save(self, xfer):
self.item.vta_rate = 0
if (Params.getvalue("invoice-vat-mode") != 0) and (self.item.article is not None) and (self.item.article.vat is not None):
self.item.vta_rate = float(self.item.article.vat.rate / 100)
if Params.getvalue("invoice-vat-mode") == 2:
self.item.vta_rate = -1 * self.item.vta_rate
return
示例3: get_show_fields
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def get_show_fields(cls):
fields = [
"adherent", "date", ((Params.getvalue("event-degree-text"), 'degree'),)]
if Params.getvalue("event-subdegree-enable") == 1:
fields.append(
((Params.getvalue("event-subdegree-text"), 'subdegree'),))
return fields
示例4: total
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def total(self):
if Params.getvalue("invoice-vat-mode") == 2:
return self.total_incltax
elif Params.getvalue("invoice-vat-mode") == 1:
return self.total_excltax
else:
return format_devise(self.get_total(), 5)
示例5: get_connection_info
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def get_connection_info(self):
from django.conf import settings
import lucterios.CORE
import os
LucteriosSession.clean_anonymous()
info_cnx = {}
info_cnx['TITLE'] = six.text_type(settings.APPLIS_NAME)
info_cnx['SUBTITLE'] = settings.APPLIS_SUBTITLE()
info_cnx['VERSION'] = six.text_type(settings.APPLIS_VERSION)
info_cnx['SERVERVERSION'] = six.text_type(lucterios.CORE.__version__)
info_cnx['COPYRIGHT'] = six.text_type(settings.APPLIS_COPYRIGHT)
info_cnx['LOGONAME'] = settings.APPLIS_LOGO.decode()
info_cnx['BACKGROUND'] = settings.APPLIS_BACKGROUND.decode()
info_cnx['STYLE'] = settings.APPLIS_STYLE.decode()
info_cnx['SUPPORT_EMAIL'] = six.text_type(settings.APPLI_EMAIL)
info_cnx['SUPPORT_HTML'] = six.text_type(settings.APPLI_SUPPORT())
info_cnx['INFO_SERVER'] = get_info_server()
setting_module_name = os.getenv("DJANGO_SETTINGS_MODULE", "???.???")
info_cnx['INSTANCE'] = setting_module_name.split('.')[0]
info_cnx['MESSAGE_BEFORE'] = Params.getvalue("CORE-MessageBefore")
info_cnx['LANGUAGE'] = self.language
info_cnx['MODE'] = six.text_type(Params.getvalue("CORE-connectmode"))
if self.request.user.is_authenticated:
info_cnx['LOGIN'] = self.request.user.username
info_cnx['REALNAME'] = "%s %s" % (self.request.user.first_name, self.request.user.last_name)
info_cnx['EMAIL'] = self.request.user.email
else:
info_cnx['LOGIN'] = ''
info_cnx['REALNAME'] = ''
info_cnx['EMAIL'] = ''
self.responsejson['connexion'] = info_cnx
示例6: show
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def show(self, xfer):
if xfer.item.cost_accounting is None:
xfer.remove_component("cost_accounting")
xfer.remove_component("lbl_cost_accounting")
xfer.params['new_account'] = Params.getvalue('invoice-account-third')
xfer.move(0, 0, 1)
lbl = XferCompLabelForm('title')
lbl.set_location(1, 0, 4)
lbl.set_value_as_title(get_value_if_choices(
self.item.bill_type, self.item.get_field_by_name('bill_type')))
xfer.add_component(lbl)
details = xfer.get_components('detail')
if Params.getvalue("invoice-vat-mode") != 0:
if Params.getvalue("invoice-vat-mode") == 1:
details.headers[2] = XferCompHeader(details.headers[2].name, _(
'price excl. taxes'), details.headers[2].type, details.headers[2].orderable)
details.headers[6] = XferCompHeader(details.headers[6].name, _(
'total excl. taxes'), details.headers[6].type, details.headers[6].orderable)
elif Params.getvalue("invoice-vat-mode") == 2:
details.headers[2] = XferCompHeader(details.headers[2].name, _(
'price incl. taxes'), details.headers[2].type, details.headers[2].orderable)
details.headers[6] = XferCompHeader(details.headers[6].name, _(
'total incl. taxes'), details.headers[6].type, details.headers[6].orderable)
xfer.get_components('lbl_total_excltax').set_value_as_name(
_('total excl. taxes'))
xfer.filltab_from_model(1, xfer.get_max_row() + 1, True,
[((_('VTA sum'), 'vta_sum'), (_('total incl. taxes'), 'total_incltax'))])
if self.item.status == 0:
SupportingEditor.show_third(self, xfer, 'invoice.add_bill')
else:
SupportingEditor.show_third_ex(self, xfer)
details.actions = []
if self.item.bill_type != 0:
SupportingEditor.show(self, xfer)
return
示例7: __str__
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def __str__(self):
val = []
if Params.getvalue("member-team-enable") and (self.team is not None):
val.append(six.text_type(self.team))
if Params.getvalue("member-activite-enable") and (self.activity is not None):
val.append("[%s]" % six.text_type(self.activity))
if Params.getvalue("member-licence-enabled") and (self.value is not None):
val.append(self.value)
return " ".join(val)
示例8: get_default_fields
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def get_default_fields(cls):
fields = ["contact", (_('subscript?'), 'is_subscripter'), (_('current'), 'current_degree'), (_(
'%s result') % Params.getvalue("event-degree-text"), 'degree_result_simple')]
if Params.getvalue("event-subdegree-enable") == 1:
fields.append(
(_('%s result') % Params.getvalue("event-subdegree-text"), 'subdegree_result'))
fields.append((_('article'), 'article.ref_price'))
fields.append('comment')
return fields
示例9: fillresponse_body
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def fillresponse_body(self):
if Params.getvalue("member-age-enable") == 1:
self.new_tab(_('Age'))
self.fill_grid(0, Age, "age", Age.objects.all())
if Params.getvalue("member-team-enable") == 1:
self.new_tab(Params.getvalue("member-team-text"))
self.fill_grid(0, Team, "team", Team.objects.all())
if Params.getvalue("member-activite-enable") == 1:
self.new_tab(Params.getvalue("member-activite-text"))
self.fill_grid(0, Activity, "activity", Activity.objects.all())
示例10: before_save
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def before_save(self, xfer):
accounts = self.item.third.accountthird_set.filter(code__regex=current_system_account().get_societary_mask())
if len(accounts) == 0:
if Params.getvalue("condominium-old-accounting"):
AccountThird.objects.create(third=self.item.third, code=correct_accounting_code(Params.getvalue("condominium-default-owner-account")))
else:
for num_account in range(1, 5):
AccountThird.objects.create(third=self.item.third,
code=correct_accounting_code(Params.getvalue("condominium-default-owner-account%d" % num_account)))
return SupportingEditor.before_save(self, xfer)
示例11: fillresponse
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def fillresponse(self):
XferListEditor.fillresponse(self)
grid = self.get_components(self.field_id)
grid.colspan = 3
if Params.getvalue("invoice-vat-mode") == 1:
grid.headers[5] = XferCompHeader(grid.headers[5].name, _('total excl. taxes'),
grid.headers[5].type, grid.headers[5].orderable)
elif Params.getvalue("invoice-vat-mode") == 2:
grid.headers[5] = XferCompHeader(grid.headers[5].name, _('total incl. taxes'),
grid.headers[5].type, grid.headers[5].orderable)
示例12: generate_entry
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def generate_entry(self):
if self.bill_type == 2:
is_bill = -1
else:
is_bill = 1
third_account = self.get_third_account(
current_system_account().get_customer_mask(), self.fiscal_year)
self.entry = EntryAccount.objects.create(
year=self.fiscal_year, date_value=self.date, designation=self.__str__(),
journal=Journal.objects.get(id=3), costaccounting=self.cost_accounting)
EntryLineAccount.objects.create(
account=third_account, amount=is_bill * self.get_total_incltax(), third=self.third, entry=self.entry)
remise_total = 0
detail_list = {}
for detail in self.detail_set.all():
if detail.article is not None:
detail_code = detail.article.sell_account
else:
detail_code = Params.getvalue("invoice-default-sell-account")
detail_account = ChartsAccount.get_account(
detail_code, self.fiscal_year)
if detail_account is None:
raise LucteriosException(
IMPORTANT, _("article has code account unknown!"))
if detail_account.id not in detail_list.keys():
detail_list[detail_account.id] = [detail_account, 0]
detail_list[detail_account.id][
1] += detail.get_total_excltax() + detail.get_reduce_excltax()
remise_total += detail.get_reduce_excltax()
if remise_total > 0.001:
remise_code = Params.getvalue("invoice-reduce-account")
remise_account = ChartsAccount.get_account(
remise_code, self.fiscal_year)
if remise_account is None:
raise LucteriosException(
IMPORTANT, _("reduce-account is not defined!"))
EntryLineAccount.objects.create(
account=remise_account, amount=-1 * is_bill * remise_total, entry=self.entry)
for detail_item in detail_list.values():
EntryLineAccount.objects.create(
account=detail_item[0], amount=is_bill * detail_item[1], entry=self.entry)
if self.get_vta_sum() > 0.001:
vta_code = Params.getvalue("invoice-vatsell-account")
vta_account = ChartsAccount.get_account(
vta_code, self.fiscal_year)
if vta_account is None:
raise LucteriosException(
IMPORTANT, _("vta-account is not defined!"))
EntryLineAccount.objects.create(
account=vta_account, amount=is_bill * self.get_vta_sum(), entry=self.entry)
no_change, debit_rest, credit_rest = self.entry.serial_control(
self.entry.get_serial())
if not no_change or (abs(debit_rest) > 0.001) or (abs(credit_rest) > 0.001):
raise LucteriosException(
GRAVE, _("Error in accounting generator!") + "{[br/]} no_change=%s debit_rest=%.3f credit_rest=%.3f" % (no_change, debit_rest, credit_rest))
示例13: get_import_fields
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def get_import_fields(cls):
fields = super(Individual, cls).get_import_fields()
fields.append(('subscriptiontype', _('subscription type')))
if Params.getvalue("member-team-enable"):
fields.append(('team', Params.getvalue("member-team-text")))
if Params.getvalue("member-activite-enable"):
fields.append(
('activity', Params.getvalue("member-activite-text")))
if Params.getvalue("member-licence-enabled"):
fields.append(('value', _('license #')))
return fields
示例14: conf_wizard_event
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def conf_wizard_event(wizard_ident, xfer):
if isinstance(wizard_ident, list) and (xfer is None):
wizard_ident.append(("event_degree", 60))
elif (xfer is not None) and (wizard_ident == "event_degree"):
xfer.add_title(_("Diacamma event"), _("Degrees"), _('Configuration of degree parameters'))
xfer.new_tab(_('Parameters'))
fill_params(xfer)
xfer.new_tab(Params.getvalue("event-degree-text"))
xfer.fill_grid(1, DegreeType, "degreetype", DegreeType.objects.all())
if Params.getvalue("event-subdegree-enable") == 1:
xfer.new_tab(Params.getvalue("event-subdegree-text"))
xfer.fill_grid(1, SubDegreeType, "subdegreetype", SubDegreeType.objects.all())
示例15: format_devise
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import getvalue [as 别名]
def format_devise(amount, mode):
# mode 0 25.45 => 25,45€ / -25.45 =>
# mode 1 25.45 => Credit 25,45€ / -25.45 => Debit 25,45€
# mode 2 25.45 => {[font color="green"]}Credit 25,45€{[/font]} /
# -25.45 => {[font color="blue"]}Debit 25,45€{[/font]}
# mode 3 25.45 => 25,45 / -25.45 => -25.45
# mode 4 25.45 => 25,45€ / -25.45 => 25.45€
# mode 5 25.45 => 25,45€ / -25.45 => -25.45€
# mode 6 25.45 => {[font color="green"]}25,45€{[/font]} /
# -25.45 => {[font color="blue"]}25,45€{[/font]}
from decimal import InvalidOperation
result = ''
currency_short = Params.getvalue("accounting-devise")
currency_decimal = Params.getvalue("accounting-devise-prec")
currency_format = "%%0.%df" % currency_decimal
currency_epsilon = pow(10, -1 * currency_decimal - 1)
try:
if (amount is None) or (abs(amount) < currency_epsilon):
amount = 0
except InvalidOperation:
return "???"
if (abs(amount) >= currency_epsilon) or (mode in (1, 2, 6)):
if amount >= 0:
if mode in (2, 6):
result = '{[font color="green"]}'
if (mode == 1) or (mode == 2):
result = '%s%s: ' % (result, _('Credit'))
else:
if mode in (2, 6):
result = result + '{[font color="blue"]}'
if (mode == 1) or (mode == 2):
result = '%s%s: ' % (result, _('Debit'))
if mode == 3:
result = currency_format % amount
elif mode == 0:
if amount >= currency_epsilon:
result = currency_format % abs(amount) + currency_short
elif mode == 6:
if abs(amount) >= currency_epsilon:
result = result + currency_format % abs(amount) + currency_short
else:
if mode < 5:
amount_text = currency_format % abs(amount)
else:
amount_text = currency_format % amount
result = result + amount_text + currency_short
if mode in (2, 6):
result = result + '{[/font]}'
return result