forked from Wavyzz/dolibarr
Merge pull request #3923 from altatof/customerinfos
NEW FEATURE PROPOSAL: on propale, order or invoice creation from
This commit is contained in:
@@ -1276,7 +1276,7 @@ if ($action == 'create')
|
||||
|
||||
// Ref customer
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
|
||||
print '<input type="text" name="ref_client" value=""></td>';
|
||||
print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Third party
|
||||
@@ -1290,6 +1290,19 @@ if ($action == 'create')
|
||||
} else {
|
||||
print '<td colspan="2">';
|
||||
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
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_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+"&ref_client="+$("input[name=ref_client]").val();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>' . "\n";
|
||||
|
||||
@@ -1346,10 +1346,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
// Reference client
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
|
||||
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 '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
|
||||
else
|
||||
print '<input type="text" name="ref_client" value=""></td>';
|
||||
print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Client
|
||||
@@ -1363,6 +1363,19 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
} else {
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_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+"&ref_client="+$("input[name=ref_client]").val();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>' . "\n";
|
||||
|
||||
@@ -1960,6 +1960,19 @@ if ($action == 'create')
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_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>';
|
||||
}
|
||||
print '</tr>' . "\n";
|
||||
|
||||
Reference in New Issue
Block a user