Skip to content

Commit

Permalink
Revert "fix(integrations): Fix invoices with progressive billing" (#3170
Browse files Browse the repository at this point in the history
)

Reverts #3166
  • Loading branch information
ivannovosad authored Feb 12, 2025
1 parent 7270abf commit 6a0d2a6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ def discounts
}
end

if credit_item && invoice.progressive_billing_credit_amount_cents > 0
output << {
'external_id' => credit_item.external_id,
'description' => 'Usage already billed',
'units' => 1,
'precise_unit_amount' => -amount(invoice.progressive_billing_credit_amount_cents, resource: invoice),
'taxes_amount_cents' => 0,
'account_code' => credit_item.external_account_code
}
end

if credit_note_item && invoice.credit_notes_amount_cents > 0
output << {
'external_id' => credit_note_item.external_id,
Expand Down
21 changes: 0 additions & 21 deletions app/services/integrations/aggregator/invoices/payloads/netsuite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,6 @@ def discounts
}
end

if credit_item && invoice.progressive_billing_credit_amount_cents > 0
output << {
'item' => credit_item.external_id,
'account' => credit_item.external_account_code,
'quantity' => 1,
'rate' => -amount(invoice.progressive_billing_credit_amount_cents, resource: invoice),
'taxdetailsreference' => 'credit_item_progressive_billing'
}
end

if credit_note_item && invoice.credit_notes_amount_cents > 0
output << {
'item' => credit_note_item.external_id,
Expand Down Expand Up @@ -200,17 +190,6 @@ def discount_taxes
}
end

if credit_item && invoice.progressive_billing_credit_amount_cents > 0
output << {
'taxbasis' => 1,
'taxamount' => 0,
'taxrate' => invoice.taxes_rate,
'taxtype' => tax_item.tax_type,
'taxcode' => tax_item.tax_code,
'taxdetailsreference' => 'credit_item_progressive_billing'
}
end

if credit_note_item && invoice.credit_notes_amount_cents > 0
output << {
'taxbasis' => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
organization:,
coupons_amount_cents: 2000,
prepaid_credit_amount_cents: 4000,
progressive_billing_credit_amount_cents: 100,
credit_notes_amount_cents: 6000,
taxes_amount_cents: 200,
issuing_date: DateTime.new(2024, 7, 8)
Expand Down Expand Up @@ -213,13 +212,6 @@
'rate' => -40.0,
'taxdetailsreference' => 'credit_item'
},
{
'item' => '6',
'account' => '66',
'quantity' => 1,
'rate' => -1.0,
'taxdetailsreference' => 'credit_item_progressive_billing'
},
{
'item' => '1', # Fallback item instead of credit note
'account' => '11',
Expand Down Expand Up @@ -361,14 +353,6 @@
'taxrate' => 0.0,
'taxtype' => 'some_type'
},
{
'taxamount' => 0,
'taxbasis' => 1,
'taxcode' => 'some_code',
'taxdetailsreference' => 'credit_item_progressive_billing',
'taxrate' => 0.0,
'taxtype' => 'some_type'
},
{
'taxamount' => 0,
'taxbasis' => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
organization:,
coupons_amount_cents: 2000,
prepaid_credit_amount_cents: 4000,
progressive_billing_credit_amount_cents: 100,
credit_notes_amount_cents: 6000,
taxes_amount_cents: 200,
issuing_date: DateTime.new(2024, 7, 8)
Expand Down Expand Up @@ -175,14 +174,6 @@
'taxes_amount_cents' => 0,
'account_code' => '66'
},
{
'external_id' => '6',
'description' => 'Usage already billed',
'units' => 1,
'precise_unit_amount' => -1.0,
'taxes_amount_cents' => 0,
'account_code' => '66'
},
{
'external_id' => '1',
'description' => 'Credit note',
Expand Down

0 comments on commit 6a0d2a6

Please sign in to comment.