mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Improve invoice design help documentation
This commit is contained in:
parent
c2c2b1ef07
commit
b5fc9669df
@ -627,21 +627,6 @@ class AccountController extends BaseController
|
||||
} else {
|
||||
$data['customDesign'] = $design;
|
||||
}
|
||||
|
||||
// sample invoice to help determine variables
|
||||
$invoice = Invoice::scope()
|
||||
->invoiceType(INVOICE_TYPE_STANDARD)
|
||||
->with('client', 'account')
|
||||
->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);
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -347,14 +347,24 @@ NINJA.decodeJavascript = function(invoice, javascript)
|
||||
continue;
|
||||
}
|
||||
|
||||
field = match.replace('$invoice.', '$');
|
||||
|
||||
// legacy style had 'Value' at the end
|
||||
if (endsWith(match, 'Value"')) {
|
||||
field = match.substring(2, match.indexOf('Value'));
|
||||
if (endsWith(field, 'Value"')) {
|
||||
field = field.substring(2, field.indexOf('Value'));
|
||||
} else {
|
||||
field = match.substring(2, match.length - 1);
|
||||
field = field.substring(2, field.length - 1);
|
||||
}
|
||||
field = toSnakeCase(field);
|
||||
|
||||
if (field == 'footer') {
|
||||
field = 'invoice_footer';
|
||||
} else if (match == '$account.phone') {
|
||||
field = 'account.work_phone';
|
||||
} else if (match == '$client.phone') {
|
||||
field = 'client.phone';
|
||||
}
|
||||
|
||||
var value = getDescendantProp(invoice, field) || ' ';
|
||||
value = doubleDollarSign(value) + '';
|
||||
value = value.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
||||
|
@ -656,7 +656,6 @@ $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> provides a great way to see the library in action.</p>
|
||||
<p>You can 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> with the design you\'re using.</p>',
|
||||
'invoice_due_date' => 'Due Date',
|
||||
'quote_due_date' => 'Valid Until',
|
||||
|
@ -162,11 +162,6 @@
|
||||
});
|
||||
|
||||
refreshPDF(true);
|
||||
|
||||
@if (isset($sampleInvoice) && $sampleInvoice)
|
||||
var sample = {!! $sampleInvoice->toJSON() !!}
|
||||
$('#sampleData').show().html(prettyJson(sample));
|
||||
@endif
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -234,10 +229,8 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
{!! trans('texts.customize_help') !!}<br/>
|
||||
<pre id="sampleData" style="display:none;height:200px;padding-top:16px;"></pre>
|
||||
@if (empty($sampleInvoice))
|
||||
<div class="help-block">{{ trans('texts.create_invoice_for_sample') }}</div>
|
||||
@endif
|
||||
|
||||
@include('partials/variables_help', ['entityType' => ENTITY_INVOICE, 'account' => $account])
|
||||
|
||||
@if ($account->require_invoice_signature || $account->require_invoice_signature)
|
||||
<p> </p>
|
||||
|
85
resources/views/partials/variables_help.blade.php
Normal file
85
resources/views/partials/variables_help.blade.php
Normal file
@ -0,0 +1,85 @@
|
||||
<div class="col-md-6">
|
||||
<ul>
|
||||
@if ($entityType === ENTITY_QUOTE)
|
||||
<li>$quote.quoteNumber</li>
|
||||
<li>$quote.quoteDate</li>
|
||||
<li>$quote.validUntil</li>
|
||||
@elseif ($entityType === ENTITY_INVOICE)
|
||||
<li>$invoice.invoiceNumber</li>
|
||||
<li>$invoice.invoiceDate</li>
|
||||
<li>$invoice.dueDate</li>
|
||||
@endif
|
||||
<li>${{ $entityType }}.discount</li>
|
||||
<li>${{ $entityType }}.poNumber</li>
|
||||
<li>${{ $entityType }}.publicNotes</li>
|
||||
<li>${{ $entityType }}.amount</li>
|
||||
<li>${{ $entityType }}.terms</li>
|
||||
<li>${{ $entityType }}.footer</li>
|
||||
<li>${{ $entityType }}.partial</li>
|
||||
<li>${{ $entityType }}.partialDueDate</li>
|
||||
@if ($account->custom_invoice_label1)
|
||||
<li>${{ $entityType }}.customValue1</li>
|
||||
@endif
|
||||
@if ($account->custom_invoice_label2)
|
||||
<li>${{ $entityType }}.customValue2</li>
|
||||
@endif
|
||||
@if ($account->custom_invoice_text_label1)
|
||||
<li>${{ $entityType }}.customTextValue1</li>
|
||||
@endif
|
||||
@if ($account->custom_invoice_text_label2)
|
||||
<li>${{ $entityType }}.customTextValue2</li>
|
||||
@endif
|
||||
</ul>
|
||||
<ul>
|
||||
<li>$account.name</li>
|
||||
<li>$account.idNumber</li>
|
||||
<li>$account.vatNumber</li>
|
||||
<li>$account.address1</li>
|
||||
<li>$account.address2</li>
|
||||
<li>$account.city</li>
|
||||
<li>$account.state</li>
|
||||
<li>$account.postalCode</li>
|
||||
<li>$account.country.name</li>
|
||||
<li>$account.phone</li>
|
||||
@if ($account->custom_label1)
|
||||
<li>$account.customValue1</li>
|
||||
@endif
|
||||
@if ($account->custom_label2)
|
||||
<li>$account.customValue2</li>
|
||||
@endif
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ul>
|
||||
<li>$client.name</li>
|
||||
<li>$client.idNumber</li>
|
||||
<li>$client.vatNumber</li>
|
||||
<li>$client.address1</li>
|
||||
<li>$client.address2</li>
|
||||
<li>$client.city</li>
|
||||
<li>$client.state</li>
|
||||
<li>$client.postalCode</li>
|
||||
<li>$client.country.name</li>
|
||||
<li>$client.phone</li>
|
||||
<li>$client.balance</li>
|
||||
@if ($account->custom_client_label1)
|
||||
<li>$client.customValue1</li>
|
||||
@endif
|
||||
@if ($account->custom_client_label2)
|
||||
<li>$client.customValue2</li>
|
||||
@endif
|
||||
</ul>
|
||||
<ul>
|
||||
<li>$contact.firstName</li>
|
||||
<li>$contact.lastName</li>
|
||||
<li>$contact.email</li>
|
||||
<li>$contact.phone</li>
|
||||
@if ($account->custom_contact_label1)
|
||||
<li>$contact.customValue1</li>
|
||||
@endif
|
||||
@if ($account->custom_contact_label2)
|
||||
<li>$contact.customValue2</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
@ -21,64 +21,7 @@ function showProposalHelp() {
|
||||
<div class="container" style="width: 100%; padding-bottom: 0px !important">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="col-md-6">
|
||||
<ul>
|
||||
<li>$quote.quoteNumber</li>
|
||||
<li>$quote.discount</li>
|
||||
<li>$quote.poNumber</li>
|
||||
<li>$quote.quoteDate</li>
|
||||
<li>$quote.validUntil</li>
|
||||
<li>$quote.publicNotes</li>
|
||||
<li>$quote.amount</li>
|
||||
<li>$quote.terms</li>
|
||||
<li>$quote.footer</li>
|
||||
<li>$quote.partial</li>
|
||||
<li>$quote.partialDueDate</li>
|
||||
<li>$quote.customValue1</li>
|
||||
<li>$quote.customValue2</li>
|
||||
<li>$quote.customTextValue1</li>
|
||||
<li>$quote.customTextValue2</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>$contact.firstName</li>
|
||||
<li>$contact.lastName</li>
|
||||
<li>$contact.email</li>
|
||||
<li>$contact.phone</li>
|
||||
<li>$contact.customValue1</li>
|
||||
<li>$contact.customValue2</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ul>
|
||||
<li>$client.name</li>
|
||||
<li>$client.idNumber</li>
|
||||
<li>$client.vatNumber</li>
|
||||
<li>$client.address1</li>
|
||||
<li>$client.address2</li>
|
||||
<li>$client.city</li>
|
||||
<li>$client.state</li>
|
||||
<li>$client.postalCode</li>
|
||||
<li>$client.country.name</li>
|
||||
<li>$client.phone</li>
|
||||
<li>$client.balance</li>
|
||||
<li>$client.customValue1</li>
|
||||
<li>$client.customValue2</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>$account.name</li>
|
||||
<li>$account.idNumber</li>
|
||||
<li>$account.vatNumber</li>
|
||||
<li>$account.address1</li>
|
||||
<li>$account.address2</li>
|
||||
<li>$account.city</li>
|
||||
<li>$account.state</li>
|
||||
<li>$account.postalCode</li>
|
||||
<li>$account.country.name</li>
|
||||
<li>$account.phone</li>
|
||||
</ul>
|
||||
</div>
|
||||
@include('partials/variables_help', ['entityType' => ENTITY_QUOTE, 'account' => auth()->user()->account])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user