@@ -52,7 +52,7 @@ def registrate(self, model: Model) -> None:
5252
5353 def _create_serial_number (self , model : Model ) -> None :
5454 # Read snumber from file and increment it
55- if model == PRO_PLUS :
55+ if model == PRO_PLUS and model . upgrade is False :
5656 for i in range (0 , 3 ):
5757 try :
5858 self .serial_number = req .get_http_session ().get (
@@ -178,6 +178,8 @@ def fill_data(content: List, data: str, line: int, row: int) -> List:
178178 sales_name = model .sales_name + "S"
179179 elif model == YOUR_CHARGE and model .display and model .wall_socket is False :
180180 sales_name = model .sales_name + "D"
181+ elif model == PRO_PLUS and model .upgrade :
182+ sales_name = "Display für Pro+"
181183 else :
182184 sales_name = model .sales_name
183185 content = fill_data (content , sales_name , 8 , 25 )
@@ -188,14 +190,17 @@ def fill_data(content: List, data: str, line: int, row: int) -> List:
188190
189191 with open ("./ramdisk/outside.zpl" , "w" ) as f :
190192 f .writelines (content )
191- run_subprocess_stderr (["lp" , "-d" , self .workstation .printer , "-o" , "raw" , "./ramdisk/outside.zpl" ])
192- if model .standalone is False :
193- # für die Standalone-Verpackung braucht man kein Label
194- run_subprocess_stderr (["lp" , "-d" , self .workstation .printer , "-o" , "raw" , "./ramdisk/outside.zpl" ])
193+ if model .standalone :
194+ outside_labels = 1
195+ elif model == PRO_PLUS and model .upgrade :
196+ outside_labels = 2
197+ else :
198+ outside_labels = 3
199+ for i in range (0 , outside_labels ):
195200 run_subprocess_stderr (["lp" , "-d" , self .workstation .printer , "-o" , "raw" , "./ramdisk/outside.zpl" ])
196201
197202 # Ausstattungs-Label
198- if model .standalone :
203+ if model .standalone or ( model == PRO_PLUS and model . upgrade ) :
199204 return
200205 with open ("./data/labels/equipment.zpl" , "r" ) as f :
201206 content = f .readlines ()
@@ -207,6 +212,7 @@ def fill_data(content: List, data: str, line: int, row: int) -> List:
207212 equipment = [item for item in Equipment ]
208213 equipment .remove (Equipment .MAX_POWER )
209214 equipment .remove (Equipment .ENTERPRISE )
215+ equipment .remove (Equipment .UPGRADE )
210216 for e in equipment :
211217 if getattr (model , e .value ):
212218 eq = f"•{ EQUIPMENT_TO_SALES_NAME [e ]} "
0 commit comments