38 global $db, $langs, $conf;
43 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/card.php?facid='.$object->id;
44 $head[$h][1] = $langs->trans(
'CustomerInvoice');
45 $head[$h][2] =
'compta';
48 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
50 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
51 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/contact.php?facid='.$object->id;
52 $head[$h][1] = $langs->trans(
'ContactsAddresses');
53 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
54 $head[$h][2] =
'contact';
58 if (!empty($conf->prelevement->enabled))
60 $nbStandingOrders = 0;
61 $sql =
"SELECT COUNT(pfd.rowid) as nb";
62 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_facture_demande as pfd";
63 $sql .=
" WHERE pfd.fk_facture = ".$object->id;
64 $sql .=
" AND pfd.ext_payment_id IS NULL";
68 $obj = $db->fetch_object(
$resql);
69 if ($obj) $nbStandingOrders = $obj->nb;
71 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/prelevement.php?facid='.$object->id;
72 $head[$h][1] = $langs->trans(
'StandingOrders');
73 if ($nbStandingOrders > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
74 $head[$h][2] =
'standingorders';
84 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
87 if (!empty($object->note_private)) $nbNote++;
88 if (!empty($object->note_public)) $nbNote++;
89 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/note.php?facid='.$object->id;
90 $head[$h][1] = $langs->trans(
'Notes');
91 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
92 $head[$h][2] =
'note';
96 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
97 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
99 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
100 $nbLinks =
Link::count($db, $object->element, $object->id);
101 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/document.php?facid='.$object->id;
102 $head[$h][1] = $langs->trans(
'Documents');
103 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
104 $head[$h][2] =
'documents';
107 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/info.php?facid='.$object->id;
108 $head[$h][1] = $langs->trans(
'Info');
109 $head[$h][2] =
'info';
124 global $langs, $conf, $user;
129 $head[$h][0] = DOL_URL_ROOT.
'/admin/facture.php';
130 $head[$h][1] = $langs->trans(
"Miscellaneous");
131 $head[$h][2] =
'general';
134 $head[$h][0] = DOL_URL_ROOT.
'/admin/payment.php';
135 $head[$h][1] = $langs->trans(
"Payments");
136 $head[$h][2] =
'payment';
145 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facture_cust_extrafields.php';
146 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoices");
147 $head[$h][2] =
'attributes';
150 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facturedet_cust_extrafields.php';
151 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
152 $head[$h][2] =
'attributeslines';
155 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facture_rec_cust_extrafields.php';
156 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoicesRec");
157 $head[$h][2] =
'attributesrec';
160 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
161 $head[$h][1] = $langs->trans(
"ExtraFieldsLinesRec");
162 $head[$h][2] =
'attributeslinesrec';
165 if ($conf->global->INVOICE_USE_SITUATION) {
166 $head[$h][0] = DOL_URL_ROOT.
'/admin/facture_situation.php';
167 $head[$h][1] = $langs->trans(
"InvoiceSituation");
168 $head[$h][2] =
'situation';
186 global $db, $langs, $conf;
191 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/card-rec.php?id='.$object->id;
192 $head[$h][1] = $langs->trans(
"RepeatableInvoice");
193 $head[$h][2] =
'card';
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
static count($db, $objecttype, $objectid)
Return nb of links.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).
invoice_rec_prepare_head($object)
Return array head with list of tabs to view object informations.
facture_prepare_head($object)
Initialize the array of tabs for customer invoice.