mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Display PDF
This commit is contained in:
parent
76ba0624bc
commit
374cc88c06
@ -50,7 +50,7 @@ class InvoiceController extends Controller
|
|||||||
if (request()->ajax()) {
|
if (request()->ajax()) {
|
||||||
|
|
||||||
return DataTables::of($invoices)->addColumn('action', function ($invoice) {
|
return DataTables::of($invoices)->addColumn('action', function ($invoice) {
|
||||||
return '<a href="/client/invoices/'. $invoice->hashed_id .'/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i>'.ctrans('texts.view').'</a>';
|
return '<a href="/client/invoices/'. $invoice->hashed_id .'" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i>'.ctrans('texts.view').'</a>';
|
||||||
})
|
})
|
||||||
->addColumn('checkbox', function ($invoice){
|
->addColumn('checkbox', function ($invoice){
|
||||||
return '<input type="checkbox" name="hashed_ids[]" value="'. $invoice->hashed_id .'"/>';
|
return '<input type="checkbox" name="hashed_ids[]" value="'. $invoice->hashed_id .'"/>';
|
||||||
@ -90,7 +90,7 @@ class InvoiceController extends Controller
|
|||||||
'invoice' => $invoice
|
'invoice' => $invoice
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('portal.default.invoices.show', $invoice);
|
return view('portal.default.invoices.show', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Events\Invoice\InvoiceWasUpdated;
|
||||||
use App\Helpers\Invoice\InvoiceCalc;
|
use App\Helpers\Invoice\InvoiceCalc;
|
||||||
use App\Models\Currency;
|
use App\Models\Currency;
|
||||||
use App\Models\Filterable;
|
use App\Models\Filterable;
|
||||||
@ -246,6 +247,7 @@ class Invoice extends BaseModel
|
|||||||
* Returns the template for the invoice
|
* Returns the template for the invoice
|
||||||
*
|
*
|
||||||
* @return string Either the template view, OR the template HTML string
|
* @return string Either the template view, OR the template HTML string
|
||||||
|
* @todo this needs attention, invoice->settings needs clarification
|
||||||
*/
|
*/
|
||||||
public function design() :string
|
public function design() :string
|
||||||
{
|
{
|
||||||
@ -265,4 +267,17 @@ class Invoice extends BaseModel
|
|||||||
return $invoice_calc->build();
|
return $invoice_calc->build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function pdf_url()
|
||||||
|
{
|
||||||
|
$public_path = 'storage/' . $this->client->client_hash . '/invoices/'. $this->invoice_number . '.pdf';
|
||||||
|
|
||||||
|
$storage_path = 'public/' . $this->client->client_hash . '/invoices/'. $this->invoice_number . '.pdf';
|
||||||
|
|
||||||
|
if(!Storage::exists($storage_path)) {
|
||||||
|
event(new InvoiceWasUpdated($this));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $public_path;
|
||||||
|
}
|
||||||
}
|
}
|
@ -29,6 +29,7 @@
|
|||||||
"laravel/framework": "5.8.*",
|
"laravel/framework": "5.8.*",
|
||||||
"laravel/socialite": "^3.1",
|
"laravel/socialite": "^3.1",
|
||||||
"laravel/tinker": "^1.0",
|
"laravel/tinker": "^1.0",
|
||||||
|
"laravelcollective/html": "5.8.*",
|
||||||
"league/fractal": "^0.17.0",
|
"league/fractal": "^0.17.0",
|
||||||
"league/omnipay": "^3",
|
"league/omnipay": "^3",
|
||||||
"nwidart/laravel-modules": "^4.0",
|
"nwidart/laravel-modules": "^4.0",
|
||||||
@ -42,8 +43,7 @@
|
|||||||
"webpatser/laravel-countries": "dev-master#75992ad",
|
"webpatser/laravel-countries": "dev-master#75992ad",
|
||||||
"wildbit/postmark-php": "^2.6",
|
"wildbit/postmark-php": "^2.6",
|
||||||
"yajra/laravel-datatables-html": "^4.0",
|
"yajra/laravel-datatables-html": "^4.0",
|
||||||
"yajra/laravel-datatables-oracle": "~9.0",
|
"yajra/laravel-datatables-oracle": "~9.0"
|
||||||
"laravelcollective/html": "5.8.*"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.2",
|
"barryvdh/laravel-debugbar": "^3.2",
|
||||||
|
@ -3,12 +3,25 @@
|
|||||||
<main class="main">
|
<main class="main">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
<object id="pdfObject" type="application/pdf" style="display:block;background-color:#525659;border:solid 2px #9a9a9a;" frameborder="1" width="100%" height="1180px"></object>
|
<div class="col-md-12 mt-4">
|
||||||
|
|
||||||
|
<div class="float-right">
|
||||||
|
<button class="btn btn-primary">{{ ctrans('texts.pay_now') }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12 mt-4">
|
||||||
|
|
||||||
|
<embed src="{{ asset($invoice->pdf_url()) }}#toolbar=1&navpanes=1&scrollbar=1" type="application/pdf" width="100%" height="1180px" />
|
||||||
|
|
||||||
<div id="pdfCanvas" style="display:none;width:100%;background-color:#525659;border:solid 2px #9a9a9a;padding-top:40px;text-align:center">
|
<div id="pdfCanvas" style="display:none;width:100%;background-color:#525659;border:solid 2px #9a9a9a;padding-top:40px;text-align:center">
|
||||||
<canvas id="theCanvas" style="max-width:100%;border:solid 1px #CCCCCC;"></canvas>
|
<canvas id="theCanvas" style="max-width:100%;border:solid 1px #CCCCCC;"></canvas>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
@endsection
|
@endsection
|
@ -18,8 +18,8 @@ Route::group(['middleware' => ['auth:contact'], 'prefix' => 'client', 'as' => 'c
|
|||||||
|
|
||||||
Route::get('invoices', 'ClientPortal\InvoiceController@index')->name('invoices.index');
|
Route::get('invoices', 'ClientPortal\InvoiceController@index')->name('invoices.index');
|
||||||
Route::post('invoices/payment', 'ClientPortal\InvoiceController@bulk')->name('invoices.bulk');
|
Route::post('invoices/payment', 'ClientPortal\InvoiceController@bulk')->name('invoices.bulk');
|
||||||
Route::get('invoice/{invoice}', 'ClientPortal\InvoiceController@show')->name('invoice.show');
|
Route::get('invoices/{invoice}', 'ClientPortal\InvoiceController@show')->name('invoice.show');
|
||||||
Route::get('invoice/{invoice_invitation}', 'ClientPortal\InvoiceController@show')->name('invoice.show_invitation');
|
Route::get('invoices/{invoice_invitation}', 'ClientPortal\InvoiceController@show')->name('invoice.show_invitation');
|
||||||
|
|
||||||
Route::get('recurring_invoices', 'ClientPortal\RecurringInvoiceController@index')->name('recurring_invoices.index');
|
Route::get('recurring_invoices', 'ClientPortal\RecurringInvoiceController@index')->name('recurring_invoices.index');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user