X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=assistants%2Fbank.inc.php;fp=assistants%2Fbank.inc.php;h=d6137cf30d54fac64139d22738471fd8e7e6da12;hb=ffd3556b1654d0e96d50234306978dbac6b36518;hp=e5152d3e7ae504ef7b8f38c0df0f06d7b4287c3c;hpb=3ac53ce3eebd88cad463896f47e2ad46d3e010e8;p=mirrors%2FSokoMan.git
diff --git a/assistants/bank.inc.php b/assistants/bank.inc.php
index e5152d3..d6137cf 100644
--- a/assistants/bank.inc.php
+++ b/assistants/bank.inc.php
@@ -109,10 +109,15 @@ if(isset($_POST['transaction'])) {
$account_to=$_POST['account_to'];
$amount=$_POST['amount'];
$comment=trim($_POST['comment']);
- if(!is_numeric($amount) || $amount < 0) $this->post_redirect_get("$URL_INTERNAL?account=".urlencode($account_from),"Lze pÅevádÄt jen kladné Äástky", true);
+ $account_redirect=$account_from;
+ if(!is_numeric($amount)) $this->post_redirect_get("$URL_INTERNAL?account=".urlencode($account_from),"PÅevádÄnou Äástkou musà být celé ÄÃslo.", true);
+ if($amount < 0) {
+ $amount=abs($amount);
+ list($account_from,$account_to)=array($account_to,$account_from); //swap from/to
+ }
if(strlen($comment)<4) $this->post_redirect_get("$URL_INTERNAL?account=".urlencode($account_from),"KomentáŠmusà mÃt alespoÅ 4 znaky!",true);
bank_transaction($this, $account_from, $account_to, $comment, $amount);
- $this->post_redirect_get("$URL_INTERNAL?account=".urlencode($account_from),"Transakce byla provedena:
PÅevod $amount $bank_currency z úÄtu $account_from na úÄet $account_to.
($comment)");
+ $this->post_redirect_get("$URL_INTERNAL?account=".urlencode($account_redirect),"Transakce byla provedena:
PÅevod $amount $bank_currency z úÄtu $account_from na úÄet $account_to.
($comment)");
}
$month = isset($_GET['month']) ? $_GET['month'] : false;
@@ -157,7 +162,7 @@ switch($SUBPATH[0]) {
?>