!!! %html{:lang => "fr"} %head %meta{:charset => "utf-8"}/ %meta{:content => "IE=Edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/ %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/ %title= @title || "Admin" = csrf_meta_tags = stylesheet_link_tag :admin, :media => :all = javascript_include_tag "admin" =javascript_include_tag "https://maps.google.com/maps/api/js?sensor=false®ion=FR" =#javascript_include_tag "https://yidas.github.io/jquery-freeze-table/dist/js/freeze-table.js" %body.admin{:id => "body_#{@admin_space}"} #right_bar =link_to image_tag("/logo-sadem.png"), "/", :id => "logo" -if false .element =link_to admin_i_tasks_path do .cat#big_cat_todos =ic :"tasks" To do -if true .element =link_to admin_p_customers_path do .cat#big_cat_clients =ic :"address-book-o" Clients .element =link_to admin_m_odr_reps_path do .cat#big_cat_stocks =ic :"cubes" OpĂ©rations ODR -if false .element =link_to admin_p_customer_sheets_path do .cat#big_cat_ventes =ic :"shopping-cart" Commandes .element =link_to admin_price_documents_path do .cat#big_cat_documents =ic :"file-text-o" Documents .element =link_to admin_m_odr_virements_path do .cat#big_cat_payments =ic :"eur" Virements -if false .element =link_to admin_p_stats_path do .cat#big_cat_statistiques =ic :"bar-chart" Stats .bottom .element -if current_admin.has_permission?("admins") =link_to admin_admins_path do .cat#big_cat_preferences =ic :"cog" -if @admin_space %script =raw '$("#big_cat_'+@admin_space.to_s+'").addClass("active");' #qi_header_wrapper.fh-fixedHeader %nav#admin_nav.navbar.navbar-default.navbar-inverse{role: "navigation"} .container-fluid .navbar-header %button.navbar-toggle{"data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", type: "button"} %span.sr-only Toggle navigation %span.icon-bar %span.icon-bar %span.icon-bar #bs-example-navbar-collapse-1.collapse.navbar-collapse %ul.nav.navbar-nav -if @admin_space =render :partial => "admin/admin_spaces/#{@admin_space.to_s}" %ul.nav.navbar-nav.navbar-right %li.dropdown %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"} =current_admin.firstname =current_admin.name %b.caret %ul.dropdown-menu -if current_admin.has_permission?("admins") %li= link_to "Gestion des admins", admin_admins_path %li.divider %li=link_to "Se dĂ©connecter", admin_admin_auth_path(1), method: :delete %li =link_to ic(:refresh), "#", :onclick => "location.reload();" = yield :header #main_yield= yield :coffeescript $(".price_lines_form").sortable tolerance: "pointer" handle : ".take" stop : (evt, ui) -> i = 0 $(this).find(".price_line_form").each -> i += 1 $(this).find(".price_line_position_input").val(i) :coffeescript parse_field = (val) -> return parseFloat(val) round_price = (val) -> return (Math.round(val*100)/ 100) update_qi_price_form = (form) -> tot_lines_ht = 0.0 tot_lines_tva = 0.0 tot_lines_ttc = 0.0 weight_tot = 0.0 form.find(".price_line_form").each -> #alert($(this).find(".destroy input").val() == "false") if ($(this).find(".destroy input").val() == "false") qte = parse_field($(this).find(".input_price_line_qte").val()) if $(this).find(".input_price_line_forced_price").is(':checked') price_u_ht = parse_field($(this).find(".input_price_line_ct_u_price_ht").val()) $(this).find(".forced_price_wrapper").show() else price_u_ht = parse_field($(this).find(".input_price_line_price_u_ht").val()) $(this).find(".input_price_line_ct_u_price_ht").val("") $(this).find(".forced_price_wrapper").hide() line_tot_line_ht = round_price(qte * price_u_ht) $(this).find(".input_price_line_tot_line_ht").val(line_tot_line_ht) tot_discount_ht = parse_field($(this).find(".input_price_line_tot_discount_ht").val()) tva_account_value = parse_field($(this).find(".input_price_line_tva_account_value").val()) tot_amount_ht = round_price(line_tot_line_ht + tot_discount_ht) $(this).find(".input_price_line_tot_amount_ht").val(tot_amount_ht) tot_amount_tva = round_price(tot_amount_ht * (tva_account_value/ 100)) $(this).find(".input_price_line_tot_amount_tva").val(tot_amount_tva) tot_amount_ttc = round_price(tot_amount_ht + tot_amount_tva) $(this).find(".input_price_line_tot_amount_ttc").val(tot_amount_ttc) tot_lines_ht += round_price(tot_amount_ht) tot_lines_tva += round_price(tot_amount_tva) tot_lines_ttc += round_price(tot_amount_ttc) weight_u = parse_field($(this).find(".input_price_line_weight_u").val()) line_weight_tot = round_price(weight_u * qte) $(this).find(".input_price_line_weight_tot").val(line_weight_tot) weight_tot += line_weight_tot form.find(".input_price_line_block_tot_lines_ht").val(tot_lines_ht) ct_tot_discount_percent = parse_field(form.find(".input_price_line_block_ct_tot_discount_percent").val()) ct_tot_discount_percent = 0.0 if isNaN(ct_tot_discount_percent) ct_tot_discount_ht = round_price((ct_tot_discount_percent / -100) * tot_lines_ht) ct_tot_discount_tva = round_price((ct_tot_discount_percent / -100) * tot_lines_tva) ct_tot_discount_ttc = round_price((ct_tot_discount_percent / -100) * tot_lines_ttc) tot_discount_ht = round_price(ct_tot_discount_ht) tot_discount_tva = round_price(ct_tot_discount_tva) tot_discount_ttc = round_price(ct_tot_discount_ttc) form.find(".input_price_line_block_tot_discount_ht").val(tot_discount_ht) form.find(".input_price_line_block_tot_discount_tva").val(tot_discount_tva) form.find(".input_price_line_block_tot_discount_ttc").val(tot_discount_ttc) #tot_discount_ht = parse_field(form.find(".input_price_line_block_tot_discount_ht").val()) #tot_discount_tva = parse_field(form.find(".input_price_line_block_tot_discount_tva").val()) #tot_discount_ttc = parse_field(form.find(".input_price_line_block_tot_discount_ttc").val()) tot_fdp_ht = parse_field(form.find(".input_price_line_block_tot_fdp_ht").val()) tot_fdp_tva = parse_field(form.find(".input_price_line_block_tot_fdp_tva").val()) tot_fdp_ttc = parse_field(form.find(".input_price_line_block_tot_fdp_ttc").val()) tot_amount_ht = round_price(tot_lines_ht + tot_discount_ht + tot_fdp_ht) tot_amount_tva = round_price(tot_lines_tva + tot_discount_tva + tot_fdp_tva) tot_amount_ttc = round_price(tot_lines_ttc + tot_discount_ttc + tot_fdp_ttc) form.find(".input_price_line_block_tot_amount_ht").val(tot_amount_ht) form.find(".input_price_line_block_tot_amount_tva").val(tot_amount_tva) form.find(".input_price_line_block_tot_amount_ttc").val(tot_amount_ttc) form.find(".input_price_line_block_weight_tot").val(weight_tot) $(".qi_price_form").on "change", -> update_qi_price_form($(this)) $(".qi_price_form").on "keyup", -> update_qi_price_form($(this)) $(".qi_price_form").each -> update_qi_price_form($(this)) #flashs= bootstrap_flash .clear = timer_watcher() if Rails.env.production?