Пример #1
0
    def fill_with_invoice(self,
                          invoice: model.timesheet.invoice.Invoice,
                          browser: bool = False,
                          invoice_dir: bool = False):
        """ Fills the window with the given invoice
        If browser == True, also opens a new browser window & address book.
        This functionality is typically used when creating a new invoice.
        """
        self._guid.value = invoice.guid
        self._serial.value = invoice.serial
        self._invoice_date.value = str(invoice.invoice_date)
        self._due_date.value = str(invoice.due_date)
        self._amount.set_value(invoice.amount, invoice.currency)
        self._payer_combo.company_name = invoice.payer.name
        self._vat.value = str(invoice.vat_rate)
        self._vat_amount.value = str(invoice.vat_amount)
        self._total_amount.value = str(invoice.amount_plus_vat)
        self._income_tax.value = str(invoice.income_tax_rate)
        self._income_tax_amount.value = str(invoice.income_tax_amount)
        self._file_path.value = invoice.file_path

        if browser:
            startup_url("address_book", query_string=f"name={invoice.payer.name}")
            webbrowser.open(config.CONSTANTS["E_ARCHIVE_URL"])

        if invoice_dir and "INVOICE_FILE_PATH" in config.CONSTANTS:
            subprocess.call(["open", "-R", config.CONSTANTS["INVOICE_FILE_PATH"]])
Пример #2
0
    def _status_rep_click(self):
        selected_payments = self._get_selected_payments()
        if len(selected_payments) == 0:
            return

        first_selected_payment = selected_payments[0]
        startup_url("payment_status",
                    query_string=f"guid={first_selected_payment.guid}")
Пример #3
0
    def _reconciliation__company_selected(companies: List):
        IncubusFactory.get_instance().user_event()
        names = ""
        for selco in companies:
            if names != "":
                names += ","
            names += selco.name

        startup_url("reconciliation",
                    query_string="names=" + urllib.parse.quote(names, safe=''))
Пример #4
0
    def _recon_rep_click(self):
        selected_payments = self._get_selected_payments()
        if len(selected_payments) == 0:
            return

        selected_companies = []
        for sel_pay in selected_payments:
            already_appended = False
            for sel_comp in selected_companies:
                if sel_pay.company.name == sel_comp.name:
                    already_appended = True
                    break
            if not already_appended:
                selected_companies.append(sel_pay.company)

        names = ""
        for selco in selected_companies:
            if names != "":
                names += ","
            names += selco.name

        startup_url("reconciliation",
                    query_string="names=" + urllib.parse.quote(names, safe=''))
Пример #5
0
 def _status(self):
     startup_url("payment_status",
                 query_string=f"guid={self._payment.guid}")
Пример #6
0
 def _address_book():
     IncubusFactory.get_instance().user_event()
     startup_url("address_book")
Пример #7
0
 def _iban_list():
     IncubusFactory.get_instance().user_event()
     startup_url("iban_list")
Пример #8
0
 def _net_worth():
     IncubusFactory.get_instance().user_event()
     startup_url("net_worth")
Пример #9
0
 def _ecz_activity():
     IncubusFactory.get_instance().user_event()
     startup_url("ecz_activity_comparison")
Пример #10
0
 def _inc_tax_rates():
     IncubusFactory.get_instance().user_event()
     startup_url("income_tax_rates")
Пример #11
0
 def _currency_account():
     IncubusFactory.get_instance().user_event()
     startup_url("curr_acc_dist")
Пример #12
0
 def _asset_profit():
     IncubusFactory.get_instance().user_event()
     startup_url("asset_profit")
Пример #13
0
 def _reconciliation(self):
     query = "names=" + urllib.parse.quote(self._payment.company.name,
                                           safe='')
     startup_url("reconciliation", query_string=query)
Пример #14
0
 def _bank_account_balance():
     IncubusFactory.get_instance().user_event()
     startup_url("bank_account_balances")
Пример #15
0
 def _workdays_wo_activity():
     IncubusFactory.get_instance().user_event()
     startup_url("workdays_wo_activity")
Пример #16
0
 def _salary_simulation():
     IncubusFactory.get_instance().user_event()
     startup_url("salary_simulation")
Пример #17
0
 def _budget_plan_vs_actual():
     IncubusFactory.get_instance().user_event()
     startup_url("budget_plan_vs_actual")
Пример #18
0
 def _akbank_statement():
     IncubusFactory.get_instance().user_event()
     startup_url("akbank_statement_sum")
Пример #19
0
 def _activity_report():
     IncubusFactory.get_instance().user_event()
     startup_url("activity_list")