mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
allow only 2 month in the past for creation transactions
This commit is contained in:
parent
d96f0849f8
commit
a5ed8580fe
@ -74,8 +74,8 @@ namespace model {
|
||||
auto now = Poco::DateTime();
|
||||
if (target_date.year() == now.year())
|
||||
{
|
||||
if (target_date.month() + 3 < now.month()) {
|
||||
addError(new Error(function_name, "year is the same, target date month is more than 3 month in past"));
|
||||
if (target_date.month() + 2 < now.month()) {
|
||||
addError(new Error(function_name, "year is the same, target date month is more than 2 month in past"));
|
||||
return TRANSACTION_VALID_INVALID_TARGET_DATE;
|
||||
}
|
||||
if (target_date.month() > now.month()) {
|
||||
@ -96,8 +96,8 @@ namespace model {
|
||||
else
|
||||
{
|
||||
// target_date.year +1 == now.year
|
||||
if (target_date.month() + 3 < now.month() + 12) {
|
||||
addError(new Error(function_name, "target date is more than 3 month in past"));
|
||||
if (target_date.month() + 2 < now.month() + 12) {
|
||||
addError(new Error(function_name, "target date is more than 2 month in past"));
|
||||
return TRANSACTION_VALID_INVALID_TARGET_DATE;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user