Compare commits
6 Commits
9dd2dc31dd
...
7f38d1b4ed
| Author | SHA1 | Date |
|---|---|---|
|
|
7f38d1b4ed | |
|
|
13b244ae33 | |
|
|
d4d4df099c | |
|
|
d97e9edb1c | |
|
|
abeba55c6b | |
|
|
a898272aa5 |
|
|
@ -30,7 +30,7 @@ class MemberNewInvoiceAction
|
|||
*/
|
||||
public function handle(Member $member, Subscription $subscription, int $year): array
|
||||
{
|
||||
$invoice = Invoice::createForMember($member, Member::where('id', $member->id)->get(), $year, $subscription);
|
||||
$invoice = Invoice::createForMember($member, collect([$member]), $year, $subscription);
|
||||
|
||||
return [
|
||||
...$invoice->getAttributes(),
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
namespace App\Invoice;
|
||||
|
||||
use App\Invoice\Models\Invoice;
|
||||
use App\Payment\Payment;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Str;
|
||||
use Zoomyboy\Tex\Document;
|
||||
use Zoomyboy\Tex\Engine;
|
||||
|
|
|
|||
|
|
@ -8,15 +8,14 @@ use App\Invoice\Enums\InvoiceStatus;
|
|||
use App\Invoice\InvoiceDocument;
|
||||
use App\Invoice\InvoiceSettings;
|
||||
use App\Invoice\RememberDocument;
|
||||
use App\Invoice\Scopes\InvoiceFilterScope;
|
||||
use App\Member\Member;
|
||||
use App\Payment\Subscription;
|
||||
use Database\Factories\Invoice\Models\InvoiceFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Collection;
|
||||
use Laravel\Scout\Searchable;
|
||||
use stdClass;
|
||||
|
||||
|
|
@ -47,7 +46,7 @@ class Invoice extends Model
|
|||
/**
|
||||
* @param Collection<int, Member> $members
|
||||
*/
|
||||
public static function createForMember(Member $member, Collection $members, int $year, Subscription $subscription = null): self
|
||||
public static function createForMember(Member $member, Collection $members, int $year, ?Subscription $subscription = null): self
|
||||
{
|
||||
$invoice = new self([
|
||||
'to' => [
|
||||
|
|
|
|||
Loading…
Reference in New Issue