Renomme titre facture en "facture client" et corrige quelques pb alignement tableau

This commit is contained in:
Laurent Destailleur 2006-03-14 21:31:59 +00:00
parent a68c01a619
commit 8e3ce6ee81
5 changed files with 98 additions and 97 deletions

View File

@ -83,7 +83,7 @@ if ($_POST['action'] == 'setmode')
$facture = new Facture($db); $facture = new Facture($db);
$facture->fetch($_GET['facid']); $facture->fetch($_GET['facid']);
$result=$facture->mode_reglement($_POST['mode_reglement_id']); $result=$facture->mode_reglement($_POST['mode_reglement_id']);
if ($result < 0) dolibarr_print_error($db,$facture->error); if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
} }
if ($_POST['action'] == 'setconditions') if ($_POST['action'] == 'setconditions')
@ -91,7 +91,7 @@ if ($_POST['action'] == 'setconditions')
$facture = new Facture($db); $facture = new Facture($db);
$facture->fetch($_GET['facid']); $facture->fetch($_GET['facid']);
$result=$facture->cond_reglement($_POST['cond_reglement_id']); $result=$facture->cond_reglement($_POST['cond_reglement_id']);
if ($result < 0) dolibarr_print_error($db,$facture->error); if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
} }
if ($_POST['action'] == 'classin') if ($_POST['action'] == 'classin')
@ -204,7 +204,7 @@ if ($_POST['action'] == 'add')
} }
else else
{ {
dolibarr_print_error($db,$facture->error); dolibarr_print_error($facture->db,$facture->error);
} }
} }
@ -241,7 +241,7 @@ if ($_POST['action'] == 'add')
} }
else else
{ {
dolibarr_print_error($db,$facture->error); dolibarr_print_error($facture->db,$facture->error);
} }
} }
@ -289,7 +289,7 @@ if ($_POST['action'] == 'add')
} }
else else
{ {
dolibarr_print_error($db,$facture->error); dolibarr_print_error($facture->db,$facture->error);
} }
} }
@ -1166,7 +1166,7 @@ else
$head = facture_prepare_head($fac); $head = facture_prepare_head($fac);
dolibarr_fiche_head($head, 0, $langs->trans('Bill').' : '.$fac->ref); dolibarr_fiche_head($head, 0, $langs->trans('InvoiceCustomer'));
/* /*
* Confirmation de la suppression de la facture * Confirmation de la suppression de la facture
@ -1260,41 +1260,22 @@ else
} }
print '</td></tr>'; print '</td></tr>';
// Projet // Remise globale
print '<tr>'; print '<tr><td>'.$langs->trans('GlobalDiscount').'</td>';
if ($conf->projet->enabled) if ($fac->brouillon == 1 && $user->rights->facture->creer)
{ {
$langs->load('projects'); print '<form action="facture.php?facid='.$fac->id.'" method="post">';
print '<td>'; print '<input type="hidden" name="action" value="setremise">';
print '<td colspan="3"><input type="text" name="remise" size="1" value="'.$fac->remise_percent.'">% ';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>';
print $langs->trans('Project'); print '</form>';
print '</td>';
if ($_GET['action'] != 'classer')
{
print '<td align="right"><a href="facture.php?action=classer&amp;facid='.$fac->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->fk_soc,$fac->projetid,'projetid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->fk_soc,$fac->projetid,'none');
}
print '</td>';
} }
else else
{ {
print '<td>&nbsp;</td><td colspan="3">&nbsp;</td>'; print '<td colspan="3">'.$fac->remise_percent.'%</td>';
} }
$nbrows=7; $nbrows=5;
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">'; print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
@ -1351,23 +1332,6 @@ else
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Author').'</td><td colspan="3">'.$author->fullname.'</td></tr>';
print '<tr><td>'.$langs->trans('GlobalDiscount').'</td>';
if ($fac->brouillon == 1 && $user->rights->facture->creer)
{
print '<form action="facture.php?facid='.$fac->id.'" method="post">';
print '<input type="hidden" name="action" value="setremise">';
print '<td colspan="3"><input type="text" name="remise" size="1" value="'.$fac->remise_percent.'">% ';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>';
print '</form>';
}
else
{
print '<td colspan="3">'.$fac->remise_percent.'%</td>';
}
print '</tr>';
/* /*
\todo \todo
L'info "Reference commande client" est une carac de la commande et non de la facture. L'info "Reference commande client" est une carac de la commande et non de la facture.
@ -1404,18 +1368,37 @@ else
// Statut // Statut
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($fac->getLibStatut()).'</td></tr>'; print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($fac->getLibStatut()).'</td></tr>';
/* // Projet
if ($fac->note_public) if ($conf->projet->enabled)
{ {
print '<tr><td valign="top">'.$langs->trans('NotePublic').'</td>'; print '<tr>';
print '<td colspan="3">'.nl2br(dolibarr_trunc($fac->note_public,40)).'</td></tr>'; $langs->load('projects');
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($_GET['action'] != 'classer')
{
print '<td align="right"><a href="facture.php?action=classer&amp;facid='.$fac->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->fk_soc,$fac->projetid,'projetid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->fk_soc,$fac->projetid,'none');
}
print '</td>';
print '</tr>';
} }
else
{
print '<tr><td colspan="4">&nbsp;</td></tr>';
}
*/
print '</table><br>'; print '</table><br>';
/* /*

View File

@ -75,7 +75,7 @@ if ($_GET["facid"] > 0)
$head = facture_prepare_head($fac); $head = facture_prepare_head($fac);
$hselected = $conf->use_preview_tabs ? 2 : false; $hselected = $conf->use_preview_tabs ? 2 : false;
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); dolibarr_fiche_head($head, $hselected, $langs->trans("InvoiceCustomer"));
/* /*
@ -84,7 +84,10 @@ if ($_GET["facid"] > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$rowspan=3; $rowspan=3;
// Societe // Reference
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="5">'.$fac->ref.'</td></tr>';
// Societe
print '<tr><td>'.$langs->trans("Company").'</td>'; print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="5">'; print '<td colspan="5">';
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>';
@ -105,31 +108,24 @@ if ($_GET["facid"] > 0)
$html->form_modes_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->mode_reglement_id,"none"); $html->form_modes_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->mode_reglement_id,"none");
print '</td></tr>'; print '</td></tr>';
print '<tr>'; // Remise globale
if ($conf->projet->enabled) print '<tr><td>'.$langs->trans('GlobalDiscount').'</td>';
{ if ($fac->brouillon == 1 && $user->rights->facture->creer)
$langs->load("projects"); {
print '<td>'.$langs->trans("Project").'</td><td colspan="3">'; print '<form action="facture.php?facid='.$fac->id.'" method="post">';
if ($fac->projetid > 0) print '<input type="hidden" name="action" value="setremise">';
{ print '<td colspan="3"><input type="text" name="remise" size="1" value="'.$fac->remise_percent.'">% ';
$projet = New Project($db); print '<input type="submit" class="button" value="'.$langs->trans('Modify').'"></td>';
$projet->fetch($fac->projetid); print '</form>';
print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$fac->projetid.'">'.$projet->title.'</a>'; }
} else
else {
{ print '<td colspan="3">'.$fac->remise_percent.'%</td>';
print '&nbsp;'; }
}
}
else
{
print '<td>&nbsp;</td><td colspan="3">';
}
print '</td>';
// partie Droite sur $rowspan lignes
print '<td colspan="2" rowspan="'.$rowspan.'" valign="top" width="50%">';
$nbrows=5;
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
/* /*
* Documents * Documents
@ -214,15 +210,37 @@ if ($_GET["facid"] > 0)
} }
print "</td></tr>"; print "</td></tr>";
print '<tr><td nowrap>'.$langs->trans("GlobalDiscount").'</td>';
print '<td align="right" colspan="2">'.$fac->remise_percent.'</td>';
print '<td>%</td></tr>';
print '<tr><td>'.$langs->trans("AmountHT").'</td>'; print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right" colspan="2"><b>'.price($fac->total_ht).'</b></td>'; print '<td align="right" colspan="2"><b>'.price($fac->total_ht).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_tva).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_ttc).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Statut
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($fac->getLibStatut()).'</td></tr>';
// Projet
if ($conf->projet->enabled)
{
print '<tr>';
$langs->load("projects");
print '<td>'.$langs->trans("Project").'</td><td colspan="3">';
if ($fac->projetid > 0)
{
$projet = New Project($db);
$projet->fetch($fac->projetid);
print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$fac->projetid.'">'.$projet->title.'</a>';
}
else
{
print '&nbsp;';
}
print '</td></tr>';
}
print '</table>'; print '</table>';
} }

View File

@ -225,7 +225,7 @@ if ($id > 0)
$head = facture_prepare_head($facture); $head = facture_prepare_head($facture);
dolibarr_fiche_head($head, 1, $langs->trans('Bill').' : '.$facture->ref); dolibarr_fiche_head($head, 1, $langs->trans('InvoiceCustomer'));
/* /*
* Facture synthese pour rappel * Facture synthese pour rappel
@ -241,7 +241,7 @@ if ($id > 0)
if ( is_null($facture->client) ) if ( is_null($facture->client) )
$facture->fetch_client(); $facture->fetch_client();
print "<tr><td>".$langs->trans("Customer")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'; print '<td colspan="3">';
print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$facture->client->id.'">'.$facture->client->nom.'</a></b></td></tr>'; print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$facture->client->id.'">'.$facture->client->nom.'</a></b></td></tr>';
print "</table>"; print "</table>";

View File

@ -49,7 +49,7 @@ $head = facture_prepare_head($fac);
$hselected = 3; $hselected = 3;
if ($conf->use_preview_tabs) $hselected++; if ($conf->use_preview_tabs) $hselected++;
if ($fac->mode_reglement_code == 'PRE') $hselected++; if ($fac->mode_reglement_code == 'PRE') $hselected++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); dolibarr_fiche_head($head, $hselected, $langs->trans("InvoiceCustomer"));
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';

View File

@ -107,7 +107,7 @@ if ($_GET["facid"])
if ($conf->use_preview_tabs) $hselected++; if ($conf->use_preview_tabs) $hselected++;
if ($fac->mode_reglement_code == 'PRE') $hselected++; if ($fac->mode_reglement_code == 'PRE') $hselected++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); dolibarr_fiche_head($head, $hselected, $langs->trans("InvoiceCustomer"));
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';