Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/class/html.formfile.class.php
This commit is contained in:
Laurent Destailleur 2019-06-13 12:15:51 +02:00
commit f00c9a10db
66 changed files with 386 additions and 217 deletions

View File

@ -14,15 +14,14 @@ Component Version License GPL Compatible
PHP libraries: PHP libraries:
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package) AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
CKEditor 4.11.4 LGPL-2.1+ Yes Editor WYSIWYG CKEditor 4.11.4 LGPL-2.1+ Yes Editor WYSIWYG
PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
EvalMath 1.0 BSD Yes Safe math expressions evaluation EvalMath 1.0 BSD Yes Safe math expressions evaluation
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
ParseDown 1.6 MIT License Yes Markdown parser ParseDown 1.6 MIT License Yes Markdown parser
PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/admin/account.php * \file htdocs/accountancy/admin/account.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief List accounting account * \brief List accounting account
*/ */

View File

@ -28,7 +28,7 @@
/** /**
* \file htdocs/accountancy/admin/accountmodel.php * \file htdocs/accountancy/admin/accountmodel.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page to administer model of chart of accounts * \brief Page to administer model of chart of accounts
*/ */

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/admin/card.php * \file htdocs/accountancy/admin/card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Card of accounting account * \brief Card of accounting account
*/ */

View File

@ -18,7 +18,7 @@
/** /**
* \file htdocs/accountancy/admin/categories.php * \file htdocs/accountancy/admin/categories.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page to assign mass categories to accounts * \brief Page to assign mass categories to accounts
*/ */

View File

@ -18,7 +18,7 @@
/** /**
* \file htdocs/accountancy/admin/closure.php * \file htdocs/accountancy/admin/closure.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -24,7 +24,7 @@
/** /**
* \file htdocs/accountancy/admin/defaultaccounts.php * \file htdocs/accountancy/admin/defaultaccounts.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/accountancy/admin/export.php * \file htdocs/accountancy/admin/export.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -17,7 +17,7 @@
/** /**
* \file htdocs/accountancy/admin/fiscalyear.php * \file htdocs/accountancy/admin/fiscalyear.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure fiscal year * \brief Setup page to configure fiscal year
*/ */

View File

@ -18,7 +18,7 @@
/** /**
* \file htdocs/accountancy/admin/fiscalyear_card.php * \file htdocs/accountancy/admin/fiscalyear_card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page to show a fiscal year * \brief Page to show a fiscal year
*/ */

View File

@ -17,7 +17,7 @@
/** /**
* \file htdocs/accountancy/admin/fiscalyear_info.php * \file htdocs/accountancy/admin/fiscalyear_info.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page to show info of a fiscal year * \brief Page to show info of a fiscal year
*/ */

View File

@ -24,7 +24,7 @@
/** /**
* \file htdocs/accountancy/admin/index.php * \file htdocs/accountancy/admin/index.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */

View File

