2020-11-09 15:38:09 +01:00

105 lines
3.6 KiB
Plaintext
Executable File

:coffeescript
@update_p_customer_form = () ->
if $("#p_customer_enabled").is(':checked')
$(".disabled_raison").hide()
else
$(".disabled_raison").show()
=semantic_form_for [:admin, @p_customer], :remote => false, :html => {:onchange => "update_p_customer_form();"} do |form|
=#debug @p_customer.errors.messages
.qi_row
.qi_pannel.qi_plain.padding
=form.inputs do
.row.qi_cancel_margins
.col-sm-4
%br
= form.input :enabled, :label => "Client actif ?", :as => :boolean, :input_html => {:id => "p_customer_enabled"}
.col-sm-8
.disabled_raison{:style => ("display:none;" if @p_customer.enabled)}
= form.input :disabled_raison, :label => "Raison du blocage :", :as => :select, :collection => ["Impayé","Litige", "N'existe plus"], :include_blank => false
.row.qi_cancel_margins
.col-sm-4
= form.input :p_commercial_id, :label => "Commercial :", :include_blank => false, :collection => PCommercial.order(:name).all, :as => :select, :member_label => :long_name
.col-sm-4
= form.input :accounting_zone_id, :label => "Zone :", :collection => AccountingZone.all, :as => :select, :include_blank => false
.col-sm-4
=# form.input :fav, :label => "Favoris ?"
= form.input :p_customer_cat_id, :label => "Catégorie client", :include_blank => false, :collection => PCustomerCat.order(:name).all, :as => :select
-if @p_customer.id or (@p_customer.code? and @p_customer.errors[:code])
= form.input :code, :label => "Code client :"
.qi_row
.qi_pannel.qi_plain.padding
Adresses :
-if false
%p.right= link_to_add_fields "Ajouter une adresse", form, :particulars
.particulars_form
=form.semantic_fields_for :particulars do |form|
=render :partial => "admin/particulars/form", :locals => {:form => form}
.qi_row
.qi_pannel.qi_plain.padding
Contacts du client :
%hr
.p_contacts_form
=form.semantic_fields_for :p_contacts do |form|
=render :partial => "admin/p_contacts/form", :locals => {:form => form}
%p= link_to_add_fields ic(:plus)+" Ajouter un contact au client", form, :p_contacts
.qi_row
.qi_pannel.qi_plain.padding
= form.input :siret, :label => "Siret :"
= form.input :ape, :label => "Ape :"
= form.input :tva_intra, :label => "TVA intra. :"
= form.input :website, :label => "Site Web :"
.qi_row
.qi_pannel.qi_plain.padding
-if true
%h4 Paiements
.row.qi_cancel_margins
.col-sm-4
= form.input :comptant, :label => "Paiement comptant nécessaire ?"
-if false
= form.input :acompte, :label => "Acompte nécessaire ?"
= form.input :acompte_percent, :label => "Pourcentage d'acompte :"
.col-sm-4
= form.input :payment_delais, :label => "Délais jour de paiement :"
= form.input :payment_fin_de_mois, :label => "Fin de mois ?"
.col-sm-4
= form.input :p_payment_type_id, :label => "Type de paiement :", :include_blank => false, :collection => PPaymentType.order(:name).all, :as => :select, :input_html => {:id => "payment_type_id_select"}
.large_actions
.actions
=form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"