Example #1
0
def assembly_bar_label(assembly_id, type_result='svg'):
    '''Штрихкод для сборочного листа'''
    return render(
        type_result,
        assembly_bar_size,
        ZEan13(assembly_bar_size, assembly2barcode(assembly_id)),
    )
Example #2
0
def pallet(pallet_id, type_result='svg'):
    '''Этикетка на палеты'''
    return render(
        type_result,
        pallet_size,
        ZText((49, 6), 'pallet:%s' % pallet_id),
        ZEan13((1, 8, 47, 26), pallet2barcode(pallet_id)),
    )
Example #3
0
def party(party_id, rem='', type_result='svg'):
    '''Партионные этикетки'''
    return render(
        type_result,
        party_size,
        ZText((0, 0.5, 42.7, 5), 'party:%s' % party_id),
        ZText((0, 0.5, 49, 5), rem, align='right', weight=True),
        ZEan13((1, 8, 47, 26), party2barcode(party_id)),
    )
Example #4
0
def cell(line, row, floor, depart, type_result='svg'):
    '''Этикетка на ячейки'''

    ztext = '%02d-%02d-%1d' % (int(line), int(row), int(floor))
    zbarcode = cellinfo2barcode(int(depart), int(line), int(floor), int(row))

    return render(
        type_result,
        cell_size,
        ZRect((96, 70)),
        ZText((96, 26), ztext, align='center', weight=True),
        ZEan13((7, 30, 80, 37), zbarcode),
    )
Example #5
0
def barcode(code, party='', rem='', type_result='svg'):
    '''Партионные этикетки'''

    title = 'party'
    if code.startswith('8'):
        title = 'extra_party'

    return render(
        type_result,
        party_size,
        ZText((0, 0.5, 42.7, 5), '%s:%s' % (title, party)),
        ZText((0, 0.5, 49, 5), rem, align='right', weight=True),
        ZEan13((1, 8, 47, 26), code),
    )
Example #6
0
def party2(party_id, num, name, type_result='svg'):
    '''Партионные этикетки имени Мантурова'''

    name = name.decode('utf-8')
    num = num.decode('utf-8')

    if len(name) > 64:
        name = [name[:33], name[33:66], name[66:]]
        fs = 2.6
    elif len(name) > 32:
        name = [name[:32], name[32:]]
        fs = 3.0
    else:
        fs = 3.5

    return render(
        type_result,
        party_size,
        # ZRect(party_size),
        ZText((0, 0, 48, 9), name, font_size=fs),
        ZFillRect((0, 9.1, 49, 0.2)),
        ZText((0, 9.5, 42.7, 5), u'партия: %s' % num),
        ZEan13((1, 16, 45, 19), party2barcode(party_id)),
    )
Example #7
0
def badge(bar_code, fio, type_result='svg'):
    '''Бэйджик'''
    return render(type_result, badge_size, ZRect(badge_size),
                  ZEan13((7, 20, 74, 28), bar_code), ZFillRect(
                      (1, 18, 88, 0.5)),
                  ZText((1, 1, 88, 15), fio, align='center'))