@extends('header') @section('head') @parent @stop @section('content') @if ($invoice && $invoice->id) @endif {!! Former::open($url)->method($method)->addClass('warn-on-exit')->rules(array( 'client' => 'required', 'product_key' => 'max:20' )) !!}
@if ($invoice && $invoice->id)
@endif {!! Former::select('client')->addOption('', '')->data_bind("dropdown: client")->addGroupClass('client_select closer-row') !!}
@if ($invoice && $invoice->id)
@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))->append('') !!} {!! Former::text('due_date')->data_bind("datePicker: due_date, valueUpdate: 'afterkeydown'") ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->append('') !!} {!! Former::text('partial')->data_bind("value: partial, valueUpdate: 'afterkeydown', enable: is_partial") ->onchange('onPartialChange()')->addGroupClass('partial')->append(Former::checkbox('is_partial')->raw() ->data_bind('checked: is_partial')->onclick('onPartialEnabled()') . ' ' . (trans('texts.enable'))) !!}
@if ($entityType == ENTITY_INVOICE)
{!! Former::select('frequency_id')->options($frequencies)->data_bind("value: frequency_id") !!} {!! Former::text('start_date')->data_bind("datePicker: start_date, valueUpdate: 'afterkeydown'") ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->append('') !!} {!! Former::text('end_date')->data_bind("datePicker: end_date, valueUpdate: 'afterkeydown'") ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->append('') !!}
@if ($invoice && $invoice->recurring_invoice_id)
Created by a {!! link_to('/invoices/'.$invoice->recurring_invoice_id, 'recurring invoice') !!}
@else
{!! Former::checkbox('recurring')->onclick('onRecurringEnabled()')->text(trans('texts.enable').'    '.trans('texts.learn_more').'')->data_bind("checked: is_recurring") ->inlineHelp($invoice && $invoice->last_sent_date ? 'Last invoice sent ' . Utils::dateToString($invoice->last_sent_date) : '') !!}
@endif @endif
{!! Former::text('invoice_number')->label(trans("texts.{$entityType}_number_short"))->data_bind("value: invoice_number, 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() ) !!} {{-- Former::select('currency_id')->addOption('', '')->fromQuery($currencies, 'name', 'id')->data_bind("value: currency_id") --}}

 

{!! Former::hidden('data')->data_bind("value: ko.mapping.toJSON(model)") !!}
@if (($account->custom_invoice_label1 || ($invoice && floatval($invoice->custom_value1)) != 0) && $account->custom_invoice_taxes1) @endif @if (($account->custom_invoice_label2 || ($invoice && floatval($invoice->custom_value2)) != 0) && $account->custom_invoice_taxes2) @endif @endif @if (($account->custom_invoice_label1 || ($invoice && floatval($invoice->custom_value1)) != 0) && !$account->custom_invoice_taxes1) @endif @if (($account->custom_invoice_label2 || ($invoice && floatval($invoice->custom_value2)) != 0) && !$account->custom_invoice_taxes2) @endif @if (!$account->hide_paid_to_date) @endif
{{ trans('texts.item') }} {{ trans('texts.description') }} {{ trans('texts.unit_cost') }} {{ trans('texts.quantity') }} {{ trans('texts.tax') }} {{ trans('texts.line_total') }}
{!! Former::text('product_key')->useDatalist($products->toArray(), 'product_key')->onkeyup('onItemChange()') ->raw()->data_bind("value: product_key, valueUpdate: 'afterkeydown'")->addClass('datalist') !!}
 

{!! 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: default_terms, 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 }}
{{ 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') !!} @if ($invoice && $invoice->id) {!! Former::populateField('id', $invoice->public_id) !!} {!! Former::text('id') !!} @endif
@if (!Utils::isPro() || \App\Models\InvoiceDesign::count() == COUNT_FREE_DESIGNS) {!! Former::select('invoice_design_id')->style('display:inline;width:150px')->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')->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 || (!$invoice->trashed() && !$invoice->client->trashed())) @if ($invoice && $invoice->id)
@else {!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()')) !!} @endif @if (!$invoice || ($invoice && !$invoice->is_recurring)) {!! Button::normal(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'email_button', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!} @endif @if ($invoice && $invoice->id && $entityType == ENTITY_INVOICE && !$invoice->is_recurring) {!! Button::primary(trans('texts.enter_payment'))->withAttributes(array('onclick' => 'onPaymentClick()'))->appendIcon(Icon::create('usd')) !!} @endif @elseif ($invoice && $invoice->trashed() && !$invoice->is_deleted == '1') {!! Button::success(trans('texts.restore'))->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!} @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() !!}
@stop