Skip to content

Commit

Permalink
Merge pull request #81 from abhishek-sage/feature/invoice-net-amount
Browse files Browse the repository at this point in the history
Adding support of net_amount and base_currency_net_amount to INVOICE model
  • Loading branch information
lockstep-rakesh authored Nov 6, 2024
2 parents 19b85a2 + dff1277 commit 40467b0
Show file tree
Hide file tree
Showing 22 changed files with 2,514 additions and 3,467 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lockstep_rails (0.3.88)
lockstep_rails (0.3.89)
rails

GEM
Expand Down
15 changes: 6 additions & 9 deletions app/platform_api/schema/aging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ def self.id_ref
nil
end

# Aging bucket of outstanding balance data (days past due date of invoice)
# @type: integer
# @format: int32
field :bucket

# Currency code of aging bucket
# The Group Key the aging data is calculated for.
# @type: string
field :currency_code
# @format: uuid
field :group_key

# Outstanding balance for the given aging bucket
# The total AR outstanding amount in the group's base currency.
# @type: number
# @format: double
field :outstanding_balance
field :total


has_many :buckets, {:class_name=>"Schema::AgingBucketResult", :included=>true}

end
18 changes: 18 additions & 0 deletions app/platform_api/schema/aging_bucket_result.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Schema::AgingBucketResult < Lockstep::ApiRecord

# ApiRecord will crash unless `id_ref` is defined
def self.id_ref
nil
end

# The different buckets used for aging.
field :bucket

# The outstanding amount for the given bucket in the group's base currency.
# @type: number
# @format: double
field :value



end
1 change: 1 addition & 0 deletions app/platform_api/schema/batch_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def self.id_ref
has_many :credit_memo_applications, {:class_name=>"Schema::CreditMemoAppliedSync", :included=>true}
has_many :invoices, {:class_name=>"Schema::InvoiceSync", :included=>true}
has_many :invoice_lines, {:class_name=>"Schema::InvoiceLineSync", :included=>true}
has_many :invoice_workflow_statuses, {:class_name=>"Schema::InvoiceWorkflowStatusSync", :included=>true}
has_many :custom_fields, {:class_name=>"Schema::CustomFieldSync", :included=>true}
has_many :payments, {:class_name=>"Schema::PaymentSync", :included=>true}
has_many :payment_applications, {:class_name=>"Schema::PaymentAppliedSync", :included=>true}
Expand Down
5 changes: 1 addition & 4 deletions app/platform_api/schema/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ def self.id_ref
# @format: uuid
field :modified_user_id

# The name of the user who last modified this company
# @type: string
field :modified_user_name

# Federal Tax ID
# @type: string
field :tax_id
Expand Down Expand Up @@ -276,6 +272,7 @@ def self.id_ref
belongs_to :created_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"created_user_id"}
belongs_to :modified_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"modified_user_id"}

has_many :company_identifiers, {:class_name=>"Schema::CompanyIdentifier", :included=>true}
has_many :notes, {:class_name=>"Lockstep::Note", :included=>true, :foreign_key=>:object_key, :polymorphic=>{:table_key=>"Company"}}
has_many :attachments, {:class_name=>"Schema::Attachment", :included=>true}
has_many :contacts, {:class_name=>"Schema::Contact", :included=>true}
Expand Down
26 changes: 26 additions & 0 deletions app/platform_api/schema/company_identifier.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class Schema::CompanyIdentifier < Lockstep::ApiRecord

# ApiRecord will crash unless `id_ref` is defined
def self.id_ref
nil
end

# The type of identifier.
# @type: string
field :type

# The value of the identifier.
# @type: string
field :value

# The jurisdiction of the identifier.
# @type: string
field :jurisdiction

# The sub-jurisdiction of the identifier, ISO3166-1 or ISO3166-2 code.
# @type: string
field :subjurisdiction



end
4 changes: 4 additions & 0 deletions app/platform_api/schema/company_magic_link_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def self.id_ref
# @format: uuid
field :invite_status_modified_user_id

