284 |
$_POST["qty"], |
$_POST["qty"], |
285 |
$_POST["remise_percent"], |
$_POST["remise_percent"], |
286 |
$datestart, |
$datestart, |
287 |
$dateend |
$dateend, |
288 |
|
$_POST["tva_tx"] |
289 |
); |
); |
290 |
|
|
291 |
$_GET["facid"]=$_POST["facid"]; // Pour réaffichage de la fiche en cours d'édition |
$_GET["facid"]=$_POST["facid"]; // Pour réaffichage de la fiche en cours d'édition |
1063 |
print '<tr><td height=\"10\">'.$langs->trans("AmountTTC").'</td><td align="right" colspan="2">'.price($fac->total_ttc).'</td>'; |
print '<tr><td height=\"10\">'.$langs->trans("AmountTTC").'</td><td align="right" colspan="2">'.price($fac->total_ttc).'</td>'; |
1064 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
1065 |
|
|
1066 |
print '<tr><td height=\"10\">'.$langs->trans("Status").'</td><td align="left" colspan="3">'.($fac->getLibStatut()).'</td></tr>'; |
// Statut |
1067 |
|
print '<tr><td height=\"10\">'.$langs->trans("Status").'</td><td align="left" colspan="3">'.($fac->getLibStatut()).'</td></tr>'; |
1068 |
|
|
1069 |
if ($fac->note) |
if ($fac->note) |
1070 |
{ |
{ |
1114 |
$objp = $db->fetch_object($resql); |
$objp = $db->fetch_object($resql); |
1115 |
$var=!$var; |
$var=!$var; |
1116 |
|
|
1117 |
// Update ligne de facture |
// Ligne en mode visu |
1118 |
if ($_GET["action"] != 'editline' || $_GET["rowid"] != $objp->rowid) |
if ($_GET["action"] != 'editline' || $_GET["rowid"] != $objp->rowid) |
1119 |
{ |
{ |
1120 |
print '<tr '.$bc[$var].'>'; |
print '<tr '.$bc[$var].'>'; |
1124 |
if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); |
if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); |
1125 |
else print img_object($langs->trans('ShowProduct'),'product'); |
else print img_object($langs->trans('ShowProduct'),'product'); |
1126 |
print ' '.$objp->ref.'</a>'; |
print ' '.$objp->ref.'</a>'; |
1127 |
print ' - '.nl2br($objp->product); |
print ' - '.nl2br(stripslashes($objp->product)); |
1128 |
if ($objp->date_start && $objp->date_end) |
if ($objp->date_start && $objp->date_end) |
1129 |
{ |
{ |
1130 |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
1137 |
{ |
{ |
1138 |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
1139 |
} |
} |
1140 |
print ($objp->description&&$objp->description!=$objp->product)?'<br>'.$objp->description:''; |
print ($objp->description && $objp->description!=$objp->product)?'<br>'.$objp->description:''; |
1141 |
print '</td>'; |
print '</td>'; |
1142 |
} |
} |
1143 |
else |
else |
1191 |
{ |
{ |
1192 |
print '<a href="facture.php?facid='.$fac->id.'&action=down&rowid='.$objp->rowid.'">'; |
print '<a href="facture.php?facid='.$fac->id.'&action=down&rowid='.$objp->rowid.'">'; |
1193 |
print img_down(); |
print img_down(); |
1194 |
print '</a></td>'; |
print '</a>'; |
1195 |
} |
} |
1196 |
|
print '</td>'; |
1197 |
} |
} |
1198 |
else |
else |
1199 |
{ |
{ |
1200 |
print '<td colspan="3"> </td>'; |
print '<td colspan="3"> </td>'; |
1201 |
} |
} |
1202 |
print "</tr>"; |
print '</tr>'; |
1203 |
|
|
1204 |
} |
} |
1205 |
|
|
1206 |
// Update ligne de facture |
// Ligne en mode update |
1207 |
if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) |
if ($_GET["action"] == 'editline' && $user->rights->facture->creer && $_GET["rowid"] == $objp->rowid) |
1208 |
{ |
{ |
1209 |
print '<form action="facture.php" method="post">'; |
print '<form action="facture.php" method="post">'; |
1210 |
print '<input type="hidden" name="action" value="updateligne">'; |
print '<input type="hidden" name="action" value="updateligne">'; |
1211 |
print '<input type="hidden" name="facid" value="'.$fac->id.'">'; |
print '<input type="hidden" name="facid" value="'.$fac->id.'">'; |
1212 |
print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">'; |
print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">'; |
1213 |
print "<tr $bc[$var]>"; |
print '<tr '.$bc[$var].'>'; |
1214 |
print '<td>'; |
print '<td>'; |
1215 |
if ($objp->fk_product > 0) |
if ($objp->fk_product > 0) |
1216 |
{ |
{ |
1223 |
} |
} |
1224 |
print '<textarea name="desc" cols="50" rows="1">'.stripslashes($objp->description).'</textarea></td>'; |
print '<textarea name="desc" cols="50" rows="1">'.stripslashes($objp->description).'</textarea></td>'; |
1225 |
print '<td align="right">'; |
print '<td align="right">'; |
1226 |
//print $html->select_tva("tva_tx",$objp->tva_taux); |
print $html->select_tva("tva_tx",$objp->tva_taux); |
|
print $objp->tva_taux."%"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici |
|
1227 |
print '</td>'; |
print '</td>'; |
1228 |
print '<td align="right"><input size="6" type="text" name="price" value="'.price($objp->subprice).'"></td>'; |
print '<td align="right"><input size="6" type="text" name="price" value="'.price($objp->subprice).'"></td>'; |
1229 |
print '<td align="right"><input size="2" type="text" name="qty" value="'.$objp->qty.'"></td>'; |
print '<td align="right"><input size="2" type="text" name="qty" value="'.$objp->qty.'"></td>'; |
1318 |
{ |
{ |
1319 |
if ($user->rights->facture->valider) |
if ($user->rights->facture->valider) |
1320 |
{ |
{ |
1321 |
print " <a class=\"butAction\" href=\"facture.php?facid=".$fac->id."&action=valid\">".$langs->trans("Valid")."</a>\n"; |
print " <a class=\"butAction\" href=\"facture.php?facid=".$fac->id."&action=valid\">".$langs->trans("Validate")."</a>\n"; |
1322 |
} |
} |
1323 |
} |
} |
1324 |
else |
else |