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

 

{{ Former::open($url)->method($method)->addClass('main_form')->rules(array( 'invoice_number' => 'required', 'invoice_date' => '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)); }} @else {{ Former::populateField('invoice_number', $invoiceNumber) }} {{ Former::populateField('invoice_date', date('m/d/Y')) }} @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::text('invoice_number')->label('Invoice #') }} {{-- Former::text('invoice_date')->label('Invoice Date')->data_date_format('yyyy-mm-dd') --}} {{ 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')->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('onclick' => 'onEmailClick()')) }}

 

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