Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-11-29 14:45:35 +01:00
commit 261320e551
4 changed files with 10 additions and 6 deletions

View File

@ -735,6 +735,7 @@ if (empty($reshook) && $action == 'update') {
// type_id and type_code is not modified
} else {
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->type_code = GETPOST("actioncode", 'aZ09');
}
$object->label = GETPOST("label", "alphanohtml");

View File

@ -423,7 +423,7 @@ class ActionComm extends CommonObject
*/
public function create(User $user, $notrigger = 0)
{
global $langs, $conf, $hookmanager;
global $langs, $conf;
$error = 0;
$now = dol_now();
@ -707,10 +707,9 @@ class ActionComm extends CommonObject
*/
public function createFromClone(User $fuser, $socid)
{
global $db, $conf, $hookmanager;
global $hookmanager;
$error = 0;
$now = dol_now();
$this->db->begin();
@ -1174,7 +1173,7 @@ class ActionComm extends CommonObject
}
$code = $this->code;
if (empty($code)) {
if (empty($code) || (!empty($this->oldcopy) && $this->oldcopy->type_code != $this->type_code)) { // If code unknown or if we change the type, we reset $code too
$code = $this->type_code;
}

View File

@ -8959,7 +8959,11 @@ abstract class CommonObject
// $this->{$field} may be null, '', 0, '0', 123, '123'
if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) {
if (!isset($this->{$field})) {
$queryarray[$field] = 0;
if (!empty($info['default'])) {
$queryarray[$field] = $info['default'];
} else {
$queryarray[$field] = 0;
}
} else {
$queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
}

View File

@ -3508,7 +3508,7 @@ if ($action == 'create') {
}
print '</span>';
print '</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'</td><td>&nbsp;</td></tr>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($multicurrency_resteapayer, 'MT')).'</td><td>&nbsp;</td></tr>';
}
} else { // Credit note
$cssforamountpaymentcomplete = 'amountpaymentneutral';