mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Admin can set enterprises to charge or not charge sales tax
This commit is contained in:
@@ -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'")
|
||||
|
||||
@@ -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"}
|
||||
= 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"
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddChargesSalesTaxToEnterprises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :enterprises, :charges_sales_tax, :boolean, null: false, default: false
|
||||
end
|
||||
end
|
||||
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user