mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
f7650d0692
* 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>
41 lines
831 B
PHP
41 lines
831 B
PHP
<?php
|
|
|
|
namespace App\Services\Credit;
|
|
|
|
use App\Credit;
|
|
use App\Events\Payment\PaymentWasCreated;
|
|
use App\Factory\PaymentFactory;
|
|
use App\Jobs\Customer\UpdateCustomerBalance;
|
|
use App\Jobs\Customer\UpdateCustomerPaidToDate;
|
|
use App\Jobs\Company\UpdateCompanyLedgerWithPayment;
|
|
use App\Models\Invoice;
|
|
use App\Models\Payment;
|
|
use App\Services\Customer\CustomerService;
|
|
use App\Services\Payment\PaymentService;
|
|
use App\Traits\GeneratesCounter;
|
|
|
|
class ApplyNumber
|
|
{
|
|
use GeneratesCounter;
|
|
|
|
private $customer;
|
|
|
|
public function __construct($customer)
|
|
{
|
|
$this->customer = $customer;
|
|
}
|
|
|
|
public function __invoke($credit)
|
|
{
|
|
|
|
if ($credit->number != '') {
|
|
return $credit;
|
|
}
|
|
|
|
$credit->number = $this->getNextCreditNumber($this->customer);
|
|
|
|
|
|
return $credit;
|
|
}
|
|
}
|