akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -288,13 +288,13 @@ class Invoices extends Controller
* @return Response
*/
public function pdfInvoice(Document $invoice)
{
{
event(new \App\Events\Document\DocumentPrinting($invoice));
$currency_style = true;
$view = view($invoice->template_path, compact('invoice', 'currency_style'))->render();
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
$pdf = app('dompdf.wrapper');
@ -306,28 +306,4 @@ class Invoices extends Controller
return $pdf->download($file_name);
}
/**
* Mark the invoice as paid.
*
* @param Document $invoice
*
* @return Response
*/
public function markPaid(Document $invoice)
{
try {
event(new \App\Events\Document\PaymentReceived($invoice, ['type' => 'income', 'mark_paid' => 'invoice']));
$message = trans('documents.messages.marked_paid', ['type' => trans_choice('general.invoices', 1)]);
flash($message)->success();
} catch(\Exception $e) {
$message = $e->getMessage();
flash($message)->error()->important();
}
return redirect()->back();
}
}