Currency Field Invalid Value

v7.11.12

Create new record.
Enter 5000 into the Currency Field. Saves no issue.
Detail View shows the value of the Currency Field as 5,000.00

Edit the record, changing a different field. Not touching the Currency field.
Won’t save as I get an error that says Invalid Value on the Currency field. Currency field shows 5,000.00

If I edit the Currency field back to 5000 it saves again.

What is going on.

Looks like a bug.

Which module is this in?

Does it reproduce on the live demo?

This is in a custom module.

It does not appear to happen in the live demo.

What do your locale / currency options look like?

If you use this other demo, it allows admin access, you can change admin settings and make a test more similar to your case

https://www.softaculous.com/demos/SuiteCRM

I used that link before.

I added a currency field to another module to test it out and no issues.

I have not made changes to currency or locale since it stopped working.

I also noticed the currency symbol does not show.

It does appear in the Locale and currencies

It only happens in my custom module not in any of my other modules

This is really weird, I don’t know what to advise.

Maybe try to dig into the vardefs to try and see if you spot anything different in that field in the custom module… or in the actual rendered HTML to see if the field is rendered exactly like the in non-custom fields, or if there is something different…

I created a new currency field in my custom module and it still has the same issue.
I cant seem to find the vardef for my custom module. just the vardefs.ext.php

Have you looked in custom/Extension/modules?

$dictionary[‘qta_QuoteAmount’][‘fields’][‘quoted_amount_c’][‘inline_edit’]=’’;

$dictionary[‘qta_QuoteAmount’][‘fields’][‘quoted_amount_c’][‘labelValue’]=‘Quoted Amount’;

From the root of your SuiteCRM installation, try

grep -irn quoted_amount_c .

This should show everywhere it appears, somewhere there must be a field type definition…

Waiting on it to run

The only definition I can find is in the cache (strange)

'quoted_amount_c' => 

    array (

      'inline_edit' => '',
      'options' => 'numeric_range_search_dom',
      'labelValue' => 'Quoted Amount',
      'enable_range_search' => '1',
      'required' => false,
      'source' => 'custom_fields',
      'name' => 'quoted_amount_c',
      'vname' => 'LBL_QUOTED_AMOUNT',
      'type' => 'currency',
      'massupdate' => '0',
      'default' => NULL,
      'no_default' => false,
      'comments' => '',
      'help' => '',
      'importable' => 'true',
      'duplicate_merge' => 'disabled',
      'duplicate_merge_dom_value' => '0',
      'audited' => true,
      'reportable' => true,
      'unified_search' => false,
      'merge_filter' => 'disabled',
      'len' => '26',
      'size' => '20',
      'precision' => 6,
      'id' => 'qta_QuotedAmountquoted_amount_c',
      'custom_module' => 'qta_QuotedAmount,
),
<div class="col-xs-12 col-sm-8 edit-view-field " type="currency" field="quoted_amount_c"  >
<?php if (strlen ( $this->_tpl_vars['fields']['quoted_amount_c']['value'] ) <= 0): ?>
<?php $this->assign('value', $this->_tpl_vars['fields']['quoted_amount_c']['default_value']); ?>
<?php $this->assign('value', $this->_tpl_vars['fields']['quoted_amount_c']['value']); ?>
<input type='text' name='<?php echo $this->_tpl_vars['fields']['quoted_amount_c']['name']; ?>
<?php echo $this->_tpl_vars['fields']['quoted_amount_c']['name']; ?>
addToValidate(\'EditView\', \'quoted_amount_c\', \'currency\', false,\''; ?>
<div class="col-xs-12 col-sm-8 detail-view-field " type="currency" field="quoted_amount_c"  >
<?php if (! $this->_tpl_vars['fields']['quoted_amount_c']['hidden']): ?>
:<span id='<?php echo $this->_tpl_vars['fields']['quoted_amount_c']['name']; ?>
<?php echo smarty_function_sugar_number_format(array('var' => $this->_tpl_vars['fields']['quoted_amount_c']['value']), $this);?>

addToValidate('EditView', 'quoted_amount_c', 'currency', false,'{/literal}{sugar_translate label='LBL_QUOTED_AMOUNT' module='ldz_Leadz' for_js=true}{literal}' );

But it still validates even that it is set to false?

What are the names of those files where these bits appear?

This is also happening in the Admin/System settings with the two fields (Listview items per page & Subpanel items per page) whatever value I enter gives me the error Invalid.

This is a module I have never touched nor have I ever edited the value or fields.

Where are the files that check the validation of a field.? Could I go in an make an exception?

_quoted_amount_c in /public_html/modules/AOS_PDF_Templates/templateParser.php on line 185
(which it isn’t anywhere in there)

custom/modules/qta_QuoteAmountz/metadata/editviewdefs.php (detailviewdefs.php/searchdefs.php/SearchFields.php/vardefs.ext.php)

custom/Extension/modules/qta_QuoteAmountz/Ext/Vardefs/_override_sugarfield_quoted_amount_c.php

the rest is all cache files that cleaned out when I run a R&R do they not? I have been checking and they are getting cleanded out. I am also clearing my browser cache.

That is all the files. I went through them and no where does it say anything about it being a currency field.
I went into the vardefs.ext.php and added currency to the definition. Nothing seems to work. It also happens if I create a new currency filed in that module and only that module.