Unify quote conversion
This commit is contained in:
parent
0b22141492
commit
ccce21c0ec
|
|
@ -561,7 +561,8 @@ class QuoteController extends BaseController
|
||||||
|
|
||||||
$quotes->each(function ($quote, $key) use ($user) {
|
$quotes->each(function ($quote, $key) use ($user) {
|
||||||
if ($user->can('edit', $quote) && $quote->service()->isConvertable()) {
|
if ($user->can('edit', $quote) && $quote->service()->isConvertable()) {
|
||||||
$quote->service()->convertToInvoice();
|
// $quote->service()->convertToInvoice();
|
||||||
|
$quote->service()->convert()->save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,12 +161,19 @@ class QuoteService
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* convertToInvoice
|
||||||
|
*
|
||||||
|
* @NOTE - this method will force the quote to include all invitations for the
|
||||||
|
* client where ADD TO INVOICE = true
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function convertToInvoice()
|
public function convertToInvoice()
|
||||||
{
|
{
|
||||||
$this->convert();
|
$this->convert();
|
||||||
|
|
||||||
$this->invoice->service()->createInvitations();
|
// $this->invoice->service()->createInvitations();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue