1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

:wqerge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
David Bomba 2016-02-26 18:43:47 +11:00
commit 9db2c9c12a
39 changed files with 370 additions and 353 deletions

View File

@ -64,16 +64,16 @@ before_script:
script:
- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php
#- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php
#- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php
- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php
#- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env
#- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php

View File

@ -107,7 +107,6 @@ module.exports = function(grunt) {
//'public/vendor/pdfmake/build/pdfmake.min.js',
//'public/vendor/pdfmake/build/vfs_fonts.js',
//'public/js/vfs_fonts.js',
'public/js/lightbox.min.js',
'public/js/bootstrap-combobox.js',
'public/js/script.js',
'public/js/pdf.pdfmake.js',
@ -140,7 +139,6 @@ module.exports = function(grunt) {
'public/vendor/spectrum/spectrum.css',
'public/css/bootstrap-combobox.css',
'public/css/typeahead.js-bootstrap.css',
'public/css/lightbox.css',
//'public/vendor/handsontable/dist/jquery.handsontable.full.css',
'public/css/style.css',
],

View File

@ -15,6 +15,7 @@ use Response;
use Request;
use App\Models\Affiliate;
use App\Models\License;
use App\Models\Invoice;
use App\Models\User;
use App\Models\Account;
use App\Models\Gateway;
@ -393,6 +394,21 @@ class AccountController extends BaseController
if ($section == ACCOUNT_CUSTOMIZE_DESIGN) {
$data['customDesign'] = ($account->custom_design && !$design) ? $account->custom_design : $design;
// sample invoice to help determine variables
$invoice = Invoice::scope()
->with('client', 'account')
->where('is_quote', '=', false)
->where('is_recurring', '=', false)
->first();
if ($invoice) {
$invoice->hidePrivateFields();
unset($invoice->account);
unset($invoice->invoice_items);
unset($invoice->client->contacts);
$data['sampleInvoice'] = $invoice;
}
}
return View::make("accounts.{$section}", $data);

View File

@ -288,7 +288,7 @@ class AppController extends BaseController
}
if (Utils::getResllerType() == RESELLER_REVENUE_SHARE) {
$payments = DB::table('accounts')
$data = DB::table('accounts')
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
->where('accounts.account_key', '=', NINJA_ACCOUNT_KEY)
@ -300,15 +300,9 @@ class AppController extends BaseController
'payments.amount'
]);
} else {
$payments = DB::table('accounts')
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
->where('accounts.account_key', '=', NINJA_ACCOUNT_KEY)
->where('payments.is_deleted', '=', false)
->groupBy('clients.id')
->count();
$data = DB::table('users')->count();
}
return json_encode($payments);
return json_encode($data);
}
}

View File

