File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55use CleanPhp \Invoicer \Domain \Repository \InvoiceRepositoryInterface ;
66use CleanPhp \Invoicer \Domain \Repository \OrderRepositoryInterface ;
77use CleanPhp \Invoicer \Domain \Service \InvoicingService ;
8+ use Illuminate \Http \Response ;
89
910/**
1011 * Class InvoicesController
@@ -52,6 +53,24 @@ public function indexAction()
5253 return view ('invoices/index ' , ['invoices ' => $ invoices ]);
5354 }
5455
56+ /**
57+ * @param $id
58+ * @return Response|\Illuminate\View\View
59+ */
60+ public function viewAction ($ id )
61+ {
62+ $ invoice = $ this ->invoiceRepository ->getById ($ id );
63+
64+ if (!$ invoice ) {
65+ return new Response ('' , 404 );
66+ }
67+
68+ return view ('invoices/view ' , [
69+ 'invoice ' => $ invoice ,
70+ 'order ' => $ invoice ->getOrder ()
71+ ]);
72+ }
73+
5574 /**
5675 * @return \Illuminate\View\View
5776 */
Original file line number Diff line number Diff line change 1+ @extends (' layouts.layout' )
2+
3+ @section (' content' )
4+ <div class =" page-header clearfix" >
5+ <h2 >Invoice #{{{ $invoice -> getId () } }} </h2 >
6+ </div >
7+
8+ <table class =" table table-striped" >
9+ <thead >
10+ <tr >
11+ <th colspan =" 2" >Invoice Details</th >
12+ </tr >
13+ </thead >
14+ <tr >
15+ <th >Customer:</th >
16+ <td >
17+ <a href =" /customers/edit/{{{ $order -> getCustomer ()-> getId () } }}" >
18+ {{{ $order -> getCustomer ()-> getName () } }} </a >
19+ </td >
20+ </tr >
21+ <tr >
22+ <th >Order:</th >
23+ <td >
24+ <a href =" /orders/view/{{{ $order -> getId () } }}" >
25+ {{{ $order -> getOrderNumber () } }} </a >
26+ </td >
27+ </tr >
28+ <tr >
29+ <th >Description:</th >
30+ <td >{{{ $order -> getDescription () } }} </td >
31+ </tr >
32+ <tr >
33+ <th >Total:</th >
34+ <td >$ {{{ number_format ($invoice -> getTotal (), 2 ) } }} </td >
35+ </tr >
36+ </table >
37+ @stop
You can’t perform that action at this time.
0 commit comments