1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +01:00
invoiceninja/app/Services/Credit/CreditService.php
David Bomba c1d3fd12a8
Import (#3360)
* Fixes for test data

* Fixes for tests

* Remove legacy vue components

* Add routing number to client gateway tokens

* working on important documents and company gateways

* Import fixes
2020-02-22 13:25:49 +11:00

50 lines
896 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;
}
}