Nicolas Bally 120e9803eb initial
2020-04-28 14:51:42 +02:00

27 lines
639 B
Plaintext

%table.table.table-hover.table-striped#p_customer_etat{:id => p_customer.id}
%tr
%th Date
%th Echeance
%th Type
%th Réf
%th Débit
%th Crédit
%th Soldé ?
%th.action
=render p_customer.p_compta_elements.order("cc_element_date DESC")
%tr
%th{:colspan => 4}
Solde :
=number_to_currency p_customer.p_compta_elements.sum(:amount)
%th
-a = p_customer.p_compta_elements.where("amount < 0.0").sum(:amount)
=number_to_currency a
%th
-b = p_customer.p_compta_elements.where("amount > 0.0").sum(:amount)
=number_to_currency b
%th
%th