36 global $db, $langs, $conf;
41 $head[$h][0] = DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.$object->id;
42 $head[$h][1] = $langs->trans(
'SupplierInvoice');
43 $head[$h][2] =
'card';
46 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
48 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
49 $head[$h][0] = DOL_URL_ROOT.
'/fourn/facture/contact.php?facid='.$object->id;
50 $head[$h][1] = $langs->trans(
'ContactsAddresses');
51 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
52 $head[$h][2] =
'contact';
57 if (!empty($conf->paymentbybanktransfer->enabled))
59 $nbStandingOrders = 0;
60 $sql =
"SELECT COUNT(pfd.rowid) as nb";
61 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_facture_demande as pfd";
62 $sql .=
" WHERE pfd.fk_facture_fourn = ".$object->id;
63 $sql .=
" AND pfd.ext_payment_id IS NULL";
67 $obj = $db->fetch_object(
$resql);
68 if ($obj) $nbStandingOrders = $obj->nb;
71 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/prelevement.php?facid='.$object->id.
'&type=bank-transfer';
72 $head[$h][1] = $langs->trans(
'BankTransfer');
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.
'/fourn/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';
98 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($object->id, 2, 0, 0, $object,
'invoice_supplier').$object->ref;
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.
'/fourn/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.
'/fourn/facture/info.php?facid='.$object->id;
108 $head[$h][1] = $langs->trans(
'Info');
109 $head[$h][2] =
'info';
126 global $db, $langs, $conf, $user;
131 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/card.php?id='.$object->id;
132 $head[$h][1] = $langs->trans(
"SupplierOrder");
133 $head[$h][2] =
'card';
136 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
138 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
139 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/contact.php?id='.$object->id;
140 $head[$h][1] = $langs->trans(
'ContactsAddresses');
141 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
142 $head[$h][2] =
'contact';
146 if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)))
148 $langs->load(
"stocks");
149 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/dispatch.php?id='.$object->id;
150 $head[$h][1] = $langs->trans(
"OrderDispatch");
151 $head[$h][2] =
'dispatch';
161 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
164 if (!empty($object->note_private)) $nbNote++;
165 if (!empty($object->note_public)) $nbNote++;
166 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/note.php?id='.$object->id;
167 $head[$h][1] = $langs->trans(
"Notes");
168 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
169 $head[$h][2] =
'note';
173 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
174 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
176 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
177 $nbLinks =
Link::count($db, $object->element, $object->id);
178 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/document.php?id='.$object->id;
179 $head[$h][1] = $langs->trans(
'Documents');
180 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
181 $head[$h][2] =
'documents';
184 $head[$h][0] = DOL_URL_ROOT.
'/fourn/commande/info.php?id='.$object->id;
185 $head[$h][1] .= $langs->trans(
"Events");
186 if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
189 $head[$h][1] .= $langs->trans(
"Agenda");
191 $head[$h][2] =
'info';
204 global $langs, $conf, $user;
209 $head[$h][0] = DOL_URL_ROOT.
"/admin/supplier_order.php";
210 $head[$h][1] = $langs->trans(
"SupplierOrder");
211 $head[$h][2] =
'order';
214 $head[$h][0] = DOL_URL_ROOT.
"/admin/supplier_invoice.php";
215 $head[$h][1] = $langs->trans(
"SuppliersInvoice");
216 $head[$h][2] =
'invoice';
219 $head[$h][0] = DOL_URL_ROOT.
"/admin/supplier_payment.php";
220 $head[$h][1] = $langs->trans(
"SuppliersPayment");
221 $head[$h][2] =
'supplierpayment';
226 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplierorder_extrafields.php';
227 $head[$h][1] = $langs->trans(
"ExtraFieldsSupplierOrders");
228 $head[$h][2] =
'supplierorder';
231 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplierorderdet_extrafields.php';
232 $head[$h][1] = $langs->trans(
"ExtraFieldsSupplierOrdersLines");
233 $head[$h][2] =
'supplierorderdet';
236 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplierinvoice_extrafields.php';
237 $head[$h][1] = $langs->trans(
"ExtraFieldsSupplierInvoices");
238 $head[$h][2] =
'supplierinvoice';
241 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplierinvoicedet_extrafields.php';
242 $head[$h][1] = $langs->trans(
"ExtraFieldsSupplierInvoicesLines");
243 $head[$h][2] =
'supplierinvoicedet';
ordersupplier_prepare_head($object)
Prepare array with list of tabs.
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object informations.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart= '')
Return a path to have a the directory according to object where files are stored. ...
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.
facturefourn_prepare_head($object)
Prepare array with list of tabs.
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).