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