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"]])
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}")
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=''))
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=''))
def _status(self): startup_url("payment_status", query_string=f"guid={self._payment.guid}")
def _address_book(): IncubusFactory.get_instance().user_event() startup_url("address_book")
def _iban_list(): IncubusFactory.get_instance().user_event() startup_url("iban_list")
def _net_worth(): IncubusFactory.get_instance().user_event() startup_url("net_worth")
def _ecz_activity(): IncubusFactory.get_instance().user_event() startup_url("ecz_activity_comparison")
def _inc_tax_rates(): IncubusFactory.get_instance().user_event() startup_url("income_tax_rates")
def _currency_account(): IncubusFactory.get_instance().user_event() startup_url("curr_acc_dist")
def _asset_profit(): IncubusFactory.get_instance().user_event() startup_url("asset_profit")
def _reconciliation(self): query = "names=" + urllib.parse.quote(self._payment.company.name, safe='') startup_url("reconciliation", query_string=query)
def _bank_account_balance(): IncubusFactory.get_instance().user_event() startup_url("bank_account_balances")
def _workdays_wo_activity(): IncubusFactory.get_instance().user_event() startup_url("workdays_wo_activity")
def _salary_simulation(): IncubusFactory.get_instance().user_event() startup_url("salary_simulation")
def _budget_plan_vs_actual(): IncubusFactory.get_instance().user_event() startup_url("budget_plan_vs_actual")
def _akbank_statement(): IncubusFactory.get_instance().user_event() startup_url("akbank_statement_sum")
def _activity_report(): IncubusFactory.get_instance().user_event() startup_url("activity_list")