mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Allow archived invoices to be paid.
This commit is contained in:
parent
0772c05e66
commit
5535ce8faf
@ -89,6 +89,7 @@ class InvoiceController extends Controller
|
||||
{
|
||||
$invoices = Invoice::whereIn('id', $ids)
|
||||
->whereClientId(auth()->user()->client->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
//filter invoices which are payable
|
||||
|
@ -95,7 +95,7 @@ class PaymentController extends Controller
|
||||
*/
|
||||
|
||||
$payable_invoices = collect($request->payable_invoices);
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys($payable_invoices->pluck('invoice_id')->toArray()))->get();
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys($payable_invoices->pluck('invoice_id')->toArray()))->withTrashed()->get();
|
||||
|
||||
$invoices->each(function($invoice){
|
||||
$invoice->service()->removeUnpaidGatewayFees()->save();
|
||||
|
@ -188,7 +188,7 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
public function attachInvoices(Payment $payment, PaymentHash $payment_hash): Payment
|
||||
{
|
||||
$paid_invoices = $payment_hash->invoices();
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($paid_invoices, 'invoice_id')))->get();
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($paid_invoices, 'invoice_id')))->withTrashed()->get();
|
||||
$payment->invoices()->sync($invoices);
|
||||
|
||||
$invoices->each(function ($invoice) use ($payment) {
|
||||
|
@ -37,7 +37,7 @@ class UpdateInvoicePayment
|
||||
{
|
||||
$paid_invoices = $this->payment_hash->invoices();
|
||||
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($paid_invoices, 'invoice_id')))->get();
|
||||
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($paid_invoices, 'invoice_id')))->withTrashed()->get();
|
||||
|
||||
collect($paid_invoices)->each(function ($paid_invoice) use ($invoices) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user