mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
change creation validation to 3.000 per 3 month
This commit is contained in:
parent
91924bad7e
commit
826664f6ee
@ -197,9 +197,9 @@ class TransactionCreationsController extends AppController
|
|||||||
$connection = ConnectionManager::get('default');
|
$connection = ConnectionManager::get('default');
|
||||||
$transactionActiveMonth = $connection->execute(
|
$transactionActiveMonth = $connection->execute(
|
||||||
'SELECT id, received FROM transactions '
|
'SELECT id, received FROM transactions '
|
||||||
. 'where received >= date_sub(date_add(curdate(), interval 1 - day(curdate()) day), interval 1 month) '
|
. 'where received >= date_sub(date_add(curdate(), interval 1 - day(curdate()) day), interval 2 month) '
|
||||||
. 'AND '
|
. 'AND '
|
||||||
. 'received < date_add(date_add(curdate(), interval 1 - day(curdate()) day), interval 1 month) '
|
. 'received < date_add(date_add(curdate(), interval 1 - day(curdate()) day), interval 2 month) '
|
||||||
. 'AND '
|
. 'AND '
|
||||||
. 'transaction_type_id = 1'
|
. 'transaction_type_id = 1'
|
||||||
)->fetchAll('assoc');
|
)->fetchAll('assoc');
|
||||||
|
|||||||
@ -113,7 +113,7 @@ class TransactionCreation extends TransactionBase {
|
|||||||
return $q->where(
|
return $q->where(
|
||||||
['OR' =>
|
['OR' =>
|
||||||
['EXTRACT(YEAR_MONTH FROM Transactions.received) LIKE EXTRACT(YEAR_MONTH FROM NOW())',
|
['EXTRACT(YEAR_MONTH FROM Transactions.received) LIKE EXTRACT(YEAR_MONTH FROM NOW())',
|
||||||
'EXTRACT(YEAR_MONTH FROM DATE_ADD(Transactions.received, INTERVAL 1 MONTH)) LIKE EXTRACT(YEAR_MONTH FROM NOW())']
|
'EXTRACT(YEAR_MONTH FROM DATE_ADD(Transactions.received, INTERVAL 2 MONTH)) LIKE EXTRACT(YEAR_MONTH FROM NOW())']
|
||||||
])->select('received');
|
])->select('received');
|
||||||
});
|
});
|
||||||
//debug($existingCreations);
|
//debug($existingCreations);
|
||||||
@ -126,8 +126,8 @@ class TransactionCreation extends TransactionBase {
|
|||||||
$newSum += $creation->amount;
|
$newSum += $creation->amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($newSum > 20000000) {
|
if($newSum > 30000000) {
|
||||||
$this->addError('TransactionCreation::validate', 'Creation more than 1.000 GDD per Month (2 Month) not allowed');
|
$this->addError('TransactionCreation::validate', 'Creation more than 1.000 GDD per Month (3 Month) not allowed');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//die("\n");
|
//die("\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user