Go to the documentation of this file.
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';
32 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 $langs->loadLangs(array(
'companies',
'bills'));
46 $extrafields->fetch_name_optionals_label($object->table_element);
49 if ($id > 0 || !empty($ref)) {
50 $ret = $object->fetch($id, $ref,
'',
'', (!empty($conf->global->INVOICE_USE_SITUATION) ? $conf->global->INVOICE_USE_SITUATION : 0));
55 $socid = $user->socid;
59 $result =
restrictedArea($user,
'facture', $object->id,
'',
'',
'fk_soc',
'rowid', $isdraft);
68 $title = $langs->trans(
'InvoiceCustomer').
" - ".$langs->trans(
'Info');
69 $help_url =
"EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
73 if (empty($object->id)) {
74 $langs->load(
'errors');
75 echo
'<div class="error">'.$langs->trans(
"ErrorRecordNotFound").
'</div>';
80 $object->fetch_thirdparty();
82 $object->info($object->id);
87 $totalpaid = $object->getSommePaiement();
91 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
93 $morehtmlref =
'<div class="refidno">';
95 $morehtmlref .=
$form->editfieldkey(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'', 0, 1);
96 $morehtmlref .=
$form->editfieldval(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'',
null,
null,
'', 1);
98 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1,
'customer');
101 $langs->load(
"projects");
102 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
103 if ($user->rights->facture->creer) {
104 if ($action !=
'classify') {
106 $morehtmlref .=
' : ';
108 if ($action ==
'classify') {
110 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
111 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
112 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
113 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
114 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
115 $morehtmlref .=
'</form>';
117 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
120 if (!empty($object->fk_project)) {
122 $proj->fetch($object->fk_project);
123 $morehtmlref .=
' : '.$proj->getNomUrl(1);
125 $morehtmlref .=
' - '.$proj->title;
132 $morehtmlref .=
'</div>';
134 $object->totalpaid = $totalpaid;
136 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0);
138 print
'<div class="fichecenter">';
139 print
'<div class="underbanner clearboth"></div>';
143 print
'<table class="centpercent"><tr><td>';
145 print
'</td></tr></table>';
const STATUS_DRAFT
Draft status.
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Class to manage projects.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
facture_prepare_head($object)
Initialize the array of tabs for customer invoice.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
isModEnabled($module)
Is Dolibarr module enabled.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.