This commit is contained in:
James Cole 2017-11-24 17:33:05 +01:00
parent 93c2f13807
commit 7de512aff8
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 7 additions and 1 deletions

View File

@ -40,6 +40,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Illuminate\Http\Request;
use Log; use Log;
use Preferences; use Preferences;
use Session; use Session;
@ -153,9 +154,10 @@ class SingleController extends Controller
* *
* @return View * @return View
*/ */
public function create(string $what = TransactionType::DEPOSIT) public function create(Request $request, string $what = TransactionType::DEPOSIT)
{ {
$what = strtolower($what); $what = strtolower($what);
$what = $request->old('what') ?? $what;
$uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size')));
$assetAccounts = $this->groupedActiveAccountList(); $assetAccounts = $this->groupedActiveAccountList();
$budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets()); $budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets());

View File

@ -107,6 +107,10 @@ function selectsForeignCurrency() {
if (foreignCurrencyId === nativeCurrencyId) { if (foreignCurrencyId === nativeCurrencyId) {
$('#exchange_rate_instruction_holder').hide(); $('#exchange_rate_instruction_holder').hide();
$('#native_amount_holder').hide(); $('#native_amount_holder').hide();
// make all other inputs empty
$('input[name="destination_amount"]').val("");
$('input[name="native_amount"]').val("");
} }
return false; return false;