87 lines
2.4 KiB
Plaintext
87 lines
2.4 KiB
Plaintext
%tr#p_document{:id => p_document.id}
|
|
-tr = {}
|
|
|
|
|
|
-tr[:created_at] = capture do
|
|
%td
|
|
=l p_document.created_at, :format => :date
|
|
|
|
|
|
-tr[:p_customer_sheet] = capture do
|
|
%td
|
|
=link_to "##{p_document.element.id}", admin_p_customer_sheet_path(p_document.element)
|
|
|
|
-tr[:p_customer] = capture do
|
|
%td
|
|
-if p_document.p_customer
|
|
=link_to p_document.p_customer.show_name, [:admin, p_document.p_customer]
|
|
|
|
|
|
-tr[:label] = capture do
|
|
%td
|
|
=p_document.label
|
|
|
|
-tr[:d_number] = capture do
|
|
%td
|
|
=link_to p_document.d_number, admin_p_document_path(p_document.token)
|
|
|
|
|
|
-tr[:cache_total_ht] = capture do
|
|
%td.numeraire
|
|
= number_to_currency p_document.cache_total_ht
|
|
|
|
-tr[:cache_total_ttc] = capture do
|
|
%td.numeraire
|
|
= number_to_currency p_document.cache_total_ttc
|
|
|
|
|
|
|
|
-tr[:paid] = capture do
|
|
|
|
%td
|
|
=ic(:check) if p_document.paid
|
|
|
|
-tr[:cache_to_paid] = capture do
|
|
%td.numeraire
|
|
-if p_document.cache_to_paid?
|
|
=number_to_currency p_document.cache_to_paid
|
|
|
|
-tr[:echeance_date] = capture do
|
|
%td
|
|
=l p_document.echeance_date, :format => :date if p_document.echeance_date
|
|
|
|
-tr[:echeance_days] = capture do
|
|
%td
|
|
-if p_document.label == "Facture" or p_document.label == "Facture Acompte"
|
|
-if p_document.echeance_date and !p_document.paid
|
|
-j = (Date.today - p_document.echeance_date).to_i
|
|
|
|
-if j > 0
|
|
%span{:style => "color:red;"}
|
|
=j
|
|
-else
|
|
%span{:style => "color:green;"}
|
|
=j
|
|
|
|
-tr[:actions] = capture do
|
|
%td.actions
|
|
-if p_document.label == "Facture" and !@relances
|
|
-if p_document.relative_docs.where(:label => "Avoir").count == 0 or true
|
|
=link_to "Créer un avoir", create_avoir_admin_p_document_path(p_document), :data => {:confirm => "Voulez-vous vraiment créer un avoir ?"}
|
|
|
|
=link_to i(:eye), detail_admin_p_document_path(p_document), :remote => false
|
|
|
|
=link_to i(:envelope), send_by_mail_admin_p_document_path(p_document), :remote => false
|
|
|
|
-if false
|
|
-if p_document.compta_locked
|
|
=ic :lock
|
|
-else
|
|
=link_to i(:pencil), edit_admin_p_document_path(p_document), :remote => true
|
|
|
|
|
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_document}
|
|
|
|
|
|
|
|
|