diff --git a/config/locales/en.yml b/config/locales/en.yml index 9c38d6b867..114b0c54bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2810,6 +2810,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using report_header_customer_code: Customer Code report_header_product: Product report_header_product_properties: Product Properties + report_header_product_tax_category: Product Tax Category report_header_quantity: Quantity report_header_max_quantity: Max Quantity report_header_variant: Variant @@ -2822,6 +2823,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using report_header_supplier: Supplier report_header_producer: Producer report_header_producer_suburb: Producer Suburb + report_header_producer_charges_sales_tax?: GST/VAT Registered report_header_unit: Unit report_header_group_buy_unit_quantity: Group Buy Unit Quantity report_header_cost: Cost diff --git a/lib/reporting/reports/orders_and_fulfillment/base.rb b/lib/reporting/reports/orders_and_fulfillment/base.rb index d4e269184b..9d20695e09 100644 --- a/lib/reporting/reports/orders_and_fulfillment/base.rb +++ b/lib/reporting/reports/orders_and_fulfillment/base.rb @@ -10,6 +10,7 @@ module Reporting def default_params { + fields_to_hide: [:producer_charges_sales_tax?, :product_tax_category], q: { completed_at_gt: 1.month.ago.beginning_of_day, completed_at_lt: 1.day.from_now.beginning_of_day @@ -51,10 +52,18 @@ module Reporting proc { |line_items| line_items.first.variant.product.supplier.name } end + def supplier_charges_sales_tax? + proc { |line_items| line_items.first.variant.product.supplier.charges_sales_tax } + end + def product_name proc { |line_items| line_items.first.variant.product.name } end + def product_tax_category + proc { |line_items| line_items.first.variant.product.tax_category&.name } + end + def hub_name proc { |line_items| line_items.first.order.distributor.name } end diff --git a/lib/reporting/reports/orders_and_fulfillment/order_cycle_supplier_totals.rb b/lib/reporting/reports/orders_and_fulfillment/order_cycle_supplier_totals.rb index 7646c4ceae..3eb7d222f6 100644 --- a/lib/reporting/reports/orders_and_fulfillment/order_cycle_supplier_totals.rb +++ b/lib/reporting/reports/orders_and_fulfillment/order_cycle_supplier_totals.rb @@ -13,7 +13,9 @@ module Reporting total_units: proc { |line_items| total_units(line_items) }, curr_cost_per_unit: proc { |line_items| line_items.first.price }, total_cost: proc { |line_items| line_items.sum(&:amount) }, - sku: variant_sku + sku: variant_sku, + producer_charges_sales_tax?: supplier_charges_sales_tax?, + product_tax_category: product_tax_category } end @@ -44,7 +46,11 @@ module Reporting end def default_params - super.merge({ fields_to_hide: ["sku"] }) + super.merge({ fields_to_hide: [ + :sku, + :producer_charges_sales_tax?, + :product_tax_category + ] }) end end end