mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 07:02:34 +01:00
Fixes for subscription cron where URL/REST method is not set
This commit is contained in:
parent
dedc1f5774
commit
55fec84e1d
@ -45,6 +45,7 @@ class SubscriptionCron
|
|||||||
$invoices = Invoice::where('is_deleted', 0)
|
$invoices = Invoice::where('is_deleted', 0)
|
||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
|
->where('is_proforma',0)
|
||||||
->whereDate('due_date', '<=', now()->addDay()->startOfDay())
|
->whereDate('due_date', '<=', now()->addDay()->startOfDay())
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->whereNotNull('subscription_id')
|
->whereNotNull('subscription_id')
|
||||||
@ -74,6 +75,7 @@ class SubscriptionCron
|
|||||||
$invoices = Invoice::where('is_deleted', 0)
|
$invoices = Invoice::where('is_deleted', 0)
|
||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
|
->where('is_proforma',0)
|
||||||
->whereDate('due_date', '<=', now()->addDay()->startOfDay())
|
->whereDate('due_date', '<=', now()->addDay()->startOfDay())
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->whereNotNull('subscription_id')
|
->whereNotNull('subscription_id')
|
||||||
|
@ -27,6 +27,9 @@ trait SubscriptionHooker
|
|||||||
'X-Requested-With' => 'XMLHttpRequest',
|
'X-Requested-With' => 'XMLHttpRequest',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(!isset($subscription->webhook_configuration['post_purchase_url']) && !isset($subscription->webhook_configuration['post_purchase_rest_method']))
|
||||||
|
return;
|
||||||
|
|
||||||
if (count($subscription->webhook_configuration['post_purchase_headers']) >= 1) {
|
if (count($subscription->webhook_configuration['post_purchase_headers']) >= 1) {
|
||||||
$headers = array_merge($headers, $subscription->webhook_configuration['post_purchase_headers']);
|
$headers = array_merge($headers, $subscription->webhook_configuration['post_purchase_headers']);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user