Skip to content

Commit

Permalink
feat(netsuite): Add due date to netsuite invoice (#2356)
Browse files Browse the repository at this point in the history
## Description

Add `duedate` to netsuite invoice payload body.
  • Loading branch information
ivannovosad authored Aug 1, 2024
1 parent 4d2b960 commit 6a22eae
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def body
'otherrefnum' => invoice.number,
'custbody_lago_id' => invoice.id,
'custbody_ava_disable_tax_calculation' => true,
'custbody_lago_invoice_link' => invoice_url
'custbody_lago_invoice_link' => invoice_url,
'duedate' => due_date
},
'lines' => [
{
Expand All @@ -42,6 +43,10 @@ def invoice_url
URI.join(url, "/customer/#{invoice.customer.id}/", "invoice/#{invoice.id}/overview").to_s
end

def due_date
invoice.payment_due_date&.strftime("%-m/%-d/%Y")
end

def item(fee)
mapped_item = if fee.charge?
billable_metric_item(fee)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
URI.join(url, "/customer/#{invoice.customer.id}/", "invoice/#{invoice.id}/overview").to_s
end

let(:due_date) { invoice.payment_due_date.strftime("%-m/%-d/%Y") }

let(:params) do
{
'type' => 'invoice',
Expand All @@ -146,7 +148,8 @@
'otherrefnum' => invoice.number,
'custbody_lago_id' => invoice.id,
'custbody_ava_disable_tax_calculation' => true,
'custbody_lago_invoice_link' => invoice_url
'custbody_lago_invoice_link' => invoice_url,
'duedate' => due_date
},
'lines' => [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
URI.join(url, "/customer/#{customer.id}/", "invoice/#{invoice.id}/overview").to_s
end

let(:due_date) { invoice.payment_due_date.strftime("%-m/%-d/%Y") }

let(:body) do
{
'type' => 'invoice',
Expand All @@ -151,7 +153,8 @@
'otherrefnum' => invoice.number,
'custbody_lago_id' => invoice.id,
'custbody_ava_disable_tax_calculation' => true,
'custbody_lago_invoice_link' => invoice_link
'custbody_lago_invoice_link' => invoice_link,
'duedate' => due_date
},
'lines' => [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
URI.join(url, "/customer/#{invoice.customer.id}/", "invoice/#{invoice.id}/overview").to_s
end

let(:due_date) { invoice.payment_due_date.strftime("%-m/%-d/%Y") }

let(:params) do
{
'type' => 'salesorder',
Expand All @@ -142,7 +144,8 @@
'otherrefnum' => invoice.number,
'custbody_lago_id' => invoice.id,
'custbody_ava_disable_tax_calculation' => true,
'custbody_lago_invoice_link' => invoice_url
'custbody_lago_invoice_link' => invoice_url,
'duedate' => due_date
},
'lines' => [
{
Expand Down

0 comments on commit 6a22eae

Please sign in to comment.