Skip to content
Snippets Groups Projects
Commit 77ecd5c6 authored by Juanjo Menent's avatar Juanjo Menent
Browse files

[ task #104 ] Possibilité de facturer plusieurs commandes. Working

parent 4881d8f1
Branches
Tags
No related merge requests found
......@@ -503,7 +503,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE c.fk_soc = s.rowid';
// Which invoice to show
/*
if ($viewstatut <> '')
{
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) AND c.facture = 0";
$sql.= ' AND s.entity = '.$conf->entity;
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment