mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
50 lines
892 B
PHP
50 lines
892 B
PHP
<?php
|
|
namespace App\Services\Credit;
|
|
|
|
use App\Credit;
|
|
|
|
class CreditService
|
|
{
|
|
protected $credit;
|
|
|
|
|
|
public function __construct($credit)
|
|
{
|
|
$this->credit = $credit;
|
|
|
|
}
|
|
|
|
public function getCreditPdf($contact)
|
|
{
|
|
return (new GetCreditPdf($this->credit, $contact))->run();
|
|
}
|
|
|
|
/**
|
|
* Applies the invoice number
|
|
* @return $this InvoiceService object
|
|
*/
|
|
public function applyNumber()
|
|
{
|
|
$this->credit = (new ApplyNumber($this->credit->client, $this->credit))->run();
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function createInvitations()
|
|
{
|
|
$this->credit = (new CreateInvitations($this->credit))->run();
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Saves the credit
|
|
* @return Credit object
|
|
*/
|
|
public function save() : ?Credit
|
|
{
|
|
$this->credit->save();
|
|
return $this->credit;
|
|
}
|
|
}
|