mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add validation of history line which 'se chevauchent'
This commit is contained in:
parent
c9204e32d8
commit
82f1aeee19
@ -626,6 +626,7 @@ ou une valeur vide lorsque la donnée nest pas connue*/
|
||||
const ERROR_OPENING_IS_INSIDE_CLOSING = 1;
|
||||
const ERROR_OPENING_NOT_CLOSED_IS_BEFORE_NEW_LINE = 2;
|
||||
const ERROR_OPENING_NOT_CLOSE_IS_INSIDE_CLOSED_HISTORY_LINE = 3;
|
||||
const ERROR_OPENING_IS_BEFORE_OTHER_LINE_AND_CLOSED_IS_AFTER_THIS_LINE = 4;
|
||||
|
||||
public function checkHistoryIsNotCovering() {
|
||||
|
||||
@ -657,6 +658,17 @@ ou une valeur vide lorsque la donnée nest pas connue*/
|
||||
);
|
||||
}
|
||||
|
||||
if ($history->getDateOpening() < $against->getDateOpening()
|
||||
&& $history->getDateClosing() > $against->getDateClosing()) {
|
||||
// the history date opening is inside another opening line
|
||||
return array(
|
||||
'result' => self::ERROR_OPENING_IS_BEFORE_OTHER_LINE_AND_CLOSED_IS_AFTER_THIS_LINE,
|
||||
'dateOpening' => $against->getDateOpening(),
|
||||
'dateClosing' => $against->getDateClosing(),
|
||||
'date' => $history->getDateOpening()
|
||||
);
|
||||
}
|
||||
|
||||
//if we have an aopening later...
|
||||
if ($history->getDateOpening() < $against->getDateClosing()) {
|
||||
return array( 'result' => self::ERROR_OPENING_NOT_CLOSED_IS_BEFORE_NEW_LINE,
|
||||
|
@ -7,7 +7,7 @@ validation:
|
||||
nbOfChild_max: Ce nombre est trop élevé. Il ne peut être supérieur à {{ limit }}.
|
||||
nbOfChild_invalid: La valeur introduite n'est pas un nombre.
|
||||
history:
|
||||
opening_is_before_closing: L'historique des ouvertures et fermetures de dossier n'est pas cohérent. La date %dateOpening% ouvre un dossier avant une précédente fermeture au %dateClosing%. Vérifiez la liste des ouvertures et fermetures.
|
||||
opening_is_before_closing: L'historique des ouvertures et fermetures de dossier n'est pas cohérent. Des historiques d'ouverture et de fermeture se chevauchent. Vérifiez la liste des ouvertures et fermetures.
|
||||
open_history_without_closing: Vous tentez d'ouvrir un dossier à une date passée alors qu'il est réouvert plus tard. Veuillez insérer une nouvelle ligne d'ouverture avant de la clotûrer avant la suivante.
|
||||
PersonHistoryFile:
|
||||
constraint:
|
||||
|
Loading…
x
Reference in New Issue
Block a user