allow only 2 month in the past for creation transactions

This commit is contained in:
einhornimmond 2021-12-06 17:16:22 +01:00
parent d96f0849f8
commit a5ed8580fe

View File

@ -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;
}
}