mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 04:04:47 -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)
|
$invoices = Invoice::whereIn('id', $ids)
|
||||||
->whereClientId(auth()->user()->client->id)
|
->whereClientId(auth()->user()->client->id)
|
||||||
|
->withTrashed()
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
//filter invoices which are payable
|
//filter invoices which are payable
|
||||||
|
@ -95,7 +95,7 @@ class PaymentController extends Controller
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$payable_invoices = collect($request->payable_invoices);
|
$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){
|
$invoices->each(function($invoice){
|
||||||
$invoice->service()->removeUnpaidGatewayFees()->save();
|
$invoice->service()->removeUnpaidGatewayFees()->save();
|
||||||
|
@ -188,7 +188,7 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
public function attachInvoices(Payment $payment, PaymentHash $payment_hash): Payment
|
public function attachInvoices(Payment $payment, PaymentHash $payment_hash): Payment
|
||||||
{
|
{
|
||||||
$paid_invoices = $payment_hash->invoices();
|
$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);
|
$payment->invoices()->sync($invoices);
|
||||||
|
|
||||||
$invoices->each(function ($invoice) use ($payment) {
|
$invoices->each(function ($invoice) use ($payment) {
|
||||||
|
@ -37,7 +37,7 @@ class UpdateInvoicePayment
|
|||||||
{
|
{
|
||||||
$paid_invoices = $this->payment_hash->invoices();
|
$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) {
|
collect($paid_invoices)->each(function ($paid_invoice) use ($invoices) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user