This commit is contained in:
James Cole
2018-04-07 22:23:16 +02:00
parent d3701837e3
commit 7b715925cf
22 changed files with 343 additions and 72 deletions

View File

@@ -52,6 +52,34 @@ class ExpandedForm
return $this->currencyField($name, 'amount', $value, $options);
}
/**
* @param string $name
* @param null $value
* @param array $options
*
* @return string
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \Throwable
*/
public function amountNoCurrency(string $name, $value = null, array $options = []): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
$value = $this->fillFieldValue($name, $value);
$options['step'] = 'any';
unset($options['currency'], $options['placeholder']);
// make sure value is formatted nicely:
if (null !== $value && '' !== $value) {
$value = round($value, 8);
}
$html = view('form.amount-no-currency', compact('classes', 'name', 'label', 'value', 'options'))->render();
return $html;
}
/**
* @param string $name
* @param null $value