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

This commit is contained in:
Laurent Destailleur 2023-03-10 13:31:02 +01:00
commit ae8b213d04
12 changed files with 44 additions and 16 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

@ -463,7 +463,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

@ -1515,7 +1515,7 @@ class Form
}
if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) {
$label .= ' - ' . $obj->tva_intra;
$label .= ' - '.$obj->tva_intra;
}
$labelhtml = $label;
@ -9034,7 +9034,9 @@ class Form
print '<table class="noborder">';
print '<tr>';
print '<td>' . $langs->trans("Ref") . '</td>';
print '<td><input type="text" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;<input type="submit" class="button valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;<input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
print '<td><input type="text" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
print '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
print '</tr>';
print '</table>';
print '</form>';

View File

@ -419,7 +419,7 @@ class FormTicket
print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title;
} else {
if (isset($this->withreadid) && $this->withreadid > 0) {
$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.'';
$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title;
} else {
$subject = GETPOST('subject', 'alpha');
}

View File

@ -83,7 +83,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("CommRequest"), $langs->transnoentities("CommRequest"));
$tooltip .= $langs->trans("GenericMaskCodes5");
$mask = dolGetGlobalString('SUPPLIER_PROPOSAL_SAPHIR_MASK');
$mask = getDolGlobalString('SUPPLIER_PROPOSAL_SAPHIR_MASK');
// Parametrage du prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';

View File

@ -529,7 +529,7 @@ class CommandeFournisseur extends CommonOrder
$this->lines = array();
$sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,";
$sql = "SELECT l.rowid, l.fk_commande, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,";
$sql .= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,";
$sql .= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,";
$sql .= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,";
@ -559,6 +559,7 @@ class CommandeFournisseur extends CommonOrder
$line = new CommandeFournisseurLigne($this->db);
$line->id = $objp->rowid;
$line->fk_commande = $objp->fk_commande;
$line->desc = $objp->description;
$line->description = $objp->description;
$line->qty = $objp->qty;

View File

@ -2086,7 +2086,7 @@ if ($action == 'create') {
}
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>';
print $object->date_commande ? dol_print_date($object->date_commande, $usehourmin ? 'dayhour' : 'day') : '';
if ($object->hasDelay() && !empty($object->date_delivery) && !empty($object->date_commande)) {
if ($object->hasDelay() && !empty($object->delivery_date) && !empty($object->date_commande)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
print "</td></tr>";
@ -2256,7 +2256,7 @@ if ($action == 'create') {
$usehourmin = 1;
}
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '<input type="submit" class="button button-edit smallpaddingimp valign middle" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
$usehourmin = 'day';
@ -2264,7 +2264,7 @@ if ($action == 'create') {
$usehourmin = 'dayhour';
}
print $object->delivery_date ? dol_print_date($object->delivery_date, $usehourmin) : '&nbsp;';
if ($object->hasDelay() && !empty($object->delivery_date)) {
if ($object->hasDelay() && !empty($object->delivery_date) && ($object->statut == $object::STATUS_ORDERSENT || $object->statut == $object::STATUS_RECEIVED_PARTIALLY)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
}

View File

@ -134,10 +134,10 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
$permissiontoreadall = $user->hasRight('hrm', 'evaluation', 'readall');
$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write');
$permissiontodelete = $user->hasRight('hrm', 'evaluation', 'delete');
$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write');
$permissiontodelete = $user->hasRight('hrm', 'evaluation', 'delete');
// Security check
if (!isModEnabled('hrm')) {

View File

@ -604,7 +604,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.'">';
}