diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 97766078b1..c3d9a0f08e 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -77,7 +77,7 @@ class Enterprise < ActiveRecord::Base after_rollback :restore_permalink scope :by_name, order('name') - scope :visible, where(:visible => true) + scope :visible, where(visible: true) scope :confirmed, where('confirmed_at IS NOT NULL') scope :unconfirmed, where('confirmed_at IS NULL') scope :activated, where("confirmed_at IS NOT NULL AND sells != 'unspecified'") diff --git a/app/views/admin/enterprises/form/_business_details.html.haml b/app/views/admin/enterprises/form/_business_details.html.haml index 7fb4d2ccb3..92f727d8d3 100644 --- a/app/views/admin/enterprises/form/_business_details.html.haml +++ b/app/views/admin/enterprises/form/_business_details.html.haml @@ -3,8 +3,21 @@ = f.label :abn, 'ABN' .omega.eight.columns = f.text_field :abn, { placeholder: "eg. 99 123 456 789"} + .row .alpha.three.columns = f.label :acn, 'ACN' .omega.eight.columns - = f.text_field :acn, { placeholder: "eg. 123 456 789"} \ No newline at end of file + = f.text_field :acn, { placeholder: "eg. 123 456 789"} + +.row + .three.columns.alpha + %label= t('charges_sales_tax') + .two.columns + = f.radio_button :charges_sales_tax, true +   + = f.label :charges_sales_tax, "Yes", :value => "true" + .five.columns.omega + = f.radio_button :charges_sales_tax, false +   + = f.label :charges_sales_tax, "No", :value => "false" diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 41a02f2de2..50fbe8a6db 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -21,3 +21,4 @@ en-GB: search_by_name: Search by name... producers: UK Producers producers_join: UK producers are now welcome to join Open Food Network UK. + charges_sales_tax: Charges sales tax? diff --git a/config/locales/en.yml b/config/locales/en.yml index fe5bafa19f..fe7d3c53aa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -18,3 +18,4 @@ en: search_by_name: Search by name or suburb... producers: Aussie Producers producers_join: Australian producers are now welcome to join the Open Food Network. + charges_sales_tax: Charges GST? diff --git a/db/migrate/20150407234739_add_charges_sales_tax_to_enterprises.rb b/db/migrate/20150407234739_add_charges_sales_tax_to_enterprises.rb new file mode 100644 index 0000000000..ba8dfa7a08 --- /dev/null +++ b/db/migrate/20150407234739_add_charges_sales_tax_to_enterprises.rb @@ -0,0 +1,5 @@ +class AddChargesSalesTaxToEnterprises < ActiveRecord::Migration + def change + add_column :enterprises, :charges_sales_tax, :boolean, null: false, default: false + end +end diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index a75125bdb5..395f882b51 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -218,6 +218,7 @@ feature %q{ click_link "Business Details" fill_in 'enterprise_abn', :with => '09812309823' fill_in 'enterprise_acn', :with => '' + choose 'Yes' # enterprise_charges_sales_tax click_link "Address" fill_in 'enterprise_address_attributes_address1', :with => '35 Ballantyne St' @@ -237,6 +238,9 @@ feature %q{ @enterprise.reload expect(@enterprise.owner).to eq user + click_link "Business Details" + page.should have_checked_field "enterprise_charges_sales_tax_true" + click_link "Payment Methods" page.should have_checked_field "enterprise_payment_method_ids_#{payment_method.id}"