1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fix for enabling autobilling

This commit is contained in:
Hillel Coren 2016-06-30 20:53:06 +03:00
parent 0cc0bcbdcf
commit 6dfd50bddd

View File

@ -776,8 +776,8 @@ class ClientPortalController extends BaseController
$publicId = Input::get('public_id');
$enable = Input::get('enable');
$invoice = $client->invoices->where('public_id', intval($publicId))->first();
$invoice = $client->invoices()->where('public_id', intval($publicId))->first();
if ($invoice && $invoice->is_recurring && ($invoice->auto_bill == AUTO_BILL_OPT_IN || $invoice->auto_bill == AUTO_BILL_OPT_OUT)) {
$invoice->client_enable_auto_bill = $enable ? true : false;
$invoice->save();