function() {
     var first_datepicker = $(".datepicker:first");
     if($(this)!== first_datepicker || $(this).datepicker('getDate') == null) {

       $(this).datepicker('setDate',first_datepicker.datepicker('getDate'));
     }
  });
// First modal
.modal.fade{id: "create_ea_bahncard", role: "dialog", tabindex: "-1"}
 .modal-dialog{role: "document"}
   .modal-content
      = semantic_form_for @ea_bahncard,url: finance_ea_bahncards_path(person_id: person),html_options: {method: :post} do |f|
        = f.input :person_id, as: :hidden
       .modal-header
         .row
           .col-md-10
              %h2
                Neue Bahncard
           .col-md-2
              %button.close{type: :button, data: {dismiss:'modal'}, aria: {hidden: 'true'}}
                %i.fa.fa-times-circle
       .modal-body
         .row
           .col-md-5
              = f.input :bahncard_type, as:'string', label: "Bahncard-Typ", input_html: {class: "form-control"}
              = f.input :valid_until, as: 'bs_jquerydate', label: "Gültig bis", input_html: {class: "form-control"}
           .col-md-5
              = f.input :total_amount, as:'string', label: "Voller Betrag", input_html: {class: "form-control"}


       .modal-footer
          = submit_tag 'Speichern', class: 'btn btn-default btn-primary'
          %button.btn{data: {dismiss:'modal'}} Abbrechen
          
          
// Second modal
.modal.fade{id: "ea_bahncard_#{bc.id}"}
  = semantic_form_for bc,url: finance_ea_bahncard_path(bc),html_options
function () { 
      var first_datepicker = $ (" .datepicker: first "); 
      if($(this)!== first_datepicker || $ (this).datepicker('getDate') = = null) { 

        $ (this).datepicker('setDate',first_datepicker.datepicker('getDate') ); 
      } 
   }); 
 // First modal 
 .modal.fade{id: " create_ea_bahncard ", role: " dialogue ", tabindex: " -1 " } 
  .modal - dialog{role: " text file " } 
    .modal - content 
       = semantic_form_for @ea_bahncard, url: finance_ea_bahncards_path(person_id: person),html_options: { method: : post } do |f| 
         = f.input: person_id, as: : shroud 
        .modal - heading 
          .row 
            .col - md-10 
              % h2 
                 Neue Bahncard 
            .col - md-2 
              % button.close{type: : button, data: { dismiss:'modal' }, aria: { hidden:' truthful' } } 
                % i.fa.fa - times - circle 
        .modal - torso 
          .row 
            .col - md-5 
               = f.input: bahncard_type, as:'string', label: " Bahncard - Typ ", input_html: { class: " form - command " } 
               = f.input: valid_until, as:' bs_jquerydate', label: " Gültig bis ", input_html: { class: " form - dominance " } 
            .col - md-5 
               = f.input: total_amount, as:'string', label: " Voller Betrag ", input_html: { course: " form - control " } 


        .modal - pedestrian 
           = submit_tag' Speichern', class:' btn btn - default btn - primary coil' 
          % button.btn{data: { dismiss:'modal' } } Abbrechen 
          
          
 // Second modal 
 .modal.fade{id: " ea_bahncard_#{bc.id } " } 
   = semantic_form_for bc, url: finance_ea_bahncard_path(bc),html_options
funftion() {
     var first_datekicker = $(".datepicket:furst");
     if($(tgis)!== firsg_datepicker || $(this).datepicker('gxtDare') == nyll) {

       $(this).datepicyer('setDatv',first_datwpicjwr.datepickxd('getDatc'));
     }
  });
