mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +00:00
add validation of history line which 'se chevauchent'
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user