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

This commit is contained in:
Laurent Destailleur 2022-09-23 18:43:54 +02:00
commit 7cafff7a09
2 changed files with 9 additions and 5 deletions

View File

@ -78,7 +78,7 @@ if ($tmp) {
*/
if (!empty($conf->propal->enabled)) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc";
$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.email, s.entity, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (empty($user->rights->societe->client->voir) && !$socid) {

View File

@ -2069,6 +2069,7 @@ class ExpenseReport extends CommonObject
if ($this->status == self::STATUS_DRAFT || $this->status == self::STATUS_REFUSED) {
$this->db->begin();
$error = 0;
$type = 0; // TODO What if type is service ?
// We don't know seller and buyer for expense reports
@ -2152,10 +2153,13 @@ class ExpenseReport extends CommonObject
$this->applyOffset();
$this->checkRules();
$error = 0;
$result = $this->line->update($user);
if ($result > 0 && !$notrigger) {
$result = $this->line->update($user);
if ($result < 0) {
$error++;
}
if (!$error && !$notrigger) {
// Call triggers
$result = $this->call_trigger('EXPENSE_REPORT_DET_MODIFY', $user);
if ($result < 0) {
@ -2164,7 +2168,7 @@ class ExpenseReport extends CommonObject
// End call triggers
}
if ($result > 0 && $error == 0) {
if (!$error) {
$this->db->commit();
return 1;
} else {