decouple document number generation

This commit is contained in:
Hendrik Hagendorn
2023-04-28 17:38:49 +02:00
parent 715b81c516
commit 1719e977df
8 changed files with 103 additions and 26 deletions

View File

@ -3,6 +3,7 @@
namespace App\Models\Document;
use App\Abstracts\Model;
use App\Interfaces\Service\DocumentNumberService;
use App\Models\Common\Media as MediaModel;
use App\Models\Setting\Tax;
use App\Scopes\Document as Scope;
@ -251,7 +252,7 @@ class Document extends Model
}
$this->status = 'draft';
$this->document_number = $this->getNextDocumentNumber($type);
$this->document_number = app(DocumentNumberService::class)->getNextDocumentNumber($type, $src->contact);
}
public function getSentAtAttribute(string $value = null)