Merge pull request #8920 from turbo124/v5-develop

v5.7.37
This commit is contained in:
David Bomba 2023-10-30 09:07:26 +11:00 committed by GitHub
commit 795485a3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 35 deletions

View File

@ -1 +1 @@
5.7.36 5.7.37

View File

@ -1179,8 +1179,6 @@ class BaseController extends Controller
return 'main.next.dart.js'; return 'main.next.dart.js';
case 'profile': case 'profile':
return 'main.profile.dart.js'; return 'main.profile.dart.js';
case 'html':
return 'main.html.dart.js';
default: default:
return 'main.foss.dart.js'; return 'main.foss.dart.js';
} }

View File

@ -268,7 +268,7 @@ class PdfSlot extends Component
'line_total' => Number::formatMoney($item->line_total, $this->entity->client ?: $this->entity->vendor), 'line_total' => Number::formatMoney($item->line_total, $this->entity->client ?: $this->entity->vendor),
]; ];
}); });
return $product_items; return $product_items;
} }

View File

@ -1036,16 +1036,19 @@ class PdfBuilder
*/ */
public function getTableTotals() :array public function getTableTotals() :array
{ {
//need to see where we don't pass all these particular variables. try and refactor thisout //need to see where we don't pass all these particular variables. try and refactor thisout
$_variables = array_key_exists('variables', $this->service->options) // $_variables = array_key_exists('variables', $this->service->options)
? $this->service->options['variables'] // ? $this->service->options['variables']
: ['values' => ['$entity.public_notes' => $this->service->config->entity->public_notes, '$entity.terms' => $this->service->config->entity->terms, '$entity_footer' => $this->service->config->entity->footer], 'labels' => []]; // : ['values' => ['$entity.public_notes' => $this->service->config->entity->public_notes, '$entity.terms' => $this->service->config->entity->terms, '$entity_footer' => $this->service->config->entity->footer], 'labels' => []];
$_variables = $this->service->html_variables;
$variables = $this->service->config->pdf_variables['total_columns']; $variables = $this->service->config->pdf_variables['total_columns'];
$elements = [ $elements = [
['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [
['element' => 'p', 'content' => strtr(str_replace(["labels","values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], ['element' => 'p', 'content' => strtr(str_replace(["labels", "values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']],
['element' => 'p', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [ ['element' => 'p', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [
['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['hidden' => $this->entityVariableCheck('$entity.terms'), 'data-ref' => 'total_table-terms-label', 'style' => 'font-weight: bold; text-align: left; margin-top: 1rem;']], ['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['hidden' => $this->entityVariableCheck('$entity.terms'), 'data-ref' => 'total_table-terms-label', 'style' => 'font-weight: bold; text-align: left; margin-top: 1rem;']],
['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']], ['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']],

View File

@ -18,6 +18,7 @@ use Carbon\Carbon;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use stdClass; use stdClass;
//30-10-2023: due to HTML encoding, need to remove </ from string when searching for matches
class Helpers class Helpers
{ {
use MakesDates; use MakesDates;
@ -266,12 +267,12 @@ class Helpers
$_right = ''; $_right = '';
// If right side doesn't have any calculations, replace with raw ranges keyword. // If right side doesn't have any calculations, replace with raw ranges keyword.
if (! Str::contains($right, ['-', '+', '/', '*'])) { if (! Str::contains(str_replace("</", "", $right), ['-', '+', '/', '*'])) {
$_right = Carbon::createFromDate($currentDateTime->year, $currentDateTime->month)->translatedFormat('F Y'); $_right = Carbon::createFromDate($currentDateTime->year, $currentDateTime->month)->translatedFormat('F Y');
} }
// If right side contains one of math operations, calculate. // If right side contains one of math operations, calculate.
if (Str::contains($right, ['+'])) { if (Str::contains(str_replace("</", "", $right), ['+'])) {
$operation = preg_match_all('/(?!^-)[+*\/-](\s?-)?/', $right, $_matches); $operation = preg_match_all('/(?!^-)[+*\/-](\s?-)?/', $right, $_matches);
$_operation = array_shift($_matches)[0]; // + - $_operation = array_shift($_matches)[0]; // + -
@ -306,7 +307,7 @@ class Helpers
continue; continue;
} }
if (! Str::contains($match, ['-', '+', '/', '*'])) { if (! Str::contains(str_replace("</", "", $match), ['-', '+', '/', '*'])) {
$value = preg_replace( $value = preg_replace(
sprintf('/%s/', $matches->keys()->first()), sprintf('/%s/', $matches->keys()->first()),
$replacements['literal'][$matches->keys()->first()], $replacements['literal'][$matches->keys()->first()],
@ -315,7 +316,7 @@ class Helpers
); );
} }
if (Str::contains($match, ['-', '+', '/', '*'])) { if (Str::contains(str_replace("</", "", $match), ['-', '+', '/', '*'])) {
$operation = preg_match_all('/(?!^-)[+*\/-](\s?-)?/', $match, $_matches); $operation = preg_match_all('/(?!^-)[+*\/-](\s?-)?/', $match, $_matches);
$_operation = array_shift($_matches)[0]; $_operation = array_shift($_matches)[0];

36
composer.lock generated
View File

@ -60,16 +60,16 @@
}, },
{ {
"name": "apimatic/core", "name": "apimatic/core",
"version": "0.3.2", "version": "0.3.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/apimatic/core-lib-php.git", "url": "https://github.com/apimatic/core-lib-php.git",
"reference": "32238fb83ce9a3ebef38c726b497c0f218d6e6c9" "reference": "984123c831598fc31749d194aa044cd46f227d29"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/32238fb83ce9a3ebef38c726b497c0f218d6e6c9", "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/984123c831598fc31749d194aa044cd46f227d29",
"reference": "32238fb83ce9a3ebef38c726b497c0f218d6e6c9", "reference": "984123c831598fc31749d194aa044cd46f227d29",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -107,9 +107,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/apimatic/core-lib-php/issues", "issues": "https://github.com/apimatic/core-lib-php/issues",
"source": "https://github.com/apimatic/core-lib-php/tree/0.3.2" "source": "https://github.com/apimatic/core-lib-php/tree/0.3.3"
}, },
"time": "2023-07-11T09:30:32+00:00" "time": "2023-10-26T06:52:40+00:00"
}, },
{ {
"name": "apimatic/core-interfaces", "name": "apimatic/core-interfaces",
@ -485,16 +485,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.283.11", "version": "3.283.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "348b68edcc83062c329cf7540c4c92d061d27d9c" "reference": "853eecfb21e8d623fa1b32e597b0a75912e8a404"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/348b68edcc83062c329cf7540c4c92d061d27d9c", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/853eecfb21e8d623fa1b32e597b0a75912e8a404",
"reference": "348b68edcc83062c329cf7540c4c92d061d27d9c", "reference": "853eecfb21e8d623fa1b32e597b0a75912e8a404",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -574,9 +574,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.283.11" "source": "https://github.com/aws/aws-sdk-php/tree/3.283.13"
}, },
"time": "2023-10-24T18:10:38+00:00" "time": "2023-10-26T18:14:40+00:00"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -16363,16 +16363,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "10.4.1", "version": "10.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "62bd7af13d282deeb95650077d28ba3600ca321c" "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/62bd7af13d282deeb95650077d28ba3600ca321c", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1",
"reference": "62bd7af13d282deeb95650077d28ba3600ca321c", "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -16444,7 +16444,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.1" "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2"
}, },
"funding": [ "funding": [
{ {
@ -16460,7 +16460,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-08T05:01:11+00:00" "time": "2023-10-26T07:21:45+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

View File

@ -15,8 +15,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION','5.7.36'), 'app_version' => env('APP_VERSION','5.7.37'),
'app_tag' => env('APP_TAG','5.7.36'), 'app_tag' => env('APP_TAG','5.7.37'),
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),

View File

@ -156,7 +156,7 @@ span {
</button> </button>
<div id="notes" class="py-10 border-b-2 border-fuschia-600" x-show="show_notes"> <div id="notes" class="py-10 border-b-2 border-fuschia-600" x-show="show_notes">
{{ strip_tags($entity->public_notes) }} {!! html_entity_decode($entity->public_notes) !!}
</div> </div>
</div> </div>
@ -171,7 +171,7 @@ span {
</button> </button>
<div id="terms" class="py-10 border-b-2 border-fuschia-600" x-show="show_terms"> <div id="terms" class="py-10 border-b-2 border-fuschia-600" x-show="show_terms">
{{ strip_tags($entity->terms) }} {!! html_entity_decode($entity->terms) !!}
</div> </div>
</div> </div>
@ -186,7 +186,7 @@ span {
</button> </button>
<div id="terms" class="py-10 border-b-2 border-fuschia-600" x-show="show_footer"> <div id="terms" class="py-10 border-b-2 border-fuschia-600" x-show="show_footer">
{{ strip_tags($entity->footer) }} {!! html_entity_decode($entity->footer) !!}
</div> </div>
</div> </div>