@extends('header') @section('head') @parent @stop @section('content')

 

{{ Former::open($url)->method($method)->addClass('main_form')->rules(array( 'client' => 'required', 'product_key' => 'max:14', )); }} @if ($invoice) {{ Former::populate($invoice); }} {{ Former::populateField('id', $invoice->public_id); }} {{ Former::populateField('invoice_date', Utils::fromSqlDate($invoice->invoice_date)); }} {{ Former::populateField('due_date', Utils::fromSqlDate($invoice->due_date)); }} {{ Former::populateField('start_date', Utils::fromSqlDate($invoice->start_date)); }} {{ Former::populateField('end_date', Utils::fromSqlDate($invoice->end_date)); }} @else {{ Former::populateField('invoice_number', $invoiceNumber) }} {{ Former::populateField('invoice_date', date('m/d/Y')) }} {{ Former::populateField('start_date', date('m/d/Y')) }} {{ Former::populateField('frequency', FREQUENCY_MONTHLY) }} @endif
{{ Former::select('client')->addOption('', '')->fromQuery($clients, 'name', 'public_id')->select($client ? $client->public_id : '')->addGroupClass('client_select') ->help('Create new client') }} {{ Former::textarea('notes') }}
{{ Former::checkbox('recurring')->text('Enable automatic invoicing | Learn more')->onchange('toggleRecurring()') ->inlineHelp($invoice && $invoice->last_sent_date ? 'Last invoice sent ' . Utils::timestampToDateString($invoice->last_sent_date) : '') }}
{{ Former::text('invoice_number')->label('Invoice #') }} {{ Former::text('invoice_date') }} {{ Former::text('due_date') }} {{-- Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") --}} {{-- Former::text('invoice_date')->label('Invoice Date')->data_date_format('yyyy-mm-dd') --}}

 

{{ Former::hidden('items')->data_bind("value: ko.toJSON(items)") }}
Item Description Unit Cost Quantity Line Total
{{ Former::text('product_key')->useDatalist(Product::getProductKeys($products), 'key')->onkeyup('onChange()') ->raw()->data_bind("value: product_key, valueUpdate: 'afterkeydown'")->addClass('datalist') }}  
Subtotal
Paid to Date
Discount
Invoice Total

 

{{ Former::text('action') }} @if ($invoice) {{ Former::text('id') }} @endif
@if ($invoice) {{ DropdownButton::normal('Download PDF', Navigation::links( array( array('Download PDF', "javascript:onDownloadClick()"), array(Navigation::DIVIDER), array('Archive Invoice', "javascript:onArchiveClick()"), array('Delete Invoice', "javascript:onDeleteClick()"), ) ) , array('id'=>'actionDropDown','style'=>'text-align:left'))->split(); }} @else {{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }} @endif {{ Button::primary_submit('Save Invoice') }} {{ Button::primary('Send Email', array('id' => 'email_button', 'onclick' => 'onEmailClick()')) }}

 

{{ Former::close() }} @stop