This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/views/admin/price_lines/_form.html.haml

92 lines
4.9 KiB
Plaintext

.row.qi_pannel.qi_plain.padding.price_line_form.col-12.field{:style =>"border-left:4px solid gray;margin-bottom:10px;padding-left:5px;"}
.take.mr-1{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
=ic :arrows
.col-3
= form.input :p_product_ref, as: :select, collection: PProductRef.all.map{ |p_product_ref| [p_product_ref.member_label, p_product_ref.id] }, label: "Référence :", input_html: {class:"p_product_ref_select"}
.input-group
-# %label Référence
-# %input.p_product_ref_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.member_label}" if form.object.p_product_ref), :class => "p_product_ref_name"}
-# = form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
-# .input-group-append
-# =link_to "#", class: "btn btn-dark",:onclick => "key=genRanHex(12);select_product_from_manager(key);$(this).closest('tr').find('.p_product_ref_id').attr('id', 'p_product_ref_id_'+key);$(this).closest('tr').find('.p_product_ref_name').attr('id', 'p_product_ref_name_'+key);$(this).closest('tr').find('.p_product_ref_qte').attr('id', 'p_product_ref_qte_'+key);return false;" do
-# =ic(:search)
-form.object.forced_price = true if form.object.ct_u_price_ht
-# -if form.object.forced_price and form.object.p_product_ref
-# .col-3
-# .mx-2
-# .form-inline
-# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label => false, label_class: "mr-1", :value => form.object.th_price_u_ht)
-# -else
-# .col-3
-# .mx-2
-# .form-inline
-# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label =>false, label_class: "mr-1")
-# .col-3
-# .form-inline.mr-2{:style => ("display:none;" if !current_admin or !current_admin.has_permission?("customer-sheets-personalised-price"))}
-# = form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "form-inline input_price_line_forced_price"}
-# .forced_price_wrapper.mx-2{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
.col-3
= form.input :qte, :label => "Quantité :", :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
.col-3
= form.input :ct_u_price_ht, :label => "Prix Unitaire HT :", :input_html => { class: "mx-2"}
-# .col-3
-# =form.input :ct_tva_account_id, :collection => options_from_collection_for_select(TvaRate.where(:accounting_zone_id => (@p_customer ? @p_customer.accounting_zone_id : nil)).all, "id", "member_label", form.object.tva_account_id), :as => :select ,:label => false, :include_blank => false , :input_html => {:class => "input_price_line_tva_account_id form-control custom-select"}
.col-1.text-center.my-auto
%span.destroy{style: "font-size: 2rem;"}=link_to_remove_fields ic(:"trash-o"), form
= qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
= form.hidden_field :position, :class => "price_line_position_input"
:javascript
-# $('.p_product_ref_autocomplete_input').focus()
-# $( function() {
-# $('.p_product_ref_autocomplete_input').autocomplete({
-# source: function( request, response ) {
-# $.ajax( {
-# url: "/admin/p_product_refs/autocomplete.json",
-# dataType: "json",
-# data: {
-# search: request.term,
-# p_customer_id: $(".p_customer_id").val()
-# },
-# success: function(data){
-# arr = jQuery.map( data, function( item ) {
-# return {
-# label: item.member_label,
-# value: item.member_label,
-# id: item.id
-# }
-# });
-# response(arr)
-# }
-# });
-# },
-# minLength: 2,
-# select: function( event, ui ) {
-# $(this).next(".p_product_ref_id").val(ui.item.id)
-# form = $(this).closest(".price_line_form")
-# $.ajax( {
-# url: "/admin/p_product_refs/"+ui.item.id+"/get_infos.json",
-# dataType: "json",
-# data: {
-# type: "price",
-# qte: form.find(".input_price_line_qte").val(),
-# p_customer_id: $(".p_customer_id").val()
-# },
-# success: function (data) {
-# form.find(".input_price_line_price_u_ht").val(data.price);
-# form.find(".input_price_line_tva_account_id").val(data.tva_account_id);
-# form.find(".input_price_line_tva_account_value").val(data.tva_account_value);
-# form.find(".input_price_line_weight_u").val(data.weight);
-# }
-# });
-# //return false
-# }
-# });
-# });