 class BuyVmModal extends KDModalView
-  
+
   constructor: (options = {}, data) ->
     do (o = options) ->
       o.title    ?= "Create a new VM"

          paymentField.addSubView new BillingMethodView {}, method

          @choiceForm.addCustomData 'accountCode', method.accountCode

        else

          paymentField.addSubView new KDSelectBox
            defaultValue  : preferredAccountCode ? methods[0].accountCode
            name          : 'accountCode'
            selectOptions : methods.map (method) ->
              title       : KD.utils.getPaymentMethodTitle method
              value       : method.accountCode

  addAggregateData: (formData) ->
    for own key, val of formData

      when 'billing choice'   then @choiceForm.show()
      when 'billing entry'    then @entryForm.show()
      when 'confirm'
        confirmData = @getAggregatedData()
        confirmData.billingInfo = @currentMethod
        @confirmForm.setData confirmData
        @confirmForm.show()

  createConfirmForm: -> new BuyVmConfirmView
