Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
This commit is contained in:
commit
9cbba5941f
@ -311,6 +311,7 @@ print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="date_select" value="'.$date_select.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
@ -555,14 +555,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
print '<td class="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
print '<td class="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td class="right">'.$langs->trans('AlreadyPaid').'</td>';
|
||||
print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$total = 0;
|
||||
@ -657,6 +655,24 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print price($sign * $multicurrency_remaintopay);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
$nameRemain = 'multicurrency_remain_'.$objp->facid;
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) {
|
||||
if ($action != 'add_paiement') {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
|
||||
}
|
||||
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
|
||||
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
} else {
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print '<td class="right">'.price($sign * $objp->total_ttc).'</td>';
|
||||
@ -690,29 +706,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Multicurrency Price
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="right">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
$nameRemain = 'multicurrency_remain_'.$objp->facid;
|
||||
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) {
|
||||
if ($action != 'add_paiement') {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
|
||||
}
|
||||
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
|
||||
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
} else {
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
$total += $objp->total_ht;
|
||||
$total_ttc += $objp->total_ttc;
|
||||
@ -730,6 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
}
|
||||
print '<td class="right"><b>'.price($sign * $total_ttc).'</b></td>';
|
||||
print '<td class="right"><b>'.price($sign * $totalrecu);
|
||||
@ -742,9 +736,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '</b></td>';
|
||||
print '<td class="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td class="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
@ -1557,9 +1557,8 @@ if ($action == 'create') {
|
||||
print '</tr>';
|
||||
|
||||
// Tracking Number
|
||||
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->rights->reception->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'string', $object->tracking_number);
|
||||
print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->rights->reception->creer, 'safehtmlstring', $object->tracking_number);
|
||||
print '</td></tr>';
|
||||
|
||||
// Incoterms
|
||||
|
||||
@ -448,19 +448,15 @@ if (empty($reshook)) {
|
||||
$object->lang = GETPOST('default_lang', 'aZ09');
|
||||
|
||||
// Do we update also ->entity ?
|
||||
if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user.
|
||||
if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$object->entity = 1; // all users are in master entity
|
||||
if (!empty($conf->multicompany->enabled && $user->entity == 0 && !empty($user->admin))) { // If multicompany is not enabled, we never update the entity of a user.
|
||||
if (GETPOST('superadmin', 'int')) {
|
||||
$object->entity = 0;
|
||||
} else {
|
||||
// A user should not be able to move a user into another entity. Only superadmin should be able to do this.
|
||||
if ($user->entity == 0 && $user->admin) {
|
||||
if (GETPOST("superadmin")) {
|
||||
// We try to set the user as superadmin.
|
||||
$object->entity = 0;
|
||||
} else {
|
||||
// We try to change the entity of user
|
||||
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity);
|
||||
}
|
||||
if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$object->entity = 1; // all users are in master entity
|
||||
} else {
|
||||
// We try to change the entity of user
|
||||
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1773,7 +1773,9 @@ class User extends CommonObject
|
||||
$sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".$this->db->escape($this->salaryextra)."'" : "null");
|
||||
}
|
||||
$sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".$this->db->escape($this->weeklyhours)."'" : "null");
|
||||
$sql .= ", entity = ".((int) $this->entity);
|
||||
if (!empty($user->admin) && empty($user->entity) && $user->id != $this->id) {
|
||||
$sql .= ", entity = ".((int) $this->entity); // entity flag can be set/unset only by an another superadmin user
|
||||
}
|
||||
$sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null');
|
||||
$sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null');
|
||||
$sql .= ", fk_warehouse = ".($this->fk_warehouse > 0 ? $this->fk_warehouse : "null");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user