mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on pdfmake
This commit is contained in:
parent
6d651a250c
commit
8018bcad6c
@ -58,7 +58,7 @@ module.exports = function(grunt) {
|
|||||||
'public/vendor/jspdf/dist/jspdf.min.js',
|
'public/vendor/jspdf/dist/jspdf.min.js',
|
||||||
//'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
|
//'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
|
||||||
'public/vendor/pdfmake/build/pdfmake.min.js',
|
'public/vendor/pdfmake/build/pdfmake.min.js',
|
||||||
'public/vendor/pdfmake/build/vfs_fonts.js',
|
//'public/vendor/pdfmake/build/vfs_fonts.js',
|
||||||
//'public/js/vfs_fonts.js',
|
//'public/js/vfs_fonts.js',
|
||||||
'public/js/lightbox.min.js',
|
'public/js/lightbox.min.js',
|
||||||
'public/js/bootstrap-combobox.js',
|
'public/js/bootstrap-combobox.js',
|
||||||
|
@ -292,6 +292,7 @@ class AccountController extends BaseController
|
|||||||
$account->share_counter = Input::get('share_counter') ? true : false;
|
$account->share_counter = Input::get('share_counter') ? true : false;
|
||||||
|
|
||||||
$account->pdf_email_attachment = Input::get('pdf_email_attachment') ? true : false;
|
$account->pdf_email_attachment = Input::get('pdf_email_attachment') ? true : false;
|
||||||
|
$account->utf8_invoices = Input::get('utf8_invoices') ? true : false;
|
||||||
|
|
||||||
if (!$account->share_counter) {
|
if (!$account->share_counter) {
|
||||||
$account->quote_number_counter = Input::get('quote_number_counter');
|
$account->quote_number_counter = Input::get('quote_number_counter');
|
||||||
|
@ -11,12 +11,10 @@ class InvoiceDesign extends Eloquent
|
|||||||
{
|
{
|
||||||
$designs = $query->where('id', '<=', \Auth::user()->maxInvoiceDesignId())->orderBy('id')->get();
|
$designs = $query->where('id', '<=', \Auth::user()->maxInvoiceDesignId())->orderBy('id')->get();
|
||||||
|
|
||||||
foreach ($designs as $design) {
|
foreach ($designs as $design) {
|
||||||
if ($design->filename) {
|
$fileName = public_path(strtolower("js/templates/{$design->name}.js"));
|
||||||
$fileName = public_path(strtolower("js/templates/{$design->name}.js"));
|
if (Auth::user()->account->utf8_invoices && file_exists($fileName)) {
|
||||||
if (Auth::user()->account->utf8_invoices && file_exists($fileName)) {
|
$design->javascript = file_get_contents($fileName);
|
||||||
$design->javascript = file_get_contents($fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,15 @@
|
|||||||
function GetPdfMake(invoice, javascript, callback) {
|
function GetPdfMake(invoice, javascript, callback) {
|
||||||
var account = invoice.account;
|
var account = invoice.account;
|
||||||
eval(javascript);
|
eval(javascript);
|
||||||
|
var fonts = {
|
||||||
|
Roboto: {
|
||||||
|
normal: 'Roboto-Regular.ttf',
|
||||||
|
bold: 'Roboto-Medium.ttf',
|
||||||
|
italics: 'Roboto-Italic.ttf',
|
||||||
|
bolditalics: 'Roboto-Italic.ttf'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
doc = pdfMake.createPdf(dd);
|
doc = pdfMake.createPdf(dd);
|
||||||
doc.save = function(fileName) {
|
doc.save = function(fileName) {
|
||||||
this.download(fileName);
|
this.download(fileName);
|
||||||
|
@ -116,7 +116,7 @@ var dd = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultStyle: {
|
defaultStyle: {
|
||||||
//font: 'sans'
|
//font: 'Roboto',
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
margin: [8, 4, 8, 4]
|
margin: [8, 4, 8, 4]
|
||||||
},
|
},
|
||||||
|
File diff suppressed because one or more lines are too long
@ -596,5 +596,8 @@ return array(
|
|||||||
'more_fields' => 'More Fields',
|
'more_fields' => 'More Fields',
|
||||||
'less_fields' => 'Less Fields',
|
'less_fields' => 'Less Fields',
|
||||||
'client_name' => 'Client Name',
|
'client_name' => 'Client Name',
|
||||||
|
'pdf_settings' => 'PDFF Settings',
|
||||||
|
'utf8_invoices' => 'UTF-8 Support <sup>Beta</sup>',
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
@parent
|
@parent
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
div.checkbox {
|
.input-group-addon div.checkbox {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
span.input-group-addon {
|
span.input-group-addon {
|
||||||
@ -18,10 +18,12 @@
|
|||||||
@include('accounts.nav_advanced')
|
@include('accounts.nav_advanced')
|
||||||
|
|
||||||
{!! Former::open()->addClass('warn-on-exit') !!}
|
{!! Former::open()->addClass('warn-on-exit') !!}
|
||||||
{!! Former::populate($account) !!}
|
{{ Former::populate($account) }}
|
||||||
{!! Former::populateField('custom_invoice_taxes1', intval($account->custom_invoice_taxes1)) !!}
|
{{ Former::populateField('custom_invoice_taxes1', intval($account->custom_invoice_taxes1)) }}
|
||||||
{!! Former::populateField('custom_invoice_taxes2', intval($account->custom_invoice_taxes2)) !!}
|
{{ Former::populateField('custom_invoice_taxes2', intval($account->custom_invoice_taxes2)) }}
|
||||||
{!! Former::populateField('share_counter', intval($account->share_counter)) !!}
|
{{ Former::populateField('share_counter', intval($account->share_counter)) }}
|
||||||
|
{{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }}
|
||||||
|
{{ Former::populateField('utf8_invoices', intval($account->utf8_invoices)) }}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@ -94,7 +96,8 @@
|
|||||||
<h3 class="panel-title">{!! trans('texts.email_settings') !!}</h3>
|
<h3 class="panel-title">{!! trans('texts.email_settings') !!}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{!! Former::checkbox('pdf_email_attachment') !!}
|
{!! Former::checkbox('pdf_email_attachment')->text(trans('texts.enable')) !!}
|
||||||
|
{!! Former::checkbox('utf8_invoices')->text(trans('texts.enable')) !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
<link href="{{ asset('favicon.png') }}" rel="shortcut icon">
|
<link href="{{ asset('favicon.png') }}" rel="shortcut icon">
|
||||||
<link rel="canonical" href="{{ NINJA_APP_URL }}/{{ Request::path() }}" />
|
<link rel="canonical" href="{{ NINJA_APP_URL }}/{{ Request::path() }}" />
|
||||||
|
|
||||||
<script src="{{ asset('js/built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
<script src="{{ asset('js/built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
||||||
|
<script src="{{ asset('js/vfs_fonts.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var NINJA = NINJA || {};
|
var NINJA = NINJA || {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user