lockaz_app/app/views/admin/p_customers/_p_customer.html.haml
Nicolas Bally f20fe482c6 initial
2020-04-06 10:38:07 +02:00

64 lines
2.0 KiB
Plaintext

%tr#p_customer{:id => p_customer.id}
-tr = {}
-tr[:enabled] = capture do
%td
-if p_customer.enabled
Actif
-else
%span.red
=ic :lock
Client bloqué :
=p_customer.disabled_raison
-tr[:code] = capture do
%td= p_customer.code
-tr[:p_commercial] = capture do
%td
= p_customer.p_commercial.long_name if p_customer.p_commercial
-tr[:accounting_zone] = capture do
%td
= p_customer.accounting_zone.name if p_customer.accounting_zone
-tr[:name] = capture do
%td= p_customer.show_name
-tr[:p_payment_type] = capture do
%td
-if p_customer.p_payment_type
= p_customer.p_payment_type.name
-tr[:particular] = capture do
%td
-if p_customer.particular
= p_customer.particular.cp
= p_customer.particular.city
= p_customer.particular.country
-tr[:actions] = capture do
%td.actions
-if params[:offre].to_s == "true"
-if p_customer.enabled
-if params[:action_type].to_s == "Facture"
=link_to ic(:"arrow-right")+" Sélectionner", new_admin_price_document_path(:p_customer_id => p_customer.id), :class => "btn btn-primary btn-ap-add"
-else
=link_to ic(:"arrow-right")+" Sélectionner", new_admin_p_customer_sheet_path(:p_customer_id => p_customer.id), :class => "btn btn-primary btn-ap-add"
-else
.badge.badge-danger
=ic :lock
Client bloqué :
=p_customer.disabled_raison
-else
= link_to i(:"trash-o"), [:admin, p_customer], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce client ? ' } , :remote => true if p_customer.can_destroy?
= link_to i(:pencil), edit_admin_p_customer_path(p_customer), :remote => false
= link_to i(:eye), admin_p_customer_path(p_customer)
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_customer}