# This flag indicates whether the company is currently active.
# @type: boolean
field :is_active

belongs_to :company, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}
belongs_to :account, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}

Expand Down
44 changes: 44 additions & 0 deletions app/platform_api/schema/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def self.id_ref
# @format: uuid
field :customer_id

# The name of the customer associated with this invoice.
# @type: string
field :customer_name

# The unique ID of this record as it was known in its originating financial system.
#
# If this company record was imported from a financial system, it will have the value `ErpKey`
Expand Down Expand Up @@ -87,6 +91,12 @@ def self.id_ref
# @type: string
field :workflow_status_notes

# The reason code for the current workflow status of this invoice.
#
# Empty if workflow status does not require a reason code.
# @type: string
field :workflow_status_reason_code

# A code identifying the terms given to the purchaser. This field is imported directly from the originating
# financial system and does not follow a specified format.
# @type: string
Expand Down Expand Up @@ -120,6 +130,21 @@ def self.id_ref
# @format: double
field :outstanding_balance_amount

# The shipping amount of this invoice in it's tendered currency.
# @type: number
# @format: double
field :shipping_amount

# The total value of this invoice with deductions, excluding taxes.
# @type: number
# @format: double
field :net_amount

# The shipping amount of this invoice in it's tendered currency.
# @type: number
# @format: double
field :base_currency_shipping_amount

# The reporting date for this invoice.
# @type: string
# @format: date
Expand Down Expand Up @@ -151,6 +176,11 @@ def self.id_ref
# @format: date-time
field :imported_date, Types::Params::DateTime

# The date when the tax becomes applicable; used for tax reporting.
# @type: string
# @format: date
field :tax_point_date

# The ID number of the invoice's origination address
# @type: string
# @format: uuid
Expand Down Expand Up @@ -243,6 +273,11 @@ def self.id_ref
# @format: double
field :base_currency_outstanding_balance_amount

# The total value of this invoice with deductions, excluding taxes and in the invoice's base currency.
# @type: number
# @format: double
field :base_currency_net_amount

# Possible statuses for a record that supports ERP Update.
field :erp_update_status

Expand Down Expand Up @@ -278,6 +313,14 @@ def self.id_ref
# @type: object
field :erp_system_attributes

# The source of the invoice (e.g ERP, Peppol, Email, Gov System)
# @type: string
field :document_source

# The jurisdiction or country from which the invoice originates (e.g., US, AU)
# @type: string
field :jurisdiction

belongs_to :company, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}
belongs_to :account, {:class_name=>"Lockstep::Account", :primary_key=>:company_id, :foreign_key=>"company_id"}
belongs_to :customer, {:class_name=>"Lockstep::Connection", :primary_key=>:company_id, :foreign_key=>"customer_id"}
Expand All @@ -294,5 +337,6 @@ def self.id_ref
has_many :credit_memos, {:class_name=>"Schema::CreditMemoInvoice", :included=>true}
has_many :custom_field_values, {:class_name=>"Schema::CustomFieldValue", :included=>true}
has_many :custom_field_definitions, {:class_name=>"Schema::CustomFieldDefinition", :included=>true}
has_many :tax_summary, {:class_name=>"Schema::TaxSummary", :included=>true}

end
27 changes: 27 additions & 0 deletions app/platform_api/schema/invoice_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def self.id_ref
# @type: string
field :description

# The location to where specific items from an invoice will go.
# @type: string
field :location

# For lines measured in a unit other than "quantity", this code indicates the measurement system for the quantity field.
# If the line is measured in quantity, this field is null.
# @type: string
Expand Down Expand Up @@ -84,6 +88,15 @@ def self.id_ref
# @format: double
field :total_amount

# The tax code used for taxation on this line.
# @type: string
field :tax_code

# The taxation rate for this line.
# @type: number
# @format: double
field :tax_rate

# The amount of sales tax for this line in the transaction's currency.
# @type: number
# @format: double
Expand All @@ -94,10 +107,24 @@ def self.id_ref
# @format: double
field :base_currency_sales_tax_amount

