28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 if (!empty($conf->project->enabled)) {
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
37 $langs->loadLangs(array(
"companies",
"bills"));
44 $socid = $user->socid;
46 $result =
restrictedArea($user,
'fournisseur', $id,
'facture_fourn',
'facture');
47 $hookmanager->initHooks(array(
'invoicesuppliercardinfo'));
58 $title = $langs->trans(
'SupplierInvoice').
" - ".$langs->trans(
'Info');
59 $helpurl =
"EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores";
62 $object->fetch($id, $ref);
63 $object->fetch_thirdparty();
65 $object->info($object->id);
67 $alreadypaid = $object->getSommePaiement();
70 $titre = $langs->trans(
'SupplierInvoice');
71 print
dol_get_fiche_head($head,
'info', $langs->trans(
'SupplierInvoice'), -1,
'supplier_invoice');
73 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
75 $morehtmlref =
'<div class="refidno">';
77 $morehtmlref .=
$form->editfieldkey(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'', 0, 1);
78 $morehtmlref .=
$form->editfieldval(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
80 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
81 if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
82 $morehtmlref .=
' (<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?socid='.$object->thirdparty->id.
'&search_company='.urlencode($object->thirdparty->name).
'">'.$langs->trans(
"OtherBills").
'</a>)';
85 if (!empty($conf->project->enabled)) {
86 $langs->load(
"projects");
87 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
88 if ($user->rights->facture->creer) {
89 if ($action !=
'classify') {
91 $morehtmlref .=
' : ';
93 if ($action ==
'classify') {
95 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
96 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
97 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
98 $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
99 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
100 $morehtmlref .=
'</form>';
102 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->thirdparty->id, $object->fk_project,
'none', 0, 0, 0, 1);
105 if (!empty($object->fk_project)) {
107 $proj->fetch($object->fk_project);
108 $morehtmlref .=
' : '.$proj->getNomUrl(1);
110 $morehtmlref .=
' - '.$proj->title;
117 $morehtmlref .=
'</div>';
119 $object->totalpaid = $alreadypaid;
121 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0);
123 print
'<div class="fichecenter">';
124 print
'<div class="underbanner clearboth"></div>';
128 print
'<table width="100%"><tr><td>';
130 print
'</td></tr></table>';