Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# VertexClient Changelog

This file tracks all the changes (https://keepachangelog.com/en/1.0.0/) made to the client. This allows parsers such as Dependabot to provide a clean overview in pull requests.
## [v0.12.0] - 2026-03-12

#### Added

- Add optional `posting_date` parameter to Invoice payload. When provided, sets `@postingDate` on the `InvoiceRequest` element for Vertex tax reporting period control. Omitting `posting_date` preserves existing behavior (no `@postingDate` attribute sent).

## [v0.11.3] - 2025-01-21

#### Changed
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ VertexClient.invoice(
# Vertex's Document Number is a unique referencial identifier for this invoice.
document_number: "unique-identifier-1a43b",

# Optional posting date for controlling the Vertex tax reporting period (e.g. ship date).
# Defaults to documentDate when omitted.
posting_date: "2018-11-16",

# ... All of the of the payload from quotation here ...
)

Expand Down
10 changes: 6 additions & 4 deletions lib/vertex_client/payloads/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ def validate!
end

def body
super.merge({
:'@documentNumber' => params[:document_number],
:'@documentDate' => params[:date]
})
b = super.merge({
:'@documentNumber' => params[:document_number],
:'@documentDate' => params[:date]
})
b[:'@postingDate'] = params[:posting_date] if params[:posting_date].present?
b
end

def document_number_missing?
Expand Down
2 changes: 1 addition & 1 deletion lib/vertex_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VertexClient
VERSION = '0.11.3'
VERSION = '0.12.0'
end
10 changes: 10 additions & 0 deletions test/payloads/invoice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
}), payload.body
end

it 'includes @postingDate in body when posting_date is provided' do
working_quote_params[:posting_date] = '2026-03-12'
payload = VertexClient::Payload::Invoice.new(working_quote_params)
assert_equal '2026-03-12', payload.body[:'@postingDate']
end

it 'omits @postingDate from body when posting_date is not provided' do
assert_nil payload.body[:'@postingDate']
end

it_supports_tax_only_adjustments(:working_quote_params)

it 'supports sending is_tax_exempt to customer' do
Expand Down
Loading