mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 13:04:38 -04:00
Merge pull request #4111 from turbo124/v2
Only show implemented gateways
This commit is contained in:
commit
7b926980f1
@ -51,7 +51,7 @@ ERROR_EMAIL=
|
|||||||
|
|
||||||
NINJA_ENVIRONMENT=selfhost
|
NINJA_ENVIRONMENT=selfhost
|
||||||
|
|
||||||
PHANTOMJS_KEY=
|
PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'
|
||||||
PHANTOMJS_SECRET=
|
PHANTOMJS_SECRET=
|
||||||
|
|
||||||
SELF_UPDATER_REPO_VENDOR = invoiceninja
|
SELF_UPDATER_REPO_VENDOR = invoiceninja
|
||||||
|
@ -610,17 +610,17 @@ class CompanySettings extends BaseSettings
|
|||||||
'$task.line_total',
|
'$task.line_total',
|
||||||
],
|
],
|
||||||
'total_columns' => [
|
'total_columns' => [
|
||||||
'$total_taxes',
|
|
||||||
'$line_taxes',
|
|
||||||
'$subtotal',
|
'$subtotal',
|
||||||
'$discount',
|
'$discount',
|
||||||
|
'$total_taxes',
|
||||||
|
'$line_taxes',
|
||||||
'$custom_surcharge1',
|
'$custom_surcharge1',
|
||||||
'$custom_surcharge2',
|
'$custom_surcharge2',
|
||||||
'$custom_surcharge3',
|
'$custom_surcharge3',
|
||||||
'$custom_surcharge4',
|
'$custom_surcharge4',
|
||||||
'$paid_to_date',
|
|
||||||
'$client.balance',
|
|
||||||
'$total',
|
'$total',
|
||||||
|
'$paid_to_date',
|
||||||
|
'$outstanding',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ class SelfUpdateController extends BaseController
|
|||||||
try {
|
try {
|
||||||
$res = $repo->pull();
|
$res = $repo->pull();
|
||||||
} catch (GitException $e) {
|
} catch (GitException $e) {
|
||||||
info($e->getMessage());
|
|
||||||
|
|
||||||
|
info($e->getMessage());
|
||||||
return response()->json(['message'=>$e->getMessage()], 500);
|
return response()->json(['message'=>$e->getMessage()], 500);
|
||||||
}
|
}
|
||||||
info('Are there any changes to pull? '.$repo->hasChanges());
|
info('Are there any changes to pull? '.$repo->hasChanges());
|
||||||
|
@ -51,6 +51,10 @@ class StoreDesignRequest extends Request
|
|||||||
$input['design']['includes'] = '';
|
$input['design']['includes'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! array_key_exists('footer', $input['design']) || is_null($input['design']['footer'])) {
|
||||||
|
$input['design']['footer'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ namespace App\Http\Requests\Design;
|
|||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Models\Design;
|
use App\Models\Design;
|
||||||
use App\Utils\Traits\ChecksEntityStatus;
|
use App\Utils\Traits\ChecksEntityStatus;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class UpdateDesignRequest extends Request
|
class UpdateDesignRequest extends Request
|
||||||
{
|
{
|
||||||
@ -47,6 +46,14 @@ class UpdateDesignRequest extends Request
|
|||||||
$input['design']['task'] = '';
|
$input['design']['task'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! array_key_exists('includes', $input['design']) || is_null($input['design']['includes'])) {
|
||||||
|
$input['design']['includes'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! array_key_exists('footer', $input['design']) || is_null($input['design']['footer'])) {
|
||||||
|
$input['design']['footer'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,11 @@ class RecurringInvoicesCron
|
|||||||
|
|
||||||
if (! config('ninja.db.multi_db_enabled')) {
|
if (! config('ninja.db.multi_db_enabled')) {
|
||||||
|
|
||||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())->cursor();
|
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())
|
||||||
|
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||||
|
->cursor();
|
||||||
|
|
||||||
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db);
|
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count());
|
||||||
|
|
||||||
$recurring_invoices->each(function ($recurring_invoice, $key) {
|
$recurring_invoices->each(function ($recurring_invoice, $key) {
|
||||||
|
|
||||||
@ -62,7 +64,9 @@ class RecurringInvoicesCron
|
|||||||
|
|
||||||
MultiDB::setDB($db);
|
MultiDB::setDB($db);
|
||||||
|
|
||||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())->cursor();
|
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())
|
||||||
|
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||||
|
->cursor();
|
||||||
|
|
||||||
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db);
|
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db);
|
||||||
|
|
||||||
|
@ -53,4 +53,32 @@ class Gateway extends StaticModel
|
|||||||
{
|
{
|
||||||
return in_array($this->id, [62, 67, 68]); //static table ids of the custom gateways
|
return in_array($this->id, [62, 67, 68]); //static table ids of the custom gateways
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHelp()
|
||||||
|
{
|
||||||
|
$link = '';
|
||||||
|
|
||||||
|
if ($this->id == 1) {
|
||||||
|
$link = 'http://reseller.authorize.net/application/?id=5560364';
|
||||||
|
} elseif ($this->id == 15) {
|
||||||
|
$link = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run';
|
||||||
|
} elseif ($this->id == 24) {
|
||||||
|
$link = 'https://www.2checkout.com/referral?r=2c37ac2298';
|
||||||
|
} elseif ($this->id == 35) {
|
||||||
|
$link = 'https://bitpay.com/dashboard/signup';
|
||||||
|
} elseif ($this->id == 18) {
|
||||||
|
$link = 'https://applications.sagepay.com/apply/2C02C252-0F8A-1B84-E10D-CF933EFCAA99';
|
||||||
|
} elseif ($this->id == 20) {
|
||||||
|
$link = 'https://dashboard.stripe.com/account/apikeys';
|
||||||
|
}
|
||||||
|
|
||||||
|
$key = 'texts.gateway_help_'.$this->id;
|
||||||
|
$str = trans($key, [
|
||||||
|
'link' => "<a href='$link' >Click here</a>",
|
||||||
|
'complete_link' => url('/complete'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $key != $str ? $str : '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -372,8 +372,6 @@ class RecurringInvoice extends BaseModel
|
|||||||
|
|
||||||
/* Return early if nothing to send back! */
|
/* Return early if nothing to send back! */
|
||||||
if( $this->status_id == self::STATUS_COMPLETED ||
|
if( $this->status_id == self::STATUS_COMPLETED ||
|
||||||
$this->status_id == self::STATUS_DRAFT ||
|
|
||||||
$this->status_id == self::STATUS_PAUSED ||
|
|
||||||
$this->remaining_cycles == 0 ||
|
$this->remaining_cycles == 0 ||
|
||||||
!$this->next_send_date) {
|
!$this->next_send_date) {
|
||||||
|
|
||||||
|
@ -105,6 +105,9 @@ class UserRepository extends BaseRepository
|
|||||||
|
|
||||||
public function destroy(array $data, User $user)
|
public function destroy(array $data, User $user)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
info("destroy user");
|
||||||
|
|
||||||
if (array_key_exists('company_user', $data)) {
|
if (array_key_exists('company_user', $data)) {
|
||||||
$this->forced_includes = 'company_users';
|
$this->forced_includes = 'company_users';
|
||||||
|
|
||||||
@ -118,10 +121,10 @@ class UserRepository extends BaseRepository
|
|||||||
$cu->forceDelete();
|
$cu->forceDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->delete();
|
|
||||||
|
|
||||||
event(new UserWasDeleted($user, $company, Ninja::eventVars()));
|
event(new UserWasDeleted($user, $company, Ninja::eventVars()));
|
||||||
|
|
||||||
|
$user->delete();
|
||||||
|
|
||||||
return $user->fresh();
|
return $user->fresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +133,9 @@ class UserRepository extends BaseRepository
|
|||||||
*/
|
*/
|
||||||
public function delete($user)
|
public function delete($user)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
info("delete user");
|
||||||
|
|
||||||
$company = auth()->user()->company();
|
$company = auth()->user()->company();
|
||||||
|
|
||||||
$cu = CompanyUser::whereUserId($user->id)
|
$cu = CompanyUser::whereUserId($user->id)
|
||||||
@ -141,11 +147,12 @@ class UserRepository extends BaseRepository
|
|||||||
$cu->delete();
|
$cu->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event(new UserWasDeleted($user, $company, Ninja::eventVars()));
|
||||||
|
|
||||||
$user->is_deleted = true;
|
$user->is_deleted = true;
|
||||||
$user->save();
|
$user->save();
|
||||||
$user->delete();
|
$user->delete();
|
||||||
|
|
||||||
event(new UserWasDeleted($user, $company, Ninja::eventVars()));
|
|
||||||
|
|
||||||
return $user->fresh();
|
return $user->fresh();
|
||||||
}
|
}
|
||||||
|
@ -237,6 +237,7 @@ class HtmlEngine
|
|||||||
$data['$client.email'] = &$data['$email'];
|
$data['$client.email'] = &$data['$email'];
|
||||||
|
|
||||||
$data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
$data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
|
$data['$outstanding'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
$data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
$data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
|
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
|
||||||
|
|
||||||
|
@ -314,6 +314,8 @@ trait MakesInvoiceValues
|
|||||||
$data['$client_name'] = ['value' => $this->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
$data['$client_name'] = ['value' => $this->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||||
$data['$client.name'] = &$data['$client_name'];
|
$data['$client.name'] = &$data['$client_name'];
|
||||||
$data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
$data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
|
$data['$outstanding'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
|
|
||||||
$data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
$data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')];
|
||||||
|
|
||||||
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
|
$data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Gateway;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class UpdateGatewayTableVisibleColumn extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Gateway::query()->update(['visible' => 0]);
|
||||||
|
|
||||||
|
Gateway::whereIn('id', [1,15,20,39])->update(['visible' => 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user