@extends('header') @section('content')

 

{{ Former::open($url)->method($method)->addClass('main_form')->rules(array( 'invoice_number' => 'required', 'invoice_date' => 'required' )); }} @if ($invoice) {{ Former::populate($invoice); }} {{ Former::populateField('invoice_date', fromSqlDate($invoice->invoice_date)); }} {{ Former::populateField('due_date', fromSqlDate($invoice->due_date)); }} @else {{ Former::populateField('invoice_date', date('m/d/Y')) }} @endif
{{ Former::select('client')->addOption('', '')->fromQuery($clients, 'name', 'id')->select($client ? $client->id : '') ->help('Create new client'); }}
{{ Former::text('invoice_number')->label('Invoice #') }} {{ Former::text('invoice_date')->label('Invoice Date') }} {{ Former::text('due_date')->label('Due Date') }} {{-- Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") --}}

 

{{ 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') ->raw()->data_bind("value: product_key, valueUpdate: 'afterkeydown'")->addClass('datalist') }}  
Subtotal
Discount
Add line item Invoice Total

 

{{ Button::primary('Download PDF', array('onclick' => 'onDownloadClick()')) }} {{ Button::primary_submit('Save Invoice', array('onclick' => 'onSaveClick()')) }} {{ Button::primary('Send Email', array('onclick' => 'onEmailClick()')) }}

 

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