mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
NEW FEATURE PROPOSAL: on propale, order or invoice creation from
scratch, reload page after customer selection so its informations can be loaded
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,17 @@ 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
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {';
|
||||
print '
|
||||
$("#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";
|
||||
|
||||
@@ -1338,10 +1338,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
|
||||
@@ -1355,6 +1355,17 @@ 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
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {';
|
||||
print '
|
||||
$("#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";
|
||||
|
||||
@@ -1959,6 +1959,17 @@ 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
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {';
|
||||
print '
|
||||
$("#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