bug fixes

This commit is contained in:
Hillel Coren 2014-01-02 19:16:00 +02:00
parent 0144f5b0f2
commit 7ef27d5a96
13 changed files with 147 additions and 40 deletions

View File

@ -15,7 +15,7 @@ class ClientController extends \BaseController {
return View::make('list', array( return View::make('list', array(
'entityType'=>ENTITY_CLIENT, 'entityType'=>ENTITY_CLIENT,
'title' => '- Clients', 'title' => '- Clients',
'columns'=>['checkbox', 'Client', 'Contact', 'Email', 'Date Created', 'Phone', 'Last Login', 'Balance', 'Action'] 'columns'=>['checkbox', 'Client', 'Contact', 'Email', 'Date Created', 'Last Login', 'Balance', 'Action']
)); ));
} }
@ -49,7 +49,6 @@ class ClientController extends \BaseController {
->addColumn('first_name', function($model) { return link_to('clients/' . $model->public_id, $model->first_name . ' ' . $model->last_name); }) ->addColumn('first_name', function($model) { return link_to('clients/' . $model->public_id, $model->first_name . ' ' . $model->last_name); })
->addColumn('email', function($model) { return link_to('clients/' . $model->public_id, $model->email); }) ->addColumn('email', function($model) { return link_to('clients/' . $model->public_id, $model->email); })
->addColumn('created_at', function($model) { return Utils::timestampToDateString(strtotime($model->created_at)); }) ->addColumn('created_at', function($model) { return Utils::timestampToDateString(strtotime($model->created_at)); })
->addColumn('work_phone', function($model) { return Utils::formatPhoneNumber($model->work_phone); })
->addColumn('last_login', function($model) { return Utils::timestampToDateString($model->last_login); }) ->addColumn('last_login', function($model) { return Utils::timestampToDateString($model->last_login); })
->addColumn('balance', function($model) { return Utils::formatMoney($model->balance, $model->currency_id); }) ->addColumn('balance', function($model) { return Utils::formatMoney($model->balance, $model->currency_id); })
->addColumn('dropdown', function($model) ->addColumn('dropdown', function($model)

View File

@ -79,9 +79,19 @@ class ConstantsSeeder extends Seeder
Currency::create(array('name' => 'US Dollar', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'US Dollar', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Pound Sterling', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Pound Sterling', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
DatetimeFormat::create(array('format' => 'F j, Y, g:i a', 'label' => 'March 10, 2013, 6:15 pm')); DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013'));
DatetimeFormat::create(array('format' => 'D M jS, Y g:ia', 'label' => 'Mon March 10th, 2013, 6:15 pm')); DatetimeFormat::create(array('format' => 'd-M-Yk g:i a', 'label' => '10-Mar-2013'));
DatetimeFormat::create(array('format' => 'd/F/Y g:i a', 'label' => '10/March/2013'));
DatetimeFormat::create(array('format' => 'd-F-Y g:i a', 'label' => '10-March-2013'));
DatetimeFormat::create(array('format' => 'M j, Y g:i a', 'label' => 'Mar 10, 2013 6:15 pm'));
DatetimeFormat::create(array('format' => 'F j, Y g:i a', 'label' => 'March 10, 2013 6:15 pm'));
DatetimeFormat::create(array('format' => 'D M jS, Y g:ia', 'label' => 'Mon March 10th, 2013 6:15 pm'));
DateFormat::create(array('format' => 'd/M/Y', 'picker_format' => 'dd/M/yyyy', 'label' => '10/Mar/2013'));
DateFormat::create(array('format' => 'd-M-Y', 'picker_format' => 'dd-M-yyyy', 'label' => '10-Mar-2013'));
DateFormat::create(array('format' => 'd/F/Y', 'picker_format' => 'dd/MM/yyyy', 'label' => '10/March/2013'));
DateFormat::create(array('format' => 'd-F-Y', 'picker_format' => 'dd-MM-yyyy', 'label' => '10-March-2013'));
DateFormat::create(array('format' => 'M j, Y', 'picker_format' => 'M d, yyyy', 'label' => 'Mar 10, 2013'));
DateFormat::create(array('format' => 'F j, Y', 'picker_format' => 'MM d, yyyy', 'label' => 'March 10, 2013')); DateFormat::create(array('format' => 'F j, Y', 'picker_format' => 'MM d, yyyy', 'label' => 'March 10, 2013'));
DateFormat::create(array('format' => 'D M j, Y', 'picker_format' => 'D MM d, yyyy', 'label' => 'Mon March 10, 2013')); DateFormat::create(array('format' => 'D M j, Y', 'picker_format' => 'D MM d, yyyy', 'label' => 'Mon March 10, 2013'));

View File

@ -119,7 +119,7 @@ class Activity extends Eloquent
$activity->invoice_id = $invitation->invoice_id; $activity->invoice_id = $invitation->invoice_id;
$activity->contact_id = $invitation->contact_id; $activity->contact_id = $invitation->contact_id;
$activity->activity_type_id = ACTIVITY_TYPE_EMAIL_INVOICE; $activity->activity_type_id = ACTIVITY_TYPE_EMAIL_INVOICE;
$activity->message = $userName . ' emailed invoice ' . link_to('invoices/'.$invitation->invoice->public_id, $invitation->invoice->invoice_number) . ' to ' . $invitation->contact->getFullName() . ' - ' . $invitation->contact->email; $activity->message = $userName . ' emailed invoice ' . link_to('invoices/'.$invitation->invoice->public_id, $invitation->invoice->invoice_number) . ' to ' . $invitation->contact->getDisplayName();
$activity->balance = $client->balance; $activity->balance = $client->balance;
$activity->adjustment = $adjustment; $activity->adjustment = $adjustment;
$activity->save(); $activity->save();

View File

@ -148,7 +148,7 @@ class Client extends EntityModel
return ''; return '';
} }
return link_to($this->website, $this->website); return link_to($this->website, $this->website, array('target'=>'_blank'));
} }
public function getDateCreated() public function getDateCreated()

View File

@ -31,13 +31,21 @@ class Contact extends EntityModel
} }
*/ */
public function getFullName() public function getDisplayName()
{ {
if (!$this->first_name && !$this->last_name) if (!$this->first_name && !$this->last_name)
{ {
return $this->email; return $this->email;
} }
else
{
return $this->getFullName();
}
}
public function getFullName()
{
$fullName = $this->first_name . ' ' . $this->last_name; $fullName = $this->first_name . ' ' . $this->last_name;
if ($fullName == ' ') if ($fullName == ' ')

View File

@ -100,11 +100,11 @@ class Invoice extends EntityModel
case FREQUENCY_MONTHLY: case FREQUENCY_MONTHLY:
return $dayOfMonthStart == $dayOfMonthToday || $daysSinceLastSent > 31; return $dayOfMonthStart == $dayOfMonthToday || $daysSinceLastSent > 31;
case FREQUENCY_THREE_MONTHS: case FREQUENCY_THREE_MONTHS:
return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 3)) || $daysSinceLastSent > (3 * 31); return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 3)) || $daysSinceLastSent > 92;
case FREQUENCY_SIX_MONTHS: case FREQUENCY_SIX_MONTHS:
return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 6)) || $daysSinceLastSent > (6 * 31); return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 6)) || $daysSinceLastSent > 183;
case FREQUENCY_ANNUALLY: case FREQUENCY_ANNUALLY:
return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 12)) || $daysSinceLastSent > (12 *31); return ($dayOfMonthStart == $dayOfMonthToday && (!$daysSinceLastSent || $monthsSinceLastSent == 12)) || $daysSinceLastSent > 365;
default: default:
Utils::fatalError("Invalid frequency supplied: " . $this->frequency_id); Utils::fatalError("Invalid frequency supplied: " . $this->frequency_id);
break; break;

