From f52ae35dc6eeb9b5cd56271d4a3443ec6d10de8d Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 6 Nov 2015 16:14:00 +0100 Subject: [PATCH 1/2] NEW FEATURE PROPOSAL: on propale, order or invoice creation from scratch, reload page after customer selection so its informations can be loaded --- htdocs/comm/propal.php | 13 ++++++++++++- htdocs/commande/card.php | 15 +++++++++++++-- htdocs/compta/facture.php | 11 +++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 08d4e31ec6b..5b60e0ec273 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1276,7 +1276,7 @@ if ($action == 'create') // Ref customer print '' . $langs->trans('RefCustomer') . ''; - print ''; + print ''; print ''; // Third party @@ -1290,6 +1290,17 @@ if ($action == 'create') } else { print ''; print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1); + // reload page to retrieve customer informations + print ''; print ''; } print '' . "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4d7456af1fd..bbc255e0227 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1338,10 +1338,10 @@ if ($action == 'create' && $user->rights->commande->creer) // Reference client print '' . $langs->trans('RefCustomer') . ''; - if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER)) + if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER) && ! empty($origin) && ! empty($originid)) print ''; else - print ''; + print ''; print ''; // Client @@ -1355,6 +1355,17 @@ if ($action == 'create' && $user->rights->commande->creer) } else { print ''; print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); + // reload page to retrieve customer informations + print ''; print ''; } print '' . "\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 983331bd412..fd9f730fe09 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1959,6 +1959,17 @@ if ($action == 'create') { print ''; print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); + // reload page to retrieve customer informations + print ''; print ''; } print '' . "\n"; From 0c40a6dda5b9411acc9d6a0bc2b431cd859b7bd5 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 11 Nov 2015 15:32:42 +0100 Subject: [PATCH 2/2] add hidden constant --- htdocs/comm/propal.php | 20 +++++++++++--------- htdocs/commande/card.php | 20 +++++++++++--------- htdocs/compta/facture.php | 20 +++++++++++--------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 5b60e0ec273..625739b7128 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1291,16 +1291,18 @@ if ($action == 'create') print ''; print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1); // reload page to retrieve customer informations - print ''; + '; + } print ''; } print '' . "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bbc255e0227..508c26f24ed 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1356,16 +1356,18 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); // reload page to retrieve customer informations - print ''; + '; + } print ''; } print '' . "\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index fd9f730fe09..ea309b83a26 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1960,16 +1960,18 @@ if ($action == 'create') print ''; print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); // reload page to retrieve customer informations - print ''; + '; + } print ''; } print '' . "\n";