Update Error Message to know for which user the creation failed.

This commit is contained in:
Dario Rekowski on RockPI 2020-05-25 09:22:55 +00:00
parent aab3469422
commit fece81e5e7

View File

@ -172,11 +172,13 @@ class TransactionCreation extends TransactionBase {
]);
$newSum2 = $this->getAmount();
$receiverEmail = '';
foreach($existingCreations2 as $creation) {
$keyHex = bin2hex(stream_get_contents($creation->state_user->public_key));
//echo "\ncompare \n$keyHex\nwith: \n". $this->receiver_pubkey_hex."\n";
if($keyHex == $this->receiver_pubkey_hex) {
$newSum2 += $creation->amount;
$receiverEmail = $creation->state_user->email;
}
//$newSum2 += $creation->amount;
}
@ -188,7 +190,10 @@ class TransactionCreation extends TransactionBase {
}
} else {*/
if($newSum2 > 10000000) {
$this->addError('TransactionCreation::validate', 'Creation more than 1.000 GDD per Month in target_date not allowed');
$this->addError(
'TransactionCreation::validate',
'Creation more than 1.000 GDD per Month for '. $receiverEmail .' in target_date not allowed'
);
return false;
//}
}