From c9bb7bc51f6d543d8a2a5f3802b546feb4552dc9 Mon Sep 17 00:00:00 2001 From: Ivan Novosad Date: Fri, 25 Oct 2024 10:26:35 +0200 Subject: [PATCH] fix(netsuite): Add tranid to netsuite create invoice payload (#2739) ## Context NetSuite Sync Invoice format is wrong and failing. ## Description Fix netsuite invoice payload by: - re-add: `tranid` --- .../integrations/aggregator/invoices/payloads/netsuite.rb | 1 + .../integrations/aggregator/invoices/create_service_spec.rb | 1 + .../aggregator/invoices/payloads/netsuite_spec.rb | 4 ++++ .../aggregator/sales_orders/create_service_spec.rb | 1 + 4 files changed, 7 insertions(+) diff --git a/app/services/integrations/aggregator/invoices/payloads/netsuite.rb b/app/services/integrations/aggregator/invoices/payloads/netsuite.rb index baecd333c64..fe1f308f6e2 100644 --- a/app/services/integrations/aggregator/invoices/payloads/netsuite.rb +++ b/app/services/integrations/aggregator/invoices/payloads/netsuite.rb @@ -39,6 +39,7 @@ def body def columns result = { + 'tranid' => invoice.id, 'entity' => integration_customer.external_customer_id, 'taxregoverride' => true, 'taxdetailsoverride' => true, diff --git a/spec/services/integrations/aggregator/invoices/create_service_spec.rb b/spec/services/integrations/aggregator/invoices/create_service_spec.rb index e814a76dd92..a3a252e1f9b 100644 --- a/spec/services/integrations/aggregator/invoices/create_service_spec.rb +++ b/spec/services/integrations/aggregator/invoices/create_service_spec.rb @@ -140,6 +140,7 @@ 'type' => 'invoice', 'isDynamic' => true, 'columns' => { + 'tranid' => invoice.id, 'taxregoverride' => true, 'taxdetailsoverride' => true, 'entity' => integration_customer.external_customer_id, diff --git a/spec/services/integrations/aggregator/invoices/payloads/netsuite_spec.rb b/spec/services/integrations/aggregator/invoices/payloads/netsuite_spec.rb index 9cb04d30451..69ca5065e65 100644 --- a/spec/services/integrations/aggregator/invoices/payloads/netsuite_spec.rb +++ b/spec/services/integrations/aggregator/invoices/payloads/netsuite_spec.rb @@ -237,6 +237,7 @@ context 'when tax nexus is not present' do let(:columns) do { + 'tranid' => invoice.id, 'entity' => integration_customer.external_customer_id, 'taxregoverride' => true, 'taxdetailsoverride' => true, @@ -324,6 +325,7 @@ let(:columns) do { + 'tranid' => invoice.id, 'entity' => integration_customer.external_customer_id, 'taxregoverride' => true, 'taxdetailsoverride' => true, @@ -346,6 +348,7 @@ let(:columns) do { + 'tranid' => invoice.id, 'entity' => integration_customer.external_customer_id, 'taxregoverride' => true, 'taxdetailsoverride' => true, @@ -368,6 +371,7 @@ context 'when tax item is not mapped' do let(:columns) do { + 'tranid' => invoice.id, 'entity' => integration_customer.external_customer_id, 'taxregoverride' => true, 'taxdetailsoverride' => true, diff --git a/spec/services/integrations/aggregator/sales_orders/create_service_spec.rb b/spec/services/integrations/aggregator/sales_orders/create_service_spec.rb index 9250f86a2b0..b703560ae6c 100644 --- a/spec/services/integrations/aggregator/sales_orders/create_service_spec.rb +++ b/spec/services/integrations/aggregator/sales_orders/create_service_spec.rb @@ -136,6 +136,7 @@ 'type' => 'salesorder', 'isDynamic' => true, 'columns' => { + 'tranid' => invoice.id, 'taxregoverride' => true, 'taxdetailsoverride' => true, 'entity' => integration_customer.external_customer_id,