mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-14 03:50:33 -04:00
Fix incorrect function calls
- Fixed return type in function call to make it nullable. - Added form helper to autoload since it's used in all the views. - Fix typo in memory stored OSPOS settings reference.
This commit is contained in:
committed by
Steve Ireland
parent
6e3af9184b
commit
9aec0b45ac
@@ -202,5 +202,7 @@ class Autoload extends AutoloadConfig
|
||||
* @var string[]
|
||||
* @phpstan-var list<string>
|
||||
*/
|
||||
public $helpers = [];
|
||||
public $helpers = [
|
||||
'form'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -381,8 +381,8 @@ function to_decimals(float $number, string $decimals = NULL, int $type = NumberF
|
||||
}
|
||||
|
||||
$fmt = new NumberFormatter(config('OSPOS')->settings['number_locale'], $type);
|
||||
$fmt->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : config('OSPOS')->settings['$decimals']);
|
||||
$fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : config('OSPOS')->settings['$decimals']);
|
||||
$fmt->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : config('OSPOS')->settings[$decimals]);
|
||||
$fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : config('OSPOS')->settings[$decimals]);
|
||||
|
||||
if(empty(config('OSPOS')->settings['thousands_separator']))
|
||||
{
|
||||
@@ -592,4 +592,4 @@ function valid_date(string $date): bool //TODO: need a better name for $date. P
|
||||
function valid_decimal(string $decimal): bool //TODO: need a better name for $decimal. Perhaps $candidate. Also the function name would be better as is_valid_decimal()
|
||||
{
|
||||
return (preg_match('/^(\d*\.)?\d+$/', $decimal) === 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ class Receiving_lib
|
||||
$this->session->remove('recv_comment');
|
||||
}
|
||||
|
||||
public function get_reference(): string
|
||||
public function get_reference(): ?string
|
||||
{
|
||||
return $this->session->get('recv_reference');
|
||||
}
|
||||
@@ -423,4 +423,4 @@ class Receiving_lib
|
||||
|
||||
return $total;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* @var array $payment_options
|
||||
*/
|
||||
?>
|
||||
<?php echo view('partial/header') ?>
|
||||
<?= view('partial/header') ?>
|
||||
|
||||
<?php
|
||||
if (isset($error))
|
||||
@@ -39,7 +39,7 @@ if (isset($success))
|
||||
|
||||
<!-- Top register controls -->
|
||||
|
||||
<?php echo form_open(esc("$controller_name/change_mode", 'attr'), ['id' => 'mode_form', 'class' => 'form-horizontal panel panel-default']) ?>
|
||||
<?= form_open(esc("$controller_name/change_mode", 'attr'), ['id' => 'mode_form', 'class' => 'form-horizontal panel panel-default']) ?>
|
||||
<div class="panel-body form-group">
|
||||
<ul>
|
||||
<li class="pull-left first_li">
|
||||
|
||||
Reference in New Issue
Block a user