1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Bug fixes

This commit is contained in:
Hillel Coren 2014-03-17 20:05:01 +02:00
parent ea82406567
commit ccbbf6c6fa
14 changed files with 81 additions and 42 deletions

View File

@ -4,7 +4,11 @@
### [https://www.invoiceninja.com](https://www.invoiceninja.com)
### Introduction
Most online invoicing sites are expensive. They shouldn't be. The aim of this project is to provide a free, open-source alternative. Additionally, the hope is this codebase will serve as a sample site for Laravel as well as other JavaScript technologies.
Most online invoicing sites are expensive. They shouldn't be. The aim of this project is to provide a free, open-source alternative. Additionally, the hope is the codebase will serve as a sample site for Laravel as well as other JavaScript technologies.
For updates follow [@invoiceninja](https://twitter.com/invoiceninja) and [@hillelcoren](https://twitter.com/hillelcoren)
Site design by [kantorp-wegl.in](http://kantorp-wegl.in/)
### Features
* Core application built using Laravel 4.1
@ -15,7 +19,7 @@ Most online invoicing sites are expensive. They shouldn't be. The aim of this pr
### Steps to setup
If you plan on submitting changes it's best to fork the repo (https://help.github.com/articles/fork-a-repo), otherwise you can just checkout the code.
If you plan on submitting changes it's best to [fork the repo](https://help.github.com/articles/fork-a-repo), otherwise you can just checkout the code.
git clone git@github.com:hillelcoren/invoice-ninja.git ninja
cd ninja

View File

@ -105,7 +105,7 @@ class ConstantsSeeder extends Seeder
Industry::create(array('name' => 'Travel & Luxury'));
Industry::create(array('name' => 'Other'));
Size::create(array('name' => '1 = 3'));
Size::create(array('name' => '1 - 3'));
Size::create(array('name' => '4 - 10'));
Size::create(array('name' => '11 - 50'));
Size::create(array('name' => '51 - 100'));
@ -122,6 +122,7 @@ class ConstantsSeeder extends Seeder
Currency::create(array('name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Pound Sterling', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'));
DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013'));

View File

@ -162,7 +162,17 @@ class Client extends EntityModel
return '';
}
return link_to($this->website, $this->website, array('target'=>'_blank'));
$link = $this->website;
$title = $this->website;
$prefix = 'http://';
if (strlen($link) > 7 && substr($link, 0, 7) === $prefix) {
$title = substr($title, 7);
} else {
$link = $prefix . $link;
}
return link_to($link, $title, array('target'=>'_blank'));
}
public function getDateCreated()

View File

@ -64,7 +64,7 @@
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2>Open Source Platform</h2>
<p>Free yourself from online invoicing platforms with high monthly fees and limited functionality. Being open source allows us fast app development, security audits by the open-course community, and we can keep it <span style="color:#2299c0"><strong>FREE!</strong></span></p>
<p>Free yourself from online invoicing platforms with high monthly fees and limited functionality. Being <a href="https://github.com/hillelcoren/invoice-ninja" target="_blank">open source</a> allows us fast app development, security audits by the open-course community, and we can keep it <strong>FREE!</strong></p>
</div>
</div>
</div>

View File

@ -36,6 +36,8 @@
{{-- do nothing --}}
@elseif ($field == 'testMode' || $field == 'developerMode')
{{-- Former::checkbox($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field))->text('Enable') --}}
@elseif ($field == 'username' || $field == 'password')
{{ Former::text($gateway->id.'_'.$field)->label('API '. ucfirst(Utils::toSpaceCase($field))) }}
@else
{{ Former::text($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field)) }}
@endif

View File

@ -14,7 +14,7 @@
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.
Regards,
Regards, <p/>
The InvoiceNinja Team

View File

@ -9,9 +9,9 @@
The following client {{ $clientName }} was emailed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount}}.<p/>
Regards,
Regards, <p/>
The InvoiceNinja Team
The InvoiceNinja Team <p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.<p/>

