FIX message for automatic binding not clear of what was done or not
This commit is contained in:
parent
d0bc32047d
commit
582caf0e7a
@ -93,7 +93,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
|
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
|
||||||
// Clean database
|
// Clean database by removing binding done on non existing or no more existing accounts
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as fd";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as fd";
|
||||||
$sql1 .= " SET fk_code_ventilation = 0";
|
$sql1 .= " SET fk_code_ventilation = 0";
|
||||||
@ -119,6 +119,8 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
|
|||||||
|
|
||||||
if ($action == 'validatehistory') {
|
if ($action == 'validatehistory') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
$nbbinddone = 0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||||
@ -277,6 +279,8 @@ if ($action == 'validatehistory') {
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
$nbbinddone++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +292,7 @@ if ($action == 'validatehistory') {
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
} else {
|
} else {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,8 +131,10 @@ if ($action == 'validatehistory') {
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
|
$nbbinddone = $db->affected_rows($resql1);
|
||||||
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -117,6 +117,8 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
|
|||||||
|
|
||||||
if ($action == 'validatehistory') {
|
if ($action == 'validatehistory') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
$nbbinddone = 0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||||
@ -273,6 +275,8 @@ if ($action == 'validatehistory') {
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
$nbbinddone++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +288,7 @@ if ($action == 'validatehistory') {
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
} else {
|
} else {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -286,7 +286,7 @@ ValidateMovements=Validate movements
|
|||||||
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
|
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
|
||||||
|
|
||||||
ValidateHistory=Bind Automatically
|
ValidateHistory=Bind Automatically
|
||||||
AutomaticBindingDone=Automatic binding done
|
AutomaticBindingDone=Automatic bindings done (%s)
|
||||||
|
|
||||||
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
|
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
|
||||||
MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s
|
MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s
|
||||||
|
|||||||
@ -286,7 +286,7 @@ ValidateMovements=Valider les mouvements
|
|||||||
DescValidateMovements=Toute modification ou suppression d'écriture, de lettrage et de suppression sera interdite. Toutes les entrées pour un exercice doivent être validées, sinon la fermeture ne sera pas possible
|
DescValidateMovements=Toute modification ou suppression d'écriture, de lettrage et de suppression sera interdite. Toutes les entrées pour un exercice doivent être validées, sinon la fermeture ne sera pas possible
|
||||||
|
|
||||||
ValidateHistory=Lier automatiquement
|
ValidateHistory=Lier automatiquement
|
||||||
AutomaticBindingDone=Liaison automatique faite
|
AutomaticBindingDone=Liaisons automatiques faites (%s)
|
||||||
|
|
||||||
ErrorAccountancyCodeIsAlreadyUse=Erreur, vous ne pouvez pas détruire de compte comptable car il est utilisé
|
ErrorAccountancyCodeIsAlreadyUse=Erreur, vous ne pouvez pas détruire de compte comptable car il est utilisé
|
||||||
MvtNotCorrectlyBalanced=Mouvement non équilibré. Débit = %s| Crédit = %s
|
MvtNotCorrectlyBalanced=Mouvement non équilibré. Débit = %s| Crédit = %s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user