diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 6a68546d6e18..b9b288616666 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -65,7 +65,7 @@ class CheckData extends Command /** * @var string */ - protected $signature = 'ninja:check-data {--database=} {--fix=}'; + protected $signature = 'ninja:check-data {--database=} {--fix=} {--client_id=}'; /** * @var string diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 6e6419becf98..274db4e67635 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -449,7 +449,7 @@ class LoginController extends BaseController MultiDB::setDefaultDatabase(); - $account = CreateAccount::dispatchNow($new_account); + $account = CreateAccount::dispatchNow($new_account, request()->getClientIp()); Auth::login($account->default_company->owner(), true); diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 4b9ff0a41a02..54ac624ac833 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -347,68 +347,4 @@ class AutoBillInvoice extends AbstractService return $this; } - /** - * Removes any existing unpaid gateway fees - * due to previous payment failure. - * - * @return $this - */ - // private function purgeStaleGatewayFees() - // { - // $starting_amount = $this->invoice->amount; - - // $line_items = $this->invoice->line_items; - - // $new_items = []; - - // foreach($line_items as $item) - // { - - // if($item->type_id != 3) - // $new_items[] = $item; - - // } - - // $this->invoice->line_items = $new_items; - // $this->invoice->save(); - - // $this->invoice = $this->invoice->calc()->getInvoice(); - - // if($starting_amount != $this->invoice->amount && $this->invoice->status_id != Invoice::STATUS_DRAFT){ - // $this->invoice->client->service()->updateBalance($this->invoice->amount - $starting_amount)->save(); - // $this->invoice->ledger()->updateInvoiceBalance($this->invoice->amount - $starting_amount, 'Invoice balance updated after stale gateway fee removed')->save(); - // } - - // return $this; - // } - - // /** - // * Checks whether a given gateway token is able - // * to process the payment after passing through the - // * fees and limits check. - // * - // * @param CompanyGateway $cg The CompanyGateway instance - // * @param float $amount The amount to be paid - // * @return bool - // */ - // public function validGatewayLimits($cg, $amount) : bool - // { - // if (isset($cg->fees_and_limits)) { - // $fees_and_limits = $cg->fees_and_limits->{'1'}; - // } else { - // return true; - // } - - // if ((property_exists($fees_and_limits, 'min_limit')) && $fees_and_limits->min_limit !== null && $amount < $fees_and_limits->min_limit) { - // info("amount {$amount} less than ".$fees_and_limits->min_limit); - // $passes = false; - // } elseif ((property_exists($fees_and_limits, 'max_limit')) && $fees_and_limits->max_limit !== null && $amount > $fees_and_limits->max_limit) { - // info("amount {$amount} greater than ".$fees_and_limits->max_limit); - // $passes = false; - // } else { - // $passes = true; - // } - - // return $passes; - // } }