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

This commit is contained in:
Laurent Destailleur 2023-03-10 13:14:13 +01:00
commit c7431b83ec
6 changed files with 30 additions and 5 deletions

View File

@ -329,6 +329,7 @@ class Lettering extends BookKeeping
// Update request
$now = dol_now();
$affected_rows = 0;
if (!$error) {
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET";
@ -341,6 +342,8 @@ class Lettering extends BookKeeping
if (!$resql) {
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
} else {
$affected_rows = $this->db->affected_rows($resql);
}
}
@ -352,7 +355,7 @@ class Lettering extends BookKeeping
}
return -1 * $error;
} else {
return 1;
return $affected_rows;
}
}
@ -387,7 +390,7 @@ class Lettering extends BookKeeping
}
return -1 * $error;
} else {
return 1;
return $this->db->affected_rows($resql);
}
}
@ -482,7 +485,7 @@ class Lettering extends BookKeeping
else $result = $this->updateLettering($bookkeeping_lines);
if ($result < 0) {
$group_error++;
} else {
} elseif ($result > 0) {
$nb_lettering++;
}
}

View File

@ -805,6 +805,12 @@ if (!$error && $action == 'writebookkeeping') {
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
$lettering_static = new Lettering($db);
$nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id));
if ($nb_lettering < 0) {
$error++;
$errorforline++;
setEventMessages($lettering_static->error, $lettering_static->errors, 'errors');
}
}
}
}

View File

@ -381,6 +381,12 @@ if ($action == 'writebookkeeping') {
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
$lettering_static = new Lettering($db);
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
if ($nb_lettering < 0) {
$error++;
$errorforline++;
setEventMessages($lettering_static->error, $lettering_static->errors, 'errors');
}
}
}
}

View File

@ -403,7 +403,15 @@ if ($action == 'writebookkeeping') {
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
$lettering_static = new Lettering($db);
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
if ($nb_lettering < 0) {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
setEventMessages($lettering_static->error, $lettering_static->errors, 'errors');
}
}
}
}

View File

@ -246,7 +246,9 @@ class PropaleStats extends Stats
global $user;
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
$sql .= " FROM ".$this->from." INNER JOIN ".$this->from_line." ON p.rowid = tl.fk_propal INNER JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid";
$sql .= " FROM ".$this->from;
$sql .= " INNER JOIN ".$this->from_line." ON p.rowid = tl.fk_propal";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid";
if (empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}

View File

@ -586,7 +586,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
print '</td></tr>'."\n";
} else {
print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
//print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">';
}