28 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.facture.class.php';
31 require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.product.class.php';
32 require_once DOL_DOCUMENT_ROOT .
'/core/class/html.formaccounting.class.php';
33 require_once DOL_DOCUMENT_ROOT .
'/accountancy/class/accountingaccount.class.php';
34 require_once DOL_DOCUMENT_ROOT .
'/core/lib/accounting.lib.php';
35 require_once DOL_DOCUMENT_ROOT .
'/core/class/html.formother.class.php';
36 require_once DOL_DOCUMENT_ROOT .
'/core/lib/date.lib.php';
37 require_once DOL_DOCUMENT_ROOT .
'/core/lib/company.lib.php';
40 $langs->loadLangs(array(
"bills",
"compta",
"accountancy",
"other",
"productbatch"));
42 $action=
GETPOST(
'action',
'alpha');
43 $massaction=
GETPOST(
'massaction',
'alpha');
44 $show_files=
GETPOST(
'show_files',
'int');
45 $confirm=
GETPOST(
'confirm',
'alpha');
46 $toselect =
GETPOST(
'toselect',
'array');
49 $mesCasesCochees =
GETPOST(
'toselect',
'array');
52 $search_lineid =
GETPOST(
'search_lineid',
'int');
53 $search_invoice =
GETPOST(
'search_invoice',
'alpha');
54 $search_ref =
GETPOST(
'search_ref',
'alpha');
55 $search_label =
GETPOST(
'search_label',
'alpha');
56 $search_desc =
GETPOST(
'search_desc',
'alpha');
57 $search_amount =
GETPOST(
'search_amount',
'alpha');
58 $search_account =
GETPOST(
'search_account',
'alpha');
59 $search_vat =
GETPOST(
'search_vat',
'alpha');
60 $search_day=
GETPOST(
"search_day",
"int");
61 $search_month=
GETPOST(
"search_month",
"int");
62 $search_year=
GETPOST(
"search_year",
"int");
63 $search_country =
GETPOST(
'search_country',
'alpha');
64 $search_tvaintra =
GETPOST(
'search_tvaintra',
'alpha');
66 $btn_ventil =
GETPOST(
'ventil',
'alpha');
69 $limit =
GETPOST(
'limit',
'int')?
GETPOST(
'limit',
'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
70 $sortfield =
GETPOST(
'sortfield',
'alpha');
71 $sortorder =
GETPOST(
'sortorder',
'alpha');
73 if (empty($page) || $page < 0) { $page = 0; }
74 $offset = $limit * $page;
75 $pageprev = $page - 1;
76 $pagenext = $page + 1;
78 $sortfield =
"f.datef, f.ref, l.rowid";
80 if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
86 if ($user->societe_id > 0)
88 if (! $user->rights->accounting->bind->write)
92 $hookmanager->initHooks(array(
'accountancysupplierlist'));
97 $aarowid_s = $accounting->fetch(
'', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
98 $aarowid_p = $accounting->fetch(
'', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
100 $chartaccountcode =
dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS,
'accounting_system',
'rowid',
'pcg_version');
107 if (
GETPOST(
'cancel',
'alpha')) { $action=
'list'; $massaction=
''; }
108 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction=
''; }
111 $reshook=$hookmanager->executeHooks(
'doActions',$parameters, $object, $action);
112 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
117 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
121 $search_invoice =
'';
125 $search_account =
'';
130 $search_country =
'';
131 $search_tvaintra =
'';
135 $objectclass=
'AccountingAccount';
136 $permtoread = $user->rights->accounting->read;
137 $permtodelete = $user->rights->accounting->delete;
138 $uploaddir = $conf->accounting->dir_output;
139 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
143 if ($massaction ==
'ventil') {
147 if (! empty($mesCasesCochees)) {
148 $msg =
'<div>' . $langs->trans(
"SelectedLines") .
': '.count($mesCasesCochees).
'</div>';
149 $msg.=
'<div class="detail">';
154 foreach ($mesCasesCochees as $maLigneCochee) {
155 $maLigneCourante = explode(
"_", $maLigneCochee);
156 $monId = $maLigneCourante[0];
157 $monCompte =
GETPOST(
'codeventil'.$monId);
161 $msg.=
'<div><font color="red">' . $langs->trans(
"Lineofinvoice") .
' ' . $monId .
' - ' . $langs->trans(
"NoAccountSelected") .
'</font></div>';
166 $sql =
" UPDATE " . MAIN_DB_PREFIX .
"facture_fourn_det";
167 $sql .=
" SET fk_code_ventilation = " . $monCompte;
168 $sql .=
" WHERE rowid = " . $monId;
171 $accountventilated->fetch($monCompte,
'');
173 dol_syslog(
'accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
174 if ($db->query($sql)) {
175 $msg.=
'<div><font color="green">' . $langs->trans(
"Lineofinvoice") .
' ' . $monId .
' - ' . $langs->trans(
"VentilatedinAccount") .
' : ' .
length_accountg($accountventilated->account_number) .
'</font></div>';
178 $msg.=
'<div><font color="red">' . $langs->trans(
"ErrorDB") .
' : ' . $langs->trans(
"Lineofinvoice") .
' ' . $monId .
' - ' . $langs->trans(
"NotVentilatedinAccount") .
' : ' .
length_accountg($accountventilated->account_number) .
'<br/> <pre>' . $sql .
'</pre></font></div>';
186 $msg.=
'<div>' . $langs->trans(
"EndProcessing") .
'</div>';
198 $form =
new Form($db);
201 llxHeader(
'', $langs->trans(
"SuppliersVentilation"));
203 if (empty($chartaccountcode))
205 print $langs->trans(
"ErrorChartOfAccountSystemNotSelected");
213 $sql =
"SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
214 $sql.=
" l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
215 $sql.=
" p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
216 $sql.=
" aa.rowid as aarowid,";
217 $sql.=
" co.code as country_code, co.label as country,";
218 $sql.=
" s.tva_intra";
220 $reshook=$hookmanager->executeHooks(
'printFieldListSelect',$parameters);
221 $sql.=$hookmanager->resPrint;
222 $sql.=
" FROM " . MAIN_DB_PREFIX .
"facture_fourn as f";
223 $sql .=
" INNER JOIN " . MAIN_DB_PREFIX .
"societe as s ON s.rowid = f.fk_soc";
224 $sql .=
" LEFT JOIN " . MAIN_DB_PREFIX .
"c_country as co ON co.rowid = s.fk_pays ";
225 $sql.=
" INNER JOIN " . MAIN_DB_PREFIX .
"facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
226 $sql.=
" LEFT JOIN " . MAIN_DB_PREFIX .
"product as p ON p.rowid = l.fk_product";
227 $sql.=
" LEFT JOIN " . MAIN_DB_PREFIX .
"accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode.
"' AND aa.entity = " . $conf->entity;
228 $sql.=
" WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
229 $sql.=
" AND l.product_type <= 2";
231 if ($search_lineid) {
234 if (strlen(trim($search_invoice))) {
237 if (strlen(trim($search_ref))) {
240 if (strlen(trim($search_label))) {
243 if (strlen(trim($search_desc))) {
246 if (strlen(trim($search_amount))) {
249 if (strlen(trim($search_account))) {
252 if (strlen(trim($search_vat))) {
255 if ($search_month > 0)
257 if ($search_year > 0 && empty($search_day))
258 $sql.=
" AND f.datef BETWEEN '".$db->idate(
dol_get_first_day($search_year,$search_month,
false)).
"' AND '".$db->idate(
dol_get_last_day($search_year,$search_month,
false)).
"'";
259 else if ($search_year > 0 && ! empty($search_day))
260 $sql.=
" AND f.datef BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $search_month, $search_day, $search_year)).
"' AND '".$db->idate(
dol_mktime(23, 59, 59, $search_month, $search_day, $search_year)).
"'";
262 $sql.=
" AND date_format(f.datef, '%m') = '".$db->escape($search_month).
"'";
264 else if ($search_year > 0)
268 if (strlen(trim($search_country))) {
270 $country_code_in_EEC = $country_code_in_EEC_without_me =
'';
271 foreach ($arrayofcode as $key => $value)
273 $country_code_in_EEC.=($country_code_in_EEC ?
"," :
"").
"'".$value.
"'";
274 if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ?
"," :
"").
"'".$value.
"'";
276 if ($search_country ==
'special_allnotme') $sql .=
" AND co.code <> '".$db->escape($mysoc->country_code).
"'";
277 elseif ($search_country ==
'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
278 elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
279 elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
282 if (strlen(trim($search_tvaintra))) {
285 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
290 $sql .=
" AND f.entity IN (" .
getEntity(
'facture_fourn', 0) .
")";
294 $reshook=$hookmanager->executeHooks(
'printFieldListWhere',$parameters);
295 $sql.=$hookmanager->resPrint;
297 $sql .= $db->order($sortfield, $sortorder);
300 $nbtotalofrecords =
'';
301 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
303 $result = $db->query($sql);
304 $nbtotalofrecords = $db->num_rows($result);
305 if (($page * $limit) > $nbtotalofrecords)
312 $sql .= $db->plimit($limit + 1, $offset);
315 $result = $db->query($sql);
318 $num_lines = $db->num_rows($result);
321 $arrayofselected=is_array($toselect)?$toselect:array();
324 if (! empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) $param.=
'&contextpage='.$contextpage;
325 if ($limit > 0 && $limit != $conf->liste_limit) $param.=
'&limit='.$limit;
326 if ($search_lineid) $param.=
'&search_lineid='.urlencode($search_lineid);
327 if ($search_day) $param.=
'&search_day='.urlencode($search_day);
328 if ($search_month) $param.=
'&search_month='.urlencode($search_month);
329 if ($search_year) $param.=
'&search_year='.urlencode($search_year);
330 if ($search_invoice) $param.=
'&search_invoice='.urlencode($search_invoice);
331 if ($search_ref) $param.=
'&search_ref='.urlencode($search_ref);
332 if ($search_desc) $param.=
'&search_desc='.urlencode($search_desc);
333 if ($search_amount) $param.=
'&search_amount='.urlencode($search_amount);
334 if ($search_vat) $param.=
'&search_vat='.urlencode($search_vat);
335 if ($search_country) $param .=
"&search_country=" . urlencode($search_country);
336 if ($search_tvaintra) $param .=
"&search_tvaintra=" . urlencode($search_tvaintra);
338 $arrayofmassactions = array(
339 'ventil'=>$langs->trans(
"Ventilate")
345 $massactionbutton=$form->selectMassAction(
'ventil', $arrayofmassactions, 1);
347 print '<form action="' . $_SERVER[
"PHP_SELF"] .
'" method="post">' .
"\n";
348 print '<input type="hidden" name="action" value="ventil">';
349 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
350 print '<input type="hidden" name="token" value="'.$_SESSION[
'newtoken'].
'">';
351 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
352 print '<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
353 print '<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
354 print '<input type="hidden" name="page" value="'.$page.
'">';
356 print_barre_liste($langs->trans(
"InvoiceLines"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords,
'title_accountancy', 0,
'',
'', $limit);
358 print $langs->trans(
"DescVentilTodoCustomer") .
'</br><br>';
366 if ($msg)
print $msg.
'<br>';
370 print '<div class="div-table-responsive">';
371 print '<table class="tagtable liste'.($moreforfilter?
" listwithfilterbefore":
"").
'">'.
"\n";
374 print '<tr class="liste_titre_filter">';
375 print
'<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' .
dol_escape_htmltag($search_lineid) .
'""></td>';
376 print
'<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' .
dol_escape_htmltag($search_invoice) .
'"></td>';
377 print
'<td class="liste_titre"></td>';
378 print
'<td class="liste_titre center nowraponall">';
379 if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print
'<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.
'">';
380 print
'<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.
'">';
381 $formother->select_year($search_year,
'search_year',1, 20, 5);
383 print
'<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' .
dol_escape_htmltag($search_ref) .
'"></td>';
385 print
'<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' .
dol_escape_htmltag($search_desc) .
'"></td>';
386 print
'<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' .
dol_escape_htmltag($search_amount) .
'"></td>';
387 print
'<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' .
dol_escape_htmltag($search_vat) .
'"></td>';
388 print
'<td class="liste_titre">';
389 print $form->select_country($search_country,
'search_country',
'', 0,
'maxwidth200',
'code2', 1, 0, 1);
392 print
'<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' .
dol_escape_htmltag($search_tvaintra) .
'"></td>';
393 print
'<td class="liste_titre"></td>';
394 print
'<td class="liste_titre"></td>';
395 print
'<td align="center" class="liste_titre">';
396 $searchpicto=$form->showFilterButtons();
401 print
'<tr class="liste_titre">';
404 print_liste_field_titre(
"InvoiceLabel", $_SERVER[
"PHP_SELF"],
"f.libelle",
"", $param,
'', $sortfield, $sortorder);
405 print_liste_field_titre(
"Date", $_SERVER[
"PHP_SELF"],
"f.datef, f.ref, l.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
408 print_liste_field_titre(
"Description", $_SERVER[
"PHP_SELF"],
"l.description",
"", $param,
'', $sortfield, $sortorder);
409 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"l.total_ht",
"", $param,
'align="right"', $sortfield, $sortorder);
410 print_liste_field_titre(
"VATRate", $_SERVER[
"PHP_SELF"],
"l.tva_tx",
"", $param,
'align="right"', $sortfield, $sortorder);
412 print_liste_field_titre(
"VATIntra", $_SERVER[
"PHP_SELF"],
"s.tva_intra",
"", $param,
'', $sortfield, $sortorder);
416 if ($massactionbutton) $checkpicto=$form->showCheckAddButtons(
'checkforselect', 1);
423 while ($i < min($num_lines, $limit)) {
424 $objp = $db->fetch_object($result);
429 $objp->code_buy_l =
'';
430 $objp->code_buy_p =
'';
431 $objp->aarowid_suggest =
'';
433 $productfourn_static->ref = $objp->product_ref;
434 $productfourn_static->id = $objp->product_id;
435 $productfourn_static->type = $objp->type;
436 $productfourn_static->label = $objp->product_label;
438 $facturefourn_static->ref = $objp->ref;
439 $facturefourn_static->id = $objp->facid;
440 $facturefourn_static->type = $objp->type;
442 $code_buy_p_notset =
'';
443 $objp->aarowid_suggest = $objp->aarowid;
445 if ($objp->type_l == 1) {
446 $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT :
'');
447 if ($objp->aarowid ==
'')
448 $objp->aarowid_suggest = $aarowid_s;
449 } elseif ($objp->type_l == 0) {
450 $objp->code_buy_l = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT :
'');
451 if ($objp->aarowid ==
'')
452 $objp->aarowid_suggest = $aarowid_p;
454 if ($objp->code_buy_l == -1) $objp->code_buy_l=
'';
456 if (! empty($objp->code_buy)) {
457 $objp->code_buy_p = $objp->code_buy;
459 $code_buy_p_notset =
'color:orange';
461 if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) $code_buy_p_notset =
'color:red';
466 print
'<tr class="oddeven">';
469 print
'<td>' . $objp->rowid .
'</td>';
472 print
'<td class="nowraponall">' . $facturefourn_static->getNomUrl(1) .
'</td>';
474 print
'<td class="tdoverflowonsmartphone">';
475 print $objp->invoice_label;
478 print
'<td align="center">' .
dol_print_date($db->jdate($objp->datef),
'day') .
'</td>';
482 if ($productfourn_static->id)
483 print $productfourn_static->getNomUrl(1);
484 if ($objp->product_label) print
'<br>'.$objp->product_label;
490 $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
491 print $form->textwithtooltip(
dol_trunc($text,$trunclength), $objp->description);
494 print
'<td align="right">';
495 print
price($objp->total_ht);
499 if ($objp->vat_tx_l != $objp->vat_tx_p)
500 $code_vat_differ =
'font-weight:bold; text-decoration:blink; color:red';
501 print
'<td style="' . $code_vat_differ .
'" align="right">';
502 print
vatrate($objp->tva_tx_line.($objp->vat_src_code?
' ('.$objp->vat_src_code.
')':
''));
505 print
'<td>' . $objp->country .
'</td>';
506 print
'<td>' . $objp->tva_intra .
'</td>';
509 print
'<td align="center" style="' . $code_buy_p_notset .
'">';
510 print (($objp->type_l == 1)?$langs->trans(
"DefaultForService"):$langs->trans(
"DefaultForProduct")) .
' = ' . ($objp->code_buy_l > 0 ?
length_accountg($objp->code_buy_l) : $langs->trans(
"Unknown"));
511 if ($objp->product_id > 0)
514 print (($objp->type_l == 1)?$langs->trans(
"ThisService"):$langs->trans(
"ThisProduct")) .
' = ' . (empty($objp->code_buy_p) ? $langs->trans(
"Unknown") :
length_accountg($objp->code_buy_p));
519 print
'<td align="center">';
520 print $formaccounting->select_account($objp->aarowid_suggest,
'codeventil'.$objp->rowid, 1, array(), 0, 0,
'codeventil maxwidth300 maxwidthonsmartphone',
'cachewithshowemptyone');
524 print
'<td align="center">';
525 print
'<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.
'" name="toselect[]" value="' . $objp->rowid .
"_" . $i .
'"' . ($objp->aarowid ?
"checked" :
"") .
'/>';
541 print
'<script type="text/javascript" language="javascript"> 542 jQuery(document).ready(function() { 543 jQuery(".codeventil").change(function() { 544 var s=$(this).attr("id").replace("codeventil", "") 545 console.log(s+" "+$(this).val()); 546 if ($(this).val() == -1) jQuery(".checkforselect"+s).prop("checked", false); 547 else jQuery(".checkforselect"+s).prop("checked", true); print $object label
hash of file content (md5_file(dol_osencode($destfull))
const TYPE_STANDARD
Standard invoice.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.
const TYPE_DEPOSIT
Deposit invoice.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
getCountriesInEEC()
Return list of countries that are inside the EEC (European Economic Community) TODO Add a field into ...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0)
Return an id or code from a code or id.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
const TYPE_REPLACEMENT
Replacement invoice.
Class to manage suppliers invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
if(! GETPOST('transkey', 'alphanohtml') &&! GETPOST('transphrase', 'alphanohtml')) else
View.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dolGetFirstLineOfText($text, $nboflines=1)
Return first line of text.
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0)
Clean a string from all HTML tags and entities.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
const TYPE_CREDIT_NOTE
Credit note invoice.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
const TYPE_SITUATION
Situation invoice.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
Class to manage accounting accounts.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...
Class to manage predefined suppliers products.