Skip to content

Commit

Permalink
stan
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Mar 25, 2024
1 parent 815cf43 commit f10b9dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@composer run build",
"@php vendor/bin/testbench serve"
],
"analyse": "vendor/bin/phpstan analyse",
"analyse": "vendor/bin/phpstan analyse --memory-limit 500M",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint",
Expand Down
5 changes: 4 additions & 1 deletion src/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,14 @@ public function credit(): HasOne
*/
public function getPreviousInvoice(): ?static
{
return static::query()
/** @var ?static $invoice */
$invoice = static::query()
->when($this->getSerialNumberPrefix(), fn (Builder $query) => $query->where('serial_number_details->prefix', $this->getSerialNumberPrefix()))
->when($this->getSerialNumberSerie(), fn (Builder $query) => $query->where('serial_number_details->serie', $this->getSerialNumberSerie()))
->latest('serial_number')
->first();

return $invoice;
}

public function initSerialNumberDetailst(): static
Expand Down

0 comments on commit f10b9dc

Please sign in to comment.