18 |
* |
* |
19 |
* $Id$ |
* $Id$ |
20 |
* $Source$ |
* $Source$ |
|
* |
|
21 |
*/ |
*/ |
22 |
|
|
23 |
/** |
/** |
190 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
191 |
|
|
192 |
print '<tr><td>'.$langs->trans("GlobalDiscount").'</td><td align="right">'; |
print '<tr><td>'.$langs->trans("GlobalDiscount").'</td><td align="right">'; |
193 |
print $commande->remise_percent.' %</td><td> '; |
print $commande->remise_percent.'%</td><td> '; |
194 |
print '</td></tr>'; |
print '</td></tr>'; |
195 |
|
|
196 |
print '<tr><td>'.$langs->trans("VAT").'</td><td align="right">'.price($commande->total_tva).'</td>'; |
print '<tr><td>'.$langs->trans("VAT").'</td><td align="right">'.price($commande->total_tva).'</td>'; |
197 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
198 |
print '<tr><td>'.$langs->trans("TotalTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>'; |
print '<tr><td>'.$langs->trans("TotalTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>'; |
199 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
200 |
print "</table>\n"; |
|
201 |
|
print '</table><br>'; |
202 |
|
|
203 |
/* |
/* |
204 |
* Lignes de commandes |
* Lignes de commandes |
205 |
* |
* |
206 |
*/ |
*/ |
207 |
echo '<br><table class="noborder" width="100%">'; |
$sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,'; |
208 |
|
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; |
209 |
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice"; |
$sql.= ' FROM '.MAIN_DB_PREFIX."commandedet as l"; |
210 |
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l WHERE l.fk_commande =".$commande->id." ORDER BY l.rowid"; |
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; |
211 |
|
$sql.= " WHERE l.fk_commande = ".$commande->id; |
212 |
|
$sql.= " ORDER BY l.rowid"; |
213 |
|
|
214 |
$result = $db->query($sql); |
$resql = $db->query($sql); |
215 |
if ($result) |
if ($resql) |
216 |
{ |
{ |
217 |
$num = $db->num_rows($result); |
$num = $db->num_rows($resql); |
218 |
$i = 0; $total = 0; |
$i = 0; $total = 0; |
219 |
|
|
220 |
|
print '<table class="noborder" width="100%">'; |
221 |
if ($num) |
if ($num) |
222 |
{ |
{ |
223 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
224 |
print '<td width="54%">'.$langs->trans("Description").'</td>'; |
print '<td>'.$langs->trans('Description').'</td>'; |
225 |
print '<td width="8%" align="center">'.$langs->trans("VAT").'</td>'; |
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; |
226 |
print '<td width="8%" align="center">'.$langs->trans("Qty").'</td>'; |
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; |
227 |
print '<td width="8%" align="right">'.$langs->trans("Discount").'</td>'; |
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; |
228 |
print '<td width="12%" align="right">'.$langs->trans("PriceU").'</td>'; |
print '<td align="right">'.$langs->trans('Discount').'</td>'; |
229 |
print '<td width="10%"> </td><td width="10%"> </td>'; |
print '<td align="right">'.$langs->trans('AmountHT').'</td>'; |
230 |
|
print '<td> </td><td> </td>'; |
231 |
print "</tr>\n"; |
print "</tr>\n"; |
232 |
} |
} |
233 |
|
|
234 |
$var=true; |
$var=true; |
235 |
while ($i < $num) |
while ($i < $num) |
236 |
{ |
{ |
237 |
$objp = $db->fetch_object($result); |
$objp = $db->fetch_object($resql); |
238 |
|
|
239 |
$var=!$var; |
$var=!$var; |
240 |
print "<tr $bc[$var]>"; |
print '<tr '.$bc[$var].'>'; |
241 |
if ($objp->fk_product > 0) |
if ($objp->fk_product > 0) |
242 |
{ |
{ |
243 |
print '<td>'; |
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'; |
244 |
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.stripslashes(nl2br($objp->description)).'</a></td>'; |
if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); |
245 |
|
else print img_object($langs->trans('ShowProduct'),'product'); |
246 |
|
print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product)); |
247 |
|
print ($objp->description && $objp->description!=$objp->product)?'<br>'.$objp->description:''; |
248 |
|
print '</td>'; |
249 |
} |
} |
250 |
else |
else |
251 |
{ |
{ |
252 |
print "<td>".stripslashes(nl2br($objp->description))."</td>\n"; |
print '<td>'.stripslashes(nl2br($objp->description)); |
253 |
|
print "</td>\n"; |
254 |
} |
} |
255 |
print '<td align="center">'.$objp->tva_tx.'%</td>'; |
print '<td align="right">'.$objp->tva_tx.'%</td>'; |
256 |
print '<td align="center">'.$objp->qty.'</td>'; |
|
257 |
|
print '<td align="right">'.price($objp->subprice)."</td>\n"; |
258 |
|
|
259 |
|
print '<td align="right">'.$objp->qty.'</td>'; |
260 |
|
|
261 |
if ($objp->remise_percent > 0) |
if ($objp->remise_percent > 0) |
262 |
{ |
{ |
263 |
print '<td align="right">'.$objp->remise_percent."%</td>\n"; |
print '<td align="right">'.$objp->remise_percent."%</td>\n"; |
266 |
{ |
{ |
267 |
print '<td> </td>'; |
print '<td> </td>'; |
268 |
} |
} |
269 |
print '<td align="right">'.price($objp->subprice)."</td>\n"; |
|
270 |
|
print '<td align="right">'.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."</td>\n"; |
271 |
|
|
272 |
print '<td> </td><td> </td>'; |
print '<td> </td><td> </td>'; |
273 |
print "</tr>"; |
print '</tr>'; |
274 |
|
|
275 |
$i++; |
$i++; |
276 |
} |
} |
277 |
$db->free($result); |
$db->free($resql); |
278 |
} |
} |
279 |
else |
else |
280 |
{ |
{ |