View File

@ -80,7 +80,8 @@ class InvoiceRepository
} }
$invoice = (array) $input; $invoice = (array) $input;
$rules = ['invoice_number' => 'unique:invoices,invoice_number,' . $invoice['invoice_number'] . ',id,account_id,' . \Auth::user()->account_id]; $invoiceId = isset($invoice['public_id']) && $invoice['public_id'] ? Invoice::getPrivateId($invoice['public_id']) : null;
$rules = ['invoice_number' => 'unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id];
$validator = \Validator::make($invoice, $rules); $validator = \Validator::make($invoice, $rules);
if ($validator->fails()) if ($validator->fails())

View File

@ -37,9 +37,9 @@
{{ Former::legend('Address') }} {{ Former::legend('Address') }}
{{ Former::text('address1')->label('Street') }} {{ Former::text('address1')->label('Street') }}
{{ Former::text('address2')->label('Apt/Floor') }} {{ Former::text('address2')->label('Apt/Suite') }}
{{ Former::text('city') }} {{ Former::text('city') }}
{{ Former::text('state') }} {{ Former::text('state')->label('State/Province') }}
{{ Former::text('postal_code') }} {{ Former::text('postal_code') }}
{{ Former::select('country_id')->addOption('','')->label('Country') {{ Former::select('country_id')->addOption('','')->label('Country')
->fromQuery($countries, 'name', 'id')->select($account ? $account->country_id : '') }} ->fromQuery($countries, 'name', 'id')->select($account ? $account->country_id : '') }}

View File

@ -30,9 +30,9 @@
{{ Former::legend('Address') }} {{ Former::legend('Address') }}
{{ Former::text('address1')->label('Street') }} {{ Former::text('address1')->label('Street') }}
{{ Former::text('address2')->label('Apt/Floor') }} {{ Former::text('address2')->label('Apt/Suite') }}
{{ Former::text('city') }} {{ Former::text('city') }}
{{ Former::text('state') }} {{ Former::text('state')->label('State/Province') }}
{{ Former::text('postal_code') }} {{ Former::text('postal_code') }}
{{ Former::select('country_id')->addOption('','')->label('Country') {{ Former::select('country_id')->addOption('','')->label('Country')
->fromQuery($countries, 'name', 'id')->select($client ? $client->country_id : '') }} ->fromQuery($countries, 'name', 'id')->select($client ? $client->country_id : '') }}

View File

@ -6,10 +6,12 @@
<meta name="csrf-token" content="<?= csrf_token() ?>"> <meta name="csrf-token" content="<?= csrf_token() ?>">
<script src="{{ asset('js/jquery-ui.min.js') }}" type="text/javascript"></script> <script src="{{ asset('js/jquery-ui.min.js') }}" type="text/javascript"></script>
@if (Auth::check() && Auth::user()->theme_id) @if (Auth::check() && Auth::user()->theme_id)
<link rel="stylesheet" type="text/css" href="{{ asset('css/themes/'.Auth::user()->theme->name.'.min.css') }}"/> <link rel="stylesheet" type="text/css" href="{{ asset('css/themes/'.Auth::user()->theme->name.'.min.css') }}"/>
@else @else
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}"/> <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}"/>
@endif @endif
<script src="{{ asset('js/bootstrap.js') }}" type="text/javascript"></script> <script src="{{ asset('js/bootstrap.js') }}" type="text/javascript"></script>
@ -37,7 +39,6 @@
<script src="{{ asset('js/script.js') }}" type="text/javascript"></script> <script src="{{ asset('js/script.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/accounting.js') }}" type="text/javascript"></script> <script src="{{ asset('js/accounting.js') }}" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}"/>
<style type="text/css"> <style type="text/css">
@if (!Auth::check() || Auth::user()->showGreyBackground()) @if (!Auth::check() || Auth::user()->showGreyBackground())
@ -90,12 +91,12 @@
{{ HTML::menu_link('invoice') }} {{ HTML::menu_link('invoice') }}
{{ HTML::menu_link('payment') }} {{ HTML::menu_link('payment') }}
{{ HTML::menu_link('credit') }} {{ HTML::menu_link('credit') }}
{{ HTML::nav_link('reports', 'Reports') }} {{-- HTML::nav_link('reports', 'Reports') --}}
</ul> </ul>
<div class="navbar-form navbar-right"> <div class="navbar-form navbar-right">
@if (!Auth::check() || !Auth::user()->registered) @if (!Auth::check() || !Auth::user()->registered)
{{ Button::sm_primary('Sign up', array('data-toggle'=>'modal', 'data-target'=>'#signUpModal')) }} {{ Button::sm_success_primary('Sign up', array('data-toggle'=>'modal', 'data-target'=>'#signUpModal')) }}
@endif @endif
<div class="btn-group"> <div class="btn-group">
@ -143,6 +144,8 @@
</div><!-- /.navbar-collapse --> </div><!-- /.navbar-collapse -->
</nav> </nav>
<p>&nbsp;</p>
@if (Session::has('message')) @if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div> <div class="alert alert-info">{{ Session::get('message') }}</div>
@endif @endif
@ -153,6 +156,7 @@
</div> </div>
<div class="container"> <div class="container">
<div class="footer" style="padding-top: 32px"> <div class="footer" style="padding-top: 32px">
@if (false)
<div class="pull-right"> <div class="pull-right">
{{ Former::open('user/setTheme')->addClass('themeForm') }} {{ Former::open('user/setTheme')->addClass('themeForm') }}
<div style="display:none"> <div style="display:none">
@ -172,6 +176,7 @@
</div> </div>
{{ Former::close() }} {{ Former::close() }}
</div> </div>
@endif
Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice-ninja', 'open source', array('target'=>'_blank')) }}, email us at {{ link_to('mailto:contact@invoiceninja.com', 'contact@invoiceninja.com') }}. Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice-ninja', 'open source', array('target'=>'_blank')) }}, email us at {{ link_to('mailto:contact@invoiceninja.com', 'contact@invoiceninja.com') }}.
<p class="text-danger">This is a demo site, the data is erased.</p> <p class="text-danger">This is a demo site, the data is erased.</p>
@ -234,7 +239,7 @@
<div class="container"> <div class="container">
<h3>Are you sure?</h3> <h3>Are you sure?</h3>
<p>This will permanently erase your data.</p> <p>This will permanently erase your data.</p>
</div> </div>
<div class="modal-footer" id="signUpFooter"> <div class="modal-footer" id="signUpFooter">
@ -392,5 +397,5 @@
}); });
</script> </script>
@stop @stop

