29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
36 $langs->loadLangs(array(
"compta",
"bills",
"other",
"main",
"accountancy"));
39 if (empty($conf->accounting->enabled)) {
44 if (!$user->rights->accounting->bind->write)
48 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
54 $year_end = $year_start + 1;
55 $month_end = $month_start - 1;
61 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
63 $year_current = $year_start;
66 $action =
GETPOST(
'action',
'aZ09');
68 $chartaccountcode =
dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS,
'accounting_system',
'rowid',
'pcg_version');
75 if ($action ==
'clean' || $action ==
'validatehistory')
79 $sql1 =
"UPDATE ".MAIN_DB_PREFIX.
"facturedet as fd";
80 $sql1 .=
" SET fk_code_ventilation = 0";
81 $sql1 .=
' WHERE fd.fk_code_ventilation NOT IN';
82 $sql1 .=
' (SELECT accnt.rowid ';
83 $sql1 .=
' FROM '.MAIN_DB_PREFIX.
'accounting_account as accnt';
84 $sql1 .=
' INNER JOIN '.MAIN_DB_PREFIX.
'accounting_system as syst';
85 $sql1 .=
' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.
' AND accnt.entity = '.$conf->entity.
')';
86 $sql1 .=
' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.
'facture WHERE entity = '.$conf->entity.
')';
87 $sql1 .=
' AND fk_code_ventilation <> 0';
89 dol_syslog(
"htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
90 $resql1 = $db->query($sql1);
101 if ($action ==
'validatehistory') {
122 $sql =
"SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
123 $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,";
124 $sql .=
" p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
125 $sql .=
" p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
126 $sql .=
" aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
127 $sql .=
" co.code as country_code, co.label as country_label,";
128 $sql .=
" s.tva_intra";
129 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
130 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = f.fk_soc";
131 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as co ON co.rowid = s.fk_pays ";
132 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"facturedet as l ON f.rowid = l.fk_facture";
133 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON p.rowid = l.fk_product";
134 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode).
"' AND aa.entity = ".$conf->entity;
135 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode).
"' AND aa2.entity = ".$conf->entity;
136 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode).
"' AND aa3.entity = ".$conf->entity;
137 $sql .=
" WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
138 $sql .=
" AND l.product_type <= 2";
140 dol_syslog(
'htdocs/accountancy/customer/index.php');
141 $result = $db->query($sql);
146 $num_lines = $db->num_rows($result);
148 $isSellerInEEC =
isInEEC($mysoc);
151 while ($i < min($num_lines, 10000)) {
152 $objp = $db->fetch_object($result);
154 $isBuyerInEEC =
isInEEC($objp);
157 $suggestedaccountingaccountfor =
'';
158 if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) {
159 $objp->code_sell_p = $objp->code_sell;
160 $objp->aarowid_suggest = $objp->aarowid;
161 $suggestedaccountingaccountfor =
'';
163 if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) {
164 $objp->code_sell_p = $objp->code_sell;
165 $objp->aarowid_suggest = $objp->aarowid;
166 $suggestedaccountingaccountfor =
'eecwithvat';
167 } elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) {
168 $objp->code_sell_p = $objp->code_sell;
169 $objp->aarowid_suggest = 0;
170 $suggestedaccountingaccountfor =
'eecwithoutvatnumber';
171 } elseif ($isSellerInEEC && $isBuyerInEEC) {
172 $objp->code_sell_p = $objp->code_sell_intra;
173 $objp->aarowid_suggest = $objp->aarowid_intra;
174 $suggestedaccountingaccountfor =
'eec';
176 $objp->code_sell_p = $objp->code_sell_export;
177 $objp->aarowid_suggest = $objp->aarowid_export;
178 $suggestedaccountingaccountfor =
'export';
182 if ($objp->aarowid_suggest > 0)
184 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"facturedet";
185 $sqlupdate .=
" SET fk_code_ventilation = ".$objp->aarowid_suggest;
186 $sqlupdate .=
" WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
188 $resqlupdate = $db->query($sqlupdate);
215 llxHeader(
'', $langs->trans(
"CustomersVentilation"));
217 $textprevyear =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?year='.($year_current - 1).
'">'.
img_previous().
'</a>';
218 $textnextyear =
' <a href="'.$_SERVER[
"PHP_SELF"].
'?year='.($year_current + 1).
'">'.
img_next().
'</a>';
221 print load_fiche_titre($langs->trans(
"CustomersVentilation").
" ".$textprevyear.
" ".$langs->trans(
"Year").
" ".$year_start.
" ".$textnextyear,
'',
'title_accountancy');
223 print '<span class="opacitymedium">'.$langs->trans(
"DescVentilCustomer").
'</span><br>';
224 print '<span class="opacitymedium hideonsmartphone">'.$langs->trans(
"DescVentilMore", $langs->transnoentitiesnoconv(
"ValidateHistory"), $langs->transnoentitiesnoconv(
"ToBind")).
'<br>';
230 $buttonbind =
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?year='.$year_current.
'&action=validatehistory">'.$langs->trans(
"ValidateHistory").
'</a>';
232 print_barre_liste($langs->trans(
"OverviewOfAmountOfLinesNotBound"),
'',
'',
'',
'',
'',
'', -1,
'',
'', 0, $buttonbind,
'', 0, 1, 1);
235 print '<div class="div-table-responsive-no-min">';
236 print
'<table class="noborder centpercent">';
237 print
'<tr class="liste_titre"><td width="200">'.$langs->trans(
"Account").
'</td>';
238 print
'<td width="200" class="left">'.$langs->trans(
"Label").
'</td>';
239 for ($i = 1; $i <= 12; $i++) {
240 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
241 if ($j > 12) $j -= 12;
242 print
'<td width="60" class="right">'.$langs->trans(
'MonthShort'.str_pad($j, 2,
'0', STR_PAD_LEFT)).
'</td>';
244 print
'<td width="60" class="right"><b>'.$langs->trans(
"Total").
'</b></td></tr>';
246 $sql =
"SELECT ".$db->ifsql(
'aa.account_number IS NULL',
"'tobind'",
'aa.account_number').
" AS codecomptable,";
247 $sql .=
" ".$db->ifsql(
'aa.label IS NULL',
"'tobind'",
'aa.label').
" AS intitule,";
248 for ($i = 1; $i <= 12; $i++) {
249 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
250 if ($j > 12) $j -= 12;
251 $sql .=
" SUM(".$db->ifsql(
'MONTH(f.datef)='.$j,
'fd.total_ht',
'0').
") AS month".str_pad($j, 2,
'0', STR_PAD_LEFT).
",";
253 $sql .=
" SUM(fd.total_ht) as total";
254 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facturedet as fd";
255 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON f.rowid = fd.fk_facture";
256 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
257 $sql .=
" WHERE f.datef >= '".$db->idate($search_date_start).
"'";
258 $sql .=
" AND f.datef <= '".$db->idate($search_date_end).
"'";
260 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
261 $sql .=
" AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING).
"'";
263 $sql .=
" AND f.fk_statut > 0";
264 $sql .=
" AND fd.product_type <= 2";
265 $sql .=
" AND f.entity IN (".getEntity(
'invoice', 0).
")";
266 $sql .=
" AND aa.account_number IS NULL";
267 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
272 $sql .=
" GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
274 dol_syslog(
'htdocs/accountancy/customer/index.php sql='.$sql, LOG_DEBUG);
275 $resql = $db->query($sql);
277 $num = $db->num_rows(
$resql);
279 while ($row = $db->fetch_row(
$resql)) {
280 print
'<tr class="oddeven"><td>';
281 if ($row[0] ==
'tobind')
283 print $langs->trans(
"Unknown");
286 print
'<td class="left">';
287 if ($row[0] ==
'tobind')
289 print $langs->trans(
"UseMenuToSetBindindManualy", DOL_URL_ROOT.
'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv(
"ToBind"));
290 }
else print $row[1];
292 for ($i = 2; $i <= 12; $i++) {
293 print
'<td class="nowrap right">'.price($row[$i]).
'</td>';
295 print
'<td class="nowrap right">'.price($row[13]).
'</td>';
296 print
'<td class="nowrap right"><b>'.price($row[14]).
'</b></td>';
301 print $db->lasterror();
310 print_barre_liste($langs->trans(
"OverviewOfAmountOfLinesBound"),
'',
'',
'',
'',
'',
'', -1,
'',
'', 0,
'',
'', 0, 1, 1);
313 print
'<div class="div-table-responsive-no-min">';
314 print
'<table class="noborder centpercent">';
315 print
'<tr class="liste_titre"><td width="200">'.$langs->trans(
"Account").
'</td>';
316 print
'<td width="200" class="left">'.$langs->trans(
"Label").
'</td>';
317 for ($i = 1; $i <= 12; $i++) {
318 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
319 if ($j > 12) $j -= 12;
320 print
'<td width="60" class="right">'.$langs->trans(
'MonthShort'.str_pad($j, 2,
'0', STR_PAD_LEFT)).
'</td>';
322 print
'<td width="60" class="right"><b>'.$langs->trans(
"Total").
'</b></td></tr>';
324 $sql =
"SELECT ".$db->ifsql(
'aa.account_number IS NULL',
"'tobind'",
'aa.account_number').
" AS codecomptable,";
325 $sql .=
" ".$db->ifsql(
'aa.label IS NULL',
"'tobind'",
'aa.label').
" AS intitule,";
326 for ($i = 1; $i <= 12; $i++) {
327 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
328 if ($j > 12) $j -= 12;
329 $sql .=
" SUM(".$db->ifsql(
'MONTH(f.datef)='.$j,
'fd.total_ht',
'0').
") AS month".str_pad($j, 2,
'0', STR_PAD_LEFT).
",";
331 $sql .=
" SUM(fd.total_ht) as total";
332 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facturedet as fd";
333 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON f.rowid = fd.fk_facture";
334 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
335 $sql .=
" WHERE f.datef >= '".$db->idate($search_date_start).
"'";
336 $sql .=
" AND f.datef <= '".$db->idate($search_date_end).
"'";
338 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
339 $sql .=
" AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING).
"'";
341 $sql .=
" AND f.entity IN (".getEntity(
'invoice', 0).
")";
342 $sql .=
" AND f.fk_statut > 0";
343 $sql .=
" AND fd.product_type <= 2";
344 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
349 $sql .=
" AND aa.account_number IS NOT NULL";
350 $sql .=
" GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
352 dol_syslog(
'htdocs/accountancy/customer/index.php');
353 $resql = $db->query($sql);
355 $num = $db->num_rows(
$resql);
357 while ($row = $db->fetch_row(
$resql)) {
358 print
'<tr class="oddeven"><td>';
359 if ($row[0] ==
'tobind')
361 print $langs->trans(
"Unknown");
365 print
'<td class="left">';
366 if ($row[0] ==
'tobind')
368 print $langs->trans(
"UseMenuToSetBindindManualy", DOL_URL_ROOT.
'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv(
"ToBind"));
369 }
else print $row[1];
372 for ($i = 2; $i <= 12; $i++) {
373 print
'<td class="nowrap right">'.price($row[$i]).
'</td>';
375 print
'<td class="nowrap right">'.price($row[13]).
'</td>';
376 print
'<td class="nowrap right"><b>'.price($row[14]).
'</b></td>';
381 print $db->lasterror();
387 if ($conf->global->MAIN_FEATURES_LEVEL > 0)
392 print_barre_liste($langs->trans(
"OtherInfo"),
'',
'',
'',
'',
'',
'', -1,
'',
'', 0,
'',
'', 0, 1, 1);
395 print
'<div class="div-table-responsive-no-min">';
396 print
'<table class="noborder centpercent">';
397 print
'<tr class="liste_titre"><td width="400" class="left">'.$langs->trans(
"TotalVente").
'</td>';
398 for ($i = 1; $i <= 12; $i++) {
399 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
400 if ($j > 12) $j -= 12;
401 print
'<td width="60" class="right">'.$langs->trans(
'MonthShort'.str_pad($j, 2,
'0', STR_PAD_LEFT)).
'</td>';
403 print
'<td width="60" class="right"><b>'.$langs->trans(
"Total").
'</b></td></tr>';
405 $sql =
"SELECT '".$db->escape($langs->trans(
"TotalVente")).
"' AS total,";
406 for ($i = 1; $i <= 12; $i++) {
407 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
408 if ($j > 12) $j -= 12;
409 $sql .=
" SUM(".$db->ifsql(
'MONTH(f.datef)='.$j,
'fd.total_ht',
'0').
") AS month".str_pad($j, 2,
'0', STR_PAD_LEFT).
",";
411 $sql .=
" SUM(fd.total_ht) as total";
412 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facturedet as fd";
413 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON f.rowid = fd.fk_facture";
414 $sql .=
" WHERE f.datef >= '".$db->idate($search_date_start).
"'";
415 $sql .=
" AND f.datef <= '".$db->idate($search_date_end).
"'";
417 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
418 $sql .=
" AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING).
"'";
420 $sql .=
" AND f.entity IN (".getEntity(
'invoice', 0).
")";
421 $sql .=
" AND f.fk_statut > 0";
422 $sql .=
" AND fd.product_type <= 2";
423 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
429 dol_syslog(
'htdocs/accountancy/customer/index.php');
430 $resql = $db->query($sql);
432 $num = $db->num_rows(
$resql);
434 while ($row = $db->fetch_row(
$resql)) {
435 print
'<tr><td>'.$row[0].
'</td>';
436 for ($i = 1; $i <= 12; $i++) {
437 print
'<td class="nowrap right">'.price($row[$i]).
'</td>';
439 print
'<td class="nowrap right"><b>'.price($row[13]).
'</b></td>';
444 print $db->lasterror();
450 if (!empty($conf->margin->enabled)) {
452 print
'<div class="div-table-responsive-no-min">';
453 print
'<table class="noborder centpercent">';
454 print
'<tr class="liste_titre"><td width="400">'.$langs->trans(
"TotalMarge").
'</td>';
455 for ($i = 1; $i <= 12; $i++) {
456 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
457 if ($j > 12) $j -= 12;
458 print
'<td width="60" class="right">'.$langs->trans(
'MonthShort'.str_pad($j, 2,
'0', STR_PAD_LEFT)).
'</td>';
460 print
'<td width="60" class="right"><b>'.$langs->trans(
"Total").
'</b></td></tr>';
462 $sql =
"SELECT '".$db->escape($langs->trans(
"Vide")).
"' AS marge,";
463 for ($i = 1; $i <= 12; $i++) {
464 $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
465 if ($j > 12) $j -= 12;
466 $sql .=
" SUM(".$db->ifsql(
'MONTH(f.datef)='.$j,
'(fd.total_ht-(fd.qty * fd.buy_price_ht))',
'0').
") AS month".str_pad($j, 2,
'0', STR_PAD_LEFT).
",";
468 $sql .=
" SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
469 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facturedet as fd";
470 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON f.rowid = fd.fk_facture";
471 $sql .=
" WHERE f.datef >= '".$db->idate($search_date_start).
"'";
472 $sql .=
" AND f.datef <= '".$db->idate($search_date_end).
"'";
474 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
475 $sql .=
" AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING).
"'";
477 $sql .=
" AND f.entity IN (".getEntity(
'invoice', 0).
")";
478 $sql .=
" AND f.fk_statut > 0";
479 $sql .=
" AND fd.product_type <= 2";
480 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
486 dol_syslog(
'htdocs/accountancy/customer/index.php');
487 $resql = $db->query($sql);
489 $num = $db->num_rows(
$resql);
491 while ($row = $db->fetch_row(
$resql)) {
492 print
'<tr><td>'.$row[0].
'</td>';
493 for ($i = 1; $i <= 12; $i++) {
494 print
'<td class="nowrap right">'.price(
price2num($row[$i])).
'</td>';
496 print
'<td class="nowrap right"><b>'.price(
price2num($row[13])).
'</b></td>';
501 print $db->lasterror();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_now($mode= 'auto')
Return date for now.
const TYPE_REPLACEMENT
Replacement invoice.
const TYPE_SITUATION
Situation invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
img_next($titlealt= 'default', $moreatt= '')
Show next logo.
const TYPE_DEPOSIT
Deposit invoice.
dol_getIdFromCode($db, $key, $tablename, $fieldkey= 'code', $fieldid= 'id', $entityfilter=0)
Return an id or code from a code or id.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_previous($titlealt= 'default', $moreatt= '')
Show previous logo.
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.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...
isInEEC($object)
Return if a country of an object is inside the EEC (European Economic Community)