@extends('header') @section('head') @parent @include('money_script') @stop @section('content') {!! Former::open($url) ->addClass('warn-on-exit main-form') ->onsubmit('return onFormSubmit(event)') ->method($method) !!}
{!! Former::text('action') !!}
@if ($expense) {!! Former::populate($expense) !!} {!! Former::populateField('should_be_invoiced', intval($expense->should_be_invoiced)) !!} {!! Former::hidden('public_id') !!} @endif
{!! Former::select('vendor_id')->addOption('', '') ->data_bind('combobox: vendor_id') ->label(trans('texts.vendor')) ->addGroupClass('vendor-select') !!} {!! Former::text('expense_date') ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT)) ->addGroupClass('expense_date') ->label(trans('texts.date')) ->append('') !!} {!! Former::select('expense_currency_id')->addOption('','') ->data_bind('combobox: expense_currency_id') ->label(trans('texts.currency_id')) ->data_placeholder(Utils::getFromCache($account->getCurrencyId(), 'currencies')->name) ->fromQuery($currencies, 'name', 'id') !!} {!! Former::text('amount') ->label(trans('texts.amount')) ->data_bind("value: amount, valueUpdate: 'afterkeydown'") ->addGroupClass('amount') ->append('') !!} {!! Former::select('client_id') ->addOption('', '') ->label(trans('texts.client')) ->data_bind('combobox: client_id') ->addGroupClass('client-select') !!} @if (!$expense || ($expense && !$expense->invoice_id && !$expense->client_id)) {!! Former::checkbox('should_be_invoiced') ->text(trans('texts.should_be_invoiced')) ->data_bind('checked: should_be_invoiced() || client_id(), enable: !client_id()') ->label(' ') !!} @endif @if (!$expense || ($expense && ! $expense->isExchanged())) {!! Former::checkbox('convert_currency') ->text(trans('texts.convert_currency')) ->data_bind('checked: convert_currency') ->label(' ') !!} @endif
{!! Former::select('invoice_currency_id')->addOption('','') ->label(trans('texts.invoice_currency')) ->data_placeholder(Utils::getFromCache($account->getCurrencyId(), 'currencies')->name) ->data_bind('combobox: invoice_currency_id, disable: true') ->fromQuery($currencies, 'name', 'id') !!} {!! Former::plaintext('test') ->value('') ->style('min-height:46px') ->label(trans('texts.invoice_currency')) !!} {!! Former::text('exchange_rate') ->data_bind("value: exchange_rate, enable: enableExchangeRate, valueUpdate: 'afterkeydown'") !!} {!! Former::text('invoice_amount') ->addGroupClass('converted-amount') ->data_bind("value: convertedAmount, enable: enableExchangeRate") ->append('') !!}
{!! Former::textarea('public_notes')->rows(8) !!} {!! Former::textarea('private_notes')->rows(8) !!}
@if ($account->isPro())
{{trans('texts.expense_documents')}}
@endif
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/expenses'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!} @if ($expense) {!! DropdownButton::normal(trans('texts.more_actions')) ->withContents($actions) ->large() ->dropup() !!} @endif
{!! Former::close() !!} @stop