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->WriteHTML($proposal->present()->htmlDocument);
|
||||
|
||||
$mpdf->Output();
|
||||
$mpdf->Output($proposal->present()->filename, 'D');
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,21 @@ class ProposalPresenter extends EntityPresenter
|
||||
{
|
||||
$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()
|
||||
|
@ -26,10 +26,7 @@
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var html = {!! json_encode($proposal->html) !!};
|
||||
var css = {!! json_encode($proposal->css) !!};
|
||||
|
||||
var content = '<html><head><style>' + css + '</style></head><body>' + html + '</body></html>';
|
||||
var content = {!! json_encode($proposal->present()->htmlDocument) !!};
|
||||
var iFrame = document.getElementById('proposalIframe').contentWindow.document;
|
||||
|
||||
iFrame.write(content);
|
||||
|
@ -525,7 +525,7 @@
|
||||
@endif
|
||||
|
||||
@if ( $invoice->id && ! $invoice->is_recurring)
|
||||
{!! Button::primary(trans('texts.download_pdf'))
|
||||
{!! Button::primary(trans('texts.download'))
|
||||
->withAttributes(['onclick' => 'onDownloadClick()', 'id' => 'downloadPdfButton'])
|
||||
->appendIcon(Icon::create('download-alt')) !!}
|
||||
@endif
|
||||
|
@ -57,7 +57,7 @@
|
||||
->appendIcon(Icon::create('remove-circle'))
|
||||
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
|
||||
|
||||
{!! Button::primary(trans('texts.download_pdf'))
|
||||
{!! Button::primary(trans('texts.download'))
|
||||
->withAttributes(['onclick' => 'onDownloadClick()'])
|
||||
->appendIcon(Icon::create('download-alt')) !!}
|
||||
|
||||
@ -90,9 +90,11 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
function onDownloadClick() {
|
||||
location.href = "{{ url("/proposals/{$proposal->public_id}/download") }}";
|
||||
}
|
||||
@if ($proposal)
|
||||
function onDownloadClick() {
|
||||
location.href = "{{ url("/proposals/{$proposal->public_id}/download") }}";
|
||||
}
|
||||
@endif
|
||||
|
||||
function loadTemplate() {
|
||||
var templateId = $('select#proposal_template_id').val();
|
||||
|
Loading…
x
Reference in New Issue
Block a user