View File

@ -10,8 +10,6 @@
@section('content') @section('content')
<p>&nbsp;</p>
{{ Former::open($url)->method($method)->addClass('main_form')->rules(array( {{ Former::open($url)->method($method)->addClass('main_form')->rules(array(
'client' => 'required', 'client' => 'required',
'email' => 'required', 'email' => 'required',
@ -54,8 +52,6 @@
</div> </div>
</div> </div>
</div> </div>
{{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'") }}
{{ Former::textarea('public_notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'") }}
</div> </div>
<div class="col-md-4" id="col_2"> <div class="col-md-4" id="col_2">
@ -85,12 +81,12 @@
<div class="col-md-3" id="col_2"> <div class="col-md-3" id="col_2">
{{ Former::text('po_number')->label('PO&nbsp;number')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }} {{ Former::text('po_number')->label('PO&nbsp;number')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }}
{{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }} {{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }}
{{ Former::select('currency_id')->label('Currency')->fromQuery($currencies, 'name', 'id')->data_bind("value: currency_id") }} {{ Former::select('currency_id')->label('Currency')->addOption('', '')->fromQuery($currencies, 'name', 'id')->data_bind("value: currency_id") }}
<div class="form-group" style="margin-bottom: 8px"> <div class="form-group" style="margin-bottom: 8px">
<label for="recurring" class="control-label col-lg-4 col-sm-4">Taxes</label> <label for="recurring" class="control-label col-lg-4 col-sm-4">Taxes</label>
<div class="col-lg-8 col-sm-8" style="padding-top: 7px"> <div class="col-lg-8 col-sm-8" style="padding-top: 7px">
<a href="#" data-bind="click: $root.showTaxesForm">Manage taxe rates</a> <a href="#" data-bind="click: $root.showTaxesForm">Manage tax rates</a>
</div> </div>
</div> </div>
@ -146,7 +142,13 @@
<tfoot> <tfoot>
<tr> <tr>
<td class="hide-border"/> <td class="hide-border"/>
<td colspan="2"/> <td colspan="2" rowspan="5">
<br/>
{{ Former::textarea('public_notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'")
->label(false)->placeholder('Note to client')->style('width: 520px; resize: none') }}
{{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'")
->label(false)->placeholder('Invoice terms')->style('width: 520px; resize: none') }}
</td>
<td data-bind="visible: $root.invoice_item_taxes.show"/> <td data-bind="visible: $root.invoice_item_taxes.show"/>
<td colspan="2">Subtotal</td> <td colspan="2">Subtotal</td>
<td style="text-align: right"><span data-bind="text: totals.subtotal"/></td> <td style="text-align: right"><span data-bind="text: totals.subtotal"/></td>
@ -201,7 +203,7 @@
array('Create Credit', "javascript:onCreditClick()"), array('Create Credit', "javascript:onCreditClick()"),
) )
) )
, array('id'=>'actionDropDown', 'style'=>'text-align:left', 'data-bind'=>'css: $root.enable.save'))->split(); }} , array('id'=>'relatedActions', 'style'=>'text-align:left'))->split(); }}
{{ DropdownButton::primary('Save Invoice', {{ DropdownButton::primary('Save Invoice',
Navigation::links( Navigation::links(
@ -213,7 +215,7 @@
array('Delete Invoice', "javascript:onDeleteClick()"), array('Delete Invoice', "javascript:onDeleteClick()"),
) )
) )
, array('id'=>'actionDropDown', 'style'=>'text-align:left', 'data-bind'=>'css: $root.enable.save'))->split(); }} , array('id'=>'primaryActions', 'style'=>'text-align:left', 'data-bind'=>'css: $root.enable.save'))->split(); }}
@else @else
{{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }} {{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }}
{{ Button::primary_submit('Save Invoice', array('data-bind'=>'css: $root.enable.save')) }} {{ Button::primary_submit('Save Invoice', array('data-bind'=>'css: $root.enable.save')) }}
@ -249,9 +251,9 @@
{{ Former::legend('Address') }} {{ Former::legend('Address') }}
{{ Former::text('address1')->label('Street')->data_bind("value: address1, valueUpdate: 'afterkeydown'") }} {{ Former::text('address1')->label('Street')->data_bind("value: address1, valueUpdate: 'afterkeydown'") }}
{{ Former::text('address2')->label('Apt/Floor')->data_bind("value: address2, valueUpdate: 'afterkeydown'") }} {{ Former::text('address2')->label('Apt/Suite')->data_bind("value: address2, valueUpdate: 'afterkeydown'") }}
{{ Former::text('city')->data_bind("value: city, valueUpdate: 'afterkeydown'") }} {{ Former::text('city')->data_bind("value: city, valueUpdate: 'afterkeydown'") }}
{{ Former::text('state')->data_bind("value: state, valueUpdate: 'afterkeydown'") }} {{ Former::text('state')->label('State/Province')->data_bind("value: state, valueUpdate: 'afterkeydown'") }}
{{ Former::text('postal_code')->data_bind("value: postal_code, valueUpdate: 'afterkeydown'") }} {{ Former::text('postal_code')->data_bind("value: postal_code, valueUpdate: 'afterkeydown'") }}
{{ Former::select('country_id')->addOption('','')->label('Country')->addGroupClass('country_select') {{ Former::select('country_id')->addOption('','')->label('Country')->addGroupClass('country_select')
->fromQuery($countries, 'name', 'id')->data_bind("dropdown: country_id") }} ->fromQuery($countries, 'name', 'id')->data_bind("dropdown: country_id") }}
@ -387,7 +389,7 @@
console.log('load blank client'); console.log('load blank client');
} }
refreshPDF(); refreshPDF();
}); //.trigger('change'); }).trigger('change');
$('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discout, #currency_id').change(function() { $('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discout, #currency_id').change(function() {
refreshPDF(); refreshPDF();
@ -422,7 +424,11 @@
$('table.invoice-table select').trigger('change'); $('table.invoice-table select').trigger('change');
}) })
$('#actionDropDown > button:first').click(function() { $('#relatedActions > button:first').click(function() {
onDownloadClick();
});
$('#primaryActions > button:first').click(function() {
onSaveClick(); onSaveClick();
}); });
@ -434,7 +440,7 @@
client.name.display()); client.name.display());
applyComboboxListeners(); applyComboboxListeners();
refreshPDF(); //refreshPDF();
}); });
function applyComboboxListeners() { function applyComboboxListeners() {
@ -801,7 +807,8 @@
this.id = ko.observable(''); this.id = ko.observable('');
self.discount = ko.observable(''); self.discount = ko.observable('');
self.frequency_id = ko.observable(''); self.frequency_id = ko.observable('');
self.currency_id = ko.observable({{ Session::get(SESSION_CURRENCY) }}); //self.currency_id = ko.observable({{ Session::get(SESSION_CURRENCY) }});
self.currency_id = ko.observable({{ $client && $client->currency_id ? $client->currency_id : Session::get(SESSION_CURRENCY) }});
self.terms = ko.observable(wordWrapText('{{ $account->invoice_terms }}', 340)); self.terms = ko.observable(wordWrapText('{{ $account->invoice_terms }}', 340));
self.public_notes = ko.observable(''); self.public_notes = ko.observable('');
self.po_number = ko.observable(''); self.po_number = ko.observable('');

View File

@ -135,7 +135,7 @@ table.table thead .sorting_desc_disabled { background: url('../images/sort_desc_
} }
.invoice-table { .invoice-table tbody {
border-style: none !important; border-style: none !important;
} }
@ -184,3 +184,72 @@ body {
-o-transition: all 0.5s ease; -o-transition: all 0.5s ease;
transition: all 0.5s ease; transition: all 0.5s ease;
} }
.navbar-default {
background-color: #428bff;
border-color: #3276b1;
}
.navbar-default .navbar-brand {
color: #ecf0f1;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffffff;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #3276b1;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #ffffff;
background-color: #3276b1;
}
.navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #ecf0f1;
border-bottom-color: #ecf0f1;
}
.navbar-default .navbar-nav > .dropdown > a:hover .caret,
.navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar-default .navbar-nav > .open > a .caret,
.navbar-default .navbar-nav > .open > a:hover .caret,
.navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar-default .navbar-toggle {
border-color: #3276b1;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #3276b1;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ecf0f1;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
}
}

