coton_app/app/assets/javascripts/sheet_prices.coffee
Nicolas Bally 5ceaeded7d suite
2018-12-17 14:34:56 +01:00

16 lines
582 B
CoffeeScript

@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))