Search thirds from barcode directly from the mini search box
Also added a check when generating barcode image
This commit is contained in:
parent
c291ea2ec2
commit
85064abdad
@ -43,7 +43,7 @@ For users:
|
|||||||
- New: [ task #498 ] Improvement of the block to add products/services lines.
|
- New: [ task #498 ] Improvement of the block to add products/services lines.
|
||||||
- New: ECM autodir works also for files joined to products and services.
|
- New: ECM autodir works also for files joined to products and services.
|
||||||
- New: Add a selection module for emailing to enter a recipient from gui.
|
- New: Add a selection module for emailing to enter a recipient from gui.
|
||||||
- New: Allow to search product from barcodes directly from the permanent mini search left box
|
- New: Allow to search thirds and products from barcodes directly from the permanent mini search left box
|
||||||
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX
|
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX
|
||||||
New experimental modules:
|
New experimental modules:
|
||||||
- New: Add margin and commissions management module.
|
- New: Add margin and commissions management module.
|
||||||
|
|||||||
@ -3758,14 +3758,18 @@ class Form
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
//Check if barcode is filled in the card
|
||||||
if (empty($object->barcode)) return '';
|
if (empty($object->barcode)) return '';
|
||||||
|
|
||||||
// Complete object if not complete
|
// Complete object if not complete
|
||||||
if (empty($object->barcode_type_code) || empty($object->barcode_type_coder))
|
if (empty($object->barcode_type_code) || empty($object->barcode_type_coder))
|
||||||
{
|
{
|
||||||
$object->fetch_barcode();
|
$result = $object->fetch_barcode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check if fetch_barcode() failed
|
||||||
|
if ($result < 1) return '';
|
||||||
|
|
||||||
// Barcode image
|
// Barcode image
|
||||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
|
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
|
||||||
$out ='<!-- url barcode = '.$url.' -->';
|
$out ='<!-- url barcode = '.$url.' -->';
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -81,6 +82,12 @@ if ($mode == 'search')
|
|||||||
$sql.= " OR s.code_client LIKE '%".$db->escape($socname)."%'";
|
$sql.= " OR s.code_client LIKE '%".$db->escape($socname)."%'";
|
||||||
$sql.= " OR s.email LIKE '%".$db->escape($socname)."%'";
|
$sql.= " OR s.email LIKE '%".$db->escape($socname)."%'";
|
||||||
$sql.= " OR s.url LIKE '%".$db->escape($socname)."%'";
|
$sql.= " OR s.url LIKE '%".$db->escape($socname)."%'";
|
||||||
|
|
||||||
|
if (!empty($conf->barcode->enabled))
|
||||||
|
{
|
||||||
|
$sql.= "OR s.barcode LIKE '".$db->escape($socname)."'";
|
||||||
|
}
|
||||||
|
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user