@ -109,8 +109,7 @@ class ExportController extends BaseController
if ($request->input(ENTITY_CLIENT)) {
$data['clients'] = Client::scope()
->with('user', 'contacts', 'country')
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->get();
$data['contacts'] = Contact::scope()
@ -126,33 +125,36 @@ class ExportController extends BaseController
if ($request->input(ENTITY_TASK)) {
$data['tasks'] = Task::scope()
->with('user', 'client.contacts')
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->get();
}
if ($request->input(ENTITY_INVOICE)) {
$data['invoices'] = Invoice::scope()
->with('user', 'client.contacts', 'invoice_status')
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->where('is_quote', '=', false)
->where('is_recurring', '=', false)
->get();
$data['quotes'] = Invoice::scope()
->with('user', 'client.contacts', 'invoice_status')
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->where('is_quote', '=', true)
->where('is_recurring', '=', false)
->get();
$data['recurringInvoices'] = Invoice::scope()
->with('user', 'client.contacts', 'invoice_status', 'frequency')
->withArchived()
->where('is_quote', '=', false)
->where('is_recurring', '=', true)
->get();
}
if ($request->input(ENTITY_PAYMENT)) {
$data['payments'] = Payment::scope()
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->with('user', 'client.contacts', 'payment_type', 'invoice', 'account_gateway.gateway')
->get();
}
@ -161,14 +163,14 @@ class ExportController extends BaseController
if ($request->input(ENTITY_VENDOR)) {
$data['clients'] = Vendor::scope()
->with('user', 'vendorcontacts', 'country')
->withTrashed()
->where('is_deleted', '=', false)
->withArchived()
->get();
$data['vendor_contacts'] = VendorContact::scope()
->with('user', 'vendor.contacts')
->withTrashed()
->get();
/*
$data['expenses'] = Credit::scope()
->with('user', 'client.contacts')

View File

@ -292,7 +292,7 @@ class ReportController extends BaseController
foreach ($taxes as $tax) {
$displayData[] = [
$tax['name'],
$tax['rate'],
$tax['rate'] . '%',
$account->formatMoney($tax['amount'], $client),
$account->formatMoney($tax['paid'], $client)
];
@ -372,6 +372,8 @@ class ReportController extends BaseController
$query->where('invoice_date', '>=', $startDate)
->where('invoice_date', '<=', $endDate)
->where('is_deleted', '=', false)
->where('is_quote', '=', false)
->where('is_recurring', '=', false)
->with(['payments' => function($query) {
$query->withTrashed()
->with('payment_type', 'account_gateway.gateway')
@ -419,6 +421,8 @@ class ReportController extends BaseController
->with(['invoices' => function($query) use ($startDate, $endDate) {
$query->where('invoice_date', '>=', $startDate)
->where('invoice_date', '<=', $endDate)
->where('is_quote', '=', false)
->where('is_recurring', '=', false)
->withArchived();
}]);

View File

@ -528,6 +528,8 @@ if (!defined('CONTACT_EMAIL')) {
define('EMAIL_MARKUP_URL', 'https://developers.google.com/gmail/markup');
define('OFX_HOME_URL', 'http://www.ofxhome.com/index.php/home/directory/all');
define('BLANK_IMAGE', 'data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=');
define('COUNT_FREE_DESIGNS', 4);
define('COUNT_FREE_DESIGNS_SELF_HOST', 5); // include the custom design
define('PRODUCT_ONE_CLICK_INSTALL', 1);

View File

@ -439,7 +439,7 @@ class Account extends Eloquent
return $height;
}
public function createInvoice($entityType, $clientId = null)
public function createInvoice($entityType = ENTITY_INVOICE, $clientId = null)
{
$invoice = Invoice::createNew();

View File

@ -200,6 +200,11 @@ class Invoice extends EntityModel implements BalanceAffecting
return $this->hasMany('App\Models\Invoice', 'recurring_invoice_id');
}
public function frequency()
{
return $this->belongsTo('App\Models\Frequency');
}
public function invitations()
{
return $this->hasMany('App\Models\Invitation')->orderBy('invitations.contact_id');

View File

@ -1,5 +1,6 @@
<?php namespace App\Ninja\Presenters;
use URL;
use Utils;
use Laracasts\Presenter\Presenter;
@ -28,6 +29,11 @@ class ClientPresenter extends Presenter {
return "<span class=\"label label-{$class}\">{$text}</span>";
}
public function url()
{
return URL::to('/clients/' . $this->entity->public_id);
}
public function link()
{
return link_to('/clients/' . $this->entity->public_id, $this->entity->getDisplayName());

View File

@ -1,5 +1,6 @@
<?php namespace App\Ninja\Presenters;
use URL;
use Utils;
use Laracasts\Presenter\Presenter;
@ -40,9 +41,15 @@ class InvoicePresenter extends Presenter {
public function status()
{
$status = $this->entity->invoice_status ? $this->entity->invoice_status->name : 'draft';
$status = strtolower($status);
return trans("texts.status_{$status}");
if ($this->entity->is_deleted) {
return trans('texts.deleted');
} elseif ($this->entity->trashed()) {
return trans('texts.archived');
} else {
$status = $this->entity->invoice_status ? $this->entity->invoice_status->name : 'draft';
$status = strtolower($status);
return trans("texts.status_{$status}");
}
}
public function invoice_date()
@ -55,9 +62,24 @@ class InvoicePresenter extends Presenter {
return Utils::fromSqlDate($this->entity->due_date);
}
public function frequency()
{
return $this->entity->frequency ? $this->entity->frequency->name : '';
}
public function url()
{
return URL::to('/invoices/' . $this->entity->public_id);
}
public function link()
{
return link_to('/invoices/' . $this->entity->public_id, $this->entity->invoice_number);
}
public function email()
{
$client = $this->entity->client;
return count($client->contacts) ? $client->contacts[0]->email : '';
}
}

View File

@ -82,47 +82,42 @@ class AccountRepository
private function getAccountSearchData()
{
$clients = \DB::table('clients')
->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id)
->whereRaw("clients.name <> ''")
->select(\DB::raw("'clients' as type, '" . trans('texts.clients') . "' as trans_type, clients.public_id, clients.name, '' as token"));
$data = [
trans('texts.clients') => [],
trans('texts.contacts') => [],
trans('texts.invoices') => [],
trans('texts.quotes') => [],
];
$contacts = \DB::table('clients')
->join('contacts', 'contacts.client_id', '=', 'clients.id')
->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id)
->whereRaw("CONCAT(contacts.first_name, contacts.last_name, contacts.email) <> ''")
->select(\DB::raw("'clients' as type, '" . trans('texts.contacts') . "' as trans_type, clients.public_id, CONCAT(contacts.first_name, ' ', contacts.last_name, ' ', contacts.email) as name, '' as token"));
$clients = Client::scope()
->with('contacts', 'invoices')
->get();
$invoices = \DB::table('clients')
->join('invoices', 'invoices.client_id', '=', 'clients.id')
->where('clients.account_id', '=', \Auth::user()->account_id)
->where('clients.deleted_at', '=', null)
->where('invoices.deleted_at', '=', null)
->select(\DB::raw("'invoices' as type, '" . trans('texts.invoices') . "' as trans_type, invoices.public_id, CONCAT(invoices.invoice_number, ': ', clients.name) as name, invoices.invoice_number as token"));
$data = [];
foreach ($clients->union($contacts)->union($invoices)->get() as $row) {
$type = $row->trans_type;
if (!isset($data[$type])) {
$data[$type] = [];
foreach ($clients as $client) {
if ($client->name) {
$data[trans('texts.clients')][] = [
'value' => $client->name,
'tokens' => explode(' ', $client->name),
'url' => $client->present()->url,
];
}
$tokens = explode(' ', $row->name);
$tokens[] = $type;
if ($type == 'Invoices') {
$tokens[] = intVal($row->token).'';
foreach ($client->contacts as $contact) {
$data[trans('texts.contacts')][] = [
'value' => $contact->getDisplayName(),
'tokens' => explode(' ', $contact->getFullName() . ' ' . $contact->email),
'url' => $client->present()->url,
];
}
$data[$type][] = [
'value' => $row->name,
'tokens' => $tokens,
'url' => URL::to("/{$row->type}/{$row->public_id}"),
];
foreach ($client->invoices as $invoice) {
$entityType = $invoice->getEntityType();
$data[trans("texts.{$entityType}s")][] = [
'value' => $invoice->getDisplayName() . ': ' . $client->getDisplayName(),
'tokens' => explode(' ', $invoice->invoice_number . ' ' . intval($invoice->invoice_number) . ' ' . $client->getDisplayName()),
'url' => $invoice->present()->url,
];
}
}
return $data;

File diff suppressed because one or more lines are too long

211
public/css/built.css vendored
View File

@ -2138,217 +2138,6 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
border-radius: 6px;
line-height: 1.33;
}
/* Preload images */
body:after {
content: url(../images/lightbox/close.png) url(../images/lightbox/loading.gif) url(../images/lightbox/prev.png) url(../images/lightbox/next.png);
display: none;
}
.lightboxOverlay {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
background-color: black;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
opacity: 0.8;
display: none;
}
.lightbox {
position: absolute;
left: 0;
width: 100%;
z-index: 10000;
text-align: center;
line-height: 0;
font-weight: normal;
}
.lightbox .lb-image {
display: block;
height: auto;
max-width: inherit;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
}
.lightbox a img {
border: none;
}
.lb-outerContainer {
position: relative;
background-color: white;
*zoom: 1;
width: 250px;
height: 250px;
margin: 0 auto;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
}
.lb-outerContainer:after {
content: "";
display: table;
clear: both;
}
.lb-container {
padding: 4px;
}
.lb-loader {
position: absolute;
top: 43%;
left: 0;
height: 25%;
width: 100%;
text-align: center;
line-height: 0;
}
.lb-cancel {
display: block;
width: 32px;
height: 32px;
margin: 0 auto;
background: url(../images/lightbox/loading.gif) no-repeat;
}
.lb-nav {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 10;
}
.lb-container > .nav {
left: 0;
}
.lb-nav a {
outline: none;
background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
}
.lb-prev, .lb-next {
height: 100%;
cursor: pointer;
display: block;
}
.lb-nav a.lb-prev {
width: 34%;
left: 0;
float: left;
background: url(../images/lightbox/prev.png) left 48% no-repeat;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-webkit-transition: opacity 0.6s;
-moz-transition: opacity 0.6s;
-o-transition: opacity 0.6s;
transition: opacity 0.6s;
}
.lb-nav a.lb-prev:hover {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}
.lb-nav a.lb-next {
width: 64%;
right: 0;
float: right;
background: url(../images/lightbox/next.png) right 48% no-repeat;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-webkit-transition: opacity 0.6s;
-moz-transition: opacity 0.6s;
-o-transition: opacity 0.6s;
transition: opacity 0.6s;
}
.lb-nav a.lb-next:hover {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}
.lb-dataContainer {
margin: 0 auto;
padding-top: 5px;
*zoom: 1;
width: 100%;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.lb-dataContainer:after {
content: "";
display: table;
clear: both;
}
.lb-data {
padding: 0 4px;
color: #ccc;
}
.lb-data .lb-details {
width: 85%;
float: left;
text-align: left;
line-height: 1.1em;
}
.lb-data .lb-caption {
font-size: 13px;
font-weight: bold;
line-height: 1em;
}
.lb-data .lb-number {
display: block;
clear: left;
padding-bottom: 1em;
font-size: 12px;
color: #999999;
}
.lb-data .lb-close {
display: block;
float: right;
width: 30px;
height: 30px;
background: url(../images/lightbox/close.png) top right no-repeat;
text-align: right;
outline: none;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
opacity: 0.7;
-webkit-transition: opacity 0.2s;
-moz-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
transition: opacity 0.2s;
}
.lb-data .lb-close:hover {
cursor: pointer;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}
body { background: #f8f8f8 !important;
font-family: 'Roboto', sans-serif;
font-size: 15px;

View File

@ -209,18 +209,28 @@ NINJA.decodeJavascript = function(invoice, javascript)
}
// search/replace values
var regExp = new RegExp('"\\$[\\\w\\\.]*?Value"', 'g');
var regExp = new RegExp('"\\$[a-z][\\\w\\\.]*?[Value]?"', 'g');
var matches = javascript.match(regExp);
if (matches) {
for (var i=0; i<matches.length; i++) {
var match = matches[i];
field = match.substring(2, match.indexOf('Value'));
// reserved words
if (['"$none"', '"$firstAndLast"', '"$notFirstAndLastColumn"', '"$notFirst"', '"$amount"', '"$primaryColor"', '"$secondaryColor"'].indexOf(match) >= 0) {
continue;
}
// legacy style had 'Value' at the end
if (endsWith(match, 'Value"')) {
field = match.substring(2, match.indexOf('Value'));
} else {
field = match.substring(2, match.length - 1);
}
field = toSnakeCase(field);
var value = getDescendantProp(invoice, field) || ' ';
value = doubleDollarSign(value);
javascript = javascript.replace(match, '"'+value+'"');
}
}

View File

@ -961,6 +961,11 @@ function truncate(str, length) {
return (str && str.length > length) ? (str.substr(0, length-1) + '...') : str;
}
// http://stackoverflow.com/questions/280634/endswith-in-javascript
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
// http://codeaid.net/javascript/convert-seconds-to-hours-minutes-and-seconds-%28javascript%29
function secondsToTime(secs)
{
@ -993,6 +998,11 @@ function toSnakeCase(str) {
return str.replace(/([A-Z])/g, function($1){return "_"+$1.toLowerCase();});
}
// https://coderwall.com/p/iprsng/convert-snake-case-to-camelcase
function snakeToCamel(s){
return s.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
function getDescendantProp(obj, desc) {
var arr = desc.split(".");
while(arr.length && (obj = obj[arr.shift()]));
@ -1001,6 +1011,7 @@ function getDescendantProp(obj, desc) {
function doubleDollarSign(str) {
if (!str) return '';
if (!str.replace) return str;
return str.replace(/\$/g, '\$\$\$');
}
@ -1025,3 +1036,35 @@ function actionListHandler() {
}
});
}
function loadImages(selector) {
$(selector + ' img').each(function(index, item) {
var src = $(item).attr('data-src');
$(item).attr('src', src);
$(item).attr('data-src', src);
});
}
// http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript
function prettyJson(json) {
if (typeof json != 'string') {
json = JSON.stringify(json, undefined, 2);
}
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
}
match = snakeToCamel(match);
return '<span class="' + cls + '">' + match + '</span>';
});
}

View File

@ -747,8 +747,7 @@ return array(
'primary_user' => 'Primær bruger',
'help' => 'Hjælp',
'customize_help' => '<p>Vi bruger <a href="http://pdfmake.org/" target="_blank">pdfmake</a> til at definere faktura design felter. pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">legeplads</a> giver en god mulighed for at se biblioteket i aktion.</p>
<p>Du kan tilgå alle faktura felter ved at tilføje <code>Value</code> til slutningen. For eksempel viser <code>$invoiceNumberValue</code> fakturanummeret.</p>
<p>For at tilgå under indstillingerne ved hjælp af dot notation. For eksempel kan man for at vise klient navnet bruge <code>$client.nameValue</code>.</p>
<p>For at tilgå under indstillingerne ved hjælp af dot notation. For eksempel kan man for at vise klient navnet bruge <code>$client.name</code>.</p>
<p>Hvis du mangler svar nogen spørgsmål post et spørgsmål i vores <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Due Date',

View File

@ -747,8 +747,7 @@ return array(
'primary_user' => 'Primärer Benutzer',
'help' => 'Hilfe',
'customize_help' => '<p>Wir benutzen zur deklarativen Definition der Rechnungsdesigns <a href="http://pdfmake.org/" target="_blank">pdfmake</a>. Der pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> bietet Gelegenheit die Bibliothek in Aktion zu sehen.</p>
<p>Man kann jedes Rechnungsfeld nutzen, in dem man <code>Value</code> hinten anhängt. Zum Beispiel zeigt <code>$invoiceNumberValue</code> die Rechnungsnummer.</p>
<p>Mit der <i>dot notation</i> kann auf Kind-Eigenschaften zugegriffen werden. Für den Kundennamen kann man zum Beispiel <code>$client.nameValue</code> benutzen.</p>
<p>Mit der <i>dot notation</i> kann auf Kind-Eigenschaften zugegriffen werden. Für den Kundennamen kann man zum Beispiel <code>$client.name</code> benutzen.</p>
<p>Wenn du Hilfe brauchst schreibe uns gern im <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">Support Forum</a> (Englisch).</p>',
'invoice_due_date' => 'Fällig am',

View File

@ -81,7 +81,7 @@ $LANG = array(
'company_details' => 'Company Details',
'online_payments' => 'Online Payments',
'notifications' => 'Email Notifications',
'import_export' => 'Import/Export/Cancel',
'import_export' => 'Import | Export | Cancel',
'done' => 'Done',
'save' => 'Save',
'create' => 'Create',
@ -655,8 +655,7 @@ $LANG = array(
'primary_user' => 'Primary User',
'help' => 'Help',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Due Date',
'quote_due_date' => 'Valid Until',

View File

@ -725,8 +725,7 @@ return array(
'primary_user' => 'Usuario Primario',
'help' => 'Ayuda',
'customize_help' => '<p>Nosotros usamos <a href="http://pdfmake.org/" target="_blank">pdfmake</a> para definir los diseños de las facturas de manera declarativa. El <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> de pdfmake es una excelente manera de ver a la librería en acción.</p>
<p>Puedes acceder cualquier campo de una factura agregando <code>Value</code> al final. Por ejemplo, <code>$invoiceNumberValue</code> muestra el número de factura.</p>
<p>Para acceder a una propiedad hija usando notación de punto.Por ejemplo, para mostrar el nombre de un cliente se puede usar <code>$client.nameValue</code>.</p>
<p>Para acceder a una propiedad hija usando notación de punto.Por ejemplo, para mostrar el nombre de un cliente se puede usar <code>$client.name</code>.</p>
<p>Si necesitas ayuda entendiendo algo puede preguntar en nuestro <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">foro de soporte</a>.</p>',
'invoice_due_date' => 'Fecha de Vencimiento',

View File

@ -746,8 +746,7 @@ return array(
'primary_user' => 'Usuario Principal',
'help' => 'Ayuda',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Fecha de Pago',

View File

@ -738,8 +738,7 @@ return array(
'primary_user' => 'Utilisateur principal',
'help' => 'Aide',
'customize_help' => '<p>Nous utilisons <a href="http://pdfmake.org/" target="_blank">pdfmake</a> pour définir le design des factures. Le <a href="http://pdfmake.org/playground.html" target="_blank">bac à sable<a> de pdfmake est une bonne façon de voir cette bibliothèque en action.</p>
<p>Vous pouvez accéder à n\'importe quel champ de facture en ajoutant <code>Value</code> à la fin. Par exemple <code>$invoiceNumberValue</code> affiche le numéro de facture.</p>
<p>Pour accéder à une propriété héritée avec la notation par point. Par exemple pour montrer le nom du client vous pouvez utiliser <code>$client.nameValue</code>.</p>
<p>Pour accéder à une propriété héritée avec la notation par point. Par exemple pour montrer le nom du client vous pouvez utiliser <code>$client.name</code>.</p>
<p>Si vous avez besoin d\'aide pour comprendre quelque chose envoyez une question à notre <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">forum de support</a>.</p>',
'invoice_due_date' => 'Date limite',

View File

@ -741,8 +741,7 @@ return array(
'primary_user' => 'Utilisateur principal',
'help' => 'Aide',
'customize_help' => '<p>Nous utilisons <a href="http://pdfmake.org/" target="_blank">pdfmake</a> pour définir le design des factures de façon déclarative. L\'<a href="http://pdfmake.org/playground.html" target="_blank">environnement</a> pdfmake permet de voir la librairie en action.</p>
<p>Vous pouvez accéder à n\'importe quel champ de facture en ajoutant <code>Value</code> à la fin. Par exemple <code>$invoiceNumberValue</code> affiche le numéro de facture.</p>
<p>Pour accéder à une propriété enfant en utilisant la notation par point. Par exemple <code>$client.nameValue</code>affiche le nom du client.</p>
<p>Pour accéder à une propriété enfant en utilisant la notation par point. Par exemple <code>$client.name</code>affiche le nom du client.</p>
<p>Si vous avez besoin d\'aide à cet effet, n\'hésitez pas à publier une question sur notre <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">forum d\'aide (en anglais)</a>.</p>',
'invoice_due_date' => 'Échéance',

View File

@ -743,8 +743,7 @@ return array(
'primary_user' => 'Primary User',
'help' => 'Help',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Due Date',

View File

@ -750,8 +750,7 @@ return array(
'primary_user' => 'Primary User',
'help' => 'Help',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Due Date',

View File

@ -746,8 +746,7 @@ return array(
'primary_user' => 'Hovedbruker',
'help' => 'Hjelp',
'customize_help' => '<p>Vi bruker <a href="http://pdfmake.org/" target="_blank">pdfmake</a> for å definere faktura designene deklarativt. Pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> gir en flott måte å se biblioteket i aksjon.</p>
<p>Du kan tilgang til hvilket som helst faktura felt ved å legge til <code>Value</code> i slutten. For eksempel <code>$invoiceNumberValue</code> viser faktura nummeret.</p>
<p>For å tilgang til et underelementet ved bruk av prikk notasjon. For eksempel for å vise klientens navn, kan du bruke <code>$client.nameValue</code>.</p>
<p>For å tilgang til et underelementet ved bruk av prikk notasjon. For eksempel for å vise klientens navn, kan du bruke <code>$client.name</code>.</p>
<p>Om du trenger hjelp til å finne ut noe, poster et spørsmål til vårt <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">brukerforum</a>.</p>',
'invoice_due_date' => 'Tidsfrist',

View File

@ -741,8 +741,7 @@ return array(
'primary_user' => 'Primaire gebruiker',
'help' => 'Help',
'customize_help' => '<p>We gebruiken <a href="http://pdfmake.org/" target="_blank">pdfmake</a> om de factuur ontwerpen declaratief te definieren. De pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> is een interessante manier om de library in actie te zien.</p>
<p>Je kan elk factuur veld gebruiken door <code>Veld</code> toe te voegen op het einde. Bijvoorbeeld <code>$invoiceNumberValue</code> toont de factuur nummer.</p>
<p>Gebruik dot notatie om een "kind eigenschap" te gebruiken. Bijvoorbeeld voor de klant naam te tonen gebruik je <code>$client.nameValue</code>.</p>
<p>Gebruik dot notatie om een "kind eigenschap" te gebruiken. Bijvoorbeeld voor de klant naam te tonen gebruik je <code>$client.name</code>.</p>
<p>Als je ergens hulp bij nodig hebt, post dan een vraag op ons <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Vervaldatum',

View File

@ -739,8 +739,7 @@ return array(
'primary_user' => 'Usuário Principal',
'help' => 'Ajuda',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Data de vencimento',

View File

@ -745,8 +745,7 @@ return array(
'primary_user' => 'Primary User',
'help' => 'Help',
'customize_help' => '<p>We use <a href="http://pdfmake.org/" target="_blank">pdfmake</a> to define the invoice designs declaratively. The pdfmake <a href="http://pdfmake.org/playground.html" target="_blank">playground</a> provide\'s a great way to see the library in action.</p>
<p>You can access any invoice field by adding <code>Value</code> to the end. For example <code>$invoiceNumberValue</code> displays the invoice number.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.nameValue</code>.</p>
<p>To access a child property using dot notation. For example to show the client name you could use <code>$client.name</code>.</p>
<p>If you need help figuring something out post a question to our <a href="https://www.invoiceninja.com/forums/forum/support/" target="_blank">support forum</a>.</p>',
'invoice_due_date' => 'Due Date',

View File

@ -22,6 +22,14 @@
background: #FFFFFF !important;
}
/* http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript */
pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
.string { color: green; }
.number { color: red; }
.boolean { color: blue; }
.null { color: gray; }
.key { color: black; }
</style>
@stop
@ -140,8 +148,14 @@
target = target.substring(1); // strip leading #
loadEditor(target);
});
refreshPDF(true);
@if (isset($sampleInvoice) && $sampleInvoice)
var sample = {!! $sampleInvoice->toJSON() !!}
console.log(sample);
$('#sampleData').show().html(prettyJson(sample));
@endif
});
</script>
@ -206,6 +220,8 @@
<div class="panel-body" style="background-color: #fff">
{!! trans('texts.customize_help') !!}
<pre id="sampleData" style="display:none;height:200px;padding-top:16px;"></pre>
</div>
<div class="modal-footer" style="margin-top: 0px">

View File

@ -7,7 +7,9 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/lightbox.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/lightbox.css') }}" rel="stylesheet" type="text/css"/>
@stop

View File

@ -35,6 +35,11 @@
@include('export.invoices', ['entityType' => ENTITY_QUOTE])
@endif
@if (isset($recurringInvoices) && $recurringInvoices && count($recurringInvoices))
<tr><td>{{ strtoupper(trans('texts.recurring_invoices')) }}</td></tr>
@include('export.recurring_invoices', ['entityType' => ENTITY_RECURRING_INVOICE])
@endif
@if (isset($payments) && $payments && count($payments))
<tr><td>{{ strtoupper(trans('texts.payments')) }}</td></tr>
@include('export.payments')

View File

@ -1,5 +1,6 @@
<tr>
<td>{{ trans('texts.client') }}</td>
<td>{{ trans('texts.email') }}</td>
@if ($multiUser)
<td>{{ trans('texts.user') }}</td>
@endif
@ -28,6 +29,7 @@
@if (!$invoice->client->is_deleted)
<tr>
<td>{{ $invoice->present()->client }}</td>
<td>{{ $invoice->present()->email }}</td>
@if ($multiUser)
<td>{{ $invoice->present()->user }}</td>
@endif

View File

@ -0,0 +1,55 @@
<tr>
<td>{{ trans('texts.client') }}</td>
<td>{{ trans('texts.email') }}</td>
@if ($multiUser)
<td>{{ trans('texts.user') }}</td>
@endif
<td>{{ trans('texts.frequency') }}</td>
<td>{{ trans('texts.balance') }}</td>
<td>{{ trans('texts.amount') }}</td>
<td>{{ trans('texts.po_number') }}</td>
<td>{{ trans('texts.status') }}</td>
@if ($account->custom_invoice_label1)
<td>{{ $account->custom_invoice_label1 }}</td>
@endif
@if ($account->custom_invoice_label2)
<td>{{ $account->custom_invoice_label2 }}</td>
@endif
@if ($account->custom_invoice_text_label1)
<td>{{ $account->custom_invoice_text_label1 }}</td>
@endif
@if ($account->custom_invoice_text_label2)
<td>{{ $account->custom_invoice_text_label2 }}</td>
@endif
</tr>
@foreach ($recurringInvoices as $invoice)
@if (!$invoice->client->is_deleted)
<tr>
<td>{{ $invoice->present()->client }}</td>
<td>{{ $invoice->present()->email }}</td>
@if ($multiUser)
<td>{{ $invoice->present()->user }}</td>
@endif
<td>{{ $invoice->present()->frequency }}</td>
<td>{{ $account->formatMoney($invoice->balance, $invoice->client) }}</td>
<td>{{ $account->formatMoney($invoice->amount, $invoice->client) }}</td>
<td>{{ $invoice->po_number }}</td>
<td>{{ $invoice->present()->status }}</td>
@if ($account->custom_invoice_label1)
<td>{{ $invoice->custom_value1 }}</td>
@endif
@if ($account->custom_invoice_label2)
<td>{{ $invoice->custom_value2 }}</td>
@endif
@if ($account->custom_invoice_label1)
<td>{{ $invoice->custom_text_value1 }}</td>
@endif
@if ($account->custom_invoice_label2)
<td>{{ $invoice->custom_text_value2 }}</td>
@endif
</tr>
@endif
@endforeach
<tr><td></td></tr>

View File

@ -736,7 +736,7 @@
@if (Auth::user()->account->isWhiteLabel())
{{ trans('texts.white_labeled') }}
@else
<a href="#" onclick="$('#whiteLabelModal').modal('show');">{{ trans('texts.white_label_link') }}</a>
<a href="#" onclick="loadImages('#whiteLabelModal');$('#whiteLabelModal').modal('show');">{{ trans('texts.white_label_link') }}</a>
<div class="modal fade" id="whiteLabelModal" tabindex="-1" role="dialog" aria-labelledby="whiteLabelModalLabel" aria-hidden="true">
<div class="modal-dialog">
@ -751,11 +751,11 @@
<div class="row">
<div class="col-md-6">
<h4>{{ trans('texts.before') }}</h4>
{!! HTML::image('images/pro_plan/white_label_before.png', 'before', ['width' => '100%']) !!}
<img src="{{ BLANK_IMAGE }}" data-src="http://ninja.dev/images/pro_plan/white_label_before.png" width="100%" alt="before">
</div>
<div class="col-md-6">
<h4>{{ trans('texts.after') }}</h4>
{!! HTML::image('images/pro_plan/white_label_after.png', 'after', ['width' => '100%']) !!}
<img src="{{ BLANK_IMAGE }}" data-src="http://ninja.dev/images/pro_plan/white_label_after.png" width="100%" alt="after">
</div>
</div>
</div>

View File

@ -4,17 +4,19 @@
@parent
@include('money_script')
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/lightbox.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/lightbox.css') }}" rel="stylesheet" type="text/css"/>
<style type="text/css">
/* the value is auto set so we're removing the bold formatting */
label.control-label[for=invoice_number] {
font-weight: normal !important;
}
/* the value is auto set so we're removing the bold formatting */
label.control-label[for=invoice_number] {
font-weight: normal !important;
}
</style>
@stop

View File

@ -22,13 +22,25 @@
<center id="designThumbs">
<p>&nbsp;</p>
<a href="{{ asset('/images/designs/business.png') }}" data-lightbox="more-designs" data-title="Business"><img src="{{ asset('/images/designs/business_thumb.png') }}"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/creative.png') }}" data-lightbox="more-designs" data-title="Creative"><img src="{{ asset('/images/designs/creative_thumb.png') }}"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/elegant.png') }}" data-lightbox="more-designs" data-title="Elegant"><img src="{{ asset('/images/designs/elegant_thumb.png') }}"/></a>
<a href="{{ asset('/images/designs/business.png') }}" data-lightbox="more-designs" data-title="Business">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/business_thumb.png') }}"/>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/creative.png') }}" data-lightbox="more-designs" data-title="Creative">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/creative_thumb.png') }}"/>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/elegant.png') }}" data-lightbox="more-designs" data-title="Elegant">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/elegant_thumb.png') }}"/>
</a>
<p>&nbsp;</p>
<a href="{{ asset('/images/designs/hipster.png') }}" data-lightbox="more-designs" data-title="Hipster"><img src="{{ asset('/images/designs/hipster_thumb.png') }}"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/playful.png') }}" data-lightbox="more-designs" data-title="Playful"><img src="{{ asset('/images/designs/playful_thumb.png') }}"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/photo.png') }}" data-lightbox="more-designs" data-title="Photo"><img src="{{ asset('/images/designs/photo_thumb.png') }}"/></a>
<a href="{{ asset('/images/designs/hipster.png') }}" data-lightbox="more-designs" data-title="Hipster">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/hipster_thumb.png') }}"/>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/playful.png') }}" data-lightbox="more-designs" data-title="Playful">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/playful_thumb.png') }}"/>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{{ asset('/images/designs/photo.png') }}" data-lightbox="more-designs" data-title="Photo">
<img src="{{ BLANK_IMAGE }}" data-src="{{ asset('/images/designs/photo_thumb.png') }}"/>
</a>
<p>&nbsp;</p>
</center>
@ -133,6 +145,7 @@
}
function showMoreDesigns() {
loadImages('#designThumbs');
trackEvent('/account', '/view_more_designs');
$('#moreDesignsModal').modal('show');
}

View File

@ -32,7 +32,7 @@
var NINJA = NINJA || {};
NINJA.fontSize = 9;
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
window.onerror = function (errorMsg, url, lineNumber, column, error) {
if (errorMsg.indexOf('Script error.') > -1) {
return;

View File

@ -87,13 +87,19 @@
</tr>
</thead>
<tbody>
@foreach ($displayData as $record)
@if (count($displayData))
@foreach ($displayData as $record)
<tr>
@foreach ($record as $field)
<td>{!! $field !!}</td>
@endforeach
</tr>
@endforeach
@else
<tr>
@foreach ($record as $field)
<td>{!! $field !!}</td>
@endforeach
<td colspan="10" style="text-align: center">{{ trans('texts.empty_table') }}</td>
</tr>
@endforeach
@endif
</tbody>
</table>