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

Conflicts:
	htdocs/comm/propal/card.php
This commit is contained in:
Laurent Destailleur 2022-11-02 00:24:08 +01:00
commit 88273690c5
6 changed files with 28 additions and 18 deletions

View File

@ -718,9 +718,12 @@ class AccountancyExport
/**
* Export format : WinFic - eWinfic - WinSis Compta
* Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf
*
* @param array $TData data
*
* @return void
*/
public function exportWinfic(&$TData)
@ -728,10 +731,14 @@ class AccountancyExport
global $conf;
$end_line = "\r\n";
$index = 1;
//We should use dol_now function not time however this is wrong date to transfert in accounting
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
foreach ($TData as $data) {
$code_compta = $data->numero_compte;
if (!empty($data->subledger_account)) {
@ -740,7 +747,7 @@ class AccountancyExport
$Tab = array();
//$Tab['type_ligne'] = 'M';
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
$Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2);
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
@ -749,11 +756,11 @@ class AccountancyExport
$Tab['folio'] = ' 1';
$Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
$Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT);
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
$Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0');
if ($data->sens == 'D') {
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
@ -765,11 +772,11 @@ class AccountancyExport
$Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
$Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30);
$Tab['lettrage'] = str_repeat(' ', 2);
$Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2);
$Tab['code_piece'] = str_repeat(' ', 5);
$Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT);
$Tab['code_stat'] = str_repeat(' ', 4);
@ -793,6 +800,8 @@ class AccountancyExport
$Tab['end_line'] = $end_line;
print implode('|', $Tab);
$index++;
}
}

View File

@ -1791,13 +1791,13 @@ if ($action == 'create') {
// Terms of payment
print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
print img_picto('', 'paiment');
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
print '</td></tr>';
// Mode of payment
print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
print img_picto('', 'bank', 'class="pictofixedwidth"');
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
// Bank Account

View File

@ -2193,7 +2193,7 @@ abstract class CommonObject
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
@ -2263,7 +2263,7 @@ abstract class CommonObject
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';

View File

@ -222,9 +222,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
$success = 1;
} else {
if ($newuser->error == 'ErrorLoginAlreadyExists') {
if ($result == -6) { //login or email already exists
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
print '<br><div class="warning">'.$langs->trans("AdminLoginAlreadyExists", $login)."</div><br>";
print '<br><div class="warning">'.$newuser->error."</div><br>";
$success = 1;
} else {
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
@ -450,7 +450,7 @@ if ($action == "set") {
$morehtml .= '</a></div>';
}
} else {
dol_print_error('', 'step5.php: unknown choice of action');
dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction');
}
// Clear cache files

View File

@ -3792,7 +3792,7 @@ class User extends CommonObject
} else {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
$sql .= " WHERE ((ug.fk_user = t.rowid";
$sql .= " AND ug.entity IN (".getEntity('user')."))";
$sql .= " AND ug.entity IN (".getEntity('usergroup')."))";
$sql .= " OR t.entity = 0)"; // Show always superadmin
}
} else {

View File

@ -1102,14 +1102,15 @@ while ($i < $imaxinloop) {
}
}
// Phone
if (!empty($arrayfields['u.office_phone']['checked'])) {
print '<td>'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."</td>\n";
print '<td class="tdoverflowmax125">'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['u.user_mobile']['checked'])) {
print '<td>'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."</td>\n";
print '<td class="tdoverflowmax125">'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
@ -1121,10 +1122,10 @@ while ($i < $imaxinloop) {
}
}
if (!empty($arrayfields['u.api_key']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->api_key).'">';
if ($obj->api_key) {
if ($canreadsecretapi) {
print $obj->api_key;
print dol_escape_htmltag($obj->api_key);
} else {
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
}