77def create_item(count: int, name: str, pos: int, group: int, price: float, price_total: float, user: str | None, date: datetime, port: bool) -> Item:
78 """!
79 @brief Create Item to write to log
80 @param count : number of items
81 @param name : name of item
82 @param pos : article position
83 @param group : group number
84 @param price : single article prince
85 @param price_total : total article price
86 @param user : user name who print the article
87 @param date : datetime of item print
88 @param port : status if item print or only save (if print use COM port name)
89 @return item
90 """
91 s_datetime = date.strftime(S_DATE_PRINT_FORMAT) if (date is not None) else None
92 assert (user is not None), "None user will print"
93 return Item(count, name, pos, group, f"{price:.2f}", f"{price_total:.2f}", user, s_datetime, port)
94
95