[ task #104 ] Possibilité de facturer plusieurs commandes. Working
This commit is contained in:
parent
4881d8f1c2
commit
77ecd5c6fc
@ -503,7 +503,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
|||||||
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= ' WHERE c.fk_soc = s.rowid';
|
$sql.= ' WHERE c.fk_soc = s.rowid';
|
||||||
|
|
||||||
// Which invoice to show
|
// Which invoice to show
|
||||||
|
/*
|
||||||
if ($viewstatut <> '')
|
if ($viewstatut <> '')
|
||||||
{
|
{
|
||||||
if ($viewstatut < 4 && $viewstatut > -2)
|
if ($viewstatut < 4 && $viewstatut > -2)
|
||||||
@ -524,6 +526,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
|||||||
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
|
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
$sql.= " AND c.fk_statut in (1, 2) AND c.facture = 0";
|
||||||
|
|
||||||
$sql.= ' AND s.entity = '.$conf->entity;
|
$sql.= ' AND s.entity = '.$conf->entity;
|
||||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||||
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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user