diff --git a/HISTORY.md b/HISTORY.md index 66f1a361..1270599f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,7 @@ ## Unreleased ### Added -* +* Update ServiceResaleItem record fields/record refs for 2021.2. `cost_estimate_type`, `item_options_list`, `matrix_type`, `out_of_stock_behavior`, `overall_quantity_pricing_type`, `presentation_item_list`, `site_category_list`, `sitemap_priority`, `translations_list`, `vsoe_deferral`, `vsoe_permit_discount`, `vsoe_sop_group` were all removed as fields as the are not simple fields, they require special classes. (#500) ### Fixed * diff --git a/lib/netsuite/records/service_resale_item.rb b/lib/netsuite/records/service_resale_item.rb index 0eef3bc4..47431baa 100644 --- a/lib/netsuite/records/service_resale_item.rb +++ b/lib/netsuite/records/service_resale_item.rb @@ -9,28 +9,132 @@ class ServiceResaleItem actions :get, :get_list, :add, :update, :delete, :upsert, :search - fields :available_to_partners, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date, - :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description, - :include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_inactive, :is_online, :is_taxable, - :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, - :minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior, - :out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax, - :rate, :related_items_description, :sales_description, :search_keywords, - :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description, - :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component, - :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group - - # item_task_templates_list - # billing_rates_matrix -- RecordRef, via listAcct::ItemOptionsList - - record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account, - :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code, - :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :store_display_image, - :store_display_thumbnail, :store_item_template, :tax_schedule, :units_type + fields :amortization_period, + :available_to_partners, + :contingent_revenue_handling, + :cost, + :cost_estimate, + :cost_estimate_units, + :cost_units, + :created_date, + :create_job, + :currency, + :defer_rev_rec, + :direct_revenue_posting, + :display_name, + :dont_show_price, + :enforce_min_qty_internally, + :exclude_from_sitemap, + :featured_description, + :generate_accruals, + :include_children, + :is_donation_item, + :is_fulfillable, + :is_gco_compliant, + :is_inactive, + :is_online, + :is_taxable, + :item_id, + :last_modified_date, + :manufacturing_charge_item, + :matrix_item_name_template, + :max_donation_amount, + :maximum_quantity, + :meta_tag_html, + :minimum_quantity, + :minimum_quantity_units, + :no_price_message, + :offer_support, + :on_special, + :out_of_stock_message, + :page_title, + :prices_include_tax, + :purchase_description, + :purchase_order_amount, + :purchase_order_quantity, + :purchase_order_quantity_diff, + :rate, + :receipt_amount, + :receipt_quantity, + :receipt_quantity_diff, + :related_items_description, + :residual, + :sales_description, + :search_keywords, + :show_default_donation_amount, + :soft_descriptor, + :specials_description, + :store_description, + :store_detailed_description, + :store_display_name, + :upc_code, + :url_component, + :use_marginal_rates, + :vendor_name, + :vsoe_delivered, + :vsoe_price + + record_refs :amortization_template, + :bill_exch_rate_variance_acct, + :billing_schedule, + :bill_price_variance_acct, + :bill_qty_variance_acct, + :klass, + :consumption_unit, + :cost_category, + :create_revenue_plans_on, + :custom_form, + :deferral_account, + :deferred_revenue_account, + :department, + :expense_account, + :income_account, + :interco_def_rev_account, + :interco_expense_account, + :interco_income_account, + :issue_product, + :item_revenue_category, + :location, + :parent, + :pricing_group, + :purchase_tax_code, + :purchase_unit, + :quantity_pricing_schedule, + :revenue_allocation_group, + :revenue_recognition_rule, + :rev_rec_forecast_rule, + :rev_reclass_f_x_account, + :rev_rec_schedule, + :sales_tax_code, + :sale_unit, + :store_display_image, + :store_display_thumbnail, + :store_item_template, + :tax_schedule, + :units_type, + :vendor - field :pricing_matrix, PricingMatrix field :custom_field_list, CustomFieldList + field :item_vendor_list, ItemVendorList + field :matrix_option_list, MatrixOptionList + field :pricing_matrix, PricingMatrix field :subsidiary_list, RecordRefList + # TODO: field :accounting_book_detail_list, ItemAccountingBookDetailList + # TODO: field :billing_rates_matrix, BillingRatesMatrix + # TODO: field :cost_estimate_type, ItemCostEstimateType + # TODO: field :item_options_list, ItemOptionsList + # TODO: field :item_task_templates_list, ServiceItemTaskTemplatesList + # TODO: field :hierarchy_versions_list, ServiceResaleItemHierarchyVersionsList + # TODO: field :matrix_type, ItemMatrixType + # TODO: field :out_of_stock_behavior, ItemOutOfStockBehavior + # TODO: field :overall_quantity_pricing_type, ItemOverallQuantityPricingType + # TODO: field :presentation_item_list, PresentationItemList + # TODO: field :site_category_list, SiteCategoryList + # TODO: field :sitemap_priority, SitemapPriority + # TODO: field :translations_list, TranslationList + # TODO: field :vsoe_deferral, VsoeDeferral + # TODO: field :vsoe_permit_discount, VsoePermitDiscount + # TODO: field :vsoe_sop_group, VsoeSopGroup attr_reader :internal_id attr_accessor :external_id diff --git a/spec/netsuite/records/service_resale_item_spec.rb b/spec/netsuite/records/service_resale_item_spec.rb index b59f9917..76de5747 100644 --- a/spec/netsuite/records/service_resale_item_spec.rb +++ b/spec/netsuite/records/service_resale_item_spec.rb @@ -5,31 +5,128 @@ it 'has the right fields' do [ - :available_to_partners, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date, - :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description, - :include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_inactive, :is_online, :is_taxable, - :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, - :minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior, - :out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax, - :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description, - :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component, - :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group + :amortization_period, + :available_to_partners, + :contingent_revenue_handling, + :cost, + :cost_estimate, + :cost_estimate_units, + :cost_units, + :created_date, + :create_job, + :currency, + :defer_rev_rec, + :direct_revenue_posting, + :display_name, + :dont_show_price, + :enforce_min_qty_internally, + :exclude_from_sitemap, + :featured_description, + :generate_accruals, + :include_children, + :is_donation_item, + :is_fulfillable, + :is_gco_compliant, + :is_inactive, + :is_online, + :is_taxable, + :item_id, + :last_modified_date, + :manufacturing_charge_item, + :matrix_item_name_template, + :max_donation_amount, + :maximum_quantity, + :meta_tag_html, + :minimum_quantity, + :minimum_quantity_units, + :no_price_message, + :offer_support, + :on_special, + :out_of_stock_message, + :page_title, + :prices_include_tax, + :purchase_description, + :purchase_order_amount, + :purchase_order_quantity, + :purchase_order_quantity_diff, + :rate, + :receipt_amount, + :receipt_quantity, + :receipt_quantity_diff, + :related_items_description, + :residual, + :sales_description, + :search_keywords, + :show_default_donation_amount, + :soft_descriptor, + :specials_description, + :store_description, + :store_detailed_description, + :store_display_name, + :upc_code, + :url_component, + :use_marginal_rates, + :vendor_name, + :vsoe_delivered, + :vsoe_price, ].each do |field| expect(item).to have_field(field) end + end - # TODO there is a probably a more robust way to test this - expect(item.custom_field_list.class).to eq(NetSuite::Records::CustomFieldList) - expect(item.pricing_matrix.class).to eq(NetSuite::Records::PricingMatrix) - expect(item.subsidiary_list.class).to eq(NetSuite::Records::RecordRefList) + it 'has all the right fields with specific classes' do + { + custom_field_list: NetSuite::Records::CustomFieldList, + item_vendor_list: NetSuite::Records::ItemVendorList, + matrix_option_list: NetSuite::Records::MatrixOptionList, + pricing_matrix: NetSuite::Records::PricingMatrix, + subsidiary_list: NetSuite::Records::RecordRefList, + }.each do |field, klass| + expect(item).to have_field(field, klass) + end end it 'has the right record_refs' do [ - :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account, - :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code, - :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :store_display_image, - :store_display_thumbnail, :store_item_template, :tax_schedule, :units_type + :amortization_template, + :bill_exch_rate_variance_acct, + :billing_schedule, + :bill_price_variance_acct, + :bill_qty_variance_acct, + :klass, + :consumption_unit, + :cost_category, + :create_revenue_plans_on, + :custom_form, + :deferral_account, + :deferred_revenue_account, + :department, + :expense_account, + :income_account, + :interco_def_rev_account, + :interco_expense_account, + :interco_income_account, + :issue_product, + :item_revenue_category, + :location, + :parent, + :pricing_group, + :purchase_tax_code, + :purchase_unit, + :quantity_pricing_schedule, + :revenue_allocation_group, + :revenue_recognition_rule, + :rev_rec_forecast_rule, + :rev_reclass_f_x_account, + :rev_rec_schedule, + :sales_tax_code, + :sale_unit, + :store_display_image, + :store_display_thumbnail, + :store_item_template, + :tax_schedule, + :units_type, + :vendor, ].each do |record_ref| expect(item).to have_record_ref(record_ref) end