Form for changing enterprise type specifies trial length

This commit is contained in:
Rob Harrington
2016-09-07 11:13:05 +10:00
parent be51a55f16
commit da55eb6d27
2 changed files with 10 additions and 2 deletions

View File

@@ -16,6 +16,10 @@ module Admin
private
def free_use?
Spree::Config[:account_invoices_monthly_fixed] == 0 && Spree::Config[:account_invoices_monthly_rate] == 0
end
def fixed_description
fixed_amount = Spree::Money.new(Spree::Config[:account_invoices_monthly_fixed], {currency: Spree::Config[:currency]} ).rounded
monthly_bill_includes_fixed? ? "#{fixed_amount}" : ""

View File

@@ -76,8 +76,12 @@
%span.error{ ng: { show: "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } }
Please choose one of the options above.
- if @enterprise.sells == 'unspecified' && @enterprise.shop_trial_start_date.nil?
%input.button.big{ type: 'submit', value: 'Start 30 Day Trial', ng: { click: "submit(change_type)", show: "sells=='own' || sells=='any'" } }
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)", hide: "sells=='own' || sells=='any'" } }
-if free_use?
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)" } }
- else
- trial_length = Spree::Config[:shop_trial_length_days]
%input.button.big{ type: 'submit', value: "Start #{trial_length}-Day Shop Trial", ng: { click: "submit(change_type)", show: "sells=='own' || sells=='any'" } }
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)", hide: "sells=='own' || sells=='any'" } }
- elsif @enterprise.sells == 'unspecified'
%input.button.big{ type: 'submit', value: 'Select and continue', ng: { click: "submit(change_type)" } }
- else