Bar code lengths give different formats.
This commit is contained in:
parent
195f88ad06
commit
2c790e1fe1
|
@ -19,7 +19,13 @@ Put it up somewhere in the vicinity.
|
||||||
thing = self.input_thing('Prodct/User> ')
|
thing = self.input_thing('Prodct/User> ')
|
||||||
|
|
||||||
if isinstance(thing, Product):
|
if isinstance(thing, Product):
|
||||||
print_bar_code(thing.bar_code, thing.name, barcode_type="ean13", rotate=conf.label_rotate,
|
if len(thing.bar_code) == 13:
|
||||||
|
bar_type = "ean13"
|
||||||
|
elif len(thing.bar_code) == 8:
|
||||||
|
bar_type = "ean8"
|
||||||
|
else:
|
||||||
|
bar_type = "code39"
|
||||||
|
print_bar_code(thing.bar_code, thing.name, barcode_type=bar_type, rotate=conf.label_rotate,
|
||||||
printer_type="QL-700", label_type=conf.label_type)
|
printer_type="QL-700", label_type=conf.label_type)
|
||||||
elif isinstance(thing, User):
|
elif isinstance(thing, User):
|
||||||
print_name_label(text=thing.name, label_type=conf.label_type, rotate=conf.label_rotate,
|
print_name_label(text=thing.name, label_type=conf.label_type, rotate=conf.label_rotate,
|
||||||
|
|
Loading…
Reference in New Issue