@extends('header') @section('head') @parent @include('money_script') @foreach ($account->getFontFolders() as $font) @endforeach @stop @section('content') @if ($errors->first('invoice_items'))
{{ trans($errors->first('invoice_items')) }}
@endif @if ($invoice->id) @endif {!! Former::open($url) ->method($method) ->addClass('warn-on-exit') ->autocomplete('off') ->onsubmit('return onFormSubmit(event)') ->rules(array( 'client' => 'required', 'invoice_number' => 'required', 'product_key' => 'max:255' )) !!} @include('partials.autocomplete_fix')
@if ($invoice->id || $data)

@if($invoice->client->canView()) @if ($invoice->client->canEdit()) {{ trans('texts.edit_client') }} | @endif {!! link_to('/clients/'.$invoice->client->public_id, trans('texts.view_client'), ['target' => '_blank']) !!} @endif
@endif {!! Former::select('client')->addOption('', '')->data_bind("dropdown: client")->addClass('client-input')->addGroupClass('client_select closer-row') !!} @if ($invoice->id || $data)
@endif
{!! Former::text('invoice_date')->data_bind("datePicker: invoice_date, valueUpdate: 'afterkeydown'")->label(trans("texts.{$entityType}_date")) ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->appendIcon('calendar')->addGroupClass('invoice_date') !!} {!! Former::text('due_date')->data_bind("datePicker: due_date, valueUpdate: 'afterkeydown'")->label(trans("texts.{$entityType}_due_date")) ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->appendIcon('calendar')->addGroupClass('due_date') !!} {!! Former::text('partial')->data_bind("value: partial, valueUpdate: 'afterkeydown'")->onchange('onPartialChange()') ->rel('tooltip')->data_toggle('tooltip')->data_placement('bottom')->title(trans('texts.partial_value')) !!}
@if ($entityType == ENTITY_INVOICE)
{!! Former::select('frequency_id')->options($frequencies)->data_bind("value: frequency_id") ->appendIcon('question-sign')->addGroupClass('frequency_id')->onchange('onFrequencyChange()') !!} {!! Former::text('start_date')->data_bind("datePicker: start_date, valueUpdate: 'afterkeydown'") ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->appendIcon('calendar')->addGroupClass('start_date') !!} {!! Former::text('end_date')->data_bind("datePicker: end_date, valueUpdate: 'afterkeydown'") ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->appendIcon('calendar')->addGroupClass('end_date') !!} {!! Former::select('recurring_due_date')->label(trans('texts.due_date'))->options($recurringDueDates)->data_bind("value: recurring_due_date")->appendIcon('question-sign')->addGroupClass('recurring_due_date') !!}
@endif @if ($account->showCustomField('custom_invoice_text_label1', $invoice)) {!! Former::text('custom_text_value1')->label($account->custom_invoice_text_label1)->data_bind("value: custom_text_value1, valueUpdate: 'afterkeydown'") !!} @endif
{!! Former::text('invoice_number') ->label(trans("texts.{$entityType}_number_short")) ->data_bind("value: invoice_number, valueUpdate: 'afterkeydown'") !!} {!! Former::checkbox('auto_bill') ->label(trans('texts.auto_bill')) ->text(trans('texts.enable_with_stripe')) ->data_bind("checked: auto_bill, valueUpdate: 'afterkeydown'") !!} {!! Former::text('po_number')->label(trans('texts.po_number_short'))->data_bind("value: po_number, valueUpdate: 'afterkeydown'") !!} {!! Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") ->addGroupClass('discount-group')->type('number')->min('0')->step('any')->append( Former::select('is_amount_discount')->addOption(trans('texts.discount_percent'), '0') ->addOption(trans('texts.discount_amount'), '1')->data_bind("value: is_amount_discount")->raw() ) !!} @if ($account->showCustomField('custom_invoice_text_label2', $invoice)) {!! Former::text('custom_text_value2')->label($account->custom_invoice_text_label2)->data_bind("value: custom_text_value2, valueUpdate: 'afterkeydown'") !!} @endif @if ($entityType == ENTITY_INVOICE)
@if ($invoice->recurring_invoice) {!! trans('texts.created_by_invoice', ['invoice' => link_to('/invoices/'.$invoice->recurring_invoice->public_id, trans('texts.recurring_invoice'))]) !!} @elseif ($invoice->id) @if (isset($lastSent) && $lastSent) {!! trans('texts.last_sent_on', ['date' => link_to('/invoices/'.$lastSent->public_id, $invoice->last_sent_date, ['id' => 'lastSent'])]) !!}
@endif @if ($invoice->is_recurring && $invoice->getNextSendDate()) {!! trans('texts.next_send_on', ['date' => ''.$account->formatDate($invoice->getNextSendDate()). '']) !!} @if ($invoice->getDueDate())
{!! trans('texts.next_due_on', ['date' => ''.$account->formatDate($invoice->getDueDate($invoice->getNextSendDate())).'']) !!} @endif @endif
@endif
@endif
@if ($account->custom_invoice_item_label1) @endif @if ($account->custom_invoice_item_label2) @endif @if ($account->custom_invoice_item_label1) @endif @if ($account->custom_invoice_item_label2) @endif @if ($account->showCustomField('custom_invoice_label1', $invoice) && $account->custom_invoice_taxes1) @endif @if ($account->showCustomField('custom_invoice_label2', $invoice) && $account->custom_invoice_taxes2) @endif @endif @endif @if ($account->showCustomField('custom_invoice_label1', $invoice) && !$account->custom_invoice_taxes1) @endif @if ($account->showCustomField('custom_invoice_label2', $invoice) && !$account->custom_invoice_taxes2) @endif @if (!$account->hide_paid_to_date) @endif
{{ $invoiceLabels['item'] }} {{ $invoiceLabels['description'] }}{{ $account->custom_invoice_item_label1 }}{{ $account->custom_invoice_item_label2 }}{{ $invoiceLabels['unit_cost'] }} {{ $invoiceLabels['quantity'] }} {{ trans('texts.tax') }} {{ trans('texts.line_total') }}

{!! Former::textarea('public_notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'") ->label(null)->style('resize: none; min-width: 450px;')->rows(3) !!}
{!! Former::textarea('terms')->data_bind("value:wrapped_terms, placeholder: terms_placeholder, valueUpdate: 'afterkeydown'") ->label(false)->style('resize: none; min-width: 450px')->rows(3) ->help('
') !!}
{{ trans('texts.subtotal') }}
{{ trans('texts.discount') }}
{{ $account->custom_invoice_label1 }}
{{ $account->custom_invoice_label2 }}
@if (!$account->hide_quantity) {{ trans('texts.tax') }}
{{ trans('texts.tax') }}
{{ $account->custom_invoice_label1 }}
{{ $account->custom_invoice_label2 }}
{{ trans('texts.paid_to_date') }}
{{ trans($entityType == ENTITY_INVOICE ? 'texts.balance_due' : 'texts.total') }}

 

{!! Former::populateField('entityType', $entityType) !!} {!! Former::text('entityType') !!} {!! Former::text('action') !!} {!! Former::text('public_id')->data_bind('value: public_id') !!} {!! Former::text('is_recurring')->data_bind('value: is_recurring') !!} {!! Former::text('is_quote')->data_bind('value: is_quote') !!} {!! Former::text('has_tasks')->data_bind('value: has_tasks') !!} {!! Former::text('data')->data_bind('value: ko.mapping.toJSON(model)') !!} {!! Former::text('has_expenses')->data_bind('value: has_expenses') !!} {!! Former::text('pdfupload') !!}
@if ($account->hasLargeFont()) @endif @if (!Utils::isPro() || \App\Models\InvoiceDesign::count() == COUNT_FREE_DESIGNS_SELF_HOST) {!! Former::select('invoice_design_id')->style('display:inline;width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id")->addOption(trans('texts.more_designs') . '...', '-1') !!} @else {!! Former::select('invoice_design_id')->style('display:inline;width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id") !!} @endif {!! Button::primary(trans('texts.download_pdf'))->withAttributes(array('onclick' => 'onDownloadClick()'))->appendIcon(Icon::create('download-alt')) !!} @if ($invoice->isClientTrashed()) @elseif ($invoice->trashed()) {!! Button::success(trans('texts.restore'))->withAttributes(['onclick' => 'submitBulkAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!} @elseif (!$invoice->trashed()) {!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!} {!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!} @if ($invoice->id) {!! DropdownButton::normal(trans('texts.more_actions')) ->withContents($actions) ->dropup() !!} @endif @endif

 

@include('invoices.pdf', ['account' => Auth::user()->account]) @if (!Auth::user()->account->isPro())
{!! trans('texts.pro_plan.remove_logo', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) !!}
@endif {!! Former::close() !!} {!! Former::open("{$entityType}s/bulk")->addClass('bulkForm') !!} {!! Former::populateField('bulk_public_id', $invoice->public_id) !!} {!! Former::text('bulk_public_id') !!} {!! Former::text('bulk_action') !!} {!! Former::close() !!}
@include('invoices.knockout') @stop