From 9ac2810d68b11b5932ab18050db6434b6c50183b Mon Sep 17 00:00:00 2001 From: Viswas Date: Mon, 25 Nov 2024 18:03:58 +0530 Subject: [PATCH] fix: include receipt links in all line items for cc charges --- apps/netsuite/tasks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/netsuite/tasks.py b/apps/netsuite/tasks.py index 9ee71f70..7b82574b 100644 --- a/apps/netsuite/tasks.py +++ b/apps/netsuite/tasks.py @@ -561,10 +561,11 @@ def create_credit_card_charge(expense_group, task_log_id, last_export): if expense.amount < 0: refund = True - attachment_link = load_attachments(netsuite_connection, expense, expense_group, credit_card_charge_object) + for expense in expense_group.expenses.all(): + attachment_link = load_attachments(netsuite_connection, expense, expense_group, credit_card_charge_object) - if attachment_link: - attachment_links[expense.expense_id] = attachment_link + if attachment_link: + attachment_links[expense.expense_id] = attachment_link created_credit_card_charge = netsuite_connection.post_credit_card_charge( credit_card_charge_object, credit_card_charge_lineitems_objects, general_mappings, attachment_links, refund