ImportFile module

This module handles all operations involving importing reports.

class ImportFile.ImportReportController(vendors, settings, import_report_widget, import_report_ui)

Bases: object

Controls the Import Report tab

Parameters
  • vendors (list) – The list of vendors in the system

  • settings (SettingsModel) – The user’s settings

  • import_report_widget (QWidget) – The import report widget.

  • import_report_ui (Ui_import_report_tab) – The UI for the import_report_widget.

check_if_c5_report_exists(vendor_name, report_type)
Return type

bool

copy_file(origin_path, dest_path)

Copies a file from origin_path to dest_path

import_report(vendor, report_type, origin_file_path)

Imports the selected file using the selected parameters

Parameters
  • vendor (Vendor) – The target vendor

  • report_type (str) – The target report type

  • origin_file_path (str) – The path of the file to be imported

Raises

Exception – If anything goes wrong while importing the report

Return type

ProcessResult

on_c4_import_clicked()

Handles the signal emitted when the import button is clicked

on_c4_report_type_selected(index)

Handles the signal emitted when a report type is selected

on_c4_select_file_clicked()

Handles the signal emitted when the select file button is clicked

on_c5_import_clicked()

Handles the signal emitted when the import button is clicked

on_c5_report_type_selected(index)

Handles the signal emitted when a report type is selected

on_c5_select_file_clicked()

Handles the signal emitted when the select file button is clicked

on_date_changed(date)

Handles the signal emitted when the target date is changed

on_vendor_selected(index)

Handles the signal emitted when a vendor is selected

on_vendors_changed(vendors)

Handles the signal emitted when the system’s vendor list is updated

Parameters

vendors (list) – An updated list of the system’s vendors

show_results(process_results)

Shows the result of the import process to the user

Parameters

process_results (list) – The results of the import process

update_vendors(vendors)

Updates the local copy of vendors that support report import

Parameters

vendors (list) – A list of vendors

update_vendors_ui()

Updates the UI to show vendors that support report import

class ImportFile.ProcessResult(vendor, report_type)

Bases: object

This holds the results of an import process

Parameters
  • vendor (Vendor) – The target vendor

  • report_type (str) – The target report type

ImportFile.get_c5_equivalent(counter4_report_type)
Return type

str