View File

@ -9,9 +9,9 @@
The following client {{ $clientName }} viewed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount}}.<p/>
Regards,
Regards,<p/>
The InvoiceNinja Team
The InvoiceNinja Team<p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.<p/>

View File

@ -77,7 +77,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="{{ URL::to('/rocksteady') }}" class='navbar-brand'>
<a href="{{ URL::to('/') }}" class='navbar-brand'>
<img src="{{ asset('images/invoiceninja-logo.png') }}" style="height:18px;width:auto"/>
</a>
</div>

View File

@ -22,6 +22,8 @@
'product_key' => 'max:20',
)); }}
<input type="submit" style="display:none" name="submitButton" id="submitButton">
<div data-bind="with: invoice">
<div class="row" style="min-height:195px" onkeypress="formEnterClick(event)">
<div class="col-md-4" id="col_1">
@ -255,7 +257,7 @@
)
, array('id'=>'primaryActions', 'style'=>'text-align:left', 'data-bind'=>'css: $root.enable.save'))->split(); --}}
@else
{{ Button::success_submit('Save Invoice', array('id' => 'saveButton')) }}
{{ Button::success('Save Invoice', array('id' => 'saveButton', 'onclick' => 'onSaveClick()')) }}
@endif
{{ Button::normal('Email Invoice', array('id' => 'email_button', 'onclick' => 'onEmailClick()'))->append_with_icon('send'); }}
@ -423,7 +425,7 @@
<p>Examples of dynamic invoice variables:</p>
<ul>
<li>"Gym membership for the month of :MONTH" => "Gym membership for the month of July"</li>
<li>":YEAR+1 yearly subscription" => "2014 Yearly Subscription"</li>
<li>":YEAR+1 yearly subscription" => "2015 Yearly Subscription"</li>
<li>"Retainer payment for :QUARTER+1" => "Retainer payment for Q2"</li>
</ul>
&nbsp;
@ -454,7 +456,26 @@
$(function() {
$('#country_id').combobox();
$('#country_id').combobox().on('change', function(e) {
console.log('changed country');
var countryId = parseInt($('input[name=country_id]').val(), 10);
var foundMatch = false;
$('#country_id option').each(function() {
var itemId = parseInt($(this).val(), 10);
if (countryId === itemId) {
foundMatch = true;
var country = {id:countryId, name:$(this).text()};
model.invoice().client().country = country;
model.invoice().client().country_id(countryId);
return;
}
});
if (!foundMatch) {
model.invoice().client().country = false;
model.invoice().client().country_id(0);
}
});
$('[rel=tooltip]').tooltip();
$('#invoice_date, #due_date, #start_date, #end_date').datepicker();
@ -470,19 +491,15 @@
model.loadClient(clientMap[clientId]);
} else {
model.loadClient($.parseJSON(ko.toJSON(new ClientModel())));
model.invoice().client().country = false;
}
refreshPDF();
}); //.trigger('change');
}); //.trigger('change');
$('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discount, #currency_id, #invoice_design_id').change(function() {
refreshPDF();
});
$('.country_select input.form-control').on('change', function(e) {
var countryId = parseInt($('input[name=country_id]').val(), 10);
model.invoice().client().country_id(countryId);
});
@if ($client || $invoice)
$('#invoice_number').focus();
@else
@ -651,16 +668,17 @@
@if (Auth::user()->confirmed)
if (confirm('Are you sure you want to email this invoice?')) {
$('#action').val('email');
$('.main_form').submit();
$('#submitButton').click();
}
@else
$('#action').val('email');
$('.main_form').submit();
$('#submitButton').click();
@endif
}
function onSaveClick() {
$('.main_form').submit();
$('#action').val('');
$('#submitButton').click();
}
function isSaveValid() {
@ -698,7 +716,7 @@
function onCloneClick() {
$('#action').val('clone');
$('.main_form').submit();
$('#submitButton').click();
}
@if ($client && $invoice)
@ -713,13 +731,13 @@
function onArchiveClick() {
$('#action').val('archive');
$('.main_form').submit();
$('#submitButton').click();
}
function onDeleteClick() {
if (confirm('Are you sure you want to delete this invoice?')) {
$('#action').val('delete');
$('.main_form').submit();
$('#submitButton').click();
}
}
@ -730,8 +748,8 @@
}
event.preventDefault();
$('.main_form').submit();
$('#action').val('');
$('#submitButton').click();
return false;
}
}
@ -1431,6 +1449,7 @@
var clientMap = {};
var $clientSelect = $('select#client');
for (var i=0; i<clients.length; i++) {
var client = clients[i];
for (var j=0; j<client.contacts.length; j++) {

View File

@ -3,7 +3,7 @@
<head>
<title>Invoice Ninja {{ isset($title) ? $title : '' }}</title>
<link rel="canonical" href="https://www.invoiceninja.com/rocksteady"></link>
<link rel="canonical" href="https://www.invoiceninja.com"></link>
<link href="{{ asset('favicon.ico') }}" rel="icon" type="image/x-icon">
<link href='//fonts.googleapis.com/css?family=Roboto:400,700,900,100' rel='stylesheet' type='text/css'>
@ -13,7 +13,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:site_name" content="Invoice Ninja"></meta>
<meta property="og:url" content="https://www.invoiceninja.com/rocksteady"></meta>
<meta property="og:url" content="https://www.invoiceninja.com"></meta>
<meta property="og:title" content="Invoice Ninja"></meta>
<meta property="og:image" content="https://www.invoiceninja.com/images/facebook.jpg"></meta>
<meta property="og:description" content="Simple, Intuitive Invoicing."></meta>

View File

@ -440,12 +440,12 @@ ko.bindingHandlers.dropdown = {
/*
ko.utils.registerEventHandler(element, "change", function () {
console.log("change: %s", $(element).val());
var
console.log("change: %s", $(element).val());
//var
valueAccessor($(element).val());
//$(element).combobox('refresh');
});
*/
*/
},
update: function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
@ -1290,11 +1290,12 @@ function displayClient(doc, invoice, x, y, layout) {
if (!client) {
return;
}
console.log('=== country: ' + (client.country ? client.country.name : false));
var data = [
getClientDisplayName(client),
concatStrings(client.address1, client.address2),
concatStrings(client.city, client.state, client.postal_code),
client.country ? client.country.name : false,
client.contacts[0].email
];
@ -1335,21 +1336,23 @@ function displaySubtotals(doc, layout, invoice, y, rightAlignTitleX)
}
function concatStrings() {
var hasValue = false;
var concatStr = '';
var data = [];
for (var i=0; i<arguments.length; i++) {
var string = arguments[i];
if (string) {
hasValue = true;
data.push(string);
}
concatStr += string;
if (i == 0) {
}
for (var i=0; i<data.length; i++) {
concatStr += data[i];
if (i == 0 && data.length > 1) {
concatStr += ', ';
} else if (i < arguments.length -1) {
} else if (i < data.length -1) {
concatStr += ' ';
}
}
return hasValue ? concatStr : false;
return data.length ? concatStr : false;
}
function displayGrid(doc, invoice, data, x, y, layout, hasheader, rightAlignX, rightAlignTitleX) {

View File

@ -2,7 +2,7 @@
$I = new WebGuy($scenario);
$I->wantTo('click invoice now');
$I->amOnPage('/rocksteady');
$I->amOnPage('/');
$I->click('#startButton');
$I->seeInDatabase('users', ['id' => 1]);

View File

@ -11,7 +11,7 @@ $I->wantTo('Test Form:New Client. /clients/create');
$I->amOnPage('/rocksteady');
$I->amOnPage('/');
$I->click('#startButton');