diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 50b481f4b143ae83befc3f002b5e242e2b9d69b2..c3846a54383ca828a100b3ec68fa98313415f322 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1445,6 +1445,19 @@ if ($action=='create') else { print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur = 1', 'SelectThirdParty'); + // reload page to retrieve customer informations + if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) + { + print '<script type="text/javascript"> + $(document).ready(function() { + $("#socid").change(function() { + var socid = $(this).val(); + // reload page + window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid; + }); + }); + </script>'; + } } print '</td>'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d756bc2b72af5f978ad15546b2ee50609e821c4f..1fce3965c6bfd4d86eebfdb2d465bfbed20f217d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1446,6 +1446,19 @@ if ($action == 'create') else { print $form->select_company($societe->id, 'socid', 's.fournisseur = 1', 'SelectThirdParty'); + // reload page to retrieve supplier informations + if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) + { + print '<script type="text/javascript"> + $(document).ready(function() { + $("#socid").change(function() { + var socid = $(this).val(); + // reload page + window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid; + }); + }); + </script>'; + } } print '</td></tr>';