Debug v19

This commit is contained in:
Laurent Destailleur 2023-12-13 19:42:23 +01:00
parent 23b62d928c
commit fe99114fc1

View file

@ -258,25 +258,38 @@ if ($user->hasRight('banque', 'consolidate') && ($action == 'num_releve' || $act
}
$sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog("line.php", LOG_DEBUG);
$updatePathFile = true;
$update_dir = true;
dol_syslog("line.php update bank line to set the new bank receipt nuber", LOG_DEBUG);
$result = $db->query($sql);
// We must not rename the directory of the bank receipt when we change 1 line of bank receipt. Other lines may share the same old ref.
// Renaming can be done when we rename globaly a bank receipt but not when changing 1 line from one receipt into another one.
/*
if ($result) {
$oldfilepath = dol_sanitizePathName("bank/".((int) $id)."/statement/".$oldNum_rel);
$filepath = dol_sanitizePathName("bank/".((int) $id)."/statement/".$num_rel);
if ($oldNum_rel) {
if ($num_rel) {
$oldfilepath = dol_sanitizePathName("bank/".((int) $id)."/statement/".$oldNum_rel);
$filepath = dol_sanitizePathName("bank/".((int) $id)."/statement/".$num_rel);
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_files";
$sql .= " SET filepath = '".$db->escape($filepath)."'";
$sql .= " WHERE filepath = '".$db->escape($oldfilepath)."'";
$updatePathFile = $db->query($sql);
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_files";
$sql .= " SET filepath = '".$db->escape($filepath)."'";
$sql .= " WHERE filepath = '".$db->escape($oldfilepath)."'";
$updatePathFile = $db->query($sql);
$srcdir = dol_sanitizePathName(DOL_DATA_ROOT."/bank/".((int) $id)."/statement/".$oldNum_rel);
$destdir = dol_sanitizePathName(DOL_DATA_ROOT."/bank/".((int) $id)."/statement/".$num_rel);
$srcdir = dol_sanitizePathName(DOL_DATA_ROOT."/bank/".((int) $id)."/statement/".$oldNum_rel);
$destdir = dol_sanitizePathName(DOL_DATA_ROOT."/bank/".((int) $id)."/statement/".$num_rel);
$update_dir = true;
if (dol_is_dir($srcdir)) {
$update_dir = dol_move_dir($srcdir, $destdir, 1);
if (dol_is_dir($srcdir)) {
$update_dir = dol_move_dir($srcdir, $destdir, 1);
}
}
}
}
*/
if ($result && $updatePathFile && $update_dir) {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$db->commit();