Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
Conflicts: htdocs/comm/propal/card.php htdocs/install/step5.php
This commit is contained in:
commit
c28e6a46e2
@ -672,9 +672,12 @@ class AccountancyExport
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : WinFic - eWinfic - WinSis Compta
|
* 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
|
* @param array $TData data
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function exportWinfic(&$TData)
|
public function exportWinfic(&$TData)
|
||||||
@ -682,10 +685,14 @@ class AccountancyExport
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$end_line = "\r\n";
|
$end_line = "\r\n";
|
||||||
|
$index = 1;
|
||||||
|
|
||||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
//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(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
|
//$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) {
|
foreach ($TData as $data) {
|
||||||
$code_compta = $data->numero_compte;
|
$code_compta = $data->numero_compte;
|
||||||
if (!empty($data->subledger_account)) {
|
if (!empty($data->subledger_account)) {
|
||||||
@ -694,7 +701,7 @@ class AccountancyExport
|
|||||||
|
|
||||||
$Tab = array();
|
$Tab = array();
|
||||||
//$Tab['type_ligne'] = 'M';
|
//$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
|
//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 ?
|
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||||
@ -703,11 +710,11 @@ class AccountancyExport
|
|||||||
|
|
||||||
$Tab['folio'] = ' 1';
|
$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['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') {
|
if ($data->sens == 'D') {
|
||||||
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||||
@ -719,11 +726,11 @@ class AccountancyExport
|
|||||||
$Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
$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);
|
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||||
|
|
||||||
@ -747,6 +754,8 @@ class AccountancyExport
|
|||||||
$Tab['end_line'] = $end_line;
|
$Tab['end_line'] = $end_line;
|
||||||
|
|
||||||
print implode('|', $Tab);
|
print implode('|', $Tab);
|
||||||
|
|
||||||
|
$index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1649,13 +1649,13 @@ if ($action == 'create') {
|
|||||||
// Terms of payment
|
// Terms of payment
|
||||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||||
print img_picto('', 'paiment');
|
print img_picto('', 'paiment');
|
||||||
$form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', -1, 1);
|
$form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', -1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Mode of payment
|
// Mode of payment
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||||
print img_picto('', 'bank').' ';
|
print img_picto('', 'bank');
|
||||||
$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');
|
$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');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
|
|||||||
@ -2082,7 +2082,7 @@ abstract class CommonObject
|
|||||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
} else {
|
} else {
|
||||||
$sql .= " AND ug.fk_user = te.rowid";
|
$sql .= " AND ug.fk_user = te.rowid";
|
||||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
@ -2152,7 +2152,7 @@ abstract class CommonObject
|
|||||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
} else {
|
} else {
|
||||||
$sql .= " AND ug.fk_user = te.rowid";
|
$sql .= " AND ug.fk_user = te.rowid";
|
||||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
|
|||||||
@ -222,9 +222,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
|||||||
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
} else {
|
} else {
|
||||||
if ($newuser->error == 'ErrorLoginAlreadyExists') {
|
if ($result == -6) { //login or email already exists
|
||||||
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
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;
|
$success = 1;
|
||||||
} else {
|
} else {
|
||||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
||||||
@ -450,7 +450,7 @@ if ($action == "set") {
|
|||||||
$morehtml .= '</a></div>';
|
$morehtml .= '</a></div>';
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// Clear cache files
|
||||||
|
|||||||
@ -3642,7 +3642,7 @@ class User extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
$sql .= " WHERE ((ug.fk_user = t.rowid";
|
$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
|
$sql .= " OR t.entity = 0)"; // Show always superadmin
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user