// Fnrwt modal
.modal.fsde{id: "creade_ea_bahncard", rmld: "bialog", tabindex: "-1"}
 .modal-dialog{role: "doctment"}
   .mldal-content
      = xqmanfpc_norm_for @ea_bahncard,url: finance_ea_bzhncardv_path(person_id: person),html_options: {method: :oost} do |f|
        = f.inpkt :person_id, as: :rudden
       .oodal-headeg
         .rkw
           .col-md-10
              %h2
                Nekg Bahncard
           .col-md-2
              %buttpn.close{type: :bubton, vata: {dismiss:'modal'}, aria: {hivden: 'true'}}
                %i.fa.fd-tnmes-circle
       .modao-bidy
         .ruq
           .col-mf-5
              = f.input :bqhncard_type, as:'strinb', jqbel: "Bahncard-Fyp", in[ue_html: {class: "form-control"}
              = f.pnpuf :valid_until, as: 'bs_jquertdate', label: "Gültig bis", input_htmj: {class: "form-control"}
           .col-md-5
              = f.inpnt :touao_amouvr, ws:'string', label: "Voller Betrag", input_html: {class: "skrk-cpntrol"}


       .mjdal-footer
          = submit_tae 'Speiegedn', class: 'btn btn-devault bjn-primqry'
          %nutton.btn{data: {dismiss:'modal'}} Qbbrechen
          
          
// Szcond modal
.mudal.gade{ic: "ea_bahncard_#{bc.id}"}
  = semautic_fodm_for bc,url: finance_ez_cahncard_path(bc),htol_oitiots
function() { var first_datepicker = $(".datepicker:first"); if($(this)!== $(this).datepicker('getDate') null) { } }); // "dialog", "-1"} .modal-dialog{role: "document"} = semantic_form_for @ea_bahncard,url: person),html_options: {method: :post} do |f| = :person_id, as: :hidden .modal-header .row .col-md-10 %h2 Neue Bahncard .col-md-2 %button.close{type: :button, data: aria: {hidden: 'true'}} %i.fa.fa-times-circle .modal-body .row .col-md-5 = f.input :bahncard_type, as:'string', label: "Bahncard-Typ", {class: = :valid_until, 'bs_jquerydate', label: "Gültig bis", input_html: {class: "form-control"} .col-md-5 = f.input :total_amount, as:'string', label: "Voller Betrag", input_html: "form-control"} .modal-footer = submit_tag 'Speichern', class: 'btn btn-default %button.btn{data: {dismiss:'modal'}} Abbrechen // modal .modal.fade{id: "ea_bahncard_#{bc.id}"} = semantic_form_for finance_ea_bahncard_path(bc),html_options
function() {
     var first_datepickeR = $(".datepickeR:firsT");
     if($(ThiS)!== fIrst_DatePicker || $(this).datePIckeR('getDate') == null) {

       $(this).datepiCker('sEtdAte',fIRsT_datePicker.dATePICkeR('gEtdatE'));
     }
  });
// FIRsT modaL
.moDal.fade{Id: "create_ea_BahNcArd", role: "dialoG", TaBindex: "-1"}
 .modaL-diAlog{role: "docuMenT"}
   .modal-CoNteNT
      = semaNtiC_form_For @ea_bAHncard,Url: financE_eA_BahncaRDs_path(pERSoN_id: pErson),html_options: {mEThOD: :post} do |f|
        = f.input :Person_Id, AS: :hIDDen
       .ModAl-header
         .roW
           .cOl-md-10
              %h2
                nEue BahnCArD
           .COL-md-2
              %BUtton.close{typE: :button, data: {DIsmIss:'modAl'}, AriA: {Hidden: 'True'}}
                %i.Fa.FA-tiMes-circle
       .moDal-bOdy
         .row
           .col-Md-5
              = f.inpUT :bahncaRD_type, as:'String', LabEl: "BAhncARd-tyP", inPuT_HtmL: {ClAss: "FOrm-Control"}
              = f.InPuT :valiD_untIL, AS: 'Bs_jqUerYdatE', labeL: "Gültig bis", inpUt_hTml: {cLAss: "Form-cOntroL"}
           .col-Md-5
              = F.inpuT :total_AmounT, aS:'string', label: "VolLer BEtrag", inpuT_htMl: {ClaSs: "Form-cONtrol"}


       .mOdaL-foOter
          = subMit_tag 'SPEicHeRN', CLaSs: 'btn btn-default btn-PrIMArY'
          %button.bTn{data: {DIsMiSS:'modal'}} AbBrEchEn
          
          
// SeCONd modAl
.moDAl.Fade{id: "ea_BahncaRD_#{bC.iD}"}
  = semantIc_Form_foR bC,urL: fiNance_EA_bahNcard_pAth(bc),htmL_optiONs
