Dolibarr 8.0.2. Using Module Builder, I created a module and added an object (location) such that I can record a few hundred sites that my customer has. I’ve edited …/htdocs/customer/mymodule/location.class.php to setup the fields array as …
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'ref' => array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Site/Location Name", 'showoncombobox'=>'1',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'help'=>"LinkToThirparty",),
'latitude' => array('type'=>'double(9,6)', 'label'=>'Latitude/y', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'notnull'=>-1,),
'longitude' => array('type'=>'double(9,6)', 'label'=>'Longitude/x', 'enabled'=>1, 'visible'=>1, 'position'=>51, 'notnull'=>-1,),
....
Problem one…
When I list the locations or display the location card the coordinates are fine, eg.
But when I modify, the coordinates are truncated to two decimals, in the edit box (my coordinate sql column type is double(9,6).
Problem two…
When I list the locations I cannot correctly order by, or filter on, the third party. The box in the title of the list is taking the integer value for fk_soc rather than the result of indexing through llx_societe.rowid. I have tried adding ‘foreignkey’=>‘llx_societe.rowid’ attribute to the fk_soc definition but that seems to have no effect.