mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for ach bank import - Stripe
This commit is contained in:
parent
e035a75cc3
commit
f0ec25a606
@ -380,7 +380,7 @@ class UserController extends BaseController
|
||||
*/
|
||||
public function update(UpdateUserRequest $request, User $user)
|
||||
{
|
||||
$old_company_user = $user->company_user();
|
||||
$old_company_user = $user->company_user;
|
||||
$old_user = json_encode($user);
|
||||
$old_user_email = $user->getOriginal('email');
|
||||
|
||||
@ -398,8 +398,8 @@ class UserController extends BaseController
|
||||
|
||||
|
||||
if(
|
||||
strcasecmp($old_company_user->permissions, $user->company_user()->permissions) != 0 ||
|
||||
$old_company_user->is_admin != $user->company_user()->is_admin
|
||||
strcasecmp($old_company_user->permissions, $user->company_user->permissions) != 0 ||
|
||||
$old_company_user->is_admin != $user->company_user->is_admin
|
||||
){
|
||||
$user->company_user()->update(["permissions_updated_at" => now()]);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
||||
/**
|
||||
@ -189,7 +190,7 @@ class BaseModel extends Model
|
||||
|
||||
public function numberFormatter()
|
||||
{
|
||||
$number = strlen($this->number) > 1 ? $this->number : class_basename($this);
|
||||
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5); ;
|
||||
|
||||
$formatted_number = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $number);
|
||||
// Remove any runs of periods (thanks falstro!)
|
||||
|
@ -107,7 +107,7 @@ class UpdatePaymentMethods
|
||||
$additional_data = ['gateway_customer_reference' => $customer->id];
|
||||
|
||||
if($customer->default_source === $method->id)
|
||||
$additional_data = ['gateway_customer_reference' => $customer->id, 'is_default', 1];
|
||||
$additional_data = ['gateway_customer_reference' => $customer->id, 'is_default' => 1];
|
||||
|
||||
$this->stripe->storeGatewayToken($data, $additional_data);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user