@ -18,7 +18,7 @@
/** /**
* \file htdocs/accountancy/admin/journals_list.php * \file htdocs/accountancy/admin/journals_list.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Setup page to configure journals * \brief Setup page to configure journals
*/ */

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/admin/productaccount.php * \file htdocs/accountancy/admin/productaccount.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief To define accounting account on product / service * \brief To define accounting account on product / service
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/balance.php * \file htdocs/accountancy/bookkeeping/balance.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Balance of book keeping * \brief Balance of book keeping
*/ */

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/balancebymonth.php * \file htdocs/accountancy/bookkeeping/balancebymonth.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Balance by month * \brief Balance by month
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/card.php * \file htdocs/accountancy/bookkeeping/card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page to show book-entry * \brief Page to show book-entry
*/ */

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/list.php * \file htdocs/accountancy/bookkeeping/list.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief List operation of book keeping * \brief List operation of book keeping
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("accountancy")); $langs->loadLangs(array("accountancy"));
@ -47,6 +48,9 @@ $search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmo
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int')); $search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int')); $search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int')); $search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
//var_dump($search_date_start);exit; //var_dump($search_date_start);exit;
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
$action = 'delbookkeepingyear'; $action = 'delbookkeepingyear';
@ -143,6 +147,7 @@ $arrayfields=array(
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
); );
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
@ -178,6 +183,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_date_creation_end = ''; $search_date_creation_end = '';
$search_date_modification_start = ''; $search_date_modification_start = '';
$search_date_modification_end = ''; $search_date_modification_end = '';
$search_date_export_start = '';
$search_date_export_end = '';
$search_debit = ''; $search_debit = '';
$search_credit = ''; $search_credit = '';
$search_lettering_code = ''; $search_lettering_code = '';
@ -269,6 +276,16 @@ if (! empty($search_date_modification_end)) {
$tmp=dol_getdate($search_date_modification_end); $tmp=dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year']; $param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
} }
if (! empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp=dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
}
if (! empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp=dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
}
if (! empty($search_debit)) { if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit; $filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit); $param .= '&search_debit=' . urlencode($search_debit);
@ -348,8 +365,7 @@ if ($action == 'delmouvconfirm') {
// Export into a file with format defined into setup (FEC, CSV, ...) // Export into a file with format defined into setup (FEC, CSV, ...)
if ($action == 'export_file') { if ($action == 'export_file') {
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
if ($result < 0) if ($result < 0)
{ {
@ -357,17 +373,57 @@ if ($action == 'export_file') {
} }
else else
{ {
// Export files
$accountancyexport = new AccountancyExport($db); $accountancyexport = new AccountancyExport($db);
$accountancyexport->export($object->lines); $accountancyexport->export($object->lines);
if (!empty($accountancyexport->errors)) if (! empty($accountancyexport->errors))
{ {
setEventMessages('', $accountancyexport->errors, 'errors'); setEventMessages('', $accountancyexport->errors, 'errors');
} } else {
// Specify as export : update field date_export
// TODO Move in class bookKeeping
$error=0;
$db->begin();
if (is_array($object->lines)) {
foreach ($object->lines as $movement) {
$now = dol_now();
$sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping";
$sql .= " SET date_export = '" . $db->idate($now) . "'";
$sql .= " WHERE rowid = " . $movement->id;
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
} else {
$db->rollback();
// setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
}
}
}
}
exit; exit;
} }
} }
if ($action == 'setreexport') {
$export = 0;
$setreexport = GETPOST('value', 'int');
if (! dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) $error++;
if (! $error) {
if ($conf->global->ACCOUNTING_REEXPORT == 1) {
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs');
} else {
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs');
}
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/* /*
* View * View
@ -380,14 +436,14 @@ llxHeader('', $title_page);
// List // List
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter); $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($nbtotalofrecords < 0) { if ($nbtotalofrecords < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
// TODO Do not use this // TODO Do not use this
$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter); $result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -442,18 +498,26 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
$listofformat=AccountancyExport::getType(); $button .= '<a class="butAction" title="" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
$listofformat=AccountancyExport::getType();
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList"); if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
else $buttonLabel = $langs->trans("ExportList"); else $buttonLabel = $langs->trans("ExportList");
$newcardbutton = dolGetButtonTitle($buttonLabel, '', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'')); // Button re-export
if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=0'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
} else {
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=1'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
}
$newcardbutton.= $langs->trans("IncludeDocsAlreadyExported");
$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param); $newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create'); $newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create');
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
@ -596,6 +660,20 @@ if (! empty($arrayfields['t.tms']['checked']))
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }
// Date export
if (! empty($arrayfields['t.date_export']['checked']))
{
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1);
print '</div>';
print '</td>';
}
// Action column // Action column
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
@ -616,6 +694,7 @@ if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_tit
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -728,11 +807,20 @@ if ($num > 0)
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Exported operation date
if (! empty($arrayfields['t.date_export']['checked']))
{
print '<td align="center">' . dol_print_date($line->date_export, 'dayhour') . '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Action column // Action column
print '<td class="nowraponall center">'; print '<td class="nowraponall center">';
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;'; if(empty($line->date_export)) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>'; print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;';
print '</td>'; print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
}
print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
print "</tr>\n"; print "</tr>\n";

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/listbyaccount.php * \file htdocs/accountancy/bookkeeping/listbyaccount.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief List operation of book keeping ordered by account number * \brief List operation of book keeping ordered by account number
*/ */

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php * \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Tab to setup lettering * \brief Tab to setup lettering
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/class/accountancycategory.class.php * \file htdocs/accountancy/class/accountancycategory.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class to manage categories of an accounting category_type * \brief File of class to manage categories of an accounting category_type
*/ */

View File

@ -27,7 +27,7 @@
/** /**
* \file htdocs/accountancy/class/accountancyexport.class.php * \file htdocs/accountancy/class/accountancyexport.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Class accountancy export * \brief Class accountancy export
*/ */

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/class/accountancysystem.class.php * \file htdocs/accountancy/class/accountancysystem.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class to manage accountancy systems * \brief File of class to manage accountancy systems
*/ */

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/class/accountingaccount.class.php * \file htdocs/accountancy/class/accountingaccount.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class to manage accounting accounts * \brief File of class to manage accounting accounts
*/ */

View File

@ -17,7 +17,7 @@
/** /**
* \file htdocs/accountancy/class/accountingjournal.class.php * \file htdocs/accountancy/class/accountingjournal.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class to manage accounting journals * \brief File of class to manage accounting journals
*/ */

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/accountancy/class/bookkeeping.class.php * \file htdocs/accountancy/class/bookkeeping.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class to manage Ledger (General Ledger and Subledger) * \brief File of class to manage Ledger (General Ledger and Subledger)
*/ */
@ -860,15 +860,16 @@ class BookKeeping extends CommonObject
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
* @param string $sortorder Sort Order * @param string $sortorder Sort Order
* @param string $sortfield Sort field * @param string $sortfield Sort field
* @param int $limit Offset limit * @param int $limit Offset limit
* @param int $offset Offset limit * @param int $offset Offset limit
* @param array $filter Filter array * @param array $filter Filter array
* @param string $filtermode Filter mode (AND or OR) * @param string $filtermode Filter mode (AND or OR)
* @return int <0 if KO, >0 if OK * @param int $showAlreadyExportMovements Show movements when field 'date_export' is not empty (0:No / 1:Yes (Default))
* @return int <0 if KO, >0 if OK
*/ */
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $showAlreadyExportMovements = 1)
{ {
global $conf; global $conf;
@ -898,7 +899,8 @@ class BookKeeping extends CommonObject
$sql .= " t.journal_label,"; $sql .= " t.journal_label,";
$sql .= " t.piece_num,"; $sql .= " t.piece_num,";
$sql .= " t.date_creation,"; $sql .= " t.date_creation,";
$sql .= " t.tms as date_modification"; $sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
// Manage filter // Manage filter
$sqlwhere = array (); $sqlwhere = array ();
@ -918,6 +920,8 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\''; $sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
} elseif ($key == 't.tms>=' || $key == 't.tms<=') { } elseif ($key == 't.tms>=' || $key == 't.tms<=') {
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\''; $sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
} elseif ($key == 't.credit' || $key == 't.debit') { } elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1); $sqlwhere[] = natural_search($key, $value, 1, 1);
} else { } else {
@ -926,10 +930,12 @@ class BookKeeping extends CommonObject
} }
} }
$sql.= ' WHERE t.entity IN (' . getEntity('accountancy') . ')'; $sql.= ' WHERE t.entity IN (' . getEntity('accountancy') . ')';
if ($showAlreadyExportMovements == 0) {
$sql .= " AND t.date_export IS NULL";
}
if (count($sqlwhere) > 0) { if (count($sqlwhere) > 0) {
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere); $sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
} }
if (! empty($sortfield)) { if (! empty($sortfield)) {
$sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->order($sortfield, $sortorder);
} }
@ -972,6 +978,7 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$line->date_creation = $this->db->jdate($obj->date_creation); $line->date_creation = $this->db->jdate($obj->date_creation);
$line->date_modification = $this->db->jdate($obj->date_modification); $line->date_modification = $this->db->jdate($obj->date_modification);
$line->date_export = $this->db->jdate($obj->date_export);
$this->lines[] = $line; $this->lines[] = $line;

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/accountancy/class/lettering.class.php * \file htdocs/accountancy/class/lettering.class.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief File of class for lettering * \brief File of class for lettering
*/ */

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/customer/card.php * \file htdocs/accountancy/customer/card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Card customer ventilation * \brief Card customer ventilation
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/customer/index.php * \file htdocs/accountancy/customer/index.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Home customer journalization page * \brief Home customer journalization page
*/ */

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/customer/lines.php * \file htdocs/accountancy/customer/lines.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page of detail of the lines of ventilation of invoices customers * \brief Page of detail of the lines of ventilation of invoices customers
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -310,9 +310,9 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
} }
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/customer/list.php * \file htdocs/accountancy/customer/list.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Ventilation page from customers invoices * \brief Ventilation page from customers invoices
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -377,9 +377,9 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { 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.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
} }
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
@ -410,7 +410,7 @@ if ($result) {
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center '); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center ');
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center '); print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
$checkpicto=''; $checkpicto='';

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \file htdocs/accountancy/supplier/card.php * \file htdocs/accountancy/supplier/card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Card expense report ventilation * \brief Card expense report ventilation
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/accountancy/expensereport/index.php * \file htdocs/accountancy/expensereport/index.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Home expense report ventilation * \brief Home expense report ventilation
*/ */

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/expensereport/lines.php * \file htdocs/accountancy/expensereport/lines.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page of detail of the lines of ventilation of expense reports * \brief Page of detail of the lines of ventilation of expense reports
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -263,8 +263,8 @@ if ($result) {
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>'; print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/expensereport/list.php * \file htdocs/accountancy/expensereport/list.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Ventilation page from expense reports * \brief Ventilation page from expense reports
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -309,8 +309,8 @@ if ($result) {
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
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.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';

View File

@ -18,7 +18,7 @@
/** /**
* \file htdocs/accountancy/index.php * \file htdocs/accountancy/index.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Home accounting module * \brief Home accounting module
*/ */

View File

@ -27,7 +27,7 @@
/** /**
* \file htdocs/accountancy/journal/bankjournal.php * \file htdocs/accountancy/journal/bankjournal.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page with bank journal * \brief Page with bank journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -25,7 +25,7 @@
/** /**
* \file htdocs/accountancy/journal/expensereportsjournal.php * \file htdocs/accountancy/journal/expensereportsjournal.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page with expense reports journal * \brief Page with expense reports journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -25,7 +25,7 @@
/** /**
* \file htdocs/accountancy/journal/purchasesjournal.php * \file htdocs/accountancy/journal/purchasesjournal.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page with purchases journal * \brief Page with purchases journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -26,7 +26,7 @@
/** /**
* \file htdocs/accountancy/journal/sellsjournal.php * \file htdocs/accountancy/journal/sellsjournal.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page with sells journal * \brief Page with sells journal
*/ */

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \file htdocs/accountancy/supplier/card.php * \file htdocs/accountancy/supplier/card.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Card supplier ventilation * \brief Card supplier ventilation
*/ */
require '../../main.inc.php'; require '../../main.inc.php';

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/accountancy/supplier/index.php * \file htdocs/accountancy/supplier/index.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Home supplier journalization page * \brief Home supplier journalization page
*/ */

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/supplier/lines.php * \file htdocs/accountancy/supplier/lines.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Page of detail of the lines of ventilation of invoices suppliers * \brief Page of detail of the lines of ventilation of invoices suppliers
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -314,8 +314,8 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
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.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/supplier/list.php * \file htdocs/accountancy/supplier/list.php
* \ingroup Advanced accountancy * \ingroup Accountancy (Double entries)
* \brief Ventilation page from suppliers invoices * \brief Ventilation page from suppliers invoices
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -376,8 +376,8 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
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.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';

View File

@ -196,7 +196,7 @@ if ($object->id > 0)
$objthirdparty=$object; $objthirdparty=$object;
$objcon=new stdClass(); $objcon=new stdClass();
$out=''; $out='&origin='.$object->element.'&originid='.$object->id;
$permok=$user->rights->agenda->myactions->create; $permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{ {
@ -227,9 +227,9 @@ if ($object->id > 0)
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{ {
$param='&socid='.$socid; $param='&id='.$object->id.'&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
//print load_fiche_titre($langs->trans("ActionsOnBom"), '', ''); //print load_fiche_titre($langs->trans("ActionsOnBom"), '', '');
@ -239,7 +239,7 @@ if ($object->id > 0)
$filters['search_agenda_label']=$search_agenda_label; $filters['search_agenda_label']=$search_agenda_label;
// TODO Replace this with same code than into list.php // TODO Replace this with same code than into list.php
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
} }
} }

View File

@ -238,8 +238,8 @@ if ($action == 'add')
$object->fulldayevent = (! empty($fulldayevent)?1:0); $object->fulldayevent = (! empty($fulldayevent)?1:0);
$object->location = GETPOST("location"); $object->location = GETPOST("location");
$object->label = trim(GETPOST('label')); $object->label = trim(GETPOST('label'));
$object->fk_element = GETPOST("fk_element"); $object->fk_element = GETPOST("fk_element", 'int');
$object->elementtype = GETPOST("elementtype"); $object->elementtype = GETPOST("elementtype", 'alpha');
if (! GETPOST('label')) if (! GETPOST('label'))
{ {
if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
@ -349,7 +349,7 @@ if ($action == 'add')
{ {
$db->begin(); $db->begin();
// On cree l'action // Creation of action/event
$idaction=$object->create($user); $idaction=$object->create($user);
if ($idaction > 0) if ($idaction > 0)
@ -690,7 +690,7 @@ if ($action == 'create')
dol_fiche_head(); dol_fiche_head();
print '<table class="border tableforfield" width="100%">'; print '<table class="border centpercent">';
// Type of event // Type of event
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
@ -857,7 +857,7 @@ if ($action == 'create')
print '<br><hr><br>'; print '<br><hr><br>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border centpercent">';
if ($conf->societe->enabled) if ($conf->societe->enabled)
{ {

View File

@ -1647,7 +1647,7 @@ class Contrat extends CommonObject
// if buy price not defined, define buyprice as configured in margin admin // if buy price not defined, define buyprice as configured in margin admin
if ($this->pa_ht == 0) if ($this->pa_ht == 0)
{ {
if (($result = $this->defineBuyPrice($pu_ht, $remise_percent)) < 0) if (($result = $this->defineBuyPrice($pu, $remise_percent)) < 0)
{ {
return $result; return $result;
} }

View File

@ -269,11 +269,22 @@ if (! $error && $massaction == 'confirm_presend')
if ($_POST['addmaindocfile']) if ($_POST['addmaindocfile'])
{ {
// TODO Use future field $objectobj->fullpathdoc to know where is stored default file // TODO Use future field $objectobj->fullpathdoc to know where is stored default file
// TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. // TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename=dol_sanitizeFileName($objectobj->ref).'.pdf'; $filename = dol_sanitizeFileName($objectobj->ref).'.pdf';
$filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref); $subdir = '';
$file = $filedir . '/' . $filename; // TODO Set subdir to be compatible with multi levels dir trees
// $subdir = get_exdir($objectobj->id, 2, 0, 0, $objectobj, $objectobj->element)
$filedir = $uploaddir . '/' . $subdir . dol_sanitizeFileName($objectobj->ref);
$file = $filedir . '/' . $filename;
// For supplier invoices, we use the file provided by supplier, not the one we generate
if ($objectobj->element == 'invoice_supplier')
{
$fileparams = dol_most_recent_file($uploaddir . '/' . get_exdir($objectobj->id,2,0,0,$objectobj,$objectobj->element).$objectobj->ref, preg_quote($objectobj->ref,'/').'([^\-])+');
$file = $fileparams['fullname'];
}
$mime = dol_mimetype($file); $mime = dol_mimetype($file);
if (dol_is_file($file)) if (dol_is_file($file))

View File

@ -1040,7 +1040,7 @@ class FormFile
* @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT. * @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT.
* @param int $permonobject Permission on object (so permission to delete or crop document) * @param int $permonobject Permission on object (so permission to delete or crop document)
* @param int $useinecm Change output for use in ecm module: * @param int $useinecm Change output for use in ecm module:
* 0 or 6: Add a preview column. Show also a rename button. Show also a crop button (if modulepart into a specific list) * 0 or 6: Add a preview column. Show also a rename button. Show also a crop button for some values of $modulepart (must be supported into hard coded list in this function + photos_resize.php + restrictedArea + checkUserAccessToObject)
* 1: Add link to edit ECM entry * 1: Add link to edit ECM entry
* 2: Add rename and crop link * 2: Add rename and crop link
* 4: Add a preview column * 4: Add a preview column
@ -1068,7 +1068,7 @@ class FormFile
global $form; global $form;
$disablecrop=1; $disablecrop=1;
if (in_array($modulepart, array('expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0; if (in_array($modulepart, array('bom','expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0;
// Define relative path used to store the file // Define relative path used to store the file
if (empty($relativepath)) if (empty($relativepath))

View File

@ -394,6 +394,7 @@ class FormMail extends Form
if ($this->param['models'] != 'none') if ($this->param['models'] != 'none')
{ {
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); $result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($this->error, $this->errors, 'errors'); setEventMessages($this->error, $this->errors, 'errors');

View File

@ -393,7 +393,8 @@ class FormOther
public function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '') public function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf, $langs;
$langs->load('users'); $langs->load('users');
$out = ''; $out = '';
@ -415,17 +416,44 @@ class FormOther
// Get list of users allowed to be viewed // Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login"; $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))";
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
}
}
else
{
$sql_usr.= " WHERE u.entity IN (".getEntity('user').")";
}
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.rowid = ".$user->id; if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.rowid = ".$user->id;
if (! empty($user->societe_id)) $sql_usr.=" AND u.fk_soc = ".$user->societe_id; if (! empty($user->socid)) $sql_usr.=" AND u.fk_soc = ".$user->socid;
// Add existing sales representatives of thirdparty of external user // Add existing sales representatives of thirdparty of external user
if (empty($user->rights->user->user->lire) && $user->societe_id) if (empty($user->rights->user->user->lire) && $user->socid)
{ {
$sql_usr.=" UNION "; $sql_usr.=" UNION ";
$sql_usr.= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login"; $sql_usr.= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u2, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u2, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id; if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))";
}
}
else
{
$sql_usr.= " WHERE u2.entity IN (".getEntity('user').")";
}
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->socid;
} }
$sql_usr.= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION. $sql_usr.= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
//print $sql_usr;exit; //print $sql_usr;exit;

View File

@ -1188,7 +1188,8 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
} }
/** /**
* Show html area with actions (done or not, ignore the name of function) * Show html area with actions (done or not, ignore the name of function).
* Note: Global parameter $param must be defined.
* *
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param Translate $langs Object langs * @param Translate $langs Object langs
@ -1208,7 +1209,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
global $user, $conf; global $user, $conf;
global $form; global $form;
global $param; global $param, $massactionbutton;
dol_include_once('/comm/action/class/actioncomm.class.php'); dol_include_once('/comm/action/class/actioncomm.class.php');
@ -1251,6 +1252,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", o.ref"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
@ -1273,6 +1275,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') $sql.= ", ".MAIN_DB_PREFIX."bom_bom as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")"; $sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if ($force_filter_contact === false) { if ($force_filter_contact === false) {
@ -1298,6 +1301,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
} }
elseif (is_object($filterobj) && get_class($filterobj) == 'BOM')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
} }
// Condition on actioncode // Condition on actioncode

View File

@ -247,7 +247,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{ {
if (! $user->rights->projet->lire && ! $user->rights->projet->all->lire) { $readok=0; $nbko++; } if (! $user->rights->projet->lire && ! $user->rights->projet->all->lire) { $readok=0; $nbko++; }
} }
elseif (! empty($feature2)) // This should be used for future changes elseif (! empty($feature2)) // This is for permissions on 2 levels
{ {
$tmpreadok=1; $tmpreadok=1;
foreach($feature2 as $subfeature) foreach($feature2 as $subfeature)
@ -263,7 +263,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
$nbko++; $nbko++;
} }
} }
elseif (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions elseif (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is permissions on 1 level
{ {
if (empty($user->rights->$feature->lire) if (empty($user->rights->$feature->lire)
&& empty($user->rights->$feature->read) && empty($user->rights->$feature->read)
@ -307,7 +307,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{ {
if (! $user->rights->banque->cheque) { $createok=0; $nbko++; } if (! $user->rights->banque->cheque) { $createok=0; $nbko++; }
} }
elseif (! empty($feature2)) // This should be used elseif (! empty($feature2)) // This is for permissions on one level
{ {
foreach($feature2 as $subfeature) foreach($feature2 as $subfeature)
{ {
@ -317,7 +317,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
else { $createok=1; break; } // Break to bypass second test if the first is ok else { $createok=1; break; } // Break to bypass second test if the first is ok
} }
} }
elseif (! empty($feature)) // This is for old permissions ('creer' or 'write') elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write')
{ {
//print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write; //print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
if (empty($user->rights->$feature->creer) if (empty($user->rights->$feature->creer)
@ -384,7 +384,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{ {
if (! $user->rights->salaries->delete) $deleteok=0; if (! $user->rights->salaries->delete) $deleteok=0;
} }
elseif (! empty($feature2)) // This should be used for permissions on 2 levels elseif (! empty($feature2)) // This is for permissions on 2 levels
{ {
foreach($feature2 as $subfeature) foreach($feature2 as $subfeature)
{ {
@ -392,7 +392,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
else { $deleteok=1; break; } // For bypass the second test if the first is ok else { $deleteok=1; break; } // For bypass the second test if the first is ok
} }
} }
elseif (! empty($feature)) // This is used for permissions on 1 level elseif (! empty($feature)) // This is used for permissions on 1 level
{ {
//print '<br>feature='.$feature.' creer='.$user->rights->$feature->supprimer.' write='.$user->rights->$feature->delete; //print '<br>feature='.$feature.' creer='.$user->rights->$feature->supprimer.' write='.$user->rights->$feature->delete;
if (empty($user->rights->$feature->supprimer) if (empty($user->rights->$feature->supprimer)
@ -451,7 +451,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
if ($feature == 'project') $feature='projet'; if ($feature == 'project') $feature='projet';
if ($feature == 'task') $feature='projet_task'; if ($feature == 'task') $feature='projet_task';
$check = array('adherent','banque','don','user','usergroup','product','produit','service','produit|service','categorie','resource','expensereport','holiday'); // Test on entity only (Objects with no link to company) $check = array('adherent','banque','bom','don','user','usergroup','product','produit','service','produit|service','categorie','resource','expensereport','holiday'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object $checksoc = array('societe'); // Test for societe object
$checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...). $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet','project'); // Test for project object $checkproject = array('projet','project'); // Test for project object

View File

@ -116,7 +116,6 @@ class modTcpdfbarcode extends ModeleBarCode
$_GET["code"]=$code; $_GET["code"]=$code;
$_GET["type"]=$encoding; $_GET["type"]=$encoding;
$_GET["height"]=$height;
$_GET["readable"]=$readable; $_GET["readable"]=$readable;
if ($code) { if ($code) {
@ -166,7 +165,6 @@ class modTcpdfbarcode extends ModeleBarCode
$_GET["code"]=$code; $_GET["code"]=$code;
$_GET["type"]=$encoding; $_GET["type"]=$encoding;
$_GET["height"]=$height;
$_GET["readable"]=$readable; $_GET["readable"]=$readable;
if ($code) { if ($code) {

View File

@ -117,13 +117,13 @@ class pdf_standard extends ModeleExpenseReport
public $emetteur; public $emetteur;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
public function __construct($db) public function __construct($db)
{ {
global $conf, $langs, $mysoc, $user; global $conf, $langs, $mysoc, $user;
// Translations // Translations
@ -172,12 +172,12 @@ class pdf_standard extends ModeleExpenseReport
$this->posxup=145; $this->posxup=145;
$this->posxqty=168; $this->posxqty=168;
$this->postotalttc=178; $this->postotalttc=178;
// if (empty($conf->projet->enabled)) { // if (empty($conf->projet->enabled)) {
// $this->posxtva-=20; // $this->posxtva-=20;
// $this->posxup-=20; // $this->posxup-=20;
// $this->posxqty-=20; // $this->posxqty-=20;
// $this->postotalttc-=20; // $this->postotalttc-=20;
// } // }
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxdate-=20; $this->posxdate-=20;
@ -196,19 +196,19 @@ class pdf_standard extends ModeleExpenseReport
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param Object $object Object to generate * @param Object $object Object to generate
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {
// phpcs:enable // phpcs:enable
global $user, $langs, $conf, $mysoc, $db, $hookmanager; global $user, $langs, $conf, $mysoc, $db, $hookmanager;
@ -501,9 +501,9 @@ class pdf_standard extends ModeleExpenseReport
$posy=$this->tablePayments($pdf, $object, $posy_start_of_totals, $outputlangs); $posy=$this->tablePayments($pdf, $object, $posy_start_of_totals, $outputlangs);
} }
// Pied de page // Page footer
$this->_pagefoot($pdf, $object, $outputlangs); $this->_pagefoot($pdf, $object, $outputlangs);
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPage(); if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
@ -540,17 +540,17 @@ class pdf_standard extends ModeleExpenseReport
} }
} }
/** /**
* @param TCPDF $pdf Object PDF * @param TCPDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $linenumber line number * @param int $linenumber line number
* @param int $curY current y position * @param int $curY current y position
* @param int $default_font_size default siez of font * @param int $default_font_size default siez of font
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void * @return void
*/ */
private function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0) private function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
{ {
global $conf; global $conf;
$pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFont('', '', $default_font_size - 1);
@ -618,7 +618,7 @@ class pdf_standard extends ModeleExpenseReport
} }
$comment .= $object->lines[$linenumber]->comments; $comment .= $object->lines[$linenumber]->comments;
$pdf->writeHTMLCell($this->posxtva-$this->posxcomment-0.8, 4, $this->posxcomment-1, $curY, $comment, 0, 1); $pdf->writeHTMLCell($this->posxtva-$this->posxcomment-0.8, 4, $this->posxcomment-1, $curY, $comment, 0, 1);
} }
/** /**
* Show top header of page. * Show top header of page.
@ -846,7 +846,7 @@ class pdf_standard extends ModeleExpenseReport
} }
} }
} }
} }
/** /**
* Show table for lines * Show table for lines
@ -1024,6 +1024,7 @@ class pdf_standard extends ModeleExpenseReport
if ($resql) if ($resql)
{ {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$totalpaid = 0;
$i=0; $i=0;
while ($i < $num) { while ($i < $num) {
$y+=$tab3_height; $y+=$tab3_height;

View File

@ -154,7 +154,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$widthtouse = $maxwidthtouse; $widthtouse = $maxwidthtouse;
$heighttouse = $maxheighttouse; $heighttouse = $maxheighttouse;
$logoHeight = $heighttouse; $logoHeight = $heighttouse;
$logoWidth = $heighttouse; $logoWidth = $widthtouse;
//var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit; //var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit;
@ -175,9 +175,11 @@ class pdf_tcpdflabel extends CommonStickerGenerator
} }
elseif ($textleft!='' && $textright!='') // left and right part elseif ($textleft!='' && $textright!='') // left and right part
{ {
$logoHeight = $heighttouse/2;
$logoWidth = $widthtouse/2;
if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text
{ {
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, 0); if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $logoWidth, 0);
elseif ($code && !empty($encoding)) elseif ($code && !empty($encoding))
{ {
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse); $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse);
@ -187,7 +189,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
} }
elseif (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text elseif (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
{ {
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, 0); if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $logoWidth, 0);
elseif ($code && !empty($encoding)) elseif ($code && !empty($encoding))
{ {
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse); $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse);
@ -203,7 +205,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft+$logoWidth+1, $_PosY+$ytop, $widthtouse-$logoWidth-1, $heighttouse); $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft+$logoWidth+1, $_PosY+$ytop, $widthtouse-$logoWidth-1, $heighttouse);
} else { } else {
$pdf->SetXY($_PosX+$xleft+$logoWidth+1, $_PosY+$ytop); $pdf->SetXY($_PosX+$xleft+$logoWidth+1, $_PosY+$ytop);
$pdf->MultiCell($widthtouse-$logoWidth1-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); $pdf->MultiCell($widthtouse-$logoWidth-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
} }
} }
elseif ($textright == '%LOGO%') // right part logo left part text/barcode elseif ($textright == '%LOGO%') // right part logo left part text/barcode

View File

@ -53,6 +53,12 @@ elseif ($modulepart == 'project')
if (! $user->rights->projet->lire) accessforbidden(); if (! $user->rights->projet->lire) accessforbidden();
$accessallowed=1; $accessallowed=1;
} }
elseif ($modulepart == 'bom')
{
$result=restrictedArea($user, 'bom', $id, 'bom_bom');
if (! $user->rights->bom->read) accessforbidden();
$accessallowed=1;
}
elseif ($modulepart == 'expensereport') elseif ($modulepart == 'expensereport')
{ {
$result=restrictedArea($user, 'expensereport', $id, 'expensereport'); $result=restrictedArea($user, 'expensereport', $id, 'expensereport');
@ -205,8 +211,19 @@ elseif ($modulepart == 'ticket')
$dir=$conf->ticket->dir_output; // By default $dir=$conf->ticket->dir_output; // By default
} }
} }
elseif ($modulepart == 'bom')
{
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
$object = new BOM($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db, 'Failed to load object');
$dir=$conf->bom->dir_output; // By default
}
}
else { else {
print 'Action crop for module part '.$modulepart.' is not supported yet.'; print 'Action crop for modulepart = '.$modulepart.' is not supported yet.';
} }
if (empty($backtourl)) if (empty($backtourl))
@ -220,6 +237,7 @@ if (empty($backtourl))
elseif (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]); elseif (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]); elseif (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]); elseif (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else $backtourl=DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
} }

View File

@ -1402,6 +1402,8 @@ class Expedition extends CommonObject
$this->total_localtax1 = 0; $this->total_localtax1 = 0;
$this->total_localtax2 = 0; $this->total_localtax2 = 0;
$line = new ExpeditionLigne($this->db);
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
@ -2566,8 +2568,6 @@ class ExpeditionLigne extends CommonObjectLine
$this->error = 'ErrorMandatoryParametersNotProvided'; $this->error = 'ErrorMandatoryParametersNotProvided';
return -1; return -1;
} }
// Clean parameters
if (empty($this->entrepot_id)) $this->entrepot_id='null';
$this->db->begin(); $this->db->begin();
@ -2578,7 +2578,7 @@ class ExpeditionLigne extends CommonObjectLine
$sql.= ", qty"; $sql.= ", qty";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= $this->fk_expedition; $sql.= $this->fk_expedition;
$sql.= ", ".$this->entrepot_id; $sql.= ", ".(empty($this->entrepot_id) ? 'NULL' : $this->entrepot_id);
$sql.= ", ".$this->fk_origin_line; $sql.= ", ".$this->fk_origin_line;
$sql.= ", ".$this->qty; $sql.= ", ".$this->qty;
$sql.= ")"; $sql.= ")";

View File

@ -247,10 +247,10 @@ class ProductFournisseur extends Product
if (empty($supplier_reputation) || $supplier_reputation == -1) $supplier_reputation=''; if (empty($supplier_reputation) || $supplier_reputation == -1) $supplier_reputation='';
if ($delivery_time_days != '' && ! is_numeric($delivery_time_days)) $delivery_time_days = ''; if ($delivery_time_days != '' && ! is_numeric($delivery_time_days)) $delivery_time_days = '';
if ($price_base_type == 'TTC') if ($price_base_type == 'TTC')
{ {
$ttx = $tva_tx; $ttx = $tva_tx;
$buyprice = $buyprice/(1+($ttx/100)); $buyprice = $buyprice/(1+($ttx/100));
} }
// Multicurrency // Multicurrency
if ($conf->multicurrency->enabled) { if ($conf->multicurrency->enabled) {
@ -259,10 +259,10 @@ class ProductFournisseur extends Product
if (empty($multicurrency_buyprice)) $multicurrency_buyprice=0; if (empty($multicurrency_buyprice)) $multicurrency_buyprice=0;
if ($multicurrency_price_base_type == 'TTC') if ($multicurrency_price_base_type == 'TTC')
{ {
$ttx = $tva_tx; $ttx = $tva_tx;
$multicurrency_buyprice = $multicurrency_buyprice/(1+($ttx/100)); $multicurrency_buyprice = $multicurrency_buyprice/(1+($ttx/100));
} }
$multicurrency_buyprice=price2num($multicurrency_buyprice, 'MU'); $multicurrency_buyprice=price2num($multicurrency_buyprice, 'MU');
$multicurrency_unitBuyPrice=price2num($multicurrency_buyprice/$qty, 'MU'); $multicurrency_unitBuyPrice=price2num($multicurrency_buyprice/$qty, 'MU');
@ -369,7 +369,7 @@ class ProductFournisseur extends Product
// End call triggers // End call triggers
if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG))
{ {
$result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrency, $multicurrency_code);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -911,21 +911,21 @@ class ProductFournisseur extends Product
return $out; return $out;
} }
/** /**
* Function used to replace a thirdparty id with another one. * Function used to replace a thirdparty id with another one.
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id * @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id * @param int $dest_id New thirdparty id
* @return bool * @return bool
*/ */
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{ {
$tables = array( $tables = array(
'product_fournisseur_price' 'product_fournisseur_price'
); );
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
} }
/** /**
@ -1089,7 +1089,7 @@ class ProductFournisseur extends Product
* *
* @return int < 0 NOK > 0 OK * @return int < 0 NOK > 0 OK
*/ */
private function logPrice($user, $datec, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrency, $multicurrency_code) private function logPrice($user, $datec, $buyprice, $qty, $multicurrency_buyprice = null, $multicurrency_unitBuyPrice = null, $multicurrency_tx = null, $fk_multicurrency = null, $multicurrency_code = null)
{ {
// Add record into log table // Add record into log table
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log("; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log(";

View File

@ -484,7 +484,7 @@ if ($resql)
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$topicmail="SendBillRef"; $topicmail="SendBillRef";
$modelmail="supplier_invoice_send"; $modelmail="invoice_supplier_send";
$objecttmp=new FactureFournisseur($db); $objecttmp=new FactureFournisseur($db);
$trackid='sinv'.$object->id; $trackid='sinv'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';

View File

@ -382,7 +382,7 @@ ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_ob
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAULT NULL; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL after date_validated;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);

View File

@ -1,6 +1,6 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> -- Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
-- Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by -- it under the terms of the GNU General Public License as published by
@ -50,6 +50,7 @@ CREATE TABLE llx_accounting_bookkeeping
journal_label varchar(255), -- FEC:JournalLib journal_label varchar(255), -- FEC:JournalLib
piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification) date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification)
date_export datetime DEFAULT NULL, --
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format extraparams varchar(255) -- for other parameters with json format
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -842,6 +842,11 @@ Exports=Exports
ExportFilteredList=Export filtered list ExportFilteredList=Export filtered list
ExportList=Export list ExportList=Export list
ExportOptions=Export Options ExportOptions=Export Options
IncludeDocsAlreadyExported=Include docs already exported
ExportOfPiecesAlreadyExportedIsEnable=Export of pieces already exported is enable
ExportOfPiecesAlreadyExportedIsDisable=Export of pieces already exported is disable
AllExportedMovementsWereRecordedAsExported=All exported movements were recorded as exported
NotAllExportedMovementsCouldBeRecordedAsExported=Not all exported movements could be recorded as exported
Miscellaneous=Miscellaneous Miscellaneous=Miscellaneous
Calendar=Calendar Calendar=Calendar
GroupBy=Group by... GroupBy=Group by...

View File

@ -13,3 +13,5 @@ WatermarkOnDraftBOMs=Watermark on draft BOM
ConfirmCloneBillOfMaterials=Are you sure you want to clone this bill of material ? ConfirmCloneBillOfMaterials=Are you sure you want to clone this bill of material ?
ManufacturingEfficiency=Manufacturing efficiency ManufacturingEfficiency=Manufacturing efficiency
ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production
DeleteBillOfMaterials=Delete Bill Of Materials
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Material?

View File

@ -209,7 +209,7 @@ if ($object->id > 0)
$objthirdparty=$object; $objthirdparty=$object;
$objcon=new stdClass(); $objcon=new stdClass();
$out=''; $out='&origin='.$object->element.'&originid='.$object->id;
$permok=$user->rights->agenda->myactions->create; $permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{ {
@ -240,19 +240,19 @@ if ($object->id > 0)
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{ {
$param='&socid='.$socid; $param='&id='.$object->id.'&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', ''); //print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', '');
// List of all actions // List of all actions
$filters=array(); $filters=array();
$filters['search_agenda_label']=$search_agenda_label; $filters['search_agenda_label']=$search_agenda_label;
// TODO Replace this with same code than into list.php // TODO Replace this with same code than into list.php
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); //show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
} }
} }

View File

@ -59,12 +59,12 @@ class FormProduct
* Load in cache array list of warehouses * Load in cache array list of warehouses
* If fk_product is not 0, we do not use cache * If fk_product is not 0, we do not use cache
* *
* @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0.
* @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''.
* @param string $status warehouse status filter, following comma separated filter options can be used * @param string $status warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses, * 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param boolean $sumStock sum total stock of a warehouse, default true * @param boolean $sumStock sum total stock of a warehouse, default true
* @param array $exclude warehouses ids to exclude * @param array $exclude warehouses ids to exclude
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO * @return int Nb of loaded lines, 0 if already loaded, <0 if KO
@ -114,9 +114,9 @@ class FormProduct
{ {
$sql.= " AND ps.fk_product = '".$fk_product."'"; $sql.= " AND ps.fk_product = '".$fk_product."'";
if (!empty($batch)) if (!empty($batch))
{ {
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb on pb.fk_product_stock = ps.rowid AND pb.batch = '".$batch."'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb on pb.fk_product_stock = ps.rowid AND pb.batch = '".$batch."'";
} }
} }
$sql.= " WHERE e.entity IN (".getEntity('stock').")"; $sql.= " WHERE e.entity IN (".getEntity('stock').")";
if (count($warehouseStatus)) if (count($warehouseStatus))
@ -173,9 +173,9 @@ class FormProduct
* @param String $final_label full label with all parents, separated by ' >> ' (completed on each call) * @param String $final_label full label with all parents, separated by ' >> ' (completed on each call)
* @return String full label with all parents, separated by ' >> ' * @return String full label with all parents, separated by ' >> '
*/ */
private function get_parent_path($tab, $final_label = '') private function get_parent_path($tab, $final_label = '')
{ {
//phpcs:enable //phpcs:enable
if(empty($final_label)) $final_label = $tab['label']; if(empty($final_label)) $final_label = $tab['label'];
if(empty($tab['parent_id'])) return $final_label; if(empty($tab['parent_id'])) return $final_label;
@ -195,9 +195,9 @@ class FormProduct
* @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) * @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value)
* @param string $htmlname Name of html select html * @param string $htmlname Name of html select html
* @param string $filterstatus warehouse status filter, following comma separated filter options can be used * @param string $filterstatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses, * 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param int $empty 1=Can be empty, 0 if not * @param int $empty 1=Can be empty, 0 if not
* @param int $disabled 1=Select is disabled * @param int $disabled 1=Select is disabled
* @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0.
@ -379,9 +379,9 @@ class FormProduct
*/ */
public function selectLotStock($selected = '', $htmlname = 'batch_id', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200') public function selectLotStock($selected = '', $htmlname = 'batch_id', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200')
{ {
global $langs; global $conf, $langs;
dol_syslog(get_class($this)."::selectLot $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); dol_syslog(get_class($this)."::selectLot $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
$out=''; $out='';
$productIdArray = array(); $productIdArray = array();