# The total value of this invoice line with deductions, excluding taxes.
# @type: number
# @format: double
field :net_amount

# The total value of this invoice line with deductions, excluding taxes and in the invoice's base currency.
# @type: number
# @format: double
field :base_currency_net_amount

# If this line is tax exempt, this code indicates the reason for the exemption.
# @type: string
field :exemption_code

# Unique identifier for tax purposes, used for reference, validation, or compliance.
# @type: string
field :tax_uid

# If null, the products specified on this line were delivered on the same date as all other lines.
# If not null, this line was delivered or finalized on a different date than the overall invoice.
# @type: string
Expand Down
27 changes: 27 additions & 0 deletions app/platform_api/schema/invoice_line_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def self.id_ref
# @type: string
field :description

# The location to where specific items from an invoice will go.
# @type: string
field :location

# For lines measured in a unit other than "quantity", this code indicates the measurement system for the quantity field.
# If the line is measured in quantity, this field is null.
# @type: string
Expand Down Expand Up @@ -82,6 +86,15 @@ def self.id_ref
# @format: double
field :total_amount

# The tax code used for taxation on this line.
# @type: string
field :tax_code

# The taxation rate for this line.
# @type: number
# @format: double
field :tax_rate

# The amount of sales tax for this line in the transaction's currency.
# @type: number
# @format: double
Expand All @@ -92,10 +105,24 @@ def self.id_ref
# @format: double
field :base_currency_sales_tax_amount

# The total value of this invoice line with deductions, excluding taxes.
# @type: number
# @format: double
field :net_amount

# The total value of this invoice line with deductions, excluding taxes and in the invoice's base currency.
# @type: number
# @format: double
field :base_currency_net_amount

# If this line is tax exempt, this code indicates the reason for the exemption.
# @type: string
field :exemption_code

# Unique identifier for tax purposes, used for reference, validation, or compliance.
# @type: string
field :tax_uid

# If null, the products specified on this line were delivered on the same date as all other lines.
# If not null, this line was delivered or finalized on a different date than the overall invoice.
# @type: string
Expand Down
43 changes: 43 additions & 0 deletions app/platform_api/schema/invoice_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ def self.id_ref
# @format: double
field :outstanding_balance_amount

# The shipping amount of this invoice in it's tendered currency.
# @type: number
# @format: double
field :shipping_amount

# The total value of this invoice with deductions, excluding taxes.
# @type: number
# @format: double
field :net_amount

# The reporting date for this invoice.
# @type: string
# @format: date-time
Expand Down Expand Up @@ -158,6 +168,11 @@ def self.id_ref
# @format: date-time
field :imported_date, Types::Params::DateTime

# The date when the tax becomes applicable; used for tax reporting.
# @type: string
# @format: date-time
field :tax_point_date, Types::Params::DateTime

# The origination address for this invoice
# @type: string
field :origin_address_line1
Expand Down Expand Up @@ -331,6 +346,16 @@ def self.id_ref
# @format: double
field :base_currency_outstanding_balance_amount

# The shipping amount of this invoice in it's tendered currency.
# @type: number
# @format: double
field :base_currency_shipping_amount

# The total value of this invoice with deductions, excluding taxes and in the invoice's base currency.
# @type: number
# @format: double
field :base_currency_net_amount

# True if the invoice is an E-Invoice
# @type: boolean
field :is_e_invoice
Expand All @@ -348,10 +373,28 @@ def self.id_ref
# @type: string
field :workflow_status_notes

# The reason code for the current workflow status of this invoice.
#
# Empty if workflow status does not require a reason code.
# @type: string
field :workflow_status_reason_code

# Workflow status code dictated by government standards
# @type: string
field :workflow_status_code

# A JSON string representing the tax information for this invoice
# @type: string
field :tax_summary

# The source of the invoice (e.g ERP, Peppol, Email, Gov System)
# @type: string
field :document_source

# The jurisdiction or country from which the invoice originates (e.g., US, AU)
# @type: string
field :jurisdiction



end
Loading

0 comments on commit 40467b0

Please sign in to comment.