45 |
$limit = $conf->liste_limit; |
$limit = $conf->liste_limit; |
46 |
$offset = $limit * $page ; |
$offset = $limit * $page ; |
47 |
|
|
|
|
|
48 |
if ($user->societe_id > 0) |
if ($user->societe_id > 0) |
49 |
{ |
{ |
50 |
$action = ''; |
$action = ''; |
51 |
$socid = $user->societe_id; |
$socid = $user->societe_id; |
52 |
} |
} |
53 |
|
|
|
llxHeader(); |
|
|
|
|
54 |
|
|
55 |
/* |
/* |
56 |
* Affiche fiche |
* Affiche fiche |
57 |
* |
* |
58 |
*/ |
*/ |
59 |
|
|
60 |
|
llxHeader(); |
61 |
|
|
62 |
|
|
63 |
if ($_GET["id"]) |
if ($_GET["id"]) |
64 |
{ |
{ |
65 |
$product = new Product($db); |
$product = new Product($db); |
126 |
$h++; |
$h++; |
127 |
|
|
128 |
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; |
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; |
129 |
$head[$h][1] = $langs->trans('Bills'); |
$head[$h][1] = $langs->trans('Referers'); |
130 |
$hselected=$h; |
$hselected=$h; |
131 |
$h++; |
$h++; |
132 |
|
|
137 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
138 |
|
|
139 |
print '<tr>'; |
print '<tr>'; |
140 |
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'.$product->ref.'</td>'; |
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">'.$product->ref.'</td>'; |
141 |
print '</tr>'; |
print '</tr>'; |
142 |
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>'; |
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>'; |
143 |
print '</tr>'; |
print '</tr>'; |
144 |
|
|
145 |
// Prix |
// Prix |
146 |
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="2">'.price($product->price).'</td></tr>'; |
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">'.price($product->price).'</td></tr>'; |
147 |
|
|
148 |
// Statut |
// Statut |
149 |
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'; |
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; |
150 |
if ($product->envente) print $langs->trans("OnSell"); |
if ($product->envente) print $langs->trans("OnSell"); |
151 |
else print $langs->trans("NotOnSell"); |
else print $langs->trans("NotOnSell"); |
152 |
print '</td></tr>'; |
print '</td></tr>'; |
153 |
|
|
154 |
|
print '<tr><td valign="top" width="25%">'.$langs->trans("Referers").'</td>'; |
155 |
|
print '<td align="right" width="25%">'.$langs->trans("NbOfCustomers").'</td>'; |
156 |
|
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>'; |
157 |
|
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>'; |
158 |
|
print '</tr>'; |
159 |
|
|
160 |
|
// Propals |
161 |
|
if ($conf->propal->enabled) |
162 |
|
{ |
163 |
|
$ret=$product->load_stats_propale($socid); |
164 |
|
if ($ret < 0) dolibarr_print_error($db); |
165 |
|
$langs->load("propal"); |
166 |
|
print '<tr><td>'; |
167 |
|
print '<a href="propal.php?id='.$product->id.'">'.$langs->trans("Proposals").'</a>'; |
168 |
|
print '</td><td align="right">'; |
169 |
|
print $product->stats_propale['customers']; |
170 |
|
print '</td><td align="right">'; |
171 |
|
print $product->stats_propale['nb']; |
172 |
|
print '</td><td align="right">'; |
173 |
|
print $product->stats_propale['qty']; |
174 |
|
print '</td>'; |
175 |
|
print '</tr>'; |
176 |
|
} |
177 |
|
// Commandes |
178 |
|
if ($conf->commande->enabled) |
179 |
|
{ |
180 |
|
$ret=$product->load_stats_commande($socid); |
181 |
|
if ($ret < 0) dolibarr_print_error($db); |
182 |
|
$langs->load("orders"); |
183 |
|
print '<tr><td>'; |
184 |
|
print '<a href="commande.php?id='.$product->id.'">'.$langs->trans("Orders").'</a>'; |
185 |
|
print '</td><td align="right">'; |
186 |
|
print $product->stats_commande['customers']; |
187 |
|
print '</td><td align="right">'; |
188 |
|
print $product->stats_commande['nb']; |
189 |
|
print '</td><td align="right">'; |
190 |
|
print $product->stats_commande['qty']; |
191 |
|
print '</td>'; |
192 |
|
print '</tr>'; |
193 |
|
} |
194 |
|
// Contrats |
195 |
|
if ($conf->contrat->enabled) |
196 |
|
{ |
197 |
|
$ret=$product->load_stats_contrat($socid); |
198 |
|
if ($ret < 0) dolibarr_print_error($db); |
199 |
|
$langs->load("contracts"); |
200 |
|
print '<tr><td>'; |
201 |
|
print '<a href="contrat.php?id='.$product->id.'">'.$langs->trans("Contracts").'</a>'; |
202 |
|
print '</td><td align="right">'; |
203 |
|
print $product->stats_contrat['customers']; |
204 |
|
print '</td><td align="right">'; |
205 |
|
print $product->stats_contrat['nb']; |
206 |
|
print '</td><td align="right">'; |
207 |
|
print $product->stats_contrat['qty']; |
208 |
|
print '</td>'; |
209 |
|
print '</tr>'; |
210 |
|
} |
211 |
|
// Factures |
212 |
|
if ($conf->facture->enabled) |
213 |
|
{ |
214 |
|
$ret=$product->load_stats_facture($socid); |
215 |
|
if ($ret < 0) dolibarr_print_error($db); |
216 |
|
$langs->load("bills"); |
217 |
|
print '<tr><td>'; |
218 |
|
print '<a href="facture.php?id='.$product->id.'">'.$langs->trans("Bills").'</a>'; |
219 |
|
print '</td><td align="right">'; |
220 |
|
print $product->stats_facture['customers']; |
221 |
|
print '</td><td align="right">'; |
222 |
|
print $product->stats_facture['nb']; |
223 |
|
print '</td><td align="right">'; |
224 |
|
print $product->stats_facture['qty']; |
225 |
|
print '</td>'; |
226 |
|
print '</tr>'; |
227 |
|
} |
228 |
|
|
229 |
print "</table>"; |
print "</table>"; |
230 |
|
|
231 |
print '</div>'; |
print '</div>'; |