diff --git a/app/Http/Controllers/SubdomainController.php b/app/Http/Controllers/SubdomainController.php index 7751eda00d..20334c32c1 100644 --- a/app/Http/Controllers/SubdomainController.php +++ b/app/Http/Controllers/SubdomainController.php @@ -28,6 +28,7 @@ class SubdomainController extends BaseController 'custom_domain', 'preview', 'invoiceninja', + 'cname', ]; public function __construct() diff --git a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php index bbd097d2aa..d2f4e09d28 100644 --- a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php +++ b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php @@ -107,6 +107,7 @@ class StoreRecurringInvoiceRequest extends Request } else { if ($client = Client::find($input['client_id'])) { $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) { - if ($auto_bill == 'always') { + if ($auto_bill == 'always' || $auto_bill == 'optout') { return true; } - - //if ($auto_bill == 'off' || $auto_bill == 'optin') { return false; - //} + } public function messages() diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 62835f4561..e4240b49ac 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -25,6 +25,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\App; class ReminderJob implements ShouldQueue { @@ -148,6 +149,10 @@ class ReminderJob implements ShouldQueue */ 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; if ($amount <= 0 && $percent <= 0) { diff --git a/app/Models/Company.php b/app/Models/Company.php index adabc07822..2d6e9badd8 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -94,6 +94,7 @@ class Company extends BaseModel 'invoice_task_datelog', 'default_password_timeout', 'show_task_end_date', + 'use_comma_as_decimal_place', ]; protected $hidden = [ diff --git a/app/PaymentDrivers/Sample/CreditCard.php b/app/PaymentDrivers/Sample/CreditCard.php index 44c404ae26..976ae402f2 100644 --- a/app/PaymentDrivers/Sample/CreditCard.php +++ b/app/PaymentDrivers/Sample/CreditCard.php @@ -10,7 +10,7 @@ * @license https://www.elastic.co/licensing/elastic-license */ -namespace App\PaymentDrivers\Eway; +namespace App\PaymentDrivers\Sample; use App\Exceptions\PaymentFailed; use App\Jobs\Mail\PaymentFailureMailer; diff --git a/app/PaymentDrivers/Sample/PaymentDriver.php b/app/PaymentDrivers/Sample/PaymentDriver.php index 401ceec3ae..71cbb77e54 100644 --- a/app/PaymentDrivers/Sample/PaymentDriver.php +++ b/app/PaymentDrivers/Sample/PaymentDriver.php @@ -9,7 +9,7 @@ * @license https://www.elastic.co/licensing/elastic-license */ -namespace App\PaymentDrivers; +namespace App\PaymentDrivers\Sample; use App\Http\Requests\Payments\PaymentWebhookRequest; use App\Models\ClientGatewayToken; diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 79bb8ceda2..daf1f80294 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -160,6 +160,7 @@ class CompanyTransformer extends EntityTransformer 'invoice_task_datelog' => (bool) $company->invoice_task_datelog, 'show_task_end_date' => (bool) $company->show_task_end_date, 'markdown_enabled' => (bool) $company->markdown_enabled, + 'use_comma_as_decimal_place' => (bool) $company->use_comma_as_decimal_place, ]; } diff --git a/database/migrations/2021_08_18_220124_use_comma_as_decimal_place_companies_table.php b/database/migrations/2021_08_18_220124_use_comma_as_decimal_place_companies_table.php new file mode 100644 index 0000000000..d5330bea29 --- /dev/null +++ b/database/migrations/2021_08_18_220124_use_comma_as_decimal_place_companies_table.php @@ -0,0 +1,32 @@ +boolean('use_comma_as_decimal_place')->default(0); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}