diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index e32e47b169d..11d144e26e7 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -618,7 +618,7 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy; $codesell = length_accountg($obj->accountancy_code_buy); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') { // Accounting account buy intra (In EEC) @@ -628,7 +628,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') { // Accounting account buy export (Out of EEC) @@ -638,7 +638,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_export); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') { // Accounting account sell @@ -648,7 +648,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') { // Accounting account sell intra (In EEC) @@ -658,7 +658,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } else { // Accounting account sell export (Out of EEC) @@ -667,13 +667,13 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodsell; $codesell = length_accountg($obj->accountancy_code_sell_export); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } // Checkbox select print ''; - print ''; + print ''; print ""; $i++; } @@ -697,7 +697,17 @@ if ($result) if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\'); else jQuery("#changeaccount").attr(\'class\',\'button\'); } - jQuery(".checkforselect, #checkallactions").click(function() { + + jQuery(".checkforselect").change(function() { + init_savebutton(); + }); + jQuery(".productforselect").change(function() { + console.log($(this).attr("id")+" "+$(this).val()); + if ($(this).val() && $(this).val() != -1) { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', true); + } else { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', false); + } init_savebutton(); }); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98cb1527031..450ed7364ca 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7817,7 +7817,7 @@ class Form $(document).ready(function() { $("#checkallactions'.$id.'").click(function() { if($(this).is(\':checked\')){ - console.log("We check all '.$cssclass.'"); + console.log("We check all '.$cssclass.' and trigger the change method"); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else