mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Proposals
This commit is contained in:
parent
cb9c418333
commit
4229b8ad57
@ -142,6 +142,8 @@ class ProposalController extends BaseController
|
|||||||
|
|
||||||
$mpdf = new mPDF();
|
$mpdf = new mPDF();
|
||||||
$mpdf->WriteHTML($proposal->present()->htmlDocument);
|
$mpdf->WriteHTML($proposal->present()->htmlDocument);
|
||||||
|
|
||||||
|
$mpdf->Output();
|
||||||
$mpdf->Output($proposal->present()->filename, 'D');
|
$mpdf->Output($proposal->present()->filename, 'D');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,21 @@ class ProposalPresenter extends EntityPresenter
|
|||||||
{
|
{
|
||||||
$proposal = $this->entity;
|
$proposal = $this->entity;
|
||||||
|
|
||||||
return "<html><head><style>{$proposal->css}</style><head><body>{$proposal->html}</body></html>";
|
$html = "<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
@page {
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
{$proposal->css}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{$proposal->html}
|
||||||
|
</body>
|
||||||
|
</html>";
|
||||||
|
|
||||||
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function filename()
|
public function filename()
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var html = {!! json_encode($proposal->html) !!};
|
var content = {!! json_encode($proposal->present()->htmlDocument) !!};
|
||||||
var css = {!! json_encode($proposal->css) !!};
|
|
||||||
|
|
||||||
var content = '<html><head><style>' + css + '</style></head><body>' + html + '</body></html>';
|
|
||||||
var iFrame = document.getElementById('proposalIframe').contentWindow.document;
|
var iFrame = document.getElementById('proposalIframe').contentWindow.document;
|
||||||
|
|
||||||
iFrame.write(content);
|
iFrame.write(content);
|
||||||
|
@ -525,7 +525,7 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ( $invoice->id && ! $invoice->is_recurring)
|
@if ( $invoice->id && ! $invoice->is_recurring)
|
||||||
{!! Button::primary(trans('texts.download_pdf'))
|
{!! Button::primary(trans('texts.download'))
|
||||||
->withAttributes(['onclick' => 'onDownloadClick()', 'id' => 'downloadPdfButton'])
|
->withAttributes(['onclick' => 'onDownloadClick()', 'id' => 'downloadPdfButton'])
|
||||||
->appendIcon(Icon::create('download-alt')) !!}
|
->appendIcon(Icon::create('download-alt')) !!}
|
||||||
@endif
|
@endif
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
->appendIcon(Icon::create('remove-circle'))
|
->appendIcon(Icon::create('remove-circle'))
|
||||||
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
|
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
|
||||||
|
|
||||||
{!! Button::primary(trans('texts.download_pdf'))
|
{!! Button::primary(trans('texts.download'))
|
||||||
->withAttributes(['onclick' => 'onDownloadClick()'])
|
->withAttributes(['onclick' => 'onDownloadClick()'])
|
||||||
->appendIcon(Icon::create('download-alt')) !!}
|
->appendIcon(Icon::create('download-alt')) !!}
|
||||||
|
|
||||||
@ -90,9 +90,11 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@if ($proposal)
|
||||||
function onDownloadClick() {
|
function onDownloadClick() {
|
||||||
location.href = "{{ url("/proposals/{$proposal->public_id}/download") }}";
|
location.href = "{{ url("/proposals/{$proposal->public_id}/download") }}";
|
||||||
}
|
}
|
||||||
|
@endif
|
||||||
|
|
||||||
function loadTemplate() {
|
function loadTemplate() {
|
||||||
var templateId = $('select#proposal_template_id').val();
|
var templateId = $('select#proposal_template_id').val();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user