335 |
$_POST['pu'], |
$_POST['pu'], |
336 |
$_POST['qty'], |
$_POST['qty'], |
337 |
$_POST['tva_tx'], |
$_POST['tva_tx'], |
338 |
0, |
$_POST['idprod'], |
339 |
$_POST['remise_percent'], |
$_POST['remise_percent'], |
340 |
$datestart, |
$datestart, |
341 |
$dateend |
$dateend |
651 |
print '</td>'; |
print '</td>'; |
652 |
|
|
653 |
// Notes |
// Notes |
654 |
print '<td rowspan="5" valign="top">'; |
$nbrows=4; |
655 |
print '<textarea name="note" wrap="soft" cols="50" rows="4">'; |
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; |
656 |
|
print '<td rowspan="'.$nbrows.'" valign="top">'; |
657 |
|
print '<textarea name="note" wrap="soft" cols="50" rows="'.ROWS_5.'">'; |
658 |
if (is_object($propal)) |
if (is_object($propal)) |
659 |
{ |
{ |
660 |
print $propal->note; |
print $propal->note; |
693 |
print '<tr><td colspan="2"> </td></tr>'; |
print '<tr><td colspan="2"> </td></tr>'; |
694 |
} |
} |
695 |
|
|
696 |
print '<tr><td>'.$langs->trans('RefCdeClient').'</td><td>'; |
/* |
697 |
print '<input type="text" name="ref_client" value="'.$ref_client.'">'; |
\todo |
698 |
print '</td></tr>'; |
L'info "Reference commande client" est une carac de la commande et non de la facture. |
699 |
|
Elle devrait donc etre stockée sur l'objet commande lié à la facture et non sur la facture. |
700 |
|
Pour ceux qui utilisent ainsi, positionner la constante FAC_USE_CUSTOMER_ORDER_REF à 1. |
701 |
|
*/ |
702 |
|
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) |
703 |
|
{ |
704 |
|
print '<tr><td>'.$langs->trans('RefCdeClient').'</td><td>'; |
705 |
|
print '<input type="text" name="ref_client" value="'.$ref_client.'">'; |
706 |
|
print '</td></tr>'; |
707 |
|
} |
708 |
|
|
709 |
if ($_GET['propalid'] > 0) |
if ($_GET['propalid'] > 0) |
710 |
{ |
{ |
711 |
print '<input type="hidden" name="amount" value="'.$propal->price.'">'."\n"; |
print '<input type="hidden" name="amount" value="'.$propal->price.'">'."\n"; |
718 |
print '<tr><td>'.$langs->trans('Proposal').'</td><td colspan="2">'.$propal->ref.'</td></tr>'; |
print '<tr><td>'.$langs->trans('Proposal').'</td><td colspan="2">'.$propal->ref.'</td></tr>'; |
719 |
print '<tr><td>'.$langs->trans('GlobalDiscount').'</td><td colspan="2">'.$propal->remise_percent.'%</td></tr>'; |
print '<tr><td>'.$langs->trans('GlobalDiscount').'</td><td colspan="2">'.$propal->remise_percent.'%</td></tr>'; |
720 |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($propal->price).'</td></tr>'; |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($propal->price).'</td></tr>'; |
721 |
print '<tr><td>'.$langs->trans('VAT').'</td><td colspan="2">'.price($propal->tva)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($propal->tva)."</td></tr>"; |
722 |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($propal->total)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($propal->total)."</td></tr>"; |
723 |
} |
} |
724 |
elseif ($_GET['commandeid'] > 0) |
elseif ($_GET['commandeid'] > 0) |
729 |
|
|
730 |
print '<tr><td>'.$langs->trans('Order').'</td><td colspan="2">'.$commande->ref.'</td></tr>'; |
print '<tr><td>'.$langs->trans('Order').'</td><td colspan="2">'.$commande->ref.'</td></tr>'; |
731 |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($commande->total_ht).'</td></tr>'; |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($commande->total_ht).'</td></tr>'; |
732 |
print '<tr><td>'.$langs->trans('VAT').'</td><td colspan="2">'.price($commande->total_tva)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($commande->total_tva)."</td></tr>"; |
733 |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($commande->total_ttc)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($commande->total_ttc)."</td></tr>"; |
734 |
} |
} |
735 |
elseif ($_GET['contratid'] > 0) |
elseif ($_GET['contratid'] > 0) |
748 |
|
|
749 |
print '<tr><td>'.$langs->trans('Contract').'</td><td colspan="2">'.$contrat->ref.'</td></tr>'; |
print '<tr><td>'.$langs->trans('Contract').'</td><td colspan="2">'.$contrat->ref.'</td></tr>'; |
750 |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($contrat->total_ht).'</td></tr>'; |
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($contrat->total_ht).'</td></tr>'; |
751 |
print '<tr><td>'.$langs->trans('VAT').'</td><td colspan="2">'.price($contrat->total_tva)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($contrat->total_tva)."</td></tr>"; |
752 |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($contrat->total_ttc)."</td></tr>"; |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($contrat->total_ttc)."</td></tr>"; |
753 |
} |
} |
754 |
else |
else |
765 |
for ($i = 1 ; $i <= $NBLINES ; $i++) |
for ($i = 1 ; $i <= $NBLINES ; $i++) |
766 |
{ |
{ |
767 |
print '<tr><td>'; |
print '<tr><td>'; |
768 |
$html->select_produits('','idprod'.$i); |
$html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); |
769 |
print '</td>'; |
print '</td>'; |
770 |
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>'; |
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>'; |
771 |
print '<td><input type="text" size="4" name="remise_percent'.$i.'" value="0">%</td>'; |
print '<td nowrap="nowrap"><input type="text" size="4" name="remise_percent'.$i.'" value="0">%</td>'; |
772 |
print '<td> </td>'; |
print '<td> </td>'; |
773 |
// Si le module service est actif, on propose des dates de début et fin à la ligne |
// Si le module service est actif, on propose des dates de début et fin à la ligne |
774 |
if ($conf->service->enabled) |
if ($conf->service->enabled) |
775 |
{ |
{ |
776 |
print '<td>'; |
print '<td nowrap="nowrap">'; |
777 |
print 'Du '; |
print 'Du '; |
778 |
print $html->select_date('','date_start'.$i,0,0,1); |
print $html->select_date('','date_start'.$i,0,0,1); |
779 |
print '<br>au '; |
print '<br>au '; |
1232 |
print '<table class="nobordernopadding" width="100%"><tr><td>'; |
print '<table class="nobordernopadding" width="100%"><tr><td>'; |
1233 |
print $langs->trans('Project'); |
print $langs->trans('Project'); |
1234 |
print '</td>'; |
print '</td>'; |
1235 |
if ($_GET['action'] != 'classer') print '<td align="right"><a href="facture.php?action=classer&facid='.$fac->id.'">'; |
if ($_GET['action'] != 'classer') |
1236 |
print img_edit($langs->trans('SetProject')); |
{ |
1237 |
print '</a></td>'; |
print '<td align="right"><a href="facture.php?action=classer&facid='.$fac->id.'">'; |
1238 |
|
print img_edit($langs->trans('SetProject')); |
1239 |
|
print '</a></td>'; |
1240 |
|
} |
1241 |
print '</tr></table>'; |
print '</tr></table>'; |
1242 |
|
|
1243 |
print '</td><td colspan="3">'; |
print '</td><td colspan="3">'; |
1256 |
print '<td> </td><td colspan="3"> </td>'; |
print '<td> </td><td colspan="3"> </td>'; |
1257 |
} |
} |
1258 |
|
|
1259 |
print '<td rowspan="9" colspan="2" valign="top">'; |
$nbrows=8; |
1260 |
|
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; |
1261 |
|
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">'; |
1262 |
|
|
1263 |
/* |
/* |
1264 |
* Paiements |
* Paiements |
1332 |
} |
} |
1333 |
print '</tr>'; |
print '</tr>'; |
1334 |
|
|
1335 |
print '<tr><td>'.$langs->trans('RefCdeClient').'</td>'; |
/* |
1336 |
if ($fac->brouillon == 1 && $user->rights->facture->creer) |
\todo |
1337 |
{ |
L'info "Reference commande client" est une carac de la commande et non de la facture. |
1338 |
print '<form action="facture.php?facid='.$fac->id.'" method="post">'; |
Elle devrait donc etre stockée sur l'objet commande lié à la facture et non sur la facture. |
1339 |
print '<input type="hidden" name="action" value="set_ref_client">'; |
Pour ceux qui utilisent ainsi, positionner la constante FAC_USE_CUSTOMER_ORDER_REF à 1. |
1340 |
print '<td colspan="3"><input type="text" name="ref_client" size="20" value="'.$fac->ref_client.'">'; |
*/ |
1341 |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>'; |
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) |
1342 |
print '</form>'; |
{ |
1343 |
} |
print '<tr><td>'.$langs->trans('RefCdeClient').'</td>'; |
1344 |
else |
|
1345 |
{ |
if ($fac->brouillon == 1 && $user->rights->facture->creer) |
1346 |
print '<td colspan="3">'.$fac->ref_client.'</td>'; |
{ |
1347 |
} |
print '<form action="facture.php?facid='.$fac->id.'" method="post">'; |
1348 |
|
print '<input type="hidden" name="action" value="set_ref_client">'; |
1349 |
|
print '<td colspan="3"><input type="text" name="ref_client" size="20" value="'.$fac->ref_client.'">'; |
1350 |
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>'; |
1351 |
|
print '</form>'; |
1352 |
|
} |
1353 |
|
else |
1354 |
|
{ |
1355 |
|
print '<td colspan="3">'.$fac->ref_client.'</td>'; |
1356 |
|
} |
1357 |
|
} |
1358 |
|
|
1359 |
print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
1360 |
print '<td align="right" colspan="2" nowrap><b>'.price($fac->total_ht).'</b></td>'; |
print '<td align="right" colspan="2" nowrap><b>'.price($fac->total_ht).'</b></td>'; |
1361 |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
1362 |
|
|
1363 |
print '<tr><td>'.$langs->trans('VAT').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_tva).'</td>'; |
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_tva).'</td>'; |
1364 |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
1365 |
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_ttc).'</td>'; |
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_ttc).'</td>'; |
1366 |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
1500 |
print ' - '.stripslashes(nl2br($objp->product)); |
print ' - '.stripslashes(nl2br($objp->product)); |
1501 |
print '<br>'; |
print '<br>'; |
1502 |
} |
} |
1503 |
print '<textarea name="desc" cols="50" rows="1">'.stripslashes($objp->description).'</textarea></td>'; |
print '<textarea name="desc" cols="50" rows="'.ROWS_2.'">'.stripslashes($objp->description).'</textarea></td>'; |
1504 |
print '<td align="right">'; |
print '<td align="right">'; |
1505 |
print $html->select_tva('tva_tx',$objp->tva_taux); |
print $html->select_tva('tva_tx',$objp->tva_taux); |
1506 |
print '</td>'; |
print '</td>'; |
1539 |
*/ |
*/ |
1540 |
if ($fac->statut == 0 && $user->rights->facture->creer && $_GET['action'] <> 'valid') |
if ($fac->statut == 0 && $user->rights->facture->creer && $_GET['action'] <> 'valid') |
1541 |
{ |
{ |
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
|
1542 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
1543 |
print '<td>'.$langs->trans('Description').'</td>'; |
print '<td>'.$langs->trans('Description').'</td>'; |
1544 |
print '<td align="right">'.$langs->trans('VAT').'</td>'; |
print '<td align="right">'.$langs->trans('VAT').'</td>'; |
1549 |
print '<td> </td>'; |
print '<td> </td>'; |
1550 |
print '<td> </td>'; |
print '<td> </td>'; |
1551 |
print '<td> </td>'; |
print '<td> </td>'; |
1552 |
print '</tr>'; |
print "</tr>\n"; |
1553 |
|
|
1554 |
|
// Ajout produit produits/services personalisés |
1555 |
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
1556 |
print '<input type="hidden" name="facid" value="'.$fac->id.'">'; |
print '<input type="hidden" name="facid" value="'.$fac->id.'">'; |
1557 |
print '<input type="hidden" name="action" value="addligne">'; |
print '<input type="hidden" name="action" value="addligne">'; |
1558 |
|
|
1559 |
$var=!$var; |
$var=true; |
|
|
|
1560 |
print '<tr '.$bc[$var].'>'; |
print '<tr '.$bc[$var].'>'; |
1561 |
print '<td><textarea name="desc" cols="50" rows="1"></textarea></td>'; |
print '<td><textarea name="desc" cols="50" rows="'.ROWS_2.'"></textarea></td>'; |
1562 |
print '<td align="right">'; |
print '<td align="right">'; |
1563 |
print $html->select_tva('tva_tx',$conf->defaulttx); |
$html->select_tva('tva_tx',$conf->defaulttx); |
1564 |
print '</td>'; |
print '</td>'; |
1565 |
print '<td align="right"><input type="text" name="pu" size="6"></td>'; |
print '<td align="right"><input type="text" name="pu" size="6"></td>'; |
1566 |
print '<td align="right"><input type="text" name="qty" value="1" size="2"></td>'; |
print '<td align="right"><input type="text" name="qty" value="1" size="2"></td>'; |
1578 |
print '</tr>'; |
print '</tr>'; |
1579 |
} |
} |
1580 |
print '</form>'; |
print '</form>'; |
1581 |
|
|
1582 |
|
// Ajout de produits/services prédéfinis |
1583 |
|
if ($conf->produit->enabled) |
1584 |
|
{ |
1585 |
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
1586 |
|
print '<input type="hidden" name="facid" value="'.$fac->id.'">'; |
1587 |
|
print '<input type="hidden" name="action" value="addligne">'; |
1588 |
|
|
1589 |
|
$var=! $var; |
1590 |
|
print '<tr '.$bc[$var].'>'; |
1591 |
|
print '<td colspan="2">'; |
1592 |
|
$html->select_produits('','idprod','',$conf->produit->limit_size); |
1593 |
|
print '<br>'; |
1594 |
|
print '<textarea name="desc" cols="50" rows="'.ROWS_2.'"></textarea></td>'; |
1595 |
|
print '<td> </td>'; |
1596 |
|
print '<td align="right"><input type="text" name="qty" value="1" size="2"></td>'; |
1597 |
|
print '<td align="right" nowrap><input type="text" name="remise_percent" size="2" value="0">%</td>'; |
1598 |
|
print '<td align="center" valign="middle" rowspan="2" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; |
1599 |
|
print '</tr>'; |
1600 |
|
if ($conf->service->enabled) |
1601 |
|
{ |
1602 |
|
print '<tr '.$bc[$var].'>'; |
1603 |
|
print '<td colspan="5">Si produit de type service à durée limitée: Du '; |
1604 |
|
print $html->select_date('','date_start',0,0,1); |
1605 |
|
print ' au '; |
1606 |
|
print $html->select_date('','date_end',0,0,1); |
1607 |
|
print '</td>'; |
1608 |
|
print '</tr>'; |
1609 |
|
} |
1610 |
|
print '</form>'; |
1611 |
|
} |
1612 |
} |
} |
1613 |
print "</table>\n"; |
print "</table>\n"; |
1614 |
|
|
|
|
|
1615 |
print "</div>\n"; |
print "</div>\n"; |
1616 |
|
|
1617 |
|
|
1776 |
print '<table class="noborder" width="100%">'; |
print '<table class="noborder" width="100%">'; |
1777 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
1778 |
print '<td>'.$langs->trans('Ref').'</td>'; |
print '<td>'.$langs->trans('Ref').'</td>'; |
1779 |
print '<td>'.$langs->trans('RefCdeClient').'</td>'; |
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) |
1780 |
|
{ |
1781 |
|
print '<td>'.$langs->trans('RefCdeClient').'</td>'; |
1782 |
|
} |
1783 |
print '<td align="center">'.$langs->trans('Date').'</td>'; |
print '<td align="center">'.$langs->trans('Date').'</td>'; |
1784 |
print '<td align="right">'.$langs->trans('AmountHT').'</td>'; |
print '<td align="right">'.$langs->trans('AmountHT').'</td>'; |
1785 |
print '</tr>'; |
print '</tr>'; |