Пример #1
0
def create_xcty_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + Product.PRODUCT_EXTRA_CITY)
    p.price = 1000
    p.default_count = 1
    p.default = False
    p.possible_counts = range(1, 37)
    p.is_subscription = False
    p.is_subscription_discount = False
    p.is_subscription_extension = True
    p.organization_types = []
    p.product_dependencies = [
        '|'.join([
            '%s%s:-1' % (code_prefix, product_code)
            for product_code in ('MSUP', 'MSSU', 'SSUP', 'SSZP', 'CSUB',
                                 Product.PRODUCT_FREE_PRESENCE,
                                 Product.PRODUCT_FREE_SUBSCRIPTION)
        ])
    ]
    p.picture_url = ""
    p.visible = True
    p.legal_entity_id = legal_entity_id
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
        p.default_comment_translation_key = p.code[len(code_prefix
                                                       ):] + '.default_comment'
    return p
Пример #2
0
def create_suby_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + 'SUBY')
    p.price = 12000
    p.default_count = 1
    p.default = False
    p.possible_counts = [1]
    p.is_subscription = False
    p.is_subscription_extension = True
    p.extra_subscription_months = 12
    p.organization_types = []
    p.product_dependencies = []
    p.visible = bool(
        code_prefix)  # only for legal entities other than mobicage
    p.legal_entity_id = legal_entity_id
    p.default_comment_translation_key = u'SUBX.default_comment'
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
    return p
Пример #3
0
def create_appl_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + 'APPL')
    p.price = 10000
    p.default_count = 1
    p.default = False
    p.possible_counts = [1]
    p.is_subscription = False
    p.is_subscription_discount = False
    p.is_subscription_extension = True
    p.organization_types = [ServiceProfile.ORGANIZATION_TYPE_CITY]
    p.product_dependencies = []
    p.visible = True
    p.legal_entity_id = legal_entity_id
    p.default_comment_translation_key = ''
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
    p.charge_interval = 12
    return p
Пример #4
0
def create_kkrt_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + Product.PRODUCT_CARDS)
    p.price = 1750
    p.default_count = 2
    p.default = False
    p.possible_counts = range(1, 6)
    p.is_subscription = False
    p.is_subscription_extension = False
    p.organization_types = []
    p.product_dependencies = []
    p.visible = bool(
        code_prefix)  # only for legal entities other than mobicage
    p.picture_url = "/static/images/solutions/flex/loyalty_cards.jpg"
    p.legal_entity_id = legal_entity_id
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
        p.default_comment_translation_key = p.code[len(code_prefix
                                                       ):] + '.default_comment'
    return p
Пример #5
0
def create_otrm_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + 'OTRM')
    p.price = 19900
    p.default_count = 1
    p.default = False
    p.possible_counts = range(1, 50)
    p.is_subscription = False
    p.is_subscription_discount = False
    p.is_subscription_extension = False
    p.organization_types = []
    p.product_dependencies = []
    p.visible = bool(
        code_prefix)  # only for legal entities other than mobicage
    p.legal_entity_id = legal_entity_id
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
        p.default_comment_translation_key = p.code[len(code_prefix
                                                       ):] + '.default_comment'
    return p
Пример #6
0
def create_xctd_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + 'XCTD')
    p.price = -1000
    p.default_count = 1
    p.default = False
    p.possible_counts = range(1, 37)
    p.is_subscription = False
    p.is_subscription_discount = False
    p.is_subscription_extension = True
    p.organization_types = []
    p.product_dependencies = [
        '%(code_prefix)sXCTY:-1' % dict(code_prefix=code_prefix)
    ]
    p.picture_url = ""
    p.visible = True
    p.legal_entity_id = legal_entity_id
    p.default_comment_translation_key = ''
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
    return p
Пример #7
0
def create_a3ct_product(legal_entity_id, code_prefix=''):
    p = Product(key_name=code_prefix + Product.PRODUCT_ACTION_3_EXTRA_CITIES)
    p.price = 2000
    p.default_count = 1
    p.default = False
    p.possible_counts = range(1, 37)
    p.is_subscription = False
    p.is_subscription_discount = False
    p.is_subscription_extension = True
    p.organization_types = []
    p.product_dependencies = [
        '%(code_prefix)sMSUP:-1|%(code_prefix)sMSSU:-1|%(code_prefix)sSSUP:-1|%(code_prefix)sSSZP:-1|%(code_prefix)sOCAP:-1'
        % dict(code_prefix=code_prefix)
    ]
    p.picture_url = ""
    p.visible = bool(
        code_prefix)  # only for legal entities other than mobicage
    p.legal_entity_id = legal_entity_id
    if code_prefix:
        p.description_translation_key = p.code[len(code_prefix
                                                   ):] + '.description'
        p.default_comment_translation_key = p.code[len(code_prefix
                                                       ):] + '.default_comment'
    return p