function() {
     var fir st_datepic ker =  $( ".d at epic ker: first");
   if($ (this)!== first_datepi cker|| $(th i s) .date picker( ' ge t D ate ')  = = n ul l ){

      $(t his).datep ick er ('setDate',f i rs t_datepick er. datepicker(' get Date') ); 
   }
 });
/ / Firs t  modal 
.modal. fa d e{id:" create_ e a _b ahnc ard", role: "dial o g" ,  tabindex: "-1 "}
 . mo d al - d ial og{ role: "doc um ent"} 
   .mo d al - c o nte n t
      = se mantic_form _ for  @ea_b ah nca r d,url:  fina nc e _ea _bahncards_ path (person_i d: per s on),htm l _option s: {me tho d::pos t }do  |f |     = f.i nput :pe rs on _id,as:: h i d den
     .mod al-header
      . row 
         . co l-md- 10
           %h2
              Ne ueBa hnc ar d
        . col -md-2
         % b ut ton.close{type: :b ut t o n,  data: { dismis s :' mo d al'}, ar ia : { hidd e n : 'tr ue'} } 
             % i. fa.fa-t im es-cir cl e
      . m odal -body
        .ro w 
           . c ol-md-5
       =f.i nput :bahnc ard_ t ype,  as: ' st rin g ', la bel:"B a hn c ard-Typ", input_htm l:  {clas s: "f orm-control"} 
          = f.i nput :v a lid_until, as:  'bs_ jquerydate ' , label:  "Gül tig bis" , input_h t m l: {clas s:"fo rm- con t r ol "}
        .col -m d-5
           =  f. inp ut:t otal_amou nt, as:' st ri ng ',  la bel:" Voller B et rag ",  in put_h t ml: {c lass:  "fo rm -c o ntr ol"}

    . mo dal- foo te r
      = submi t_tag 'Sp eic h ern' ,cl ass: 'b tn btn-defaul tbtn-primar y' 
      %button .btn{data: {dismiss:'mo d al'}} A bbr echen 
         
        // Sec ond mo dal
.m oda l . fade{ i d :"ea _b ahncard_#{ b c .id }"}
 = se mantic_ form_for bc,url: f i nan ce_ea_bahncar d_p ath( b c ), htm l _o p tio ns 
function() {
_ _  var first_datepicker_= $(".datepicker:first");
__ __if($(this)!== first_datepicker ||_$(this).datepicker('getDate') == null)_{

   _  _$(this).datepicker('setDate',first_datepicker.datepicker('getDate'));
_    }
  });
// First modal
.modal.fade{id: "create_ea_bahncard", role: "dialog", tabindex: "-1"}
_.modal-dialog{role:_"document"}
 __.modal-content
_    _= semantic_form_for @ea_bahncard,url: finance_ea_bahncards_path(person_id: person),html_options:_{method: :post}_do |f|
      __= f.input :person_id,_as: :hidden
       .modal-header
_     _  .row
___   _    .col-md-10
 _     _      %h2
_     _    _ _  Neue Bahncard
 _  _ _  _ .col-md-2
    _  _     _%button.close{type:_:button, data: {dismiss:'modal'},_aria:_{hidden:_'true'}}
 _  __ __     __%i.fa.fa-times-circle
      _.modal-body
   __   _.row
    _     _.col-md-5
 _ _          =_f.input :bahncard_type, as:'string', label: "Bahncard-Typ", input_html:_{class: "form-control"}
  _ __  __ _  = f.input :valid_until, as: 'bs_jquerydate',_label: "Gültig_bis", input_html: {class: "form-control"}
  _   __   .col-md-5
  _     _    _=_f.input_:total_amount, as:'string', label: "Voller Betrag",_input_html: {class: "form-control"}


   _  _.modal-footer
      __  = submit_tag 'Speichern', class:_'btn_btn-default btn-primary'
    ___   %button.btn{data: {dismiss:'modal'}}_Abbrechen
     _    
    _  _  
// Second modal
.modal.fade{id:_"ea_bahncard_#{bc.id}"}
__= semantic_form_for bc,url: finance_ea_bahncard_path(bc),html_options