mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Working on invoice design page
This commit is contained in:
parent
9770e6a1d5
commit
7c24a34b6d
@ -11,6 +11,50 @@
|
|||||||
@parent
|
@parent
|
||||||
@include('accounts.nav_advanced')
|
@include('accounts.nav_advanced')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var invoiceDesigns = {{ $invoiceDesigns }};
|
||||||
|
var invoice = {{ json_encode($invoice) }};
|
||||||
|
|
||||||
|
function getDesignJavascript() {
|
||||||
|
var id = $('#invoice_design_id').val();
|
||||||
|
return invoiceDesigns[id-1].javascript;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPDFString() {
|
||||||
|
invoice.is_pro = {{ Auth::user()->isPro() ? 'true' : 'false' }};
|
||||||
|
invoice.account.hide_quantity = $('#hide_quantity').is(":checked");
|
||||||
|
invoice.account.hide_paid_to_date = $('#hide_paid_to_date').is(":checked");
|
||||||
|
invoice.invoice_design_id = $('#invoice_design_id').val();
|
||||||
|
|
||||||
|
NINJA.primaryColor = $('#primary_color').val();
|
||||||
|
NINJA.secondaryColor = $('#secondary_color').val();
|
||||||
|
|
||||||
|
var doc = generatePDF(invoice, getDesignJavascript(), true);
|
||||||
|
if (!doc) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return doc.output('datauristring');
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
preferredFormat: 'hex',
|
||||||
|
disabled: {{ Auth::user()->isPro() ? 'false' : 'true' }},
|
||||||
|
showInitial: false,
|
||||||
|
showInput: true,
|
||||||
|
allowEmpty: true,
|
||||||
|
clickoutFiresChange: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#primary_color').spectrum(options);
|
||||||
|
$('#secondary_color').spectrum(options);
|
||||||
|
|
||||||
|
refreshPDF();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
@ -56,48 +100,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var invoiceDesigns = {{ $invoiceDesigns }};
|
|
||||||
|
|
||||||
function getDesignJavascript() {
|
|
||||||
var id = $('#invoice_design_id').val();
|
|
||||||
return invoiceDesigns[id-1].javascript;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPDFString() {
|
|
||||||
var invoice = {{ json_encode($invoice) }};
|
|
||||||
invoice.is_pro = {{ Auth::user()->isPro() ? 'true' : 'false' }};
|
|
||||||
invoice.account.hide_quantity = $('#hide_quantity').is(":checked");
|
|
||||||
invoice.account.hide_paid_to_date = $('#hide_paid_to_date').is(":checked");
|
|
||||||
invoice.invoice_design_id = $('#invoice_design_id').val();
|
|
||||||
|
|
||||||
NINJA.primaryColor = $('#primary_color').val();
|
|
||||||
NINJA.secondaryColor = $('#secondary_color').val();
|
|
||||||
|
|
||||||
var doc = generatePDF(invoice, getDesignJavascript(), true);
|
|
||||||
if (!doc) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return doc.output('datauristring');
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
var options = {
|
|
||||||
preferredFormat: 'hex',
|
|
||||||
disabled: {{ Auth::user()->isPro() ? 'false' : 'true' }},
|
|
||||||
showInitial: false,
|
|
||||||
showInput: true,
|
|
||||||
allowEmpty: true,
|
|
||||||
clickoutFiresChange: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
$('#primary_color').spectrum(options);
|
|
||||||
$('#secondary_color').spectrum(options);
|
|
||||||
|
|
||||||
refreshPDF();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
@stop
|
@stop
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
@if (file_exists($account->getLogoPath()))
|
@if (file_exists($account->getLogoPath()))
|
||||||
invoice.image = "{{ HTML::image_data($account->getLogoPath()) }}";
|
invoice.image = "{{ HTML::image_data($account->getLogoPath()) }}";
|
||||||
invoice.imageWidth = {{ $invoice->client->account->getLogoWidth() }};
|
invoice.imageWidth = {{ $account->getLogoWidth() }};
|
||||||
invoice.imageHeight = {{ $invoice->client->account->getLogoHeight() }};
|
invoice.imageHeight = {{ $account->getLogoHeight() }};
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
var NINJA = NINJA || {};
|
var NINJA = NINJA || {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user