invoiceninja/app/Services/Credit/CreditService.php
michael-hampton f7650d0692
Ft email (#3326)
* Emails

* change to user service

* refactor emails

* refactor emails

* refactor emails

* refactor emails

* emails

* emails

* emails

* emails

* emails

* emails

* emails

* emails

* emails

* emails

* Update EmailPayment.php

* Update SendEmail.php

* Update SendEmail.php

* Update SendEmail.php

* Update and rename BuildEmail.php to EmailBuilder.php

* Create InvoiceEmail

* Create QuoteEmail.php

* Rename InvoiceEmail to InvoiceEmail.php

* Create PaymentEmail.php

* Update SendEmail.php

* Update SendEmail.php

* Update SendEmail.php

* Update SendEmail.php

* Update InvoiceEmail.php

* Update EmailInvoice.php

* Update SendEmail.php

* Update TemplateEmail.php

* Update EmailBuilder.php

* Update InvoiceEmail.php

* Update QuoteEmail.php

* Update PaymentEmail.php

* Update InvoiceEmail.php

* Update QuoteEmail.php

* Update QuoteInvitation.php

* Update EmailQuote.php

* Update SendEmail.php

* Update SendEmail.php

* Update PaymentService.php

* Update PaymentEmail.php

* Update PaymentEmail.php

* Update PaymentEmail.php

* Update EmailBuilder.php

* Update PaymentEmail.php

* Update EmailPayment.php

* Update SendEmail.php

* Update InvoiceService.php

* Update SendEmail.php

* Update PaymentService.php

* Update SendEmail.php

* Update QuoteService.php

* Update EmailPayment.php

Co-authored-by: David Bomba <turbo124@gmail.com>
2020-02-15 20:01:15 +11:00

56 lines
1009 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)
{
$get_invoice_pdf = new GetCreditPdf();
return $get_invoice_pdf($this->credit, $contact);
}
/**
* Applies the invoice number
* @return $this InvoiceService object
*/
public function applyNumber()
{
$apply_number = new ApplyNumber($this->credit->customer);
$this->credit = $apply_number($this->credit);
return $this;
}
public function createInvitations()
{
$create_invitation = new CreateInvitations();
$this->invoice = $create_invitation($this->invoice);
return $this;
}
/**
* Saves the credit
* @return Credit object
*/
public function save() : ?Credit
{
$this->credit->save();
return $this->credit;
}
}