Merge pull request #6490 from turbo124/v5-develop

Minor fixes for namespaces
This commit is contained in:
David Bomba 2021-08-19 08:36:40 +10:00 committed by GitHub
commit 59c9287ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 6 deletions

View File

@ -28,6 +28,7 @@ class SubdomainController extends BaseController
'custom_domain', 'custom_domain',
'preview', 'preview',
'invoiceninja', 'invoiceninja',
'cname',
]; ];
public function __construct() public function __construct()

View File

@ -107,6 +107,7 @@ class StoreRecurringInvoiceRequest extends Request
} else { } else {
if ($client = Client::find($input['client_id'])) { if ($client = Client::find($input['client_id'])) {
$input['auto_bill'] = $client->getSetting('auto_bill'); $input['auto_bill'] = $client->getSetting('auto_bill');
$input['auto_bill_enabled'] = $this->setAutoBillFlag($input['auto_bill']);
} }
} }
@ -115,14 +116,12 @@ class StoreRecurringInvoiceRequest extends Request
private function setAutoBillFlag($auto_bill) private function setAutoBillFlag($auto_bill)
{ {
if ($auto_bill == 'always') { if ($auto_bill == 'always' || $auto_bill == 'optout') {
return true; return true;
} }
//if ($auto_bill == 'off' || $auto_bill == 'optin') {
return false; return false;
//}
} }
public function messages() public function messages()

View File

@ -25,6 +25,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\App;
class ReminderJob implements ShouldQueue class ReminderJob implements ShouldQueue
{ {
@ -148,6 +149,10 @@ class ReminderJob implements ShouldQueue
*/ */
private function setLateFee($invoice, $amount, $percent) :Invoice private function setLateFee($invoice, $amount, $percent) :Invoice
{ {
App::forgetInstance('translator');
$t = app('translator');
$t->replace(Ninja::transformTranslations($invoice->client->getMergedSettings()));
$temp_invoice_balance = $invoice->balance; $temp_invoice_balance = $invoice->balance;
if ($amount <= 0 && $percent <= 0) { if ($amount <= 0 && $percent <= 0) {

View File

@ -94,6 +94,7 @@ class Company extends BaseModel
'invoice_task_datelog', 'invoice_task_datelog',
'default_password_timeout', 'default_password_timeout',
'show_task_end_date', 'show_task_end_date',
'use_comma_as_decimal_place',
]; ];
protected $hidden = [ protected $hidden = [

View File

@ -10,7 +10,7 @@
* @license https://www.elastic.co/licensing/elastic-license * @license https://www.elastic.co/licensing/elastic-license
*/ */
namespace App\PaymentDrivers\Eway; namespace App\PaymentDrivers\Sample;
use App\Exceptions\PaymentFailed; use App\Exceptions\PaymentFailed;
use App\Jobs\Mail\PaymentFailureMailer; use App\Jobs\Mail\PaymentFailureMailer;

View File

@ -9,7 +9,7 @@
* @license https://www.elastic.co/licensing/elastic-license * @license https://www.elastic.co/licensing/elastic-license
*/ */
namespace App\PaymentDrivers; namespace App\PaymentDrivers\Sample;
use App\Http\Requests\Payments\PaymentWebhookRequest; use App\Http\Requests\Payments\PaymentWebhookRequest;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;

View File

@ -160,6 +160,7 @@ class CompanyTransformer extends EntityTransformer
'invoice_task_datelog' => (bool) $company->invoice_task_datelog, 'invoice_task_datelog' => (bool) $company->invoice_task_datelog,
'show_task_end_date' => (bool) $company->show_task_end_date, 'show_task_end_date' => (bool) $company->show_task_end_date,
'markdown_enabled' => (bool) $company->markdown_enabled, 'markdown_enabled' => (bool) $company->markdown_enabled,
'use_comma_as_decimal_place' => (bool) $company->use_comma_as_decimal_place,
]; ];
} }

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UseCommaAsDecimalPlaceCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('companies', function (Blueprint $table) {
$table->boolean('use_comma_as_decimal_place')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}