Code improvements

This commit is contained in:
2026-09-04 09:27:48 +02:00
parent d23e6c3914
commit 4bb64b0053
51 changed files with 30702 additions and 87 deletions
@@ -24,7 +24,7 @@ class CreateInvoiceCommand {
}
$invoice = Invoice::create([
'tenant' => app('tenant')->slug,
'tenant' => currentTenant()->slug,
'cost_unit_id' => $this->request->costUnit->id,
'invoice_number' => $this->generateInvoiceNumber(),
'status' => InvoiceStatus::INVOICE_STATUS_NEW,
@@ -61,7 +61,7 @@ class CreateInvoiceCommand {
}
if ($this->request->costUnit->mail_on_new) {
$recipients = [app('tenant')->email_finance];
$recipients = [currentTenant()->email_finance];
foreach ($this->request->costUnit->treasurers()->get() as $treasurer) {
if (!in_array($treasurer->email, $recipients)) {
@@ -83,7 +83,7 @@ class CreateInvoiceCommand {
private function generateInvoiceNumber() : string {
$lastInvoiceNumber = Invoice::query()
->where('tenant', app('tenant')->slug)
->where('tenant', currentTenant()->slug)
->whereYear('created_at', date('Y'))
->count();