diff --git a/app/views/admin/buy_lists/index.html.haml b/app/views/admin/buy_lists/index.html.haml index 862b4f4..de9fbbb 100644 --- a/app/views/admin/buy_lists/index.html.haml +++ b/app/views/admin/buy_lists/index.html.haml @@ -202,9 +202,10 @@ %td.mask = qte_available %td.mask - =check_box_tag :"p_product_ref_ids[]", plr.p_product_ref.id + - default_qte = [bpa_qte - qte_available, 0].max + =check_box_tag :"p_product_ref_ids[]", plr.p_product_ref.id, (true if default_qte > 0 ) - =number_field_tag "qte[#{plr.p_product_ref.id}]", '', class: "small-input", value: ([bpa_qte - qte_available, 0].max), min: 0 + =number_field_tag "qte[#{plr.p_product_ref.id}]", '', class: "small-input", value: default_qte, min: 0 %td.mask = bpa_qte