26 require
'../../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
31 if (!empty($conf->projet->enabled)) {
32 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 $langs->loadLangs(array(
'companies',
'bills'));
46 $form =
new Form($db);
48 $title = $langs->trans(
'InvoiceCustomer').
" - ".$langs->trans(
'Info');
49 $helpurl =
"EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
53 $object->fetch($id, $ref);
54 $object->fetch_thirdparty();
56 $object->info($object->id);
61 $totalpaye = $object->getSommePaiement();
65 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
67 $morehtmlref =
'<div class="refidno">';
69 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'', 0, 1);
70 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'', null, null,
'', 1);
72 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1,
'customer');
74 if (!empty($conf->projet->enabled))
76 $langs->load(
"projects");
77 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
78 if ($user->rights->facture->creer)
80 if ($action !=
'classify')
82 $morehtmlref .=
' : ';
83 if ($action ==
'classify') {
85 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
86 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
87 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
88 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
89 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
90 $morehtmlref .=
'</form>';
92 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
95 if (!empty($object->fk_project)) {
97 $proj->fetch($object->fk_project);
98 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$object->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
99 $morehtmlref .= $proj->ref;
100 $morehtmlref .=
'</a>';
106 $morehtmlref .=
'</div>';
108 $object->totalpaye = $totalpaye;
110 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0);
112 print '<div class="fichecenter">';
113 print '<div class="underbanner clearboth"></div>';
117 print '<table width="100%"><tr><td>';
119 print '</td></tr></table>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
Class to manage projects.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage invoices.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
facture_prepare_head($object)
Initialize the array of tabs for customer invoice.