diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 881c9eacc6..02a3bcb373 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -23,6 +23,7 @@ use App\Jobs\Util\SchedulerCheck; use App\Jobs\Util\SendFailedEmails; use App\Jobs\Util\UpdateExchangeRates; use App\Jobs\Util\VersionCheck; +use App\Models\Account; use App\Utils\Ninja; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; @@ -69,6 +70,10 @@ class Kernel extends ConsoleKernel $schedule->job(new SchedulerCheck)->daily()->withoutOverlapping(); + $schedule->call(function () { + Account::whereNotNull('id')->update(['is_scheduler_running' => true]); + })->everyFiveMinutes()->withoutOverlapping(); + /* Run hosted specific jobs */ if (Ninja::isHosted()) { diff --git a/app/Http/Controllers/ClientPortal/InvitationController.php b/app/Http/Controllers/ClientPortal/InvitationController.php index 39425b8650..bf72b36a0c 100644 --- a/app/Http/Controllers/ClientPortal/InvitationController.php +++ b/app/Http/Controllers/ClientPortal/InvitationController.php @@ -75,7 +75,10 @@ class InvitationController extends Controller $entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation'; - $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key]) + $invitation = $entity_obj::where('key', $invitation_key) + ->whereHas($entity, function ($query) { + $query->where('is_deleted',0); + }) ->with('contact.client') ->firstOrFail(); diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 8ae3eb21e6..710fdfa761 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -216,7 +216,7 @@ class PreviewController extends BaseController if(!$request->has('entity_id')) $entity_obj->service()->fillDefaults()->save(); - $entity_obj->load('client'); + $entity_obj->load('client.contacts','company'); App::forgetInstance('translator'); $t = app('translator'); @@ -345,7 +345,7 @@ class PreviewController extends BaseController $invoice->setRelation('invitations', $invitation); $invoice->setRelation('client', $client); $invoice->setRelation('company', auth()->user()->company()); - $invoice->load('client'); + $invoice->load('client.company'); // nlog(print_r($invoice->toArray(),1)); diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index 30b4adc32a..4b08ad38ca 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -52,7 +52,7 @@ class QueryLogging $timeEnd = microtime(true); $time = $timeEnd - $timeStart; - // nlog("Query count = {$count}"); + // info("Query count = {$count}"); if($count > 175){ nlog("Query count = {$count}"); diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index bfa4e000c9..bb7a511aa1 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -59,6 +59,8 @@ class CreateEntityPdf implements ShouldQueue public $entity_string = ''; + public $client; + /** * Create a new job instance. * @@ -69,15 +71,19 @@ class CreateEntityPdf implements ShouldQueue $this->invitation = $invitation; if ($invitation instanceof InvoiceInvitation) { + // $invitation->load('contact.client.company','invoice.client','invoice.user.account'); $this->entity = $invitation->invoice; $this->entity_string = 'invoice'; } elseif ($invitation instanceof QuoteInvitation) { + // $invitation->load('contact.client.company','quote.client','quote.user.account'); $this->entity = $invitation->quote; $this->entity_string = 'quote'; } elseif ($invitation instanceof CreditInvitation) { + // $invitation->load('contact.client.company','credit.client','credit.user.account'); $this->entity = $invitation->credit; $this->entity_string = 'credit'; } elseif ($invitation instanceof RecurringInvoiceInvitation) { + // $invitation->load('contact.client.company','recurring_invoice'); $this->entity = $invitation->recurring_invoice; $this->entity_string = 'recurring_invoice'; } @@ -86,6 +92,8 @@ class CreateEntityPdf implements ShouldQueue $this->contact = $invitation->contact; + $this->client = $invitation->contact->client; + $this->disk = Ninja::isHosted() ? config('filesystems.default') : $disk; } @@ -102,7 +110,7 @@ class CreateEntityPdf implements ShouldQueue App::setLocale($this->contact->preferredLocale()); /* Set customized translations _NOW_ */ - $t->replace(Ninja::transformTranslations($this->entity->client->getMergedSettings())); + $t->replace(Ninja::transformTranslations($this->client->getMergedSettings())); if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') { return (new Phantom)->generate($this->invitation); @@ -111,22 +119,22 @@ class CreateEntityPdf implements ShouldQueue $entity_design_id = ''; if ($this->entity instanceof Invoice) { - $path = $this->entity->client->invoice_filepath($this->invitation); + $path = $this->client->invoice_filepath($this->invitation); $entity_design_id = 'invoice_design_id'; } elseif ($this->entity instanceof Quote) { - $path = $this->entity->client->quote_filepath($this->invitation); + $path = $this->client->quote_filepath($this->invitation); $entity_design_id = 'quote_design_id'; } elseif ($this->entity instanceof Credit) { - $path = $this->entity->client->credit_filepath($this->invitation); + $path = $this->client->credit_filepath($this->invitation); $entity_design_id = 'credit_design_id'; } elseif ($this->entity instanceof RecurringInvoice) { - $path = $this->entity->client->recurring_invoice_filepath($this->invitation); + $path = $this->client->recurring_invoice_filepath($this->invitation); $entity_design_id = 'invoice_design_id'; } $file_path = $path.$this->entity->numberFormatter().'.pdf'; - $entity_design_id = $this->entity->design_id ? $this->entity->design_id : $this->decodePrimaryKey($this->entity->client->getSetting($entity_design_id)); + $entity_design_id = $this->entity->design_id ? $this->entity->design_id : $this->decodePrimaryKey($this->client->getSetting($entity_design_id)); // if(!$this->company->account->hasFeature(Account::FEATURE_DIFFERENT_DESIGNS)) // $entity_design_id = 2; @@ -152,18 +160,18 @@ class CreateEntityPdf implements ShouldQueue $state = [ 'template' => $template->elements([ - 'client' => $this->entity->client, + 'client' => $this->client, 'entity' => $this->entity, - 'pdf_variables' => (array) $this->entity->company->settings->pdf_variables, + 'pdf_variables' => (array) $this->company->settings->pdf_variables, '$product' => $design->design->product, 'variables' => $variables, ]), 'variables' => $variables, 'options' => [ - 'all_pages_header' => $this->entity->client->getSetting('all_pages_header'), - 'all_pages_footer' => $this->entity->client->getSetting('all_pages_footer'), + 'all_pages_header' => $this->client->getSetting('all_pages_header'), + 'all_pages_footer' => $this->client->getSetting('all_pages_footer'), ], - 'process_markdown' => $this->entity->client->company->markdown_enabled, + 'process_markdown' => $this->client->company->markdown_enabled, ]; $maker = new PdfMakerService($state); diff --git a/app/Jobs/Payment/EmailPayment.php b/app/Jobs/Payment/EmailPayment.php index 97d32bba5c..6fe7f9bb88 100644 --- a/app/Jobs/Payment/EmailPayment.php +++ b/app/Jobs/Payment/EmailPayment.php @@ -74,12 +74,15 @@ class EmailPayment implements ShouldQueue MultiDB::setDb($this->company->db); + $this->payment->load('invoices'); + $this->contact->load('client'); + $email_builder = (new PaymentEmailEngine($this->payment, $this->contact))->build(); $invitation = null; - if($this->payment->invoices()->exists()) - $invitation = $this->payment->invoices()->first()->invitations()->first(); + if($this->payment->invoices && $this->payment->invoices->count() >=1) + $invitation = $this->payment->invoices->first()->invitations()->first(); $nmo = new NinjaMailerObject; $nmo->mailable = new TemplateEmail($email_builder, $this->contact, $invitation); diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index d35e571775..f7ec841a1e 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -237,9 +237,12 @@ class Import implements ShouldQueue //company size check if ($this->company->invoices()->count() > 500 || $this->company->products()->count() > 500 || $this->company->clients()->count() > 500) { $this->company->is_large = true; - $this->company->save(); } + + $this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate(); + $this->company->save(); + $this->setInitialCompanyLedgerBalances(); // $this->fixClientBalances(); diff --git a/app/Jobs/Util/SchedulerCheck.php b/app/Jobs/Util/SchedulerCheck.php index 20c54ff470..409478ca01 100644 --- a/app/Jobs/Util/SchedulerCheck.php +++ b/app/Jobs/Util/SchedulerCheck.php @@ -38,8 +38,6 @@ class SchedulerCheck implements ShouldQueue { set_time_limit(0); - Account::whereNotNull('id')->update(['is_scheduler_running' => true]); - if(config('ninja.app_version') != base_path('VERSION.txt')) { diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index ed36c8ae32..7f4805e418 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -47,6 +47,7 @@ class PaymentEmailEngine extends BaseEmailEngine $this->company = $payment->company; $this->client = $payment->client; $this->contact = $contact ?: $this->client->primary_contact()->first(); + $this->contact->load('client.company'); $this->settings = $this->client->getMergedSettings(); $this->template_data = $template_data; $this->helpers = new Helpers(); diff --git a/app/Models/Activity.php b/app/Models/Activity.php index bf9e250f62..ca8f0e8ab4 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -119,6 +119,10 @@ class Activity extends StaticModel 'hashed_id', ]; + protected $with = [ + 'backup', + ]; + public function getHashedIdAttribute() { return $this->encodePrimaryKey($this->id); diff --git a/app/Models/Client.php b/app/Models/Client.php index dfbba29ed5..5b1216e117 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -84,12 +84,12 @@ class Client extends BaseModel implements HasLocalePreference ]; protected $with = [ - 'gateway_tokens', - 'documents', - 'contacts.company', + // 'gateway_tokens', + // 'documents', + // 'contacts.company', // 'currency', // 'primary_contact', - 'country', + // 'country', // 'contacts', // 'shipping_country', // 'company', diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index f125d8fc7e..7812ad52af 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -64,6 +64,10 @@ class Subscription extends BaseModel 'deleted_at' => 'timestamp', ]; + protected $with = [ + 'company', + ]; + public function service(): SubscriptionService { return new SubscriptionService($this); diff --git a/app/Observers/QuoteObserver.php b/app/Observers/QuoteObserver.php index 89c64a603e..6e32b7f4e2 100644 --- a/app/Observers/QuoteObserver.php +++ b/app/Observers/QuoteObserver.php @@ -30,9 +30,9 @@ class QuoteObserver ->where('event_id', Webhook::EVENT_CREATE_QUOTE) ->exists(); - $quote->load('client'); if ($subscriptions) { + $quote->load('client'); WebhookHandler::dispatch(Webhook::EVENT_CREATE_QUOTE, $quote, $quote->company); } } @@ -49,10 +49,10 @@ class QuoteObserver ->where('event_id', Webhook::EVENT_UPDATE_QUOTE) ->exists(); - $quote->load('client'); if ($subscriptions) { + $quote->load('client'); WebhookHandler::dispatch(Webhook::EVENT_UPDATE_QUOTE, $quote, $quote->company); } @@ -71,6 +71,7 @@ class QuoteObserver ->exists(); if ($subscriptions) { + $quote->load('client'); WebhookHandler::dispatch(Webhook::EVENT_DELETE_QUOTE, $quote, $quote->company); } } diff --git a/app/Repositories/ActivityRepository.php b/app/Repositories/ActivityRepository.php index 40b24d23e5..c2ed5748bb 100644 --- a/app/Repositories/ActivityRepository.php +++ b/app/Repositories/ActivityRepository.php @@ -70,13 +70,9 @@ class ActivityRepository extends BaseRepository */ public function createBackup($entity, $activity) { - - if($entity instanceof User){ - - } - else if ($entity->company->is_disabled) { + if ($entity instanceof User || $entity->company->is_disabled) return; - } + $backup = new Backup(); @@ -85,6 +81,7 @@ class ActivityRepository extends BaseRepository || get_class($entity) == Credit::class || get_class($entity) == RecurringInvoice::class ) { + $entity->load('company', 'client'); $contact = $entity->client->primary_contact()->first(); $backup->html_backup = $this->generateHtml($entity); $backup->amount = $entity->amount; @@ -92,7 +89,6 @@ class ActivityRepository extends BaseRepository $backup->activity_id = $activity->id; $backup->json_backup = ''; - //$backup->json_backup = $entity->toJson(); $backup->save(); } @@ -121,6 +117,8 @@ class ActivityRepository extends BaseRepository $entity_design_id = 'credit_design_id'; } + $entity->load('client','client.company'); + $entity_design_id = $entity->design_id ? $entity->design_id : $this->decodePrimaryKey($entity->client->getSetting($entity_design_id)); $design = Design::find($entity_design_id); diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index d91799a9a5..b4f3e43124 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -322,6 +322,8 @@ class InvoiceService public function deletePdf() { + $this->invoice->load('invitations'); + $this->invoice->invitations->each(function ($invitation){ Storage::disk(config('filesystems.default'))->delete($this->invoice->client->invoice_filepath($invitation) . $this->invoice->numberFormatter().'.pdf'); diff --git a/app/Services/Payment/SendEmail.php b/app/Services/Payment/SendEmail.php index 19702b6317..978a038df2 100644 --- a/app/Services/Payment/SendEmail.php +++ b/app/Services/Payment/SendEmail.php @@ -32,6 +32,8 @@ class SendEmail */ public function run() { + $this->payment->load('company', 'client.contacts'); + $this->payment->client->contacts->each(function ($contact) { if ($contact->email) { EmailPayment::dispatchNow($this->payment, $this->payment->company, $contact); diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 971f2635b9..9fcd7abf44 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -165,6 +165,7 @@ class CompanyTransformer extends EntityTransformer 'markdown_enabled' => (bool) $company->markdown_enabled, 'use_comma_as_decimal_place' => (bool) $company->use_comma_as_decimal_place, 'report_include_drafts' => (bool) $company->report_include_drafts, + 'client_registration_fields' => (array) $company->client_registration_fields, ]; } diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 953c5a3ccc..03d8ffc1a2 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -49,6 +49,7 @@ class HtmlEngine public function __construct($invitation) { $this->invitation = $invitation; + // $invitation->load('contact.client.company', 'company'); $this->entity_string = $this->resolveEntityString(); @@ -58,7 +59,9 @@ class HtmlEngine $this->contact = $invitation->contact; - $this->client = $this->entity->client; + $this->client = $invitation->contact->client; + $this->client->load('country','company'); + $this->entity->load('client'); $this->settings = $this->client->getMergedSettings(); @@ -113,19 +116,19 @@ class HtmlEngine $data['$total_tax_values'] = ['value' => $this->totalTaxValues(), 'label' => ctrans('texts.taxes')]; $data['$line_tax_labels'] = ['value' => $this->lineTaxLabels(), 'label' => ctrans('texts.taxes')]; $data['$line_tax_values'] = ['value' => $this->lineTaxValues(), 'label' => ctrans('texts.taxes')]; - $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.date')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.date')]; $data['$invoice.date'] = &$data['$date']; $data['$invoiceDate'] = &$data['$date']; - $data['$due_date'] = ['value' => $this->translateDate($this->entity->due_date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; + $data['$due_date'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; $data['$dueDate'] = &$data['$due_date']; - $data['$payment_due'] = ['value' => $this->translateDate($this->entity->due_date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.payment_due')]; + $data['$payment_due'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.payment_due')]; $data['$invoice.due_date'] = &$data['$due_date']; $data['$invoice.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; $data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')]; $data['$poNumber'] = &$data['$invoice.po_number']; - $data['$entity.datetime'] = ['value' => $this->formatDatetime($this->entity->created_at, $this->entity->client->date_format(), $this->entity->client->locale()), 'label' => ctrans('texts.date')]; + $data['$entity.datetime'] = ['value' => $this->formatDatetime($this->entity->created_at, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.date')]; $data['$invoice.datetime'] = &$data['$entity.datetime']; $data['$quote.datetime'] = &$data['$entity.datetime']; $data['$credit.datetime'] = &$data['$entity.datetime']; @@ -145,9 +148,9 @@ class HtmlEngine $data['$view_button'] = &$data['$view_link']; $data['$paymentButton'] = &$data['$payment_button']; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')]; - $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')]; - if($this->entity->project()->exists()) { + if($this->entity->project) { $data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')]; } } @@ -164,7 +167,7 @@ class HtmlEngine $data['$view_button'] = &$data['$view_link']; $data['$approveButton'] = ['value' => ''.ctrans('texts.view_quote').'', 'label' => ctrans('texts.approve')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_quote')]; - $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')]; } if ($this->entity_string == 'credit') { @@ -179,7 +182,7 @@ class HtmlEngine $data['$viewLink'] = &$data['$view_link']; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; // $data['$view_link'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; - $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')]; } $data['$portal_url'] = ['value' => $this->invitation->getPortalLink(), 'label' =>'']; @@ -200,7 +203,7 @@ class HtmlEngine if ($this->entity->partial > 0) { $data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')]; $data['$balance_due_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.partial_due')]; - $data['$due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; + $data['$due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; } else { @@ -233,7 +236,7 @@ class HtmlEngine $data['$credit.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.credit_number')]; $data['$credit.total'] = &$data['$credit.total']; $data['$credit.po_number'] = &$data['$invoice.po_number']; - $data['$credit.date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()), 'label' => ctrans('texts.credit_date')]; + $data['$credit.date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.credit_date')]; $data['$balance'] = ['value' => Number::formatMoney($this->entity_calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')]; $data['$credit.balance'] = &$data['$balance']; @@ -260,13 +263,13 @@ class HtmlEngine $data['$entity_issued_to'] = ['value' => '', 'label' => ctrans("texts.{$this->entity_string}_issued_to")]; $data['$your_entity'] = ['value' => '', 'label' => ctrans("texts.your_{$this->entity_string}")]; - $data['$quote.date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')]; + $data['$quote.date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')]; $data['$quote.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.quote_number')]; $data['$quote.po_number'] = &$data['$invoice.po_number']; $data['$quote.quote_number'] = &$data['$quote.number']; $data['$quote_no'] = &$data['$quote.number']; $data['$quote.quote_no'] = &$data['$quote.number']; - $data['$quote.valid_until'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->entity->client->locale()), 'label' => ctrans('texts.valid_until')]; + $data['$quote.valid_until'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.valid_until')]; $data['$valid_until'] = &$data['$quote.valid_until']; $data['$credit_amount'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_amount')]; $data['$credit_balance'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')]; @@ -461,6 +464,7 @@ class HtmlEngine /*Payment Aliases*/ $data['$paymentLink'] = &$data['$payment_link']; + $data['$payment_url'] = &$data['$payment_link']; $data['$portalButton'] = &$data['$paymentLink']; $data['$dir'] = ['value' => optional($this->client->language())->locale === 'ar' ? 'rtl' : 'ltr', 'label' => '']; diff --git a/resources/views/portal/ninja2020/auth/register.blade.php b/resources/views/portal/ninja2020/auth/register.blade.php index 7512c555a8..5bb5513b42 100644 --- a/resources/views/portal/ninja2020/auth/register.blade.php +++ b/resources/views/portal/ninja2020/auth/register.blade.php @@ -14,6 +14,7 @@ @csrf
+ @if($company->client_registration_fields) @foreach($company->client_registration_fields as $field) @if($field['required'])
@@ -96,6 +97,7 @@ @endif @endif @endforeach + @endif