Skip to content

Commit

Permalink
Update last export details before attachment (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Feb 21, 2024
1 parent 68e8c21 commit 5f0b9c0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions apps/quickbooks_online/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ def create_bill(expense_group, task_log_id, last_export: bool):

resolve_errors_for_exported_expense_group(expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)

generate_export_url_and_update_expense(expense_group)

load_attachments(qbo_connection, created_bill['Bill']['Id'], 'Bill', expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)


def __validate_expense_group(expense_group: ExpenseGroup, general_settings: WorkspaceGeneralSettings): # noqa: C901
bulk_errors = []
Expand Down Expand Up @@ -378,13 +378,13 @@ def create_cheque(expense_group, task_log_id, last_export: bool):

resolve_errors_for_exported_expense_group(expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)

generate_export_url_and_update_expense(expense_group)

load_attachments(qbo_connection, created_cheque['Purchase']['Id'], 'Purchase', expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)


@handle_qbo_exceptions()
def create_qbo_expense(expense_group, task_log_id, last_export: bool):
Expand Down Expand Up @@ -431,13 +431,13 @@ def create_qbo_expense(expense_group, task_log_id, last_export: bool):

resolve_errors_for_exported_expense_group(expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)

generate_export_url_and_update_expense(expense_group)

load_attachments(qbo_connection, created_qbo_expense['Purchase']['Id'], 'Purchase', expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)


@handle_qbo_exceptions()
def create_credit_card_purchase(expense_group: ExpenseGroup, task_log_id, last_export: bool):
Expand Down Expand Up @@ -483,13 +483,13 @@ def create_credit_card_purchase(expense_group: ExpenseGroup, task_log_id, last_e

resolve_errors_for_exported_expense_group(expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)

generate_export_url_and_update_expense(expense_group)

load_attachments(qbo_connection, created_credit_card_purchase['Purchase']['Id'], 'Purchase', expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)


@handle_qbo_exceptions()
def create_journal_entry(expense_group, task_log_id, last_export: bool):
Expand Down Expand Up @@ -533,13 +533,13 @@ def create_journal_entry(expense_group, task_log_id, last_export: bool):

resolve_errors_for_exported_expense_group(expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)

generate_export_url_and_update_expense(expense_group)

load_attachments(qbo_connection, created_journal_entry['JournalEntry']['Id'], 'JournalEntry', expense_group)

if last_export:
update_last_export_details(expense_group.workspace_id)


def check_expenses_reimbursement_status(expenses):
all_expenses_paid = True
Expand Down

0 comments on commit 5f0b9c0

Please sign in to comment.