mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-12-25 19:47:51 -05:00
* Adjustments for tests * Implement handling of temp downloading resources * Refactor paths * Refactors for file paths * Refactor paths * Add in S3 adapter * Refactor company Documment URL * Refactor for entity pdf performance * Refactors for invoice generation * Enhancements for emails invoices * Emails * Fixes for client portal queries
37 lines
731 B
PHP
37 lines
731 B
PHP
<?php
|
|
|
|
namespace App\Services\Quote;
|
|
|
|
use App\Events\Quote\QuoteWasMarkedSent;
|
|
use App\Models\Quote;
|
|
|
|
class MarkSent
|
|
{
|
|
private $client;
|
|
|
|
private $quote;
|
|
|
|
public function __construct($client, $quote)
|
|
{
|
|
$this->client = $client;
|
|
$this->quote = $quote;
|
|
}
|
|
|
|
public function run()
|
|
{
|
|
|
|
/* Return immediately if status is not draft */
|
|
if ($this->quote->status_id != Quote::STATUS_DRAFT) {
|
|
return $this->quote;
|
|
}
|
|
|
|
$this->quote->markInvitationsSent();
|
|
|
|
event(new QuoteWasMarkedSent($this->quote, $this->quote->company));
|
|
|
|
$this->quote->service()->setStatus(Quote::STATUS_SENT)->applyNumber()->save();
|
|
|
|
return $this->quote;
|
|
}
|
|
}
|