View File

@ -104,6 +104,14 @@ function generatePDF(invoice) {
doc.text(headerLeft, headerY, 'Invoice Date'); doc.text(headerLeft, headerY, 'Invoice Date');
doc.text(issuedOnX, headerY, issuedOn); doc.text(issuedOnX, headerY, issuedOn);
/*
if (invoice.due_date) {
headerY += rowHeight;
doc.text(headerLeft, headerY, 'Due Date');
doc.text(poNumberX, headerY, invoice.po_number);
}
*/
headerY += rowHeight; headerY += rowHeight;
doc.setFontType("bold"); doc.setFontType("bold");
doc.text(headerLeft, headerY, 'Amount Due'); doc.text(headerLeft, headerY, 'Amount Due');
@ -198,8 +206,8 @@ function generatePDF(invoice) {
doc.lines([[0,0],[headerRight-tableLeft+5,0]],tableLeft - 8, x); doc.lines([[0,0],[headerRight-tableLeft+5,0]],tableLeft - 8, x);
doc.text(tableLeft, x+16, invoice.terms); doc.text(tableLeft, x+16, invoice.public_notes);
doc.text(tableLeft, x+16 + (doc.splitTextToSize(invoice.terms, 340).length * rowHeight), invoice.public_notes); doc.text(tableLeft, x+16 + (doc.splitTextToSize(invoice.public_notes, 340).length * rowHeight) + (rowHeight/2), invoice.terms);
x += 16; x += 16;
doc.text(footerLeft, x, 'Subtotal'); doc.text(footerLeft, x, 'Subtotal');
@ -669,12 +677,12 @@ ko.bindingHandlers.datePicker = {
init: function (element, valueAccessor, allBindingsAccessor) { init: function (element, valueAccessor, allBindingsAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor()); var value = ko.utils.unwrapObservable(valueAccessor());
if (value) $(element).datepicker('update', value); if (value) $(element).datepicker('update', value);
console.log("datePicker-init: %s", value); //console.log("datePicker-init: %s", value);
}, },
update: function (element, valueAccessor) { update: function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor()); var value = ko.utils.unwrapObservable(valueAccessor());
if (value) $(element).datepicker('update', value); if (value) $(element).datepicker('update', value);
console.log("datePicker-init: %s", value); //console.log("datePicker-init: %s", value);
} }
}; };