@udpate_sheet_lines = -> $(".p_sheet_line_field").each -> price = parseFloat($(this).find(".price").data("price")) price_tot = 0 qte_tot = 0 $(this).find(".color_line").each -> qte = 0 $(this).find("input.qte").each -> qte += parseFloat($(this).val()) if parseFloat($(this).val()) price_color = qte * price $(this).find(".price_color_tot").html(accounting.formatMoney(price_color)) qte_tot += qte $(this).find(".qte_tot").html(qte_tot) $(this).find(".price_tot").html(accounting.formatMoney(qte_tot*price))