Uniformize code for liste_array
Fix visibility of elements into product page (manage external users)
This commit is contained in:
parent
f04abccdf3
commit
52952c6fce
@ -469,10 +469,6 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
$propal_static = new Propal($db);
|
$propal_static = new Propal($db);
|
||||||
|
|
||||||
$proposals = $propal_static->liste_array(0, 0, 0, $object->id, $MAXLIST);
|
|
||||||
|
|
||||||
//var_dump($proposals);
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
|
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
|
||||||
$sql.= " p.datep as dp, p.fin_validite as datelimite";
|
$sql.= " p.datep as dp, p.fin_validite as datelimite";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||||
|
|||||||
@ -1769,9 +1769,9 @@ class Propal extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return list of proposal (eventually filtered on user) into an array
|
* Return list of proposal (eventually filtered on user) into an array
|
||||||
*
|
*
|
||||||
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref)
|
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
|
||||||
* @param int $draft 0=not draft, 1=draft
|
* @param int $draft 0=not draft, 1=draft
|
||||||
* @param int $notcurrentuser 0=current user, 1=not current user
|
* @param int $notcurrentuser 0=all user, 1=not current user
|
||||||
* @param int $socid Id third pary
|
* @param int $socid Id third pary
|
||||||
* @param int $limit For pagination
|
* @param int $limit For pagination
|
||||||
* @param int $offset For pagination
|
* @param int $offset For pagination
|
||||||
@ -1785,15 +1785,22 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
|
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||||
|
$sql.= " p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
|
||||||
$sql.= " p.datep as dp, p.fin_validite as datelimite";
|
$sql.= " p.datep as dp, p.fin_validite as datelimite";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||||
$sql.= " AND p.fk_soc = s.rowid";
|
$sql.= " AND p.fk_soc = s.rowid";
|
||||||
$sql.= " AND p.fk_statut = c.id";
|
$sql.= " AND p.fk_statut = c.id";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||||
|
{
|
||||||
|
$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;
|
||||||
if ($draft) $sql.= " AND p.fk_statut = 0";
|
if ($draft) $sql.= " AND p.fk_statut = 0";
|
||||||
if ($notcurrentuser) $sql.= " AND p.fk_user_author <> ".$user->id;
|
if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id;
|
||||||
$sql.= $this->db->order($sortfield,$sortorder);
|
$sql.= $this->db->order($sortfield,$sortorder);
|
||||||
$sql.= $this->db->plimit($limit,$offset);
|
$sql.= $this->db->plimit($limit,$offset);
|
||||||
|
|
||||||
@ -1808,14 +1815,19 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
if ($shortlist)
|
if ($shortlist == 1)
|
||||||
{
|
{
|
||||||
$ga[$obj->propalid] = $obj->ref;
|
$ga[$obj->propalid] = $obj->ref;
|
||||||
}
|
}
|
||||||
|
else if ($shortlist == 2)
|
||||||
|
{
|
||||||
|
$ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ga[$i]['id'] = $obj->propalid;
|
$ga[$i]['id'] = $obj->propalid;
|
||||||
$ga[$i]['ref'] = $obj->ref;
|
$ga[$i]['ref'] = $obj->ref;
|
||||||
|
$ga[$i]['name'] = $obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -131,7 +131,7 @@ if (! $sortfield) $sortfield='p.datep';
|
|||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
|
|
||||||
$sql = 'SELECT s.nom, s.rowid, s.client, ';
|
$sql = 'SELECT s.rowid, s.nom, s.client, ';
|
||||||
$sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
|
$sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||||
$sql.= ' u.login';
|
$sql.= ' u.login';
|
||||||
|
|||||||
@ -1972,23 +1972,38 @@ class Commande extends CommonOrder
|
|||||||
/**
|
/**
|
||||||
* Return list of orders (eventuelly filtered on a user) into an array
|
* Return list of orders (eventuelly filtered on a user) into an array
|
||||||
*
|
*
|
||||||
* @param int $brouillon 0=non brouillon, 1=brouillon
|
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
|
||||||
* @param User $user Objet user de filtre
|
* @param int $draft 0=not draft, 1=draft
|
||||||
|
* @param User $excluser Objet user to exclude
|
||||||
|
* @param int $socid Id third pary
|
||||||
|
* @param int $limit For pagination
|
||||||
|
* @param int $offset For pagination
|
||||||
|
* @param string $sortfield Sort criteria
|
||||||
|
* @param string $sortorder Sort order
|
||||||
* @return int -1 if KO, array with result if OK
|
* @return int -1 if KO, array with result if OK
|
||||||
*/
|
*/
|
||||||
function liste_array($brouillon=0, $user='')
|
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf,$user;
|
||||||
|
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid, c.rowid, c.ref";
|
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||||
|
$sql.= " c.rowid as cid, c.ref";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||||
$sql.= " AND c.fk_soc = s.rowid";
|
$sql.= " AND c.fk_soc = s.rowid";
|
||||||
if ($brouillon) $sql.= " AND c.fk_statut = 0";
|
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||||
if ($user) $sql.= " AND c.fk_user_author <> ".$user->id;
|
{
|
||||||
$sql .= " ORDER BY c.date_commande DESC";
|
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
}
|
||||||
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
|
if ($draft) $sql.= " AND c.fk_statut = 0";
|
||||||
|
if (is_object($excluser)) $sql.= " AND c.fk_user_author <> ".$excluser->id;
|
||||||
|
$sql.= $this->db->order($sortfield,$sortorder);
|
||||||
|
$sql.= $this->db->plimit($limit,$offset);
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -2001,7 +2016,20 @@ class Commande extends CommonOrder
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$ga[$obj->rowid] = $obj->ref;
|
if ($shortlist == 1)
|
||||||
|
{
|
||||||
|
$ga[$obj->cid] = $obj->ref;
|
||||||
|
}
|
||||||
|
else if ($shortlist == 2)
|
||||||
|
{
|
||||||
|
$ga[$obj->cid] = $obj->ref.' ('.$obj->name.')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ga[$i]['id'] = $obj->cid;
|
||||||
|
$ga[$i]['ref'] = $obj->ref;
|
||||||
|
$ga[$i]['name'] = $obj->name;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2664,6 +2664,80 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return list of invoices (eventually filtered on a user) into an array
|
||||||
|
*
|
||||||
|
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
|
||||||
|
* @param int $draft 0=not draft, 1=draft
|
||||||
|
* @param User $excluser Objet user to exclude
|
||||||
|
* @param int $socid Id third pary
|
||||||
|
* @param int $limit For pagination
|
||||||
|
* @param int $offset For pagination
|
||||||
|
* @param string $sortfield Sort criteria
|
||||||
|
* @param string $sortorder Sort order
|
||||||
|
* @return int -1 if KO, array with result if OK
|
||||||
|
*/
|
||||||
|
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
|
||||||
|
{
|
||||||
|
global $conf,$user;
|
||||||
|
|
||||||
|
$ga = array();
|
||||||
|
|
||||||
|
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||||
|
$sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
|
$sql.= " AND f.fk_soc = s.rowid";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||||
|
{
|
||||||
|
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
}
|
||||||
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
|
if ($draft) $sql.= " AND f.fk_statut = 0";
|
||||||
|
if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id;
|
||||||
|
$sql.= $this->db->order($sortfield,$sortorder);
|
||||||
|
$sql.= $this->db->plimit($limit,$offset);
|
||||||
|
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$numc = $this->db->num_rows($result);
|
||||||
|
if ($numc)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $numc)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if ($shortlist == 1)
|
||||||
|
{
|
||||||
|
$ga[$obj->fid] = $obj->ref;
|
||||||
|
}
|
||||||
|
else if ($shortlist == 2)
|
||||||
|
{
|
||||||
|
$ga[$obj->fid] = $obj->ref.' ('.$obj->name.')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ga[$i]['id'] = $obj->fid;
|
||||||
|
$ga[$i]['ref'] = $obj->ref;
|
||||||
|
$ga[$i]['name'] = $obj->name;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ga;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoi liste des factures remplacables
|
* Renvoi liste des factures remplacables
|
||||||
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee
|
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee
|
||||||
|
|||||||
@ -117,7 +117,7 @@ class HookManager
|
|||||||
* @param Object &$object Object to use hooks on
|
* @param Object &$object Object to use hooks on
|
||||||
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||||
* @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
|
* @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
|
||||||
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints.
|
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Deprecated. Must always return an int and things to print into ->resprints.
|
||||||
* Can also return some values into an array ->results.
|
* Can also return some values into an array ->results.
|
||||||
* $this->error or this->errors are also defined by class called by this function if error.
|
* $this->error or this->errors are also defined by class called by this function if error.
|
||||||
*/
|
*/
|
||||||
@ -131,7 +131,7 @@ class HookManager
|
|||||||
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated.
|
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated.
|
||||||
$hooktype='output';
|
$hooktype='output';
|
||||||
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
|
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
|
||||||
if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices'))) $hooktype='addreplace';
|
if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices','printSearchForm'))) $hooktype='addreplace';
|
||||||
|
|
||||||
// Loop on each hook to qualify modules that declared context
|
// Loop on each hook to qualify modules that declared context
|
||||||
$modulealreadyexecuted=array();
|
$modulealreadyexecuted=array();
|
||||||
|
|||||||
@ -542,8 +542,6 @@ class FormFile
|
|||||||
{
|
{
|
||||||
if (empty($noform)) $out.= '</form>'."\n";
|
if (empty($noform)) $out.= '</form>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.='</div>';
|
|
||||||
}
|
}
|
||||||
$out.= '<!-- End show_document -->'."\n";
|
$out.= '<!-- End show_document -->'."\n";
|
||||||
//return ($i?$i:$headershown);
|
//return ($i?$i:$headershown);
|
||||||
|
|||||||
@ -50,20 +50,24 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<body style="margin: 10px; text-align: center">'."\n";
|
print '<body style="margin: 30px; height: 100%;">'."\n";
|
||||||
print '<center><br>';
|
//print '<br>';
|
||||||
|
|
||||||
|
$nbofsearch=0;
|
||||||
|
|
||||||
// Define $searchform
|
// Define $searchform
|
||||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
|
||||||
|
$nbofsearch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
|
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
||||||
|
$nbofsearch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||||
@ -71,6 +75,7 @@ if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! em
|
|||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
||||||
|
$nbofsearch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||||
@ -78,27 +83,35 @@ if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! em
|
|||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/liste.php', DOL_URL_ROOT.'/fourn/product/liste.php', img_object('','product').' '.$langs->trans("SupplierRef"), 'products', 'srefsupplier');
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/liste.php', DOL_URL_ROOT.'/fourn/product/liste.php', img_object('','product').' '.$langs->trans("SupplierRef"), 'products', 'srefsupplier');
|
||||||
|
$nbofsearch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
||||||
|
$nbofsearch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
// Execute hook printSearchForm
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$searchform.=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters);
|
||||||
|
if (empty($reshook)) $searchform.=$hookmanager->resPrint;
|
||||||
|
else $searchform=$hookmanager->resPrint;
|
||||||
|
|
||||||
|
print '<style>.menu_titre { padding-top: 10px; }</style>';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin SearchForm -->\n";
|
print "<!-- Begin SearchForm -->\n";
|
||||||
print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n";
|
print '<div class="center">';
|
||||||
|
//print '<div id="distance"></div><div id="container" class="center">';
|
||||||
|
print '<div id="blockvmenusearch">'."\n";
|
||||||
print $searchform;
|
print $searchform;
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
//print '</div></div>';
|
||||||
|
print '</div>';
|
||||||
print "<!-- End SearchForm -->\n";
|
print "<!-- End SearchForm -->\n";
|
||||||
|
|
||||||
print '</center>';
|
|
||||||
print '</body></html>'."\n";
|
print '</body></html>'."\n";
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -85,7 +85,7 @@ ProductsAndServicesArea=Espace Produits et Services
|
|||||||
ProductsArea=Espace Produits
|
ProductsArea=Espace Produits
|
||||||
ServicesArea=Espace Services
|
ServicesArea=Espace Services
|
||||||
AddToMyProposals=Ajouter à mes propositions
|
AddToMyProposals=Ajouter à mes propositions
|
||||||
AddToOtherProposals=Ajouter aux autres propositions
|
AddToOtherProposals=Ajouter propositions brouillons
|
||||||
AddToMyBills=Ajouter à mes factures
|
AddToMyBills=Ajouter à mes factures
|
||||||
AddToOtherBills=Ajouter aux autres factures
|
AddToOtherBills=Ajouter aux autres factures
|
||||||
CorrectStock=Corriger stock
|
CorrectStock=Corriger stock
|
||||||
|
|||||||
@ -53,7 +53,7 @@ PropalsToBill=Propositions commerciales signées à facturer
|
|||||||
ListOfProposals=Liste des devis/propositions commerciales
|
ListOfProposals=Liste des devis/propositions commerciales
|
||||||
ActionsOnPropal=Événements sur la proposition
|
ActionsOnPropal=Événements sur la proposition
|
||||||
NoOpenedPropals=Pas de proposition ouverte
|
NoOpenedPropals=Pas de proposition ouverte
|
||||||
NoOtherOpenedPropals=Pas d'autre proposition ouverte
|
NoOtherOpenedPropals=Pas d'autre proposition brouillon
|
||||||
RefProposal=Réf proposition commerciale
|
RefProposal=Réf proposition commerciale
|
||||||
SendPropalByMail=Envoi proposition commerciale par mail
|
SendPropalByMail=Envoi proposition commerciale par mail
|
||||||
FileNotUploaded=Le fichier n'a pas été téléchargé
|
FileNotUploaded=Le fichier n'a pas été téléchargé
|
||||||
|
|||||||
@ -1316,6 +1316,7 @@ print "\n</div><br>\n";
|
|||||||
if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
||||||
{
|
{
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
|
//print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
// Propals
|
// Propals
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||||
@ -1324,97 +1325,27 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td width="50%" class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print $langs->trans("AddToMyProposals") . '</td>';
|
print '<td class="liste_titre">'.$langs->trans("AddToOtherProposals").'</td>';
|
||||||
|
print '</tr><tr>';
|
||||||
if ($user->rights->societe->client->voir)
|
print '<td valign="top">';
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre">';
|
|
||||||
print $langs->trans("AddToOtherProposals").'</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre"> </td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Liste de "Mes propals"
|
|
||||||
print '<tr><td'.($user->rights->societe->client->voir?' width="50%"':'').' valign="top">';
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.ref, p.datep as dp";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
|
|
||||||
$sql.= " WHERE p.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND p.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND p.fk_statut = 0";
|
|
||||||
$sql.= " AND p.fk_user_author = ".$user->id;
|
|
||||||
$sql.= " ORDER BY p.datec DESC, p.tms DESC";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$var=true;
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="addinpropal">';
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
print "<a href=\"../comm/propal.php?id=".$objp->propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n";
|
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,18)."</a></td>\n";
|
|
||||||
print "<td nowrap=\"nowrap\">".dol_print_date($objp->dp,"%d %b")."</td>\n";
|
|
||||||
print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
|
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
|
||||||
if (isset($object->stock_proposition)) print " ".$object->stock_proposition;
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print "<tr ".$bc[!$var]."><td>";
|
|
||||||
print $langs->trans("NoOpenedPropals");
|
|
||||||
print "</td></tr>";
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
$db->free($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if ($user->rights->societe->client->voir)
|
|
||||||
{
|
|
||||||
// Liste de "Other propals"
|
|
||||||
print '<td width="50%" valign="top">';
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
$otherprop = $propal->liste_array(1,1,1);
|
$otherprop = $propal->liste_array(2,1,0);
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
print '<table class="nobordernopadding" width="100%">';
|
||||||
if (is_array($otherprop) && count($otherprop))
|
if (is_array($otherprop) && count($otherprop))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td colspan="3">';
|
print '<tr '.$bc[$var].'><td style="width: 200px;">';
|
||||||
print '<input type="hidden" name="action" value="addinpropal">';
|
print '<input type="hidden" name="action" value="addinpropal">';
|
||||||
print $langs->trans("OtherPropals").'</td><td>';
|
print $langs->trans("Proposals").'</td><td colspan="2">';
|
||||||
print $form->selectarray("propalid", $otherprop);
|
print $form->selectarray("propalid", $otherprop, 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap" colspan="2">'.$langs->trans("Qty");
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Quantity").' ';
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td class="nowrap">'.$langs->trans("ReductionShort").'(%) ';
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">';
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1429,8 +1360,6 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1441,98 +1370,27 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td width="50%" class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print $langs->trans("AddToMyOrders").'</td>';
|
print '<td class="liste_titre">'.$langs->trans("AddToOtherOrders").'</td>';
|
||||||
|
print '</tr><tr>';
|
||||||
if ($user->rights->societe->client->voir)
|
print '<td valign="top">';
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre">';
|
|
||||||
print $langs->trans("AddToOtherOrders").'</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre"> </td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Liste de "Mes commandes"
|
|
||||||
print '<tr><td'.($user->rights->societe->client->voir?' width="50%"':'').' valign="top">';
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, c.rowid as commandeid, c.ref, c.date_commande as dc";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND c.fk_statut = 0";
|
|
||||||
$sql.= " AND c.fk_user_author = ".$user->id;
|
|
||||||
$sql.= " ORDER BY c.date_creation DESC";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$var=true;
|
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objc = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="addincommande">';
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
print "<a href=\"../commande/fiche.php?id=".$objc->commandeid."\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n";
|
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=".$objc->socid."\">".dol_trunc($objc->nom,18)."</a></td>\n";
|
|
||||||
print "<td nowrap=\"nowrap\">".dol_print_date($db->jdate($objc->dc),"%d %b")."</td>\n";
|
|
||||||
print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
|
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
|
||||||
if (isset($object->stock_proposition)) print " ".$object->stock_proposition;
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<tr ".$bc[!$var]."><td>";
|
|
||||||
print $langs->trans("NoOpenedOrders");
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
$db->free($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if ($user->rights->societe->client->voir)
|
|
||||||
{
|
|
||||||
// Liste de "Other orders"
|
|
||||||
print '<td width="50%" valign="top">';
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
$othercom = $commande->liste_array(1, $user);
|
$othercom = $commande->liste_array(2, 1, null);
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
print '<table class="nobordernopadding" width="100%">';
|
||||||
if (is_array($othercom) && count($othercom))
|
if (is_array($othercom) && count($othercom))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td colspan="3">';
|
print '<tr '.$bc[$var].'><td style="width: 200px;">';
|
||||||
print '<input type="hidden" name="action" value="addincommande">';
|
print '<input type="hidden" name="action" value="addincommande">';
|
||||||
print $langs->trans("OtherOrders").'</td><td>';
|
print $langs->trans("Orders").'</td><td colspan="2">';
|
||||||
print $form->selectarray("commandeid", $othercom);
|
print $form->selectarray("commandeid", $othercom, 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("Qty");
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Quantity").' ';
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td class="nowrap">'.$langs->trans("ReductionShort").'(%) ';
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">';
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1547,136 +1405,40 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Factures
|
// Factures
|
||||||
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre"><td width="50%" class="liste_titre">';
|
$invoice = new Facture($db);
|
||||||
print $langs->trans("AddToMyBills").'</td>';
|
|
||||||
|
|
||||||
if ($user->rights->societe->client->voir)
|
$langs->load("bills");
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre">';
|
|
||||||
print $langs->trans("AddToOtherBills").'</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td width="50%" class="liste_titre"> </td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td class="liste_titre">'.$langs->trans("AddToOtherOrders").'</td>';
|
||||||
|
print '</tr><tr>';
|
||||||
|
print '<td valign="top">';
|
||||||
|
|
||||||
// Liste de Mes factures
|
|
||||||
print '<tr><td'.($user->rights->societe->client->voir?' width="50%"':'').' valign="top">';
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, f.rowid as factureid, f.facnumber, f.datef as df";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND f.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND f.fk_statut = 0";
|
|
||||||
$sql.= " AND f.fk_user_author = ".$user->id;
|
|
||||||
$sql.= " ORDER BY f.datec DESC, f.rowid DESC";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
$otherinvoice = $invoice->liste_array(2, 1, null);
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="nobordernopadding" width="100%">';
|
||||||
|
if (is_array($otherinvoice) && count($otherinvoice))
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td style="width: 200px;">';
|
||||||
print '<input type="hidden" name="action" value="addinfacture">';
|
print '<input type="hidden" name="action" value="addinfacture">';
|
||||||
print "<tr $bc[$var]>";
|
print $langs->trans("Invoice").'</td><td colspan="2">';
|
||||||
print "<td nowrap>";
|
print $form->selectarray("factureid", $otherinvoice, 0, 1);
|
||||||
print "<a href=\"../compta/facture.php?facid=".$objp->factureid."\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n";
|
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,18)."</a></td>\n";
|
|
||||||
print "<td nowrap=\"nowrap\">".dol_print_date($db->jdate($objp->df),"%d %b")."</td>\n";
|
|
||||||
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print "<tr ".$bc[!$var]."><td>";
|
|
||||||
print $langs->trans("NoDraftBills");
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Quantity").' ';
|
||||||
print "</table>";
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td class="nowrap">'.$langs->trans("ReductionShort").'(%) ';
|
||||||
$db->free($result);
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if ($user->rights->societe->client->voir)
|
|
||||||
{
|
|
||||||
$facture = new Facture($db);
|
|
||||||
|
|
||||||
print '<td width="50%" valign="top">';
|
|
||||||
|
|
||||||
// Liste de Autres factures
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, f.rowid as factureid, f.facnumber, f.datef as df";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND f.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND f.fk_statut = 0";
|
|
||||||
$sql.= " AND f.fk_user_author <> ".$user->id;
|
|
||||||
$sql.= " ORDER BY f.datec DESC, f.rowid DESC";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$var=true;
|
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="addinfacture">';
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print "<td><a href=\"../compta/facture.php?facid=".$objp->factureid."\">$objp->facnumber</a></td>\n";
|
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,24)."</a></td>\n";
|
|
||||||
print "<td colspan=\"2\">".$langs->trans("Qty");
|
|
||||||
print "</td>";
|
|
||||||
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td>';
|
print '</td></tr>';
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1684,17 +1446,10 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
print $langs->trans("NoOtherDraftBills");
|
print $langs->trans("NoOtherDraftBills");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print '</table>';
|
||||||
$db->free($result);
|
print '</form>';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user