Merge pull request #7517 from turbo124/v5-develop

Fixes for negative surcharges
This commit is contained in:
David Bomba 2022-06-04 18:20:43 +10:00 committed by GitHub
commit e8644214a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -763,7 +763,7 @@ class Design extends BaseDesign
} elseif (Str::startsWith($variable, '$custom_surcharge')) {
$_variable = ltrim($variable, '$'); // $custom_surcharge1 -> custom_surcharge1
$visible = $this->entity->{$_variable} > 0 || $this->entity->{$_variable} > '0';
$visible = $this->entity->{$_variable} != 0 || $this->entity->{$_variable} != '0';
$elements[1]['elements'][] = ['element' => 'div', 'elements' => [
['element' => 'span', 'content' => $variable . '_label', 'properties' => ['hidden' => !$visible, 'data-ref' => 'totals_table-' . substr($variable, 1) . '-label']],