diff --git a/VERSION.txt b/VERSION.txt index ec9ff787c070..b48289f67fcd 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.119 \ No newline at end of file +5.5.120 \ No newline at end of file diff --git a/app/Http/Controllers/TaskStatusController.php b/app/Http/Controllers/TaskStatusController.php index 01f6756a3970..4dc1e3f11f37 100644 --- a/app/Http/Controllers/TaskStatusController.php +++ b/app/Http/Controllers/TaskStatusController.php @@ -124,15 +124,16 @@ class TaskStatusController extends BaseController */ public function update(UpdateTaskStatusRequest $request, TaskStatus $task_status) { - + $task_status->fill($request->all()); $reorder = $task_status->isDirty('status_order'); $task_status->save(); - + if ($reorder) $this->task_status_repo->reorder($task_status); return $this->itemResponse($task_status->fresh()); + } /** diff --git a/app/Jobs/Product/UpdateOrCreateProduct.php b/app/Jobs/Product/UpdateOrCreateProduct.php index dd3ad2ab5633..7405ed4ee1c6 100644 --- a/app/Jobs/Product/UpdateOrCreateProduct.php +++ b/app/Jobs/Product/UpdateOrCreateProduct.php @@ -106,12 +106,12 @@ class UpdateOrCreateProduct implements ShouldQueue $product->quantity = isset($item->quantity) ? $item->quantity : 0; } - $product->tax_name1 = isset($item->tax_name1) ? $item->tax_name1 : ''; - $product->tax_rate1 = isset($item->tax_rate1) ? $item->tax_rate1 : 0; - $product->tax_name2 = isset($item->tax_name2) ? $item->tax_name2 : ''; - $product->tax_rate2 = isset($item->tax_rate2) ? $item->tax_rate2 : 0; - $product->tax_name3 = isset($item->tax_name3) ? $item->tax_name3 : ''; - $product->tax_rate3 = isset($item->tax_rate3) ? $item->tax_rate3 : 0; + // $product->tax_name1 = isset($item->tax_name1) ? $item->tax_name1 : ''; + // $product->tax_rate1 = isset($item->tax_rate1) ? $item->tax_rate1 : 0; + // $product->tax_name2 = isset($item->tax_name2) ? $item->tax_name2 : ''; + // $product->tax_rate2 = isset($item->tax_rate2) ? $item->tax_rate2 : 0; + // $product->tax_name3 = isset($item->tax_name3) ? $item->tax_name3 : ''; + // $product->tax_rate3 = isset($item->tax_rate3) ? $item->tax_rate3 : 0; if (isset($item->custom_value1) && strlen($item->custom_value1) >=1) { $product->custom_value1 = $item->custom_value1; diff --git a/app/PaymentDrivers/PaytracePaymentDriver.php b/app/PaymentDrivers/PaytracePaymentDriver.php index 33196ee1d32e..5f33ea843e3a 100644 --- a/app/PaymentDrivers/PaytracePaymentDriver.php +++ b/app/PaymentDrivers/PaytracePaymentDriver.php @@ -11,18 +11,19 @@ namespace App\PaymentDrivers; -use App\Exceptions\SystemError; -use App\Http\Requests\Payments\PaymentWebhookRequest; -use App\Jobs\Util\SystemLogger; -use App\Models\ClientGatewayToken; -use App\Models\GatewayType; +use App\Models\Invoice; use App\Models\Payment; +use App\Utils\CurlUtils; +use App\Models\SystemLog; +use App\Models\GatewayType; use App\Models\PaymentHash; use App\Models\PaymentType; -use App\Models\SystemLog; -use App\PaymentDrivers\PayTrace\CreditCard; -use App\Utils\CurlUtils; +use App\Exceptions\SystemError; +use App\Jobs\Util\SystemLogger; use App\Utils\Traits\MakesHash; +use App\Models\ClientGatewayToken; +use App\PaymentDrivers\PayTrace\CreditCard; +use App\Http\Requests\Payments\PaymentWebhookRequest; class PaytracePaymentDriver extends BaseDriver { @@ -125,10 +126,20 @@ class PaytracePaymentDriver extends BaseDriver { $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total; + $_invoice = collect($payment_hash->data->invoices)->first(); + $invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id)); + + if ($invoice) { + $invoice_id = ctrans('texts.invoice_number').'# '.$invoice->number; + } + + $invoice_id = ctrans('texts.invoice_number').'# '.substr($payment_hash->hash, 0, 6); + $data = [ 'customer_id' => $cgt->token, 'integrator_id' => $this->company_gateway->getConfigField('integratorId'), 'amount' => $amount, + 'invoice_id' => $invoice_id, ]; $response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data); @@ -173,7 +184,10 @@ class PaytracePaymentDriver extends BaseDriver /*Helpers*/ private function generateAuthHeaders() { - $url = 'https://api.paytrace.com/oauth/token'; + $api_endpoint = $this->company_gateway->getConfigField('testMode') ? 'https://api.sandbox.paytrace.com' : 'https://api.paytrace.com'; + + $url = "{$api_endpoint}/oauth/token"; + $data = [ 'grant_type' => 'password', 'username' => $this->company_gateway->getConfigField('username'), @@ -197,9 +211,12 @@ class PaytracePaymentDriver extends BaseDriver public function getAuthToken() { + + $api_endpoint = $this->company_gateway->getConfigField('testMode') ? 'https://api.sandbox.paytrace.com' : 'https://api.paytrace.com'; + $headers = $this->generateAuthHeaders(); - $response = CurlUtils::post('https://api.paytrace.com/v1/payment_fields/token/create', [], $headers); + $response = CurlUtils::post("{$api_endpoint}/v1/payment_fields/token/create", [], $headers); $response = json_decode($response); @@ -212,7 +229,10 @@ class PaytracePaymentDriver extends BaseDriver public function gatewayRequest($uri, $data, $headers = false) { - $base_url = "https://api.paytrace.com{$uri}"; + + $api_endpoint = $this->company_gateway->getConfigField('testMode') ? 'https://api.sandbox.paytrace.com' : 'https://api.paytrace.com'; + + $base_url = "{$api_endpoint}{$uri}"; $headers = $this->generateAuthHeaders(); diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index e5cbc4b895c4..70c2f009730a 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -617,7 +617,7 @@ class StripePaymentDriver extends BaseDriver 'amount' => $this->convertToStripeAmount($amount, $this->client->currency()->precision, $this->client->currency()), ], $meta); - if ($response->status == $response::STATUS_SUCCEEDED) { + if (in_array($response->status, [$response::STATUS_SUCCEEDED, 'pending'])) { SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all()], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->client, $this->client->company); return [ @@ -712,6 +712,11 @@ class StripePaymentDriver extends BaseDriver } if ($payment) { + + if(isset($transaction['payment_method_details']['au_becs_debit'])) { + $payment->transaction_reference = $transaction['id']; + } + $payment->status_id = Payment::STATUS_COMPLETED; $payment->save(); } diff --git a/app/Repositories/TaskStatusRepository.php b/app/Repositories/TaskStatusRepository.php index 0ff8904d0c79..4cadccd4d645 100644 --- a/app/Repositories/TaskStatusRepository.php +++ b/app/Repositories/TaskStatusRepository.php @@ -45,8 +45,8 @@ class TaskStatusRepository extends BaseRepository $new_status = $task_status ? $task_status->id : null; Task::where('status_id', $task_status->id) - ->where('company_id', $task_status->company_id) - ->update(['status_id' => $new_status]); + ->where('company_id', $task_status->company_id) + ->update(['status_id' => $new_status]); parent::archive($task_status); @@ -57,14 +57,30 @@ class TaskStatusRepository extends BaseRepository public function reorder(TaskStatus $task_status) { - TaskStatus::query() - ->where('company_id', $task_status->company_id) - ->orderByRaw('ISNULL(status_order), status_order ASC') - ->orderBy('updated_at', 'DESC') - ->cursor() - ->each(function ($task_status, $index) { - $task_status->update(['status_order' => $index+1]); - }); + TaskStatus::where('company_id', $task_status->company_id) + ->where('id', '!=', $task_status->id) + ->orderByRaw('ISNULL(status_order), status_order ASC') + ->cursor() + ->each(function ($ts, $key) use($task_status){ + + if($ts->status_order < $task_status->status_order) { + $ts->status_order--; + $ts->save(); + } elseif($ts->status_order >= $task_status->status_order) { + $ts->status_order ++; + $ts->save(); + } + + }); + + + TaskStatus::where('company_id', $task_status->company_id) + ->orderByRaw('ISNULL(status_order), status_order ASC') + ->cursor() + ->each(function ($ts, $key) { + $ts->status_order = $key+1; + $ts->save(); + }); } } diff --git a/app/Services/Email/EmailDefaults.php b/app/Services/Email/EmailDefaults.php index 79f1612915bf..47d80f5702b0 100644 --- a/app/Services/Email/EmailDefaults.php +++ b/app/Services/Email/EmailDefaults.php @@ -168,14 +168,10 @@ class EmailDefaults */ private function setBody(): self { - if ($this->template == 'email.template.custom') { - $this->email->email_object->body = (str_replace('$body', $this->email->email_object->body, $this->email->email_object->settings->email_style_custom)); - return $this; - } - - if ($this->email->email_object->body) { + + if (strlen($this->email->email_object->body) > 3) { // A Custom Message has been set in the email screen. - return $this; + // return $this; } elseif (strlen($this->email->email_object->settings?->{$this->email->email_object->email_template_body}) > 3) { // A body has been saved in the settings. $this->email->email_object->body = $this->email->email_object->settings?->{$this->email->email_object->email_template_body}; @@ -183,7 +179,13 @@ class EmailDefaults // Default template to be used $this->email->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_body, $this->locale); } + + if ($this->template == 'email.template.custom') { + $this->email->email_object->body = (str_replace('$body', $this->email->email_object->body, str_replace(["\r","\n"], "", $this->email->email_object->settings->email_style_custom))); + } + return $this; + } /** diff --git a/app/Transformers/RecurringInvoiceTransformer.php b/app/Transformers/RecurringInvoiceTransformer.php index 5addf17b6aab..b692ff838fdd 100644 --- a/app/Transformers/RecurringInvoiceTransformer.php +++ b/app/Transformers/RecurringInvoiceTransformer.php @@ -91,6 +91,7 @@ class RecurringInvoiceTransformer extends EntityTransformer 'date' => $invoice->date ?: '', 'last_sent_date' => $invoice->last_sent_date ?: '', 'next_send_date' => $invoice->next_send_date_client ?: '', + 'next_send_datetime' => $invoice->next_send_date ?: '', 'due_date' => $invoice->due_date ?: '', 'terms' => $invoice->terms ?: '', 'public_notes' => $invoice->public_notes ?: '', diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 17c613482d44..c9524bfe01a3 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -114,7 +114,8 @@ class HtmlEngine $data['$company_logo_size'] = ['value' => $this->resolveCompanyLogoSize(), 'label' => '']; $data['$show_shipping_address'] = ['value' => $this->settings?->show_shipping_address ? 'flex' : 'none', 'label' => '']; $data['$show_shipping_address_block'] = ['value' => $this->settings?->show_shipping_address ? 'block' : 'none', 'label' => '']; - $data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 'visible' : 'hidden', 'label' => '']; + // $data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 'visible' : 'hidden', 'label' => '']; + $data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 1 : 0, 'label' => '']; $data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')]; $data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => '']; diff --git a/app/Utils/Traits/CleanLineItems.php b/app/Utils/Traits/CleanLineItems.php index 19938c0dce0b..8c6a79b85478 100644 --- a/app/Utils/Traits/CleanLineItems.php +++ b/app/Utils/Traits/CleanLineItems.php @@ -76,7 +76,7 @@ trait CleanLineItems } - if (array_key_exists('id', $item)) { + if (array_key_exists('id', $item) || array_key_exists('_id', $item)) { unset($item['id']); } diff --git a/config/ninja.php b/config/ninja.php index c0a09c9c87d9..f532428b0202 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.119', - 'app_tag' => '5.5.119', + 'app_version' => '5.5.120', + 'app_tag' => '5.5.120', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/database/migrations/2023_05_15_103212_e_invoice_ssl_storage.php b/database/migrations/2023_05_15_103212_e_invoice_ssl_storage.php index 5f13774326e0..59b2740c4f50 100644 --- a/database/migrations/2023_05_15_103212_e_invoice_ssl_storage.php +++ b/database/migrations/2023_05_15_103212_e_invoice_ssl_storage.php @@ -20,6 +20,8 @@ return new class extends Migration $table->text('origin_tax_data')->nullable(); }); + \Illuminate\Support\Facades\Artisan::call('ninja:design-update'); + } /** diff --git a/public/js/clients/payments/paytrace-credit-card.js b/public/js/clients/payments/paytrace-credit-card.js index 7ca72b202f4c..4609fc16ba0c 100644 --- a/public/js/clients/payments/paytrace-credit-card.js +++ b/public/js/clients/payments/paytrace-credit-card.js @@ -28,46 +28,82 @@ var PayTraceCreditCard = /*#__PURE__*/function () { key: "creditCardStyles", get: function get() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '100%' + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dotted', + 'font_size': '13pt', + 'input_border_radius': '3px', + 'input_border_width': '1px', + 'input_font': 'Times New Roman, arial, fantasy', + 'input_font_weight': '400', + 'input_margin': '5px 0px 5px 0px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'Times New Roman, sans-serif, serif', + 'label_font_weight': 'light', + 'label_margin': '5px 0px 0px 0px', + 'label_padding': '0px 5px 0px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '370px', + 'padding_bottom': '0px' }; } }, { key: "codeStyles", get: function get() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '300px' + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dotted', + 'font_size': '13pt', + 'input_border_radius': '2px', + 'input_border_width': '1px', + 'input_font': 'serif, cursive, fantasy', + 'input_font_weight': '700', + 'input_margin': '5px 0px 5px 20px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'sans-serif, arial, serif', + 'label_font_weight': 'bold', + 'label_margin': '5px 0px 0px 20px', + 'label_padding': '2px 5px 2px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '150px', + 'padding_bottom': '2px' }; } }, { key: "expStyles", get: function get() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '85px', - type: 'dropdown' + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dashed', + 'font_size': '12pt', + 'input_border_radius': '0px', + 'input_border_width': '2px', + 'input_font': 'arial, cursive, fantasy', + 'input_font_weight': '400', + 'input_margin': '5px 0px 5px 0px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'arial, fantasy, serif', + 'label_font_weight': 'normal', + 'label_margin': '5px 0px 0px 0px', + 'label_padding': '2px 5px 2px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '85px', + 'padding_bottom': '2px', + 'type': 'dropdown' }; } }, { diff --git a/public/js/clients/shared/pdf.js b/public/js/clients/shared/pdf.js index fbf628b2323f..117fb2d34942 100644 --- a/public/js/clients/shared/pdf.js +++ b/public/js/clients/shared/pdf.js @@ -29,10 +29,10 @@ var PDF = /*#__PURE__*/function () { this.context = canvas.getContext('2d'); this.currentPage = 1; this.maxPages = 1; - this.currentScale = 1.25; + this.currentScale = 1; this.currentScaleText = document.getElementById('zoom-level'); if (matchMedia('only screen and (max-width: 480px)').matches) { - this.currentScale = 1.25; + this.currentScale = 1; } this.currentScaleText.textContent = this.currentScale * 100 + '%'; } @@ -135,6 +135,24 @@ var PDF = /*#__PURE__*/function () { viewport: viewport }); this.setPagesInViewport(); + + /* document.addEventListener("webviewerloaded", function () { + PDFViewerApplication.initializedPromise.then(function () { + PDFViewerApplication.eventBus.on("pagerendered", function handler(event) { + try { + if (window.chrome && !/Edge/.test(navigator.userAgent) && !event.source.__rerendered) { + console.log("Chrome-like browser detected, re-rendering page %d for the first time.", event.pageNumber); + var currentScale = event.source.scale; + event.source.__rerendered = true; + event.source.update(currentScale * 0.99); + event.source.update(currentScale); + } + } catch (e) { + console.error(e); + } + }); + }); + }); */ case 14: case "end": return _context.stop(); diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 795e4ebed0e4..46c313e24b3f 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -19,14 +19,14 @@ "/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=b483e14d15000c04edfe4c9c80fb97c9", "/js/setup/setup.js": "/js/setup/setup.js?id=086b9e114b0b9ee01f909d686f489162", "/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=cf50b5ba1fcd1d184bf0c10d710672c8", - "/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=40f4f82b01d751c284337279b92b9297", + "/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=c9593b44d66f89874d13f99bc3e6ff33", "/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=bc6756a5ef373ffab30373a6b689d5d4", "/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=a9c53bbbced7b1f09cae117f667638cf", "/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=e0020a4104a2d88c21e47ec6679de7ef", "/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=881f15cb83dc9d0412625da80f094912", "/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=b8b588f18e7c692faa44b598f3f1bde0", "/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=e984eca06a662d2e8a8e01cae085794c", - "/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=5ff9cc69d2923a89c05412bff3a8c862", + "/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=800e95b9c19d54e844338d619e87c9dc", "/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=2f72b969507e6135b5c52a65522ab3ae", "/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=0d1c8957b02c5601b7d57c39740bff75", "/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=2f8e5af9ba5ce266d2ee49b084fbe291", diff --git a/resources/js/clients/payments/paytrace-credit-card.js b/resources/js/clients/payments/paytrace-credit-card.js index ba49c834e975..cce2ada0386a 100644 --- a/resources/js/clients/payments/paytrace-credit-card.js +++ b/resources/js/clients/payments/paytrace-credit-card.js @@ -17,44 +17,80 @@ class PayTraceCreditCard { get creditCardStyles() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '100%', + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dotted', + 'font_size': '13pt', + 'input_border_radius': '3px', + 'input_border_width': '1px', + 'input_font': 'Times New Roman, arial, fantasy', + 'input_font_weight': '400', + 'input_margin': '5px 0px 5px 0px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'Times New Roman, sans-serif, serif', + 'label_font_weight': 'light', + 'label_margin': '5px 0px 0px 0px', + 'label_padding': '0px 5px 0px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '370px', + 'padding_bottom': '0px' }; } get codeStyles() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '300px', + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dotted', + 'font_size': '13pt', + 'input_border_radius': '2px', + 'input_border_width': '1px', + 'input_font': 'serif, cursive, fantasy', + 'input_font_weight': '700', + 'input_margin': '5px 0px 5px 20px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'sans-serif, arial, serif', + 'label_font_weight': 'bold', + 'label_margin': '5px 0px 0px 20px', + 'label_padding': '2px 5px 2px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '150px', + 'padding_bottom': '2px' }; } get expStyles() { return { - font_color: '#111827', - border_color: 'rgba(210,214,220,1)', - label_color: '#111827', - label_size: '12pt', - background_color: 'white', - border_style: 'solid', - font_size: '15pt', - height: '30px', - width: '85px', - type: 'dropdown', + 'font_color': '#000', + 'border_color': '#a1b1c9', + 'border_style': 'dashed', + 'font_size': '12pt', + 'input_border_radius': '0px', + 'input_border_width': '2px', + 'input_font': 'arial, cursive, fantasy', + 'input_font_weight': '400', + 'input_margin': '5px 0px 5px 0px', + 'input_padding': '0px 5px 0px 5px', + 'label_color': '#a0aec0', + 'label_size': '16px', + 'label_width': '150px', + 'label_font': 'arial, fantasy, serif', + 'label_font_weight': 'normal', + 'label_margin': '5px 0px 0px 0px', + 'label_padding': '2px 5px 2px 5px', + 'background_color': 'white', + 'height': '30px', + 'width': '85px', + 'padding_bottom': '2px', + 'type': 'dropdown' }; } diff --git a/resources/js/clients/shared/pdf.js b/resources/js/clients/shared/pdf.js index a3b2ed4e9bea..0e9ebc998101 100644 --- a/resources/js/clients/shared/pdf.js +++ b/resources/js/clients/shared/pdf.js @@ -15,11 +15,11 @@ class PDF { this.context = canvas.getContext('2d'); this.currentPage = 1; this.maxPages = 1; - this.currentScale = 1.25; + this.currentScale = 1; this.currentScaleText = document.getElementById('zoom-level'); if (matchMedia('only screen and (max-width: 480px)').matches) { - this.currentScale = 1.25; + this.currentScale = 1; } this.currentScaleText.textContent = this.currentScale * 100 + '%'; @@ -131,6 +131,24 @@ class PDF { }); this.setPagesInViewport(); + + /* document.addEventListener("webviewerloaded", function () { + PDFViewerApplication.initializedPromise.then(function () { + PDFViewerApplication.eventBus.on("pagerendered", function handler(event) { + try { + if (window.chrome && !/Edge/.test(navigator.userAgent) && !event.source.__rerendered) { + console.log("Chrome-like browser detected, re-rendering page %d for the first time.", event.pageNumber); + var currentScale = event.source.scale; + event.source.__rerendered = true; + event.source.update(currentScale * 0.99); + event.source.update(currentScale); + } + } catch (e) { + console.error(e); + } + }); + }); + }); */ } } diff --git a/resources/views/pdf-designs/plain.html b/resources/views/pdf-designs/plain.html index b77804d85223..e07feea10af1 100644 --- a/resources/views/pdf-designs/plain.html +++ b/resources/views/pdf-designs/plain.html @@ -96,7 +96,7 @@ } #shipping-details { - visibility: $show_shipping_address_visibility; + opacity: $show_shipping_address_visibility; flex-direction: column; line-height: var(--line-height); white-space: nowrap; diff --git a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php index 9ef7d22ba57b..8c7ba1ce3ab7 100644 --- a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php +++ b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php @@ -1,5 +1,6 @@ @php - $mobile = stripos(request()->server('HTTP_USER_AGENT'), 'Android') || stripos(request()->server('HTTP_USER_AGENT'), 'iPhone') || stripos(request()->server('HTTP_USER_AGENT'), 'iPod') || stripos(request()->server('HTTP_USER_AGENT'), 'iPad'); + //$mobile = stripos(request()->server('HTTP_USER_AGENT'), 'Android') || stripos(request()->server('HTTP_USER_AGENT'), 'iPhone') || stripos(request()->server('HTTP_USER_AGENT'), 'iPod') || stripos(request()->server('HTTP_USER_AGENT'), 'iPad'); + $mobile = false; @endphp @push('head') diff --git a/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php b/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php index c84c6052171a..3a358432da9b 100644 --- a/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/paytrace/authorize.blade.php @@ -32,6 +32,10 @@ @endsection @section('gateway_footer') - + @if($gateway->company_gateway->getConfigField('testMode')) + + @else + + @endif @endsection diff --git a/resources/views/portal/ninja2020/gateways/paytrace/pay.blade.php b/resources/views/portal/ninja2020/gateways/paytrace/pay.blade.php index 6d2933188b07..4807c15827e2 100644 --- a/resources/views/portal/ninja2020/gateways/paytrace/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/paytrace/pay.blade.php @@ -59,6 +59,10 @@ @endsection @section('gateway_footer') + @if($gateway->company_gateway->getConfigField('testMode')) + + @else + @endif @endsection