When I create an expense record, the provider field has no information in it.

Where should this be coming from? I have several organisations created and ticked as provider (and customer).

Comments

Mark_Watson27’s picture

Looking at the code it uses itself as a reference. So it will list any provider that has been set before on an expense.

Magnity’s picture

Category: support » task

we'll get this in the documentation...

Mark_Watson27’s picture

Status: Active » Needs review

As an alternative, should @Magnity wish to explore it, changing the stormexpense_autocomplete function in stormexpense.admin.inc to the following will list all active providers that the user has access permissions for

function stormexpense_autocomplete($string = '') {
  $matches = array();
  if ($string) {
    $s = "SELECT n.title FROM {node} AS n INNER JOIN {stormorganization} AS sor ON n.vid=sor.vid WHERE n.status=1 AND n.type='stormorganization' AND sor.isprovider=1 AND sor.isactive=1";
    $where = array("LOWER(title) LIKE LOWER('%s%%')");
    $s = stormorganization_access_sql($s, $where);
    $s = db_rewrite_sql($s);
    $result = db_query_range($s, $string, 0, 10);
    while ($pro = db_fetch_object($result)) {
      $matches[$pro->title] = check_plain($pro->title);
    }
  }

  drupal_json($matches);
}
Magnity’s picture

Status: Needs review » Reviewed & tested by the community

Yes - that'd be a useful change.

Magnity’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

I've also added a brief note to the Storm Expense section of the README.txt, but this needs a lot of work to expand still.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.