|
BonPrinter v1.2.0
Thermal Printer tool
|
Report class to log and create sales articles. More...
Public Member Functions | |
| None | __init__ (self, "MainWindow" ui) |
| bool | check_sales_exist (self) |
| Check if sales in log file or settings exist. | |
| bool | check_setting_sales_exist (self) |
| Write printed articles to log file. | |
| None | clear_print_items (self) |
| clear items to hold in storage before print out | |
| None | clear_setting_log (self) |
| Clear sales in settings. | |
| tuple[bool, list[ItemReport], list[str]] | combine_files (self, list[str] l_files, Optional[list[list[list[str]]|None]] l_fix_data=None) |
| Combine Reports to create single report from multiple other data. | |
| None | create_report (self, Optional[list[str]] l_files=None, bool b_combine=False, bool b_clear_report=False, Optional[dict[str, dict[str, str]]] d_item=None, bool b_startup_check=False, Optional[str] s_path=None, bool b_open_folder=False) |
| Create report or show only status report. | |
| tuple[bool, list[ItemReport], list[str]] | get_items_from_print_file (self, str s_file_name=S_PRINT_FILE, bool b_combine=False, Optional[list[list[str]]] fix_data=None) |
| Get items from printouts from log file. | |
| str | get_report_text (self, list[str] l_files, list[ItemReport] l_data, datetime time, bool b_combine=False, bool b_clear_report=False, Optional[str] user_report=None) |
| Create summary report text of printed articles. | |
| str | group_items (self, dict[int, dict[str, Any]] d_dict, bool b_print_values=True, bool b_total_values=False) |
| Create summary report text of printed articles. | |
| list[list[str]] | read_data_from_print_file (self, str s_file_name=S_PRINT_FILE) |
| Read printouts from log file. | |
| None | write_data_to_file (self, list[list[Any]] l_items) |
| Write printouts to log file. | |
| None | write_data_to_print_file (self, list[Item] l_items, int i_user_pos, float f_price, str|None s_com_port) |
| Write printed articles to log file. | |
Public Attributes | |
| bool | b_log_modified = False |
| bool | b_log_valid_verified = True |
| dict | d_combine_data = {} |
| dict | d_printed_articles = {} |
| list | l_bar_items = [0] * I_ITEM_ARRAY_SIZE |
| list | l_group_values = [] |
| list | l_marked_items = [False] * I_ITEM_ARRAY_SIZE |
| l_sales = read_sales() | |
| list | l_table_position = [None] * I_ITEM_ARRAY_SIZE |
| str|None | out_folder = None |
| str | s_report_text = "" |
| str | s_report_user = "" |
| str | s_total_sum = "" |
| ui = ui | |
Report class to log and create sales articles.
| ui | : main window object |
| None __init__ | ( | self, | |
| "MainWindow" | ui ) |
Definition at line 102 of file report.py.
| bool check_sales_exist | ( | self | ) |
Check if sales in log file or settings exist.
Definition at line 135 of file report.py.
| bool check_setting_sales_exist | ( | self | ) |
Write printed articles to log file.
Definition at line 124 of file report.py.
| None clear_print_items | ( | self | ) |
clear items to hold in storage before print out
Definition at line 158 of file report.py.
| None clear_setting_log | ( | self | ) |
Clear sales in settings.
Definition at line 510 of file report.py.
| tuple[bool, list[ItemReport], list[str]] combine_files | ( | self, | |
| list[str] | l_files, | ||
| Optional[list[list[list[str]] | None]] | l_fix_data = None ) |
Combine Reports to create single report from multiple other data.
| l_files | : list of files to combine |
| l_fix_data | : use this fix data and do not read from file |
Definition at line 518 of file report.py.
| None create_report | ( | self, | |
| Optional[list[str]] | l_files = None, | ||
| bool | b_combine = False, | ||
| bool | b_clear_report = False, | ||
| Optional[dict[str, dict[str, str]]] | d_item = None, | ||
| bool | b_startup_check = False, | ||
| Optional[str] | s_path = None, | ||
| bool | b_open_folder = False ) |
Create report or show only status report.
| l_files | : list of files to create report |
| b_combine | : [True] create combined report; [False] create single report |
| b_clear_report | : [True] create report and clear log; [False] show only status of printed articles |
| d_item | : item configuration data |
| b_startup_check | : [True] only check reports, do not open; [False] open file |
| s_path | : path to write report |
| b_open_folder | : open output folder in explorer status |
Definition at line 192 of file report.py.
| tuple[bool, list[ItemReport], list[str]] get_items_from_print_file | ( | self, | |
| str | s_file_name = S_PRINT_FILE, | ||
| bool | b_combine = False, | ||
| Optional[list[list[str]]] | fix_data = None ) |
Get items from printouts from log file.
| s_file_name | : file to read |
| b_combine | : status if combine reports to extend local user with device name |
| fix_data | : use this fix data and do not read from file |
Definition at line 539 of file report.py.
| str get_report_text | ( | self, | |
| list[str] | l_files, | ||
| list[ItemReport] | l_data, | ||
| datetime | time, | ||
| bool | b_combine = False, | ||
| bool | b_clear_report = False, | ||
| Optional[str] | user_report = None ) |
Create summary report text of printed articles.
| l_files | : file to save total data for combined report |
| l_data | : list of printed articles |
| time | : actual time stamp for report |
| b_combine | : [True] create combined report; [False] create single report |
| b_clear_report | : [True] create report text and clear printed sales in settings; [False] create status text |
| user_report | : create report for this user; None: create for all user |
Definition at line 333 of file report.py.
| str group_items | ( | self, | |
| dict[int, dict[str, Any]] | d_dict, | ||
| bool | b_print_values = True, | ||
| bool | b_total_values = False ) |
Create summary report text of printed articles.
| d_dict | : dictionary with printed articles |
| b_print_values | : status if print values (not only articles) |
| b_total_values | : status if group total items to save in global data |
Definition at line 306 of file report.py.
| list[list[str]] read_data_from_print_file | ( | self, | |
| str | s_file_name = S_PRINT_FILE ) |
Read printouts from log file.
| s_file_name | : file to read |
Definition at line 588 of file report.py.
| None write_data_to_file | ( | self, | |
| list[list[Any]] | l_items ) |
Write printouts to log file.
| l_items | : articles to write to log file |
Definition at line 602 of file report.py.
| None write_data_to_print_file | ( | self, | |
| list[Item] | l_items, | ||
| int | i_user_pos, | ||
| float | f_price, | ||
| str | None | s_com_port ) |
Write printed articles to log file.
| l_items | : list of printed articles |
| i_user_pos | : user (position) that print this items |
| f_price | : price of printed items |
| s_com_port | : COM port (write to print log without printer is possible) |
Definition at line 165 of file report.py.