Beispiel #1
0
    def __init__(self, click_handler, default_currency: str):
        self._click_handler = click_handler

        self._window = tkinter.Toplevel()
        self._window.wm_geometry(str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        self._date = LabeledTextbox(
            self._window,
            "Date",
            datetime.datetime.now().isoformat(),
            0,
            cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._description = LabeledTextbox(self._window, "Description", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._amount = AmountTextbox(self._window, "Amount", 0, default_currency, 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._cleared = LabeledCheckbox(self._window, "Clear", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        save_button = tkinter.Button(self._window,
                                     text="OK",
                                     command=self._ok_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
    def __init__(self):
        self._window = tkinter.Toplevel()
        self._window.wm_geometry(str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        self._company = CompanyCombobox(self._window, "Bank", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._payment_date = LabeledTextbox(self._window,
                                            "Payment date",
                                            datetime.datetime.now().isoformat(),
                                            0,
                                            cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._amount = AmountTextbox(
            self._window,
            "Amount",
            0,
            config.CONSTANTS["HOME_CURRENCY"],
            0,
            cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        save_button = tkinter.Button(self._window,
                                     text="OK",
                                     command=self._ok_click,
                                     font=default_font())

        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
Beispiel #3
0
    def __init__(self):
        self._window = tkinter.Toplevel()
        self._window.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        self._company = CompanyCombobox(self._window, "Company", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._direction = LabeledCombobox(self._window, "Direction",
                                          ["I", "O"], 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._amount = AmountTextbox(self._window, "Amount", 0,
                                     config.CONSTANTS["HOME_CURRENCY"], 0,
                                     cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._description = LabeledTextbox(self._window, "Description", "", 0,
                                           cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        save_button = tkinter.Button(self._window,
                                     text="OK",
                                     command=self._ok_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
Beispiel #4
0
    def __init__(self):

        self._debut_activity = None

        # Initialization

        tkinter.Toplevel.__init__(self)
        self.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        # Project

        self._projects = Project.get_projects()
        self._project_combo_val = []
        self._build_project_combo_values()
        self._project_combo = LabeledCombobox(self, "Project",
                                              self._project_combo_val, 0,
                                              cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Duration

        self._duration = LabeledTextbox(self, "Duration", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Work

        self._work = LabeledTextbox(self, "Work", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Button

        save_button = tkinter.Button(self,
                                     text="Save",
                                     command=self._save_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]
    def __init__(self, click_handler, label_text: str, text_value: str):

        self._click_handler = click_handler

        self._window = tkinter.Toplevel()
        self._window.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))

        self._labeled_textbox = LabeledTextbox(self._window, label_text,
                                               text_value, 0, 0)

        save_button = tkinter.Button(self._window,
                                     text="OK",
                                     command=self._ok_click)
        save_button.place(x=200, y=100)
Beispiel #6
0
    def __init__(self):
        # Initialization
        tkinter.Toplevel.__init__(self)
        self.wm_geometry(str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        # GUID
        self._guid = LabeledTextbox(self, "GUID", "", 0, cell_y)
        self._guid.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Serial
        self._serial = LabeledTextbox(self, "Serial", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Payer
        self._payer_combo = CompanyCombobox(self, "Payer", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Invoice date
        self._invoice_date = LabeledTextbox(self, "Invoice date", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Due date
        self._due_date = LabeledTextbox(self, "Due date", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Amount
        self._amount = AmountTextbox(
            self,
            "Amount",
            0,
            config.CONSTANTS["HOME_CURRENCY"],
            0,
            cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # VAT
        self._vat = LabeledTextbox(self, "VAT %", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # VAT amount
        self._vat_amount = LabeledTextbox(self, "VAT amount", "", 0, cell_y)
        self._vat_amount.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Total amount
        self._total_amount = LabeledTextbox(self, "Total amount", "", 0, cell_y)
        self._total_amount.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Income tax rate
        self._income_tax = LabeledTextbox(self, "Inc.Tax %", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Income tax amount
        self._income_tax_amount = LabeledTextbox(self, "Inc.Tax amount", "", 0, cell_y)
        self._income_tax_amount.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # File Path
        self._file_path = LabeledTextbox(self, "File path", "", 0, cell_y)

        cell_x = (config.CONSTANTS["GUI_CELL_WIDTH"] * 2) + InvoiceWindow._SPACE
        file_path_button = tkinter.Button(self, text="...", command=self._file_path_click)
        file_path_button.place(x=cell_x, y=cell_y)

        cell_x += InvoiceWindow._SMALL_SPACE
        file_open_button = tkinter.Button(self, text="!", command=self._file_open_click)
        file_open_button.place(x=cell_x, y=cell_y)

        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Button
        save_button = tkinter.Button(self,
                                     text="Save",
                                     command=self._save_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)

        save2_button = tkinter.Button(self,
                                      text="Save with payments",
                                      command=self._save_pay_click,
                                      font=default_font())
        save2_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"] + InvoiceWindow._SPACE, y=cell_y)

        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Status
        self._status_label = tkinter.Label(master=self, text="", font=default_font())
        self._status_label.place(
            x=0,
            y=cell_y,
            width=self._WINDOW_WIDTH,
            height=config.CONSTANTS["GUI_CELL_HEIGHT"])
Beispiel #7
0
    def __init__(self):
        # Initialization

        tkinter.Toplevel.__init__(self)
        self.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        # GUID
        self._guid = LabeledTextbox(self, "GUID", "", 0, cell_y)
        self._guid.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Name
        self._name = LabeledTextbox(self, "Name", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Type
        self._asset_types = asset_model.get_asset_types()
        self._asset_type_combo_val = []
        self._build_asset_type_combo_values()
        self._asset_type_combo = LabeledCombobox(self, "Type",
                                                 self._asset_type_combo_val, 0,
                                                 cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Purcase date
        self._purchase_date = LabeledTextbox(
            self, "Pur. Date",
            datetime.datetime.now().isoformat(), 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Purchase value
        self._purchase_value = LabeledTextbox(self, "Pur. value", "", 0,
                                              cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Sales value
        self._sales_value = LabeledTextbox(self, "Sales value", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Currency
        self._currency = LabeledTextbox(self, "Currency", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Quantity
        self._quantity = LabeledTextbox(self, "Quantity", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Percentage
        self._percentage = LabeledTextbox(self, "Percentage", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Bank
        self._bank = LabeledTextbox(self, "Bank", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # URL suffix
        self._url_suffix = LabeledTextbox(self, "URL suffix", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Income tax
        self._income_tax = LabeledCheckbox(self, "Income tax", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Button
        save_button = tkinter.Button(self,
                                     text="Save",
                                     command=self._save_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Status
        self._status_label = tkinter.Label(master=self,
                                           text="",
                                           font=default_font())
        self._status_label.place(x=0,
                                 y=cell_y,
                                 width=self._WINDOW_WIDTH,
                                 height=config.CONSTANTS["GUI_CELL_HEIGHT"])
Beispiel #8
0
    def __init__(self):

        # Initialization
        tkinter.Toplevel.__init__(self)
        self.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_x = 0
        cell_y = 0
        self._payment = None

        ##########
        # Payment
        ##########

        # GUID
        self._guid = LabeledTextbox(self, "GUID", "", cell_x, cell_y)
        self._guid.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Creation date
        self._creation_date = LabeledTextbox(self, "Creation", "", cell_x,
                                             cell_y)
        self._creation_date.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Company
        self._company_combo = CompanyCombobox(self, "Company", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Description
        self._description = LabeledTextbox(self, "Description", "", cell_x,
                                           cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Invoice GUID
        self._invoice_guid = LabeledTextbox(self, "Invoice GUID", "", cell_x,
                                            cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Direction
        self._direction = LabeledCombobox(self, "Direction",
                                          payment_model.get_direction_values(),
                                          cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Amount

        self._amount = AmountTextbox(self, "Amount", 0,
                                     config.CONSTANTS["HOME_CURRENCY"], cell_x,
                                     cell_y)

        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Open amount

        self._open_amount = AmountTextbox(self, "Open Amount", 0,
                                          config.CONSTANTS["HOME_CURRENCY"],
                                          cell_x, cell_y)

        self._open_amount.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Cleared

        self._cleared = LabeledCheckbox(self, "Cleared", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Tax

        self._is_vat = LabeledCheckbox(self, "Is VAT", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._is_income_tax = LabeledCheckbox(self, "Is Income Tax", cell_x,
                                              cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]
        cell_y_bookmark = cell_y

        ##########
        # Scheme
        ##########

        cell_x = (config.CONSTANTS["GUI_CELL_WIDTH"] * 2) + self._SPACING
        cell_y = 0

        # Frequency
        self._frequency = LabeledTextbox(self, "Frequency", "", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Period
        self._period = LabeledCombobox(self, "Period",
                                       payment_model.get_period_values(),
                                       cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Start
        self._start = LabeledTextbox(self, "Start", "", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Repeat
        self._repeat = LabeledTextbox(self, "Repeat", "", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Notes
        self._notes = LabeledTextarea(self, "Notes", "", cell_x, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        ##########
        # Recurrence
        ##########

        cell_x = 0
        cell_y = cell_y_bookmark + config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Visual

        tkinter.Label(self, text="Recurrence:").place(x=cell_x, y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._recurrence_tree = tkinter.ttk.Treeview(self)
        tree_height = config.CONSTANTS["GUI_CELL_HEIGHT"] * 5
        self._recurrence_tree.place(x=cell_x,
                                    y=cell_y,
                                    width=self._WINDOW_WIDTH,
                                    height=tree_height)
        cell_y += tree_height

        self._recurrence_tree["columns"] = ("Exp.Date", "Amount",
                                            "Open Amount", "Cleared")
        self._recurrence_tree.heading("Exp.Date", text="Exp.Date")
        self._recurrence_tree.heading("Amount", text="Amount")
        self._recurrence_tree.heading("Open Amount", text="Open Amount")
        self._recurrence_tree.heading("Cleared", text="Cleared")
        self._recurrence_tree.bind("<<TreeviewSelect>>",
                                   self._recurrence_select)
        self._recurrence_tree.bind("<Double-1>", self._recurrence_double_click)

        recurrence_clear_button = tkinter.Button(
            self,
            text="Clear",
            command=self._clear_recurrence,
            font=default_font())
        recurrence_clear_button.place(x=0, y=cell_y)

        recurrence_postpone_button = tkinter.Button(
            self,
            text="Postpone",
            command=self._rec_postpone_popup,
            font=default_font())
        recurrence_postpone_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"],
                                         y=cell_y)
        recurrence_add_button = tkinter.Button(self,
                                               text="Add",
                                               command=self._recurrence_popup,
                                               font=default_font())
        recurrence_add_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"] * 2,
                                    y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Data
        self._recurrence_tree_content = {}

        ##########
        # Collections
        ##########

        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]
        tkinter.Label(self, text="Collections:").place(x=cell_x, y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        self._collection_tree = tkinter.ttk.Treeview(self)
        self._collection_tree.place(x=cell_x,
                                    y=cell_y,
                                    width=self._WINDOW_WIDTH,
                                    height=tree_height)
        cell_y += tree_height

        self._collection_tree["columns"] = ("Description", "Amount")
        self._collection_tree.heading("Description", text="Description")
        self._collection_tree.heading("Amount", text="Amount")

        add_collection_button = tkinter.Button(self,
                                               text="Add",
                                               command=self._collection_popup,
                                               font=default_font())
        add_collection_button.place(x=0, y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Data
        self._collection_tree_content = {}

        ##########
        # Final
        ##########

        cell_x = 0

        status_button = tkinter.Button(self,
                                       text="Status",
                                       command=self._status,
                                       font=default_font())
        status_button.place(x=cell_x, y=cell_y)
        cell_x += PaymentWindow._SPACING

        recon_button = tkinter.Button(self,
                                      text="Reconc.",
                                      command=self._reconciliation,
                                      font=default_font())
        recon_button.place(x=cell_x, y=cell_y)
        cell_x += PaymentWindow._SPACING

        save_button = tkinter.Button(self,
                                     text="Save",
                                     command=self._save,
                                     font=default_font())
        save_button.place(x=cell_x, y=cell_y)
        cell_x += PaymentWindow._SPACING

        del_button = tkinter.Button(self,
                                    text="Delete",
                                    command=self._delete,
                                    font=default_font())
        del_button.place(x=cell_x, y=cell_y)
        cell_x += 100
        self._delete_warning_label = tkinter.Label(self, text="!")
        self._delete_warning_label.place(x=cell_x, y=cell_y)

        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]
Beispiel #9
0
    def __init__(self):
        # Initialization

        tkinter.Toplevel.__init__(self)
        self.wm_geometry(
            str(self._WINDOW_WIDTH) + "x" + str(self._WINDOW_HEIGHT))
        cell_y = 0

        # GUID
        self._guid = LabeledTextbox(self, "GUID", "", 0, cell_y)
        self._guid.disable()
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Project
        self._projects = Project.get_projects()
        self._project_combo_val = []
        self._build_project_combo_values()
        self._project_combo = LabeledCombobox(self, "Project",
                                              self._project_combo_val, 0,
                                              cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Location
        self._locations = model.location.get_locations()
        self._location_combo_val = []
        self._build_location_combo_values()
        self._location_combo = LabeledCombobox(self, "Location",
                                               self._location_combo_val, 0,
                                               cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Date
        self._date = LabeledTextbox(self, "Date",
                                    datetime.datetime.now().isoformat(), 0,
                                    cell_y)
        save_button = tkinter.Button(self,
                                     text="Ecz",
                                     command=self._ecz_click,
                                     font=default_font())
        save_button.place(x=(config.CONSTANTS["GUI_CELL_WIDTH"] * 2 + 150),
                          y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Duration
        self._duration = LabeledTextbox(self, "Duration", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Work
        self._work = LabeledTextbox(self, "Work", "", 0, cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Button
        save_button = tkinter.Button(self,
                                     text="Save",
                                     command=self._save_click,
                                     font=default_font())
        save_button.place(x=config.CONSTANTS["GUI_CELL_WIDTH"], y=cell_y)
        cell_y += config.CONSTANTS["GUI_CELL_HEIGHT"]

        # Status
        self._status_label = tkinter.Label(master=self,
                                           text="",
                                           font=default_font())
        self._status_label.place(x=0,
                                 y=cell_y,
                                 width=self._WINDOW_WIDTH,
                                 height=config.CONSTANTS["GUI_CELL_HEIGHT"])