Sha256: 39bbd393f11d33c591ff146b1a22b34b4a41c997dca28b327bcb3e9bf3a31fad

Contents?: true

Size: 1.71 KB

Versions: 13

Compression:

Stored size: 1.71 KB

Contents

module NetSuite
  module Records
    class InvoiceItem
      include Support::Fields
      include Support::RecordRefs
      include Support::Records
      include Namespaces::TranSales

      fields :amount, :amount_ordered, :bin_numbers, :cost_estimate, :cost_estimate_type, :current_percent,
        :defer_rev_rec, :description, :gift_cert_from, :gift_cert_message, :gift_cert_number, :gift_cert_recipient_email,
        :gift_cert_recipient_name, :gross_amt, :inventory_detail, :is_taxable, :item_is_fulfilled, :license_code, :line,
        :klass, :options, :order_line, :percent_complete, :quantity, :quantity_available, :quantity_fulfilled,
        :quantity_on_hand, :quantity_ordered, :quantity_remaining, :rate, :rev_rec_end_date, :rev_rec_start_date,
        :serial_numbers, :ship_group, :tax1_amt, :tax_rate1, :tax_rate2, :vsoe_allocation, :vsoe_amount, :vsoe_deferral,
        :vsoe_delivered, :vsoe_permit_discount, :vsoe_price

      field :custom_field_list, CustomFieldList

      record_refs :department, :item, :job, :location, :price, :rev_rec_schedule, :ship_address, :ship_method, :tax_code, :units

      def initialize(attributes_or_record = {})
        case attributes_or_record
        when Hash
          initialize_from_attributes_hash(attributes_or_record)
        when self.class
          initialize_from_record(attributes_or_record)
        end
      end

      def initialize_from_record(record)
        self.attributes = record.send(:attributes)
      end

      def to_record
        rec = super
        if rec["#{record_namespace}:customFieldList"]
          rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
        end
        rec
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
netsuite-0.0.48 lib/netsuite/records/invoice_item.rb
netsuite-0.0.47 lib/netsuite/records/invoice_item.rb
netsuite-0.0.45 lib/netsuite/records/invoice_item.rb
netsuite-0.0.44 lib/netsuite/records/invoice_item.rb
netsuite-0.0.43 lib/netsuite/records/invoice_item.rb
netsuite-0.0.42 lib/netsuite/records/invoice_item.rb
netsuite-0.0.41 lib/netsuite/records/invoice_item.rb
netsuite-0.0.40 lib/netsuite/records/invoice_item.rb
netsuite-0.0.39 lib/netsuite/records/invoice_item.rb
netsuite-0.0.38 lib/netsuite/records/invoice_item.rb
netsuite-0.0.37 lib/netsuite/records/invoice_item.rb
netsuite-0.0.36 lib/netsuite/records/invoice_item.rb
netsuite-0.0.35 lib/netsuite/records/invoice_item.rb