Skip to content

Commit 16cdd39

Browse files
authored
Merge pull request #113 from itskawsar/invoice-status
Invoice status
2 parents e38ddd9 + 82529cc commit 16cdd39

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

config/invoices.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565

6666
'disk' => 'local',
6767

68+
'status' => 'Due',
69+
6870
'seller' => [
6971
/**
7072
* Class used in templates via $invoice->seller
-837 KB
Binary file not shown.

resources/views/templates/default.blade.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,19 @@
123123
.border-0 {
124124
border: none !important;
125125
}
126+
126127
.description {
127128
margin-top: 0.25rem;
128129
margin-bottom: 0;
129130
color: #999;
130131
}
132+
133+
.status {
134+
color: #999;
135+
font-size: 2rem;
136+
font-weight: bold;
137+
text-transform: uppercase;
138+
}
131139
</style>
132140
</head>
133141

@@ -145,6 +153,7 @@
145153
</h4>
146154
</td>
147155
<td class="border-0 pl-0">
156+
<p class="status">{{ $invoice->status }}</p>
148157
<p>{{ __('invoices::invoice.serial') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p>
149158
<p>{{ __('invoices::invoice.date') }}: <strong>{{ $invoice->getDate() }}</strong></p>
150159
</td>

src/Invoice.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ class Invoice
6565
*/
6666
public $notes;
6767

68+
/**
69+
* @var string
70+
*/
71+
public $status;
72+
6873
/**
6974
* @var string
7075
*/
@@ -155,6 +160,8 @@ public function __construct($name = 'Invoice')
155160
$this->items = Collection::make([]);
156161
$this->template = 'default';
157162

163+
$this->status = config('invoices.status');
164+
158165
// Date
159166
$this->date = Carbon::now();
160167
$this->date_format = config('invoices.date.format');

src/Traits/InvoiceHelpers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public function name(string $name)
2424
return $this;
2525
}
2626

27+
/**
28+
* @param string $status
29+
* @return $this
30+
*/
31+
public function status(string $status)
32+
{
33+
$this->status = $status;
34+
35+
return $this;
36+
}
37+
2738
public function notes(string $notes)
2839
{
2940
$this->notes = $notes;

0 commit comments

Comments
 (0)