%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