Topic: customer search

Hi.  I read a review which favored FrontAccounting, and I really want to participate (I'm a developer).  One of the things that the review indicated is not currently included in FrontAccounting is this: a user cannot search for customers by address, name or phone number.  Perhaps this is an old review - and this functionality DOES exist?   If not: has this modification been sized, yet?   Thank you.

2 (edited by seahawk 07/19/2023 12:26:47 pm)

Re: customer search

On the setup tab for company setup/ there is a tick box for Search Customers. Switch that on and see if that is what you are looking for.

Just tested it and if you select the search function direct invoice with company address it will display that.

Wynand

Re: customer search

I saw this review as well. I would like to propose a change to the customer search to be able to search phone numbers and emails. I often get texts from clients and I am unclear as to whom i'm speaking with, or when scheduling delivery note, I forget who it was. I added all crm fields in the search but didnt include them in the table for fear of clutter. The crm table view does have all those things and looks ok to me. 

change db function get_customers_search in '/sales/includes/db/customers_db.inc' to...

function get_customers_search($customer)
{
    global $SysPrefs;

    if (isset($SysPrefs->max_rows_in_search))
        $limit = $SysPrefs->max_rows_in_search;
    else
        $limit = 10;

  $sql = "SELECT d.debtor_no, d.name, d.debtor_ref, d.address, d.tax_id, 
    p.phone, p.phone2, p.fax, p.email 
    FROM ".TB_PREF."crm_persons p, ".TB_PREF."crm_contacts c,  
    ".TB_PREF."debtors_master d
    WHERE p.id = c.person_id AND c.entity_id = d.debtor_no AND 
          c.type = 'customer' AND
    (      d.name LIKE " . db_escape("%" . $customer. "%") . " OR 
     d.debtor_ref LIKE " . db_escape("%" . $customer. "%") . " OR 
          d.address LIKE " . db_escape("%" . $customer. "%") . " OR 
           d.tax_id LIKE " . db_escape("%" . $customer. "%")." OR
            p.phone LIKE " . db_escape("%" . $customer. "%") . " OR 
           p.phone2 LIKE " . db_escape("%" . $customer. "%") . " OR 
              p.fax LIKE " . db_escape("%" . $customer. "%") . " OR 
            p.email LIKE " . db_escape("%" . $customer. "%").")
      ORDER BY name LIMIT 0,".(int)($limit);

    return db_query($sql, "Failed in retreiving customer list.");
}

add fields to table header and cells in '/sales/inquiry/customers_list.php' to have at least phone and email
Header array $th

$th = array("", _("Customer"), _("Short Name"), _("Address"), _("Tax ID"), _("Phone"), _("Email"));

Cell contents add email and phone

      label_cell($myrow["name"]);
      label_cell($myrow["debtor_ref"]);
      label_cell($myrow["address"]);
      label_cell($myrow["tax_id"]);
      label_cell($myrow["phone"]);
      label_cell($myrow["email"]);

@joe and @ apmuthu
?