mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
* Provide failsafe creation of invoice invitations * URL Links for invitations * open up route for invitations * Set DB by Invite * Set DB By invitation Key * Tests for setting DB based on user email address * Middleware for setting db by email address * fixes for tets * fixes for tests * Tests for bulk actions * Payments API * Fixes for tests
49 lines
989 B
PHP
49 lines
989 B
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Payment;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* PaymentRepository
|
|
*/
|
|
class PaymentRepository extends BaseRepository
|
|
{
|
|
|
|
|
|
public function getClassName()
|
|
{
|
|
return Payment::class;
|
|
}
|
|
|
|
public function save(Request $request, Payment $payment) : ?Payment
|
|
{
|
|
|
|
$payment->fill($request->input());
|
|
|
|
if($request->input('invoices'))
|
|
{
|
|
|
|
$invoices = Invoice::whereIn('id', $request->input('invoices'))->get();
|
|
|
|
}
|
|
|
|
//parse invoices[] and attach to paymentables
|
|
//parse invoices[] and apply payments and subfunctions
|
|
|
|
$payment->save();
|
|
|
|
return $payment;
|
|
}
|
|
|
|
} |