Merge branch 'develop' into 10.0_intracommreport
This commit is contained in:
commit
8b8aaafc05
37
ChangeLog
37
ChangeLog
@ -14,7 +14,7 @@ WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Properties ->libelle_incoterms were renamed into ->label_incoterms
|
||||
|
||||
* Removed the method liste_array() of project class. It was not used by core code.
|
||||
|
||||
|
||||
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
||||
@ -499,6 +499,41 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Remove the no more used and deprecated dol_print_graph function
|
||||
|
||||
|
||||
***** ChangeLog for 8.0.6 compared to 8.0.5 *****
|
||||
FIX: #11244
|
||||
FIX: #11316
|
||||
FIX: Add missing end date of subscription in export
|
||||
FIX: A user may read holiday and expense report without permissions
|
||||
FIX: better syntax
|
||||
FIX: condition
|
||||
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
|
||||
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
|
||||
FIX: default value for duration of validity can be set from generic
|
||||
FIX: do not include tpl from disabled modules
|
||||
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
|
||||
FIX: Even with permission, can't validate leave once validator defined.
|
||||
FIX: extrafield list search: SQL error when field is multiselect
|
||||
FIX: if last char of customercode is accent making the truncate of first
|
||||
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
|
||||
FIX: invalid link on user.fk_user
|
||||
FIX: invoice class: bad SQL request if product type not set
|
||||
FIX: mail presend: can overwrite a file previously uploaded
|
||||
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
|
||||
FIX: mass send mail
|
||||
FIX: missing compatibility with multicompany transverse mode
|
||||
FIX: modulebuilder: hardcoded llx_
|
||||
FIX: Not showing Contract and Project columns on ficheinter list
|
||||
FIX: remove isolated transaction commit
|
||||
FIX: security (a user can read leave or holiday of other without perm.
|
||||
FIX: situation invoices: bad detailed VAT in situations following the first one
|
||||
FIX: situation invoices: block progress percentage change for discount lines
|
||||
FIX: syntax error
|
||||
FIX: try to use WHERE EXISTS instead DISTINCT
|
||||
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
|
||||
FIX: var name
|
||||
FIX: we need to fetch fourn invoice with ref in current entity
|
||||
FIX: Wrong stock movement on supplier credit notes
|
||||
|
||||
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
|
||||
FIX: #10381
|
||||
FIX: #10460 compatibility with MariaDB 10.4
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||

|
||||
[](https://houndci.com)
|
||||
|
||||
|6|7|8|9|develop|
|
||||
|7|8|9|10|develop|
|
||||
|----------|----------|----------|----------|----------|
|
||||
||||||
|
||||
||||||
|
||||
|
||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ LaunchProgram=Launch %1
|
||||
AssocFileExtension=&Associate %1 with the %2 file extension
|
||||
AssocingFileExtension=Associating %1 with the %2 file extension...
|
||||
|
||||
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party softwares like Apache, Mysql and PHP) on your computer.
|
||||
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party software like Apache, Mysql and PHP) on your computer.
|
||||
ThisAssistantInstallOrUpgrade=WARNING: Using an ERP CRM installed on a local computer can be dangerous: if your computer break down, you can lose all your data. Do this if you are ready to manage backup yourself seriously. If not, use an installation in Saas instead (see https://saas.dolibarr.org).
|
||||
IfYouHaveTechnicalKnowledge=Moreover, if you have technical knowledges and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing server with Apache, Mysql and PHP.
|
||||
ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way...
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# DOLIWAMP, THE DOLIBARR INSTALLER FOR WINDOWS
|
||||
|
||||
DoliWamp is a special all in one package installer for Windows (Dolibarr+Mysql+Apache+PHP).
|
||||
It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also and all prerequisites like the web server, and the database in one autoinstall process.
|
||||
It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also all prerequisites like the web server, and the database in one auto-install process.
|
||||
|
||||
If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file).
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ AppPublisher=NLTechno
|
||||
AppPublisherURL=https://www.nltechno.com
|
||||
AppSupportURL=https://www.dolibarr.org
|
||||
AppUpdatesURL=https://www.dolibarr.org
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql software.
|
||||
AppCopyright=Copyright (C) 2008-2019 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
|
||||
@ -150,7 +150,7 @@ Require local
|
||||
# e-mailed. This address appears on some server-generated pages, such
|
||||
# as error documents. e.g. admin@your-domain.com
|
||||
#
|
||||
ServerAdmin webmaster@localhost
|
||||
ServerAdmin doliwamp@localhost
|
||||
|
||||
#
|
||||
# ServerName gives the name and port that the server uses to identify itself.
|
||||
@ -772,5 +772,5 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key"
|
||||
#</Location>
|
||||
|
||||
|
||||
# Declare alias for Dolibarr, PHPMyAdmin and other softwares
|
||||
# Declare alias for Dolibarr, PHPMyAdmin and other software
|
||||
Include "WAMPROOT/alias/*.conf"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
// during install process to be used.
|
||||
//
|
||||
//
|
||||
$force_install_type='doliwamp';
|
||||
$force_install_noedit=2; // 1=To block vars specific to distrib, 2 to block all technical parameters
|
||||
$force_install_message='KeepDefaultValuesWamp';
|
||||
$force_install_main_data_root='WAMPROOT/dolibarr_documents';
|
||||
|
||||
@ -653,6 +653,8 @@ default_socket_timeout = 60
|
||||
; extension folders as well as the separate PECL DLL download (PHP 5).
|
||||
; Be sure to appropriately set the extension_dir directive.
|
||||
|
||||
; If an extension does not load, run "deplister.exe php_xxx.dll" to get list of dependency dll missing.
|
||||
|
||||
extension=php_bz2.dll
|
||||
extension=php_curl.dll
|
||||
;extension=php_dba.dll
|
||||
@ -665,6 +667,7 @@ extension=php_gd2.dll
|
||||
;extension=php_ifx.dll
|
||||
;extension=php_imap.dll
|
||||
;extension=php_interbase.dll
|
||||
extension=php_intl.dll
|
||||
extension=php_ldap.dll
|
||||
extension=php_mbstring.dll
|
||||
;extension=php_mcrypt.dll
|
||||
|
||||
@ -4,3 +4,4 @@ REM ----------------------------
|
||||
|
||||
REM Go to admin center page
|
||||
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/
|
||||
REM FOR EDGE start microsoft-edge:"http://localhost:WAMPAPACHEPORT/"
|
||||
@ -5,3 +5,4 @@ REM ---------------------------
|
||||
REM Go to help center page
|
||||
echo Please wait...
|
||||
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/
|
||||
REM FOR EDGE start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/support/"
|
||||
@ -4,6 +4,8 @@ REM ---------------
|
||||
|
||||
REM If no lock file, we call install process
|
||||
IF NOT EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/
|
||||
REM FOR EDGE IF NOT EXIST dolibarr_documents\install.lock start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/install/"
|
||||
|
||||
REM If lock file exists, we call home page
|
||||
IF EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/
|
||||
REM FOR EDGE IF EXIST dolibarr_documents\install.lock start microsoft-edge:"http://localhost:WAMPAPACHEPORT/dolibarr/"
|
||||
|
||||
@ -367,7 +367,6 @@ if ($nboftargetok) {
|
||||
{
|
||||
#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
|
||||
}
|
||||
print "\n";
|
||||
if (! $ret)
|
||||
@ -382,11 +381,15 @@ if ($nboftargetok) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Build xml check file
|
||||
#-----------------------
|
||||
if ($CHOOSEDTARGET{'-CHKSUM'})
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
|
||||
$ret=`git ls-files . --exclude-standard --others`;
|
||||
if ($ret)
|
||||
{
|
||||
|
||||
@ -27,6 +27,15 @@ With
|
||||
|
||||
|
||||
|
||||
ESCPOS:
|
||||
-------
|
||||
Replace
|
||||
private $connector;
|
||||
With
|
||||
protected $connector;
|
||||
|
||||
|
||||
|
||||
NUSOAP:
|
||||
-------
|
||||
* In file nusoap.php, to avoid a warning,
|
||||
|
||||
@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
||||
{
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature';
|
||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
|
||||
}
|
||||
// Other checks
|
||||
if (isset($_POST["code"]))
|
||||
@ -437,7 +437,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='nature') {
|
||||
$valuetoshow=$langs->trans("Nature");
|
||||
$valuetoshow=$langs->trans("NatureOfJournal");
|
||||
}
|
||||
|
||||
if ($valuetoshow != '') {
|
||||
@ -516,7 +516,7 @@ if ($id)
|
||||
}
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre_filter liste_titre_add">';
|
||||
/*print '<tr class="liste_titre_filter liste_titre_add">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -524,16 +524,14 @@ if ($id)
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if ($filterfound)
|
||||
{
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
}
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
*/
|
||||
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre liste_titre_add">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
@ -558,7 +556,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='nature') {
|
||||
$valuetoshow=$langs->trans("Nature");
|
||||
$valuetoshow=$langs->trans("NatureOfJournal");
|
||||
}
|
||||
|
||||
// Affiche nom du champ
|
||||
|
||||
@ -462,7 +462,7 @@ if ($result)
|
||||
// print '<td class="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
print '<td>' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
}
|
||||
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
|
||||
|
||||
@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
@ -97,8 +99,9 @@ $pagenext = $page + 1;
|
||||
if ($sortorder == "") $sortorder = "ASC";
|
||||
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new BookKeeping($db);
|
||||
$hookmanager->initHooks(array('bookkeepinglist'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
@ -160,145 +163,151 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let
|
||||
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
$parameters=array('socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
if (empty($reshook))
|
||||
{
|
||||
$search_mvt_num = '';
|
||||
$search_doc_type = '';
|
||||
$search_doc_ref = '';
|
||||
$search_doc_date = '';
|
||||
$search_accountancy_code = '';
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_accountancy_aux_code = '';
|
||||
$search_accountancy_aux_code_start = '';
|
||||
$search_accountancy_aux_code_end = '';
|
||||
$search_mvt_label = '';
|
||||
$search_direction = '';
|
||||
$search_ledger_code = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_creation_start = '';
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Must be after the remove filter action, before the export.
|
||||
$param = '';
|
||||
$filter = array ();
|
||||
if (! empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$tmp=dol_getdate($search_date_start);
|
||||
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$tmp=dol_getdate($search_date_end);
|
||||
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_doc_date)) {
|
||||
$filter['t.doc_date'] = $search_doc_date;
|
||||
$tmp=dol_getdate($search_doc_date);
|
||||
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_doc_type)) {
|
||||
$filter['t.doc_type'] = $search_doc_type;
|
||||
$param .= '&search_doc_type=' . urlencode($search_doc_type);
|
||||
}
|
||||
if (! empty($search_doc_ref)) {
|
||||
$filter['t.doc_ref'] = $search_doc_ref;
|
||||
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
|
||||
}
|
||||
if (! empty($search_accountancy_code)) {
|
||||
$filter['t.numero_compte'] = $search_accountancy_code;
|
||||
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
|
||||
}
|
||||
if (! empty($search_accountancy_code_start)) {
|
||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
|
||||
}
|
||||
if (! empty($search_accountancy_code_end)) {
|
||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code)) {
|
||||
$filter['t.subledger_account'] = $search_accountancy_aux_code;
|
||||
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code_start)) {
|
||||
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
|
||||
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code_end)) {
|
||||
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
|
||||
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
|
||||
}
|
||||
if (! empty($search_mvt_label)) {
|
||||
$filter['t.label_operation'] = $search_mvt_label;
|
||||
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
|
||||
}
|
||||
if (! empty($search_direction)) {
|
||||
$filter['t.sens'] = $search_direction;
|
||||
$param .= '&search_direction=' . urlencode($search_direction);
|
||||
}
|
||||
if (! empty($search_ledger_code)) {
|
||||
$filter['t.code_journal'] = $search_ledger_code;
|
||||
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
|
||||
}
|
||||
if (! empty($search_mvt_num)) {
|
||||
$filter['t.piece_num'] = $search_mvt_num;
|
||||
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
|
||||
}
|
||||
if (! empty($search_date_creation_start)) {
|
||||
$filter['t.date_creation>='] = $search_date_creation_start;
|
||||
$tmp=dol_getdate($search_date_creation_start);
|
||||
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_creation_end)) {
|
||||
$filter['t.date_creation<='] = $search_date_creation_end;
|
||||
$tmp=dol_getdate($search_date_creation_end);
|
||||
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_modification_start)) {
|
||||
$filter['t.tms>='] = $search_date_modification_start;
|
||||
$tmp=dol_getdate($search_date_modification_start);
|
||||
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_modification_end)) {
|
||||
$filter['t.tms<='] = $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'];
|
||||
}
|
||||
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)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit=' . urlencode($search_debit);
|
||||
}
|
||||
if (! empty($search_credit)) {
|
||||
$filter['t.credit'] = $search_credit;
|
||||
$param .= '&search_credit=' . urlencode($search_credit);
|
||||
}
|
||||
if (! empty($search_lettering_code)) {
|
||||
$filter['t.lettering_code'] = $search_lettering_code;
|
||||
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_mvt_num = '';
|
||||
$search_doc_type = '';
|
||||
$search_doc_ref = '';
|
||||
$search_doc_date = '';
|
||||
$search_accountancy_code = '';
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_accountancy_aux_code = '';
|
||||
$search_accountancy_aux_code_start = '';
|
||||
$search_accountancy_aux_code_end = '';
|
||||
$search_mvt_label = '';
|
||||
$search_direction = '';
|
||||
$search_ledger_code = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_creation_start = '';
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
}
|
||||
|
||||
// Must be after the remove filter action, before the export.
|
||||
$param = '';
|
||||
$filter = array ();
|
||||
if (! empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$tmp=dol_getdate($search_date_start);
|
||||
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$tmp=dol_getdate($search_date_end);
|
||||
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_doc_date)) {
|
||||
$filter['t.doc_date'] = $search_doc_date;
|
||||
$tmp=dol_getdate($search_doc_date);
|
||||
$param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_doc_type)) {
|
||||
$filter['t.doc_type'] = $search_doc_type;
|
||||
$param .= '&search_doc_type=' . urlencode($search_doc_type);
|
||||
}
|
||||
if (! empty($search_doc_ref)) {
|
||||
$filter['t.doc_ref'] = $search_doc_ref;
|
||||
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
|
||||
}
|
||||
if (! empty($search_accountancy_code)) {
|
||||
$filter['t.numero_compte'] = $search_accountancy_code;
|
||||
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
|
||||
}
|
||||
if (! empty($search_accountancy_code_start)) {
|
||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
|
||||
}
|
||||
if (! empty($search_accountancy_code_end)) {
|
||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code)) {
|
||||
$filter['t.subledger_account'] = $search_accountancy_aux_code;
|
||||
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code_start)) {
|
||||
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
|
||||
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
|
||||
}
|
||||
if (! empty($search_accountancy_aux_code_end)) {
|
||||
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
|
||||
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
|
||||
}
|
||||
if (! empty($search_mvt_label)) {
|
||||
$filter['t.label_operation'] = $search_mvt_label;
|
||||
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
|
||||
}
|
||||
if (! empty($search_direction)) {
|
||||
$filter['t.sens'] = $search_direction;
|
||||
$param .= '&search_direction=' . urlencode($search_direction);
|
||||
}
|
||||
if (! empty($search_ledger_code)) {
|
||||
$filter['t.code_journal'] = $search_ledger_code;
|
||||
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
|
||||
}
|
||||
if (! empty($search_mvt_num)) {
|
||||
$filter['t.piece_num'] = $search_mvt_num;
|
||||
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
|
||||
}
|
||||
if (! empty($search_date_creation_start)) {
|
||||
$filter['t.date_creation>='] = $search_date_creation_start;
|
||||
$tmp=dol_getdate($search_date_creation_start);
|
||||
$param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_creation_end)) {
|
||||
$filter['t.date_creation<='] = $search_date_creation_end;
|
||||
$tmp=dol_getdate($search_date_creation_end);
|
||||
$param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_modification_start)) {
|
||||
$filter['t.tms>='] = $search_date_modification_start;
|
||||
$tmp=dol_getdate($search_date_modification_start);
|
||||
$param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_modification_end)) {
|
||||
$filter['t.tms<='] = $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'];
|
||||
}
|
||||
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)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit=' . urlencode($search_debit);
|
||||
}
|
||||
if (! empty($search_credit)) {
|
||||
$filter['t.credit'] = $search_credit;
|
||||
$param .= '&search_credit=' . urlencode($search_credit);
|
||||
}
|
||||
if (! empty($search_lettering_code)) {
|
||||
$filter['t.lettering_code'] = $search_lettering_code;
|
||||
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
|
||||
@ -527,6 +536,11 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste" width="100%">';
|
||||
|
||||
@ -635,6 +649,13 @@ if (! empty($arrayfields['t.code_journal']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
}
|
||||
|
||||
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Date creation
|
||||
if (! empty($arrayfields['t.date_creation']['checked']))
|
||||
{
|
||||
@ -695,6 +716,10 @@ if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arr
|
||||
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $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 ');
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
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.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
@ -796,6 +821,11 @@ if ($num > 0)
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Creation operation date
|
||||
if (! empty($arrayfields['t.date_creation']['checked']))
|
||||
{
|
||||
@ -853,10 +883,15 @@ if ($num > 0)
|
||||
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -573,7 +573,14 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
{
|
||||
$reflabel = '';
|
||||
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":"");
|
||||
$reflabel.= dol_string_nohtmltag($val['soclib']);
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
$reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
}
|
||||
else
|
||||
{
|
||||
$reflabel.= dol_string_nohtmltag($val['soclib']);
|
||||
}
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
@ -702,7 +709,7 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // If thirdparty unkown, output the waiting account
|
||||
else { // If thirdparty unknown, output the waiting account
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
@ -831,7 +838,6 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep;
|
||||
print "\n";
|
||||
|
||||
|
||||
foreach ($tabpay as $key => $val)
|
||||
{
|
||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||
@ -869,7 +875,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
{
|
||||
$reflabel = '';
|
||||
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":"");
|
||||
$reflabel.= dol_string_nohtmltag($val['soclib']);
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
$reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
}
|
||||
else
|
||||
{
|
||||
$reflabel.= dol_string_nohtmltag($val['soclib']);
|
||||
}
|
||||
|
||||
print '"' . $key . '"' . $sep;
|
||||
print '"' . $date . '"' . $sep;
|
||||
@ -951,7 +964,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
|
||||
// Test that setup is complete
|
||||
@ -1087,7 +1100,14 @@ if (empty($action) || $action == 'view') {
|
||||
{
|
||||
$reflabel = '';
|
||||
if (! empty($val['lib'])) $reflabel .= $val['lib'] . ($val['soclib']?" - ":"");
|
||||
$reflabel.= $val['soclib'];
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
$reflabel.= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
||||
}
|
||||
else
|
||||
{
|
||||
$reflabel.= $val['soclib'];
|
||||
}
|
||||
|
||||
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
||||
print '<tr class="oddeven">';
|
||||
@ -1115,7 +1135,7 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will a waiting account
|
||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -653,7 +653,7 @@ if (empty($reshook))
|
||||
|
||||
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else {
|
||||
@ -734,7 +734,7 @@ if (empty($reshook))
|
||||
|
||||
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -2439,6 +2439,7 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -2448,7 +2449,7 @@ class Adherent extends CommonObject
|
||||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
private function _load_ldap_dn($info, $mode = 0)
|
||||
public function _load_ldap_dn($info, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
@ -229,7 +229,7 @@ if ($search_type) $param.="&search_type=".urlencode($search_type);
|
||||
if ($date_select) $param.="&date_select=".urlencode($date_select);
|
||||
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
|
||||
if ($search_login) $param.="&search_login=".urlencode($search_login);
|
||||
if ($search_acount) $param.="&search_account=".urlencode($search_account);
|
||||
if ($search_account) $param.="&search_account=".urlencode($search_account);
|
||||
if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
|
||||
@ -603,7 +603,7 @@ if ($rowid > 0)
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
print '<td class="liste_titre left">';
|
||||
|
||||
@ -169,7 +169,7 @@ if ($action == 'delete')
|
||||
|
||||
if ($action == 'switch')
|
||||
{
|
||||
// On permute les valeur du champ box_order des 2 lignes de la table boxes
|
||||
// We switch values of field box_order for the 2 lines of table boxes
|
||||
$db->begin();
|
||||
|
||||
$objfrom=new ModeleBoxes($db);
|
||||
|
||||
@ -1622,7 +1622,11 @@ if ($id)
|
||||
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
}
|
||||
|
||||
if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page')))
|
||||
{
|
||||
$iserasable = 0; $canbedisabled = 0;
|
||||
if (in_array($obj->code, array('banner'))) $canbedisabled = 1;
|
||||
}
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
|
||||
$canbemodified=$iserasable;
|
||||
@ -1903,6 +1907,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
}
|
||||
else{
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
||||
@ -1965,7 +1972,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position';
|
||||
|
||||
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
|
||||
|
||||
if ($fieldlist[$field]=='sortorder')
|
||||
{
|
||||
$fieldlist[$field]='position';
|
||||
}
|
||||
|
||||
$classtd=''; $class='';
|
||||
if ($fieldlist[$field]=='code') $classtd='width100';
|
||||
@ -1982,7 +1995,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$transkey="PaymentCondition".strtoupper($obj->code);
|
||||
$transkey="PaymentConditionShort".strtoupper($obj->code);
|
||||
}
|
||||
if ($transkey && $langs->trans($transkey) != $transkey)
|
||||
{
|
||||
@ -1992,8 +2005,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
if (! $transfound)
|
||||
{
|
||||
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
else{
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,6 +201,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday');
|
||||
|
||||
print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
@ -294,8 +295,10 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
@ -331,6 +334,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -457,6 +461,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -469,6 +474,8 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_other">';
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -506,6 +513,8 @@ print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK"
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@ -60,6 +60,7 @@ if (GETPOST('cancel', 'alpha'))
|
||||
|
||||
if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
|
||||
@ -81,6 +82,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK
|
||||
if ($action == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -873,6 +873,7 @@ if ($resql)
|
||||
// Status / Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
else print '<span class="opacitymedium">'.$actl[$obj->active].'</span>';
|
||||
print "</td>";
|
||||
|
||||
// Modify link / Delete link
|
||||
|
||||
@ -220,7 +220,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title
|
||||
|
||||
$head = supplier_proposal_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal');
|
||||
dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal');
|
||||
|
||||
/*
|
||||
* Module numerotation
|
||||
|
||||
@ -144,6 +144,21 @@ if (! $foundcache && $test)
|
||||
if (! $foundcache) print $langs->trans("NoOPCodeCacheFound");
|
||||
print '<br>';
|
||||
|
||||
// Use of preload bootstrap
|
||||
if (ini_get('opcache.preload'))
|
||||
{
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
|
||||
print ini_get('opcache.preload');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
|
||||
print $langs->trans("No");
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
// HTTPCacheStaticResources
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@ -467,16 +482,46 @@ if ($resql)
|
||||
{
|
||||
if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE))
|
||||
{
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXProductUseSearchOptim", $nb);
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXProductAndSearchOptimOn", $nb);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfProductIsLowerThanNoPb", $nb);
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
|
||||
}
|
||||
print '<br>';
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
// Thirdparty search
|
||||
$tab = array();
|
||||
$sql = "SELECT COUNT(*) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$limitforoptim=10000;
|
||||
$num=$db->num_rows($resql);
|
||||
$obj=$db->fetch_object($resql);
|
||||
$nb=$obj->nb;
|
||||
if ($nb > $limitforoptim)
|
||||
{
|
||||
if (empty($conf->global->THIRDPARTY_DONOTSEARCH_ANYWHERE))
|
||||
{
|
||||
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'THIRDPARTY_DONOTSEARCH_ANYWHERE');
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
|
||||
}
|
||||
print '<br>';
|
||||
$db->free($resql);
|
||||
|
||||
@ -185,12 +185,6 @@ if ($action == 'setvarother') {
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -260,7 +254,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print '</tr>';
|
||||
|
||||
// Check if email exists
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsEmailMustExist") . '</td>';
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("TicketsEmailMustExist") . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS');
|
||||
@ -277,7 +271,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
// Show logo for module
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO');
|
||||
@ -293,7 +287,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
}*/
|
||||
|
||||
// Show logo for company
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowCompanyLogo") . '</td>';
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("TicketsShowCompanyLogo") . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO');
|
||||
@ -310,7 +304,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
// Also send to main email address
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '</td>';
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
|
||||
@ -330,21 +324,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Auto assign ticket at user who created it
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsAutoAssignTicket") . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
|
||||
@ -233,7 +233,7 @@ if ($result)
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
// Lignes des champs de filtres
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre" width="15%">'.$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0).'</td>';
|
||||
|
||||
@ -495,7 +495,7 @@ if (is_array($blocks))
|
||||
print '<td'.(preg_match('/<a/', $object_link) ? ' class="nowrap"' : '').'><!-- object_link -->'.$object_link.'</td>';
|
||||
|
||||
// Amount
|
||||
print '<td class="right">'.price($block->amounts).'</td>';
|
||||
print '<td class="right nowraponall">'.price($block->amounts).'</td>';
|
||||
|
||||
// Details link
|
||||
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
|
||||
|
||||
@ -183,9 +183,9 @@ class BOM extends CommonObject
|
||||
// Translate some data of arrayofkeyval
|
||||
foreach($this->fields as $key => $val)
|
||||
{
|
||||
if (is_array($this->fields[$key]['arrayofkeyval']))
|
||||
if (is_array($val['arrayofkeyval']))
|
||||
{
|
||||
foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2)
|
||||
foreach($val['arrayofkeyval'] as $key2 => $val2)
|
||||
{
|
||||
$this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2);
|
||||
}
|
||||
@ -889,7 +889,7 @@ class BOM extends CommonObject
|
||||
$this->lines=array();
|
||||
|
||||
$objectline = new BOMLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
|
||||
|
||||
if (is_numeric($result))
|
||||
{
|
||||
@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
|
||||
'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
|
||||
'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,),
|
||||
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
);
|
||||
public $rowid;
|
||||
@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject
|
||||
public $description;
|
||||
public $qty;
|
||||
public $efficiency;
|
||||
public $rank;
|
||||
public $position;
|
||||
public $import_key;
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
@ -1084,9 +1084,9 @@ class BOMLine extends CommonObject
|
||||
// Translate some data of arrayofkeyval
|
||||
foreach($this->fields as $key => $val)
|
||||
{
|
||||
if (is_array($this->fields[$key]['arrayofkeyval']))
|
||||
if (is_array($val['arrayofkeyval']))
|
||||
{
|
||||
foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2)
|
||||
foreach($val['arrayofkeyval'] as $key2 => $val2)
|
||||
{
|
||||
$this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ $conf_fkaccount_cb = (! empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))?$_SESSIO
|
||||
|
||||
|
||||
// View parameters
|
||||
$conf_taille_listes = (empty($conf->global->PRODUIT_LIMIT_SIZE)?1000:$conf->global->PRODUIT_LIMIT_SIZE); // Nombre max de lignes a afficher dans les listes
|
||||
$conf_taille_listes = (empty($conf->global->PRODUIT_LIMIT_SIZE)?1000:$conf->global->PRODUIT_LIMIT_SIZE); // Number max of lines to show in lists
|
||||
$conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes
|
||||
|
||||
// Add hidden option to force decrease of stock whatever is user setup
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -252,7 +253,10 @@ if ($action == 'add')
|
||||
{
|
||||
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
|
||||
}
|
||||
else $object->label = $cactioncomm->libelle;
|
||||
else {
|
||||
$cactioncomm->fetch($object->type_code);
|
||||
$object->label = $cactioncomm->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
|
||||
|
||||
@ -526,6 +526,7 @@ if ($resql)
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
||||
$contactListCache = array();
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
@ -645,7 +646,34 @@ if ($resql)
|
||||
// Contact
|
||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_contact > 0)
|
||||
|
||||
|
||||
$actionstatic->fetchResources();
|
||||
if(!empty($actionstatic->socpeopleassigned))
|
||||
{
|
||||
$contactList = array();
|
||||
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
|
||||
{
|
||||
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
||||
{
|
||||
// if no cache found we fetch it
|
||||
$contact = new Contact($db);
|
||||
if($contact->fetch($socpeopleassigned['id'])>0)
|
||||
{
|
||||
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28);
|
||||
$contactList[] = $contact->getNomUrl(1, '', 28);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// use cache
|
||||
$contactList[] = $contactListCache[$socpeopleassigned['id']];
|
||||
}
|
||||
}
|
||||
if(!empty($contactList)){
|
||||
print implode(', ', $contactList);
|
||||
}
|
||||
}
|
||||
elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event
|
||||
{
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
$contactstatic->email=$obj->email;
|
||||
|
||||
@ -415,7 +415,7 @@ class Propal extends CommonObject
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param float $pu_ttc Prix unitaire TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits for type of lines
|
||||
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code (also used by externals modules!)
|
||||
@ -1330,9 +1330,9 @@ class Propal extends CommonObject
|
||||
// Hook of thirdparty module
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj);
|
||||
$parameters=array('objFrom'=>$this,'clonedObj'=>$object);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
}
|
||||
@ -1615,11 +1615,14 @@ class Propal extends CommonObject
|
||||
/**
|
||||
* Load array lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @param int $only_product Return only physical products
|
||||
* @param int $loadalsotranslation Return translation for products
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_lines($only_product = 0)
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
@ -1713,6 +1716,13 @@ class Propal extends CommonObject
|
||||
|
||||
$line->fetch_optionals();
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
//dol_syslog("1 ".$line->fk_product);
|
||||
//print "xx $i ".$this->lines[$i]->fk_product;
|
||||
|
||||
@ -446,7 +446,7 @@ if ($resql)
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create');
|
||||
}
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@ -734,7 +734,7 @@ if ($socid > 0)
|
||||
print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
|
||||
}
|
||||
|
||||
// Remises liees a lignes de factures
|
||||
// Discount linked to invoice lines
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql.= " rc.fk_facture_source,";
|
||||
@ -904,7 +904,7 @@ if ($socid > 0)
|
||||
print load_fiche_titre($langs->trans("SupplierDiscounts"), '', '');
|
||||
}
|
||||
|
||||
// Remises liees a lignes de factures
|
||||
// Discount linked to invoice lines
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql.= " rc.fk_invoice_supplier_source,";
|
||||
|
||||
@ -1519,11 +1519,11 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
elseif ($element == 'propal') {
|
||||
$element = 'comm/propal';
|
||||
$subelement = 'propal';
|
||||
}
|
||||
if ($element == 'contract') {
|
||||
elseif ($element == 'contract') {
|
||||
$element = $subelement = 'contrat';
|
||||
}
|
||||
|
||||
|
||||
@ -1312,7 +1312,7 @@ class Commande extends CommonOrder
|
||||
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of product
|
||||
* @param float $remise_percent Percentage discount of the line
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id remise
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param float $pu_ttc Prix unitaire TTC
|
||||
@ -1888,10 +1888,12 @@ class Commande extends CommonOrder
|
||||
* Load array lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @param int $loadalsotranslation Return translation for products
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_lines($only_product = 0)
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
@ -1984,6 +1986,13 @@ class Commande extends CommonOrder
|
||||
|
||||
$line->fetch_optionals();
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
$i++;
|
||||
|
||||
@ -133,7 +133,7 @@ if ($resql)
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td align="left" class="liste_titre">';
|
||||
|
||||
@ -615,7 +615,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
||||
print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"');
|
||||
print '</tr>';
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<form method="get" action="orderstoinvoice.php">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -603,12 +603,13 @@ if ($resql)
|
||||
print $langs->trans("EventualyAddCategory").': ';
|
||||
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
|
||||
}
|
||||
print '<br>'.$langs->trans("ThenCheckLinesAndConciliate").' ';
|
||||
print '<br><div style="margin-top: 5px;">'.$langs->trans("ThenCheckLinesAndConciliate").' ';
|
||||
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
|
||||
print ' '.$langs->trans("or").' ';
|
||||
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
|
||||
print ' '.$langs->trans("or").' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
// Show last bank statements
|
||||
$nbmax=15; // We accept to show last 15 receipts (so we can have more than one year)
|
||||
@ -617,7 +618,7 @@ if ($resql)
|
||||
$sql.= " WHERE fk_account=".$object->id." AND num_releve IS NOT NULL";
|
||||
$sql.= $db->order("num_releve", "DESC");
|
||||
$sql.= $db->plimit($nbmax+1);
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
print $langs->trans("LastAccountStatements").' : ';
|
||||
$resqlr=$db->query($sql);
|
||||
if ($resqlr)
|
||||
|
||||
@ -415,7 +415,7 @@ if (empty($numref))
|
||||
if ($object->canBeConciliated() > 0) {
|
||||
// If not cash account and can be reconciliate
|
||||
if ($user->rights->banque->consolidate) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$id.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ if ($resql)
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", '', $sortfield, $sortorder, 'right ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre left">';
|
||||
|
||||
@ -181,7 +181,8 @@ if (empty($reshook))
|
||||
// Change status of invoice
|
||||
elseif ($action == 'reopen' && $usercancreate) {
|
||||
$result = $object->fetch($id);
|
||||
if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
|
||||
|
||||
if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
|
||||
$result = $object->set_unpaid($user);
|
||||
if ($result > 0) {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
|
||||
@ -637,7 +638,7 @@ if (empty($reshook))
|
||||
|
||||
$resteapayer = $object->total_ttc - $totalpaye;
|
||||
|
||||
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
|
||||
// We check that invlice lines are transferred into accountancy
|
||||
$ventilExportCompta = $object->getVentilExportCompta();
|
||||
|
||||
// On verifie si aucun paiement n'a ete effectue
|
||||
@ -2972,21 +2973,24 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
if (! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
|
||||
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
|
||||
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_replacement" value="0" disabled> ';
|
||||
@ -4612,7 +4616,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
// Editer une facture deja validee, sans paiement effectue et pas exporte en compta
|
||||
if ($object->statut == Facture::STATUS_VALIDATED)
|
||||
{
|
||||
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
|
||||
// We check that invlice lines are transferred into accountancy
|
||||
$ventilExportCompta = $object->getVentilExportCompta();
|
||||
|
||||
if ($ventilExportCompta == 0)
|
||||
@ -4650,7 +4654,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
&& ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
|
||||
{
|
||||
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
|
||||
if ($object->close_code != 'replaced' || (! $objectidnext)) // Not replaced by another invoice or replaced but the replacement invoice has been deleted
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
|
||||
} else {
|
||||
|
||||
@ -510,7 +510,7 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Recupere les lignes de factures predefinies dans this->lines
|
||||
* Get lines of template invoices into this->lines
|
||||
*
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
@ -876,7 +876,7 @@ class FactureRec extends CommonInvoice
|
||||
* @param int $fk_product Product/Service ID predefined
|
||||
* @param double $remise_percent Percentage discount of the line
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id remise
|
||||
* @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note)
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
@ -1807,7 +1807,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
|
||||
|
||||
/**
|
||||
* Recupere les lignes de factures predefinies dans this->lines
|
||||
* Get line of template invoice
|
||||
*
|
||||
* @param int $rowid Id of invoice
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
|
||||
@ -917,7 +917,7 @@ class Facture extends CommonInvoice
|
||||
$facture->origin = $this->origin;
|
||||
$facture->origin_id = $this->origin_id;
|
||||
|
||||
$facture->lines = $this->lines; // Tableau des lignes de factures
|
||||
$facture->lines = $this->lines; // Array of lines of invoice
|
||||
$facture->products = $this->lines; // Tant que products encore utilise
|
||||
$facture->situation_counter = $this->situation_counter;
|
||||
$facture->situation_cycle_ref=$this->situation_cycle_ref;
|
||||
@ -1467,10 +1467,14 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* Load all detailed lines into this->lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @param int $loadalsotranslation Return translation for products
|
||||
*
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
public function fetch_lines()
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
@ -1560,6 +1564,13 @@ class Facture extends CommonInvoice
|
||||
|
||||
$line->fetch_optionals();
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
$i++;
|
||||
@ -2650,7 +2661,7 @@ class Facture extends CommonInvoice
|
||||
* @param int $date_start Date start of service
|
||||
* @param int $date_end Date end of service
|
||||
* @param int $ventil Code of dispatching into accountancy
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id discount used
|
||||
* @param string $price_base_type 'HT' or 'TTC'
|
||||
* @param double $pu_ttc Unit price with tax (> 0 even for credit note)
|
||||
|
||||
@ -1423,8 +1423,8 @@ else
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
$list = array();
|
||||
$models = ModelePDFFactures::liste_modeles($db);
|
||||
foreach ($models as $model) {
|
||||
$list[] = $model . ':' . $model;
|
||||
foreach ($models as $k => $model) {
|
||||
$list[] = str_replace(':', '|', $k) . ':' . $model;
|
||||
}
|
||||
$select = 'select;'.implode(',', $list);
|
||||
print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select);
|
||||
|
||||
@ -261,7 +261,7 @@ if ($search_month_date_when > 0)
|
||||
if ($search_year_date_when > 0 && empty($search_day_date_when))
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, $search_month_date_when, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, $search_month_date_when, false))."'";
|
||||
elseif ($search_year_date_when > 0 && ! empty($search_day_date_when))
|
||||
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
|
||||
}
|
||||
|
||||
@ -1143,7 +1143,7 @@ if ($resql)
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right nowrap">'.price($obj->total_ht)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalht'] += $obj->total_ht;
|
||||
@ -1151,7 +1151,7 @@ if ($resql)
|
||||
// Amount VAT
|
||||
if (! empty($arrayfields['f.total_vat']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($obj->total_vat)."</td>\n";
|
||||
print '<td class="right nowrap">'.price($obj->total_vat)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalvat'] += $obj->total_vat;
|
||||
@ -1159,7 +1159,7 @@ if ($resql)
|
||||
// Amount LocalTax1
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($obj->total_localtax1)."</td>\n";
|
||||
print '<td class="right nowrap">'.price($obj->total_localtax1)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax1'] += $obj->total_localtax1;
|
||||
@ -1167,7 +1167,7 @@ if ($resql)
|
||||
// Amount LocalTax2
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($obj->total_localtax2)."</td>\n";
|
||||
print '<td class="right nowrap">'.price($obj->total_localtax2)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax2'] += $obj->total_localtax2;
|
||||
@ -1175,7 +1175,7 @@ if ($resql)
|
||||
// Amount TTC
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
||||
print '<td class="right nowrap">'.price($obj->total_ttc)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
@ -1183,7 +1183,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td class="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right nowrap">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalam'] += $totalpay;
|
||||
@ -1191,7 +1191,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td class="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right nowrap">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalrtp'] += $remaintopay;
|
||||
|
||||
@ -62,42 +62,52 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('directdebitcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == "new")
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($object->id > 0)
|
||||
if ($action == "new")
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
||||
if ($result > 0)
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$db->commit();
|
||||
$db->begin();
|
||||
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$action='';
|
||||
}
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($action == "delete")
|
||||
{
|
||||
if ($object->id > 0)
|
||||
if ($action == "delete")
|
||||
{
|
||||
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
||||
if ($result == 0)
|
||||
if ($object->id > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
|
||||
if ($result == 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ if ($resql)
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
|
||||
|
||||
@ -1393,7 +1393,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
||||
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
||||
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
|
||||
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum";
|
||||
$sql.= " FROM";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
|
||||
@ -1419,7 +1419,7 @@ class BonPrelevement extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
|
||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum);
|
||||
$this->total = $this->total + $obj->somme;
|
||||
$i++;
|
||||
}
|
||||
@ -1624,15 +1624,16 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $row_cg pl.code_guichet AS cg, Not used for SEPA
|
||||
* @param string $row_cc pl.number AS cc, Not used for SEPA
|
||||
* @param string $row_somme pl.amount AS somme,
|
||||
* @param string $row_ref f.ref
|
||||
* @param string $row_ref f.ref
|
||||
* @param string $row_idfac pf.fk_facture AS idfac,
|
||||
* @param string $row_iban rib.iban_prefix AS iban,
|
||||
* @param string $row_bic rib.bic AS bic,
|
||||
* @param string $row_datec rib.datec,
|
||||
* @param string $row_drum rib.rowid used to generate rum
|
||||
* @param string $row_rum rib.rum Rum defined on company bank account
|
||||
* @return string Return string with SEPA part DrctDbtTxInf
|
||||
*/
|
||||
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
@ -1644,7 +1645,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
// Define value for RUM
|
||||
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
|
||||
$Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum);
|
||||
$Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum;
|
||||
|
||||
// Define date of RUM signature
|
||||
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/prelevement/class/ligneprelevement.class.php
|
||||
* \ingroup prelevement
|
||||
* \brief Fichier de la classe des lignes de prelevements
|
||||
* \brief File of class to manage lines of Direct Debit orders
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -52,42 +52,52 @@ $page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
|
||||
$hookmanager->initHooks(array('directdebitcreatecard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Change customer bank information to withdraw
|
||||
if ($action == 'modify')
|
||||
{
|
||||
for ($i = 1 ; $i < 9 ; $i++)
|
||||
{
|
||||
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
if ($action == 'create')
|
||||
{
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||
$bprev = new BonPrelevement($db);
|
||||
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||
$parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate);
|
||||
if ($result < 0)
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Change customer bank information to withdraw
|
||||
if ($action == 'modify')
|
||||
{
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
}
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg.='<br>'."\n";
|
||||
foreach($bprev->invoice_in_error as $key => $val)
|
||||
for ($i = 1 ; $i < 9 ; $i++)
|
||||
{
|
||||
$mesg.='<span class="warning">'.$val."</span><br>\n";
|
||||
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
else
|
||||
if ($action == 'create')
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||
$bprev = new BonPrelevement($db);
|
||||
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||
|
||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
}
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg.='<br>'."\n";
|
||||
foreach($bprev->invoice_in_error as $key => $val)
|
||||
{
|
||||
$mesg.='<span class="warning">'.$val."</span><br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,6 +191,7 @@ else
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."</a>\n";
|
||||
}
|
||||
|
||||
print "</form>\n";
|
||||
print "</div>\n";
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ $sql.= " AND pl.fk_prelevement_bons = p.rowid";
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
|
||||
if ($object->id > 0) $sql.= " AND p.rowid=".$object->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy"));
|
||||
|
||||
$modecompta = GETPOST('modecompta', 'alpha');
|
||||
$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE);
|
||||
|
||||
// Date range
|
||||
$year=GETPOST("year", 'int');
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2006-2015 Yannick Warnier <ywarnier@beeznest.org>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
*
|
||||
* 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
|
||||
@ -116,7 +117,8 @@ foreach ($listofparams as $param)
|
||||
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
|
||||
}
|
||||
|
||||
llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring);
|
||||
$title = $langs->trans("VATReport") . " " . dol_print_date($date_start) . " -> " . dol_print_date($date_end);
|
||||
llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring);
|
||||
|
||||
|
||||
//print load_fiche_titre($langs->trans("VAT"),"");
|
||||
@ -184,8 +186,10 @@ if ($mysoc->tva_assuj) {
|
||||
$vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
}
|
||||
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||
$optioncss = GETPOST('optioncss');
|
||||
if($optioncss != "print") {
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||
}
|
||||
|
||||
$vatcust=$langs->trans("VATReceived");
|
||||
$vatsup=$langs->trans("VATPaid");
|
||||
|
||||
@ -499,6 +499,7 @@ class Contact extends CommonObject
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -508,7 +509,7 @@ class Contact extends CommonObject
|
||||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
private function _load_ldap_dn($info, $mode = 0)
|
||||
public function _load_ldap_dn($info, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
@ -1096,8 +1096,6 @@ $form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
||||
|
||||
$objectlignestatic=new ContratLigne($db);
|
||||
|
||||
// Load object modContract
|
||||
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_serpis');
|
||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
|
||||
|
||||
@ -716,10 +716,14 @@ class Contrat extends CommonObject
|
||||
* Load lines array into this->lines.
|
||||
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @param int $loadalsotranslation Return translation for products
|
||||
*
|
||||
* @return ContratLigne[] Return array of contract lines
|
||||
*/
|
||||
public function fetch_lines()
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
$this->nbofserviceswait=0;
|
||||
$this->nbofservicesopened=0;
|
||||
@ -829,6 +833,13 @@ class Contrat extends CommonObject
|
||||
// fetch optionals attributes and labels
|
||||
$line->fetch_optionals();
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$pos] = $line;
|
||||
$this->lines_id_index_mapper[$line->id] = $pos;
|
||||
|
||||
@ -851,7 +862,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::Fetch Erreur lecture des lignes de contrats liees aux produits");
|
||||
dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products");
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -1350,7 +1361,7 @@ class Contrat extends CommonObject
|
||||
* @param int $date_end Date de fin prevue
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param float $pu_ttc Prix unitaire TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_fournprice Fourn price id
|
||||
* @param int $pa_ht Buying price HT
|
||||
* @param array $array_options extrafields array
|
||||
@ -1568,7 +1579,7 @@ class Contrat extends CommonObject
|
||||
* @param int|string $date_debut_reel Date de debut reelle
|
||||
* @param int|string $date_fin_reel Date de fin reelle
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_fournprice Fourn price id
|
||||
* @param int $pa_ht Buying price HT
|
||||
* @param array $array_options extrafields array
|
||||
@ -2531,7 +2542,7 @@ class Contrat extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Classe permettant la gestion des lignes de contrats
|
||||
* Class to manage lines of contracts
|
||||
*/
|
||||
class ContratLigne extends CommonObjectLine
|
||||
{
|
||||
|
||||
@ -27,7 +27,7 @@ $maxsizestring=255;
|
||||
$maxsizeint=10;
|
||||
$mesg=array();
|
||||
|
||||
$extrasize=GETPOST('size', 'int');
|
||||
$extrasize=GETPOST('size', 'intcomma');
|
||||
$type=GETPOST('type', 'alpha');
|
||||
$param=GETPOST('param', 'alpha');
|
||||
|
||||
|
||||
@ -220,6 +220,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
|
||||
@ -217,6 +217,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
|
||||
@ -216,6 +216,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
|
||||
@ -215,6 +215,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
|
||||
@ -332,6 +332,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';
|
||||
|
||||
@ -219,6 +219,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
</script>';
|
||||
$stringtoshow.='<div class="center hideobject divboxfilter" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
|
||||
@ -84,7 +84,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
if ($user->rights->service->lire && $user->rights->contrat->lire)
|
||||
{
|
||||
$contractstatic=new Contrat($db);
|
||||
$contratlignestatic=new ContratLigne($db);
|
||||
$contractlinestatic=new ContratLigne($db);
|
||||
$thirdpartytmp = new Societe($db);
|
||||
$productstatic = new Product($db);
|
||||
|
||||
@ -116,13 +116,13 @@ class box_services_contracts extends ModeleBoxes
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$db->jdate($objp->datem);
|
||||
|
||||
$contratlignestatic->id=$objp->cdid;
|
||||
$contratlignestatic->fk_contrat=$objp->rowid;
|
||||
$contratlignestatic->label=$objp->label;
|
||||
$contratlignestatic->description=$objp->description;
|
||||
$contratlignestatic->type=$objp->type;
|
||||
$contratlignestatic->product_id=$objp->product_id;
|
||||
$contratlignestatic->product_ref=$objp->product_ref;
|
||||
$contractlinestatic->id=$objp->cdid;
|
||||
$contractlinestatic->fk_contrat=$objp->rowid;
|
||||
$contractlinestatic->label=$objp->label;
|
||||
$contractlinestatic->description=$objp->description;
|
||||
$contractlinestatic->type=$objp->type;
|
||||
$contractlinestatic->product_id=$objp->product_id;
|
||||
$contractlinestatic->product_ref=$objp->product_ref;
|
||||
|
||||
$contractstatic->statut=$objp->contract_status;
|
||||
$contractstatic->id=$objp->rowid;
|
||||
@ -153,7 +153,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
if ($resultd)
|
||||
{
|
||||
$objtp = $db->fetch_object($resultd);
|
||||
if ($objtp->label != '') $contratlignestatic->label = $objtp->label;
|
||||
if ($objtp->label != '') $contractlinestatic->label = $objtp->label;
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $contratlignestatic->LibStatut($objp->statut, 3)
|
||||
'text' => $contractlinestatic->LibStatut($objp->statut, 3)
|
||||
);
|
||||
|
||||
$i++;
|
||||
|
||||
@ -286,8 +286,7 @@ class CMailFile
|
||||
// We now define $this->headers and $this->message
|
||||
$this->headers = $smtp_headers . $mime_headers;
|
||||
// On nettoie le header pour qu'il ne se termine pas par un retour chariot.
|
||||
// Ceci evite aussi les lignes vides en fin qui peuvent etre interpretees
|
||||
// comme des injections mail par les serveurs de messagerie.
|
||||
// This avoid also empty lines at end that can be interpreted as mail injection by email servers.
|
||||
$this->headers = preg_replace("/([\r\n]+)$/i", "", $this->headers);
|
||||
|
||||
//$this->message = $this->eol.'This is a message with multiple parts in MIME format.'.$this->eol;
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
|
||||
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
@ -53,6 +53,7 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* @var string Error string
|
||||
* @see $errors
|
||||
*/
|
||||
public $error;
|
||||
|
||||
@ -2443,9 +2444,9 @@ abstract class CommonObject
|
||||
*/
|
||||
public function updateRangOfLine($rowid, $rang)
|
||||
{
|
||||
$fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank'
|
||||
$fieldposition = 'rang'; // @TODO Rename 'rang' into 'position'
|
||||
if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position';
|
||||
if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank';
|
||||
if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position';
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang;
|
||||
$sql.= ' WHERE rowid = '.$rowid;
|
||||
@ -2749,7 +2750,7 @@ abstract class CommonObject
|
||||
$MODULE = "";
|
||||
if ($this->element == 'propal')
|
||||
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL";
|
||||
elseif ($this->element == 'order')
|
||||
elseif ($this->element == 'commande' || $this->element == 'order')
|
||||
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER";
|
||||
elseif ($this->element == 'facture')
|
||||
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE";
|
||||
@ -5008,6 +5009,8 @@ abstract class CommonObject
|
||||
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey];
|
||||
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey];
|
||||
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey];
|
||||
$attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey];
|
||||
|
||||
|
||||
if ($attributeRequired)
|
||||
{
|
||||
@ -5024,6 +5027,21 @@ abstract class CommonObject
|
||||
|
||||
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
|
||||
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
|
||||
|
||||
if (!empty($attrfieldcomputed))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))
|
||||
{
|
||||
$value = dol_eval($attrfieldcomputed, 1, 0);
|
||||
dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG);
|
||||
$new_array_options[$key] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_array_options[$key] = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch ($attributeType)
|
||||
{
|
||||
|
||||
@ -267,7 +267,7 @@ abstract class CommonStickerGenerator
|
||||
protected function _Get_Height_Chars($pt)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes
|
||||
// Array for link between height of characters and space between lines
|
||||
$_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10);
|
||||
if (in_array($pt, array_keys($_Table_Hauteur_Chars))) {
|
||||
return $_Table_Hauteur_Chars[$pt];
|
||||
|
||||
@ -364,6 +364,7 @@ class Conf
|
||||
$this->livraison_bon->enabled=(! empty($this->global->MAIN_SUBMODULE_LIVRAISON)?$this->global->MAIN_SUBMODULE_LIVRAISON:0);
|
||||
|
||||
// Module fournisseur
|
||||
// TODO To split into module supplier_invoice and supplier_order
|
||||
if (! empty($this->fournisseur))
|
||||
{
|
||||
$this->fournisseur->commande=new stdClass();
|
||||
@ -376,37 +377,35 @@ class Conf
|
||||
$this->fournisseur->facture->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp");
|
||||
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; // For backward compatibility
|
||||
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; // For backward compatibility
|
||||
$this->supplierproposal=new stdClass();
|
||||
$this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal");
|
||||
$this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp");
|
||||
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility
|
||||
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility
|
||||
|
||||
$this->fournisseur->payment=new stdClass();
|
||||
$this->fournisseur->payment->multidir_output=array($this->entity => $rootfordata."/fournisseur/payment");
|
||||
$this->fournisseur->payment->multidir_temp =array($this->entity => $rootfordata."/fournisseur/payment/temp");
|
||||
$this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment"; // For backward compatibility
|
||||
$this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp"; // For backward compatibility
|
||||
|
||||
// To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice
|
||||
if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties
|
||||
// To prepare split of module vendor(fournisseur) into vendor + supplier_order + supplier_invoice + supplierproposal
|
||||
if (! empty($this->fournisseur->enabled)) // By default, if module supplier is on, we set new properties
|
||||
{
|
||||
$this->supplier_order=new stdClass();
|
||||
$this->supplier_order->enabled=1;
|
||||
$this->supplier_order->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande");
|
||||
$this->supplier_order->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp");
|
||||
$this->supplier_order->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility
|
||||
$this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; // For backward compatibility
|
||||
$this->supplier_invoice=new stdClass();
|
||||
$this->supplier_invoice->enabled=1;
|
||||
$this->supplier_invoice->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture");
|
||||
$this->supplier_invoice->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp");
|
||||
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility
|
||||
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility
|
||||
$this->supplierproposal=new stdClass();
|
||||
$this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal");
|
||||
$this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp");
|
||||
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility
|
||||
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists
|
||||
{
|
||||
$this->supplier_order=new stdClass();
|
||||
$this->supplier_order->enabled=1;
|
||||
$this->supplier_order->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande");
|
||||
$this->supplier_order->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp");
|
||||
$this->supplier_order->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility
|
||||
$this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; // For backward compatibility
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists
|
||||
{
|
||||
$this->supplier_invoice=new stdClass();
|
||||
$this->supplier_invoice->enabled=1;
|
||||
$this->supplier_invoice->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture");
|
||||
$this->supplier_invoice->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp");
|
||||
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility
|
||||
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -20,14 +20,8 @@
|
||||
* \file htdocs/core/class/events.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class to manage security events.
|
||||
* \author Laurent Destailleur
|
||||
*/
|
||||
|
||||
// Put here all includes required by your class file
|
||||
//require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
//require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
//require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Events class
|
||||
@ -133,7 +127,7 @@ class Events // extends CommonObject
|
||||
*/
|
||||
public function create($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
// Clean parameters
|
||||
$this->description=trim($this->description);
|
||||
@ -185,8 +179,6 @@ class Events // extends CommonObject
|
||||
*/
|
||||
public function update($user = null, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
// Clean parameters
|
||||
$this->id=trim($this->id);
|
||||
$this->type=trim($this->type);
|
||||
@ -222,8 +214,6 @@ class Events // extends CommonObject
|
||||
*/
|
||||
public function fetch($id, $user = null)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
$sql.= " t.tms,";
|
||||
@ -273,8 +263,6 @@ class Events // extends CommonObject
|
||||
*/
|
||||
public function delete($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."events";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
|
||||
@ -1627,6 +1627,8 @@ class ExtraFields
|
||||
|
||||
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
||||
|
||||
//if ($computed) $value = // $value is already calculated into $value before calling this method
|
||||
|
||||
$showsize=0;
|
||||
if ($type == 'date')
|
||||
{
|
||||
@ -1645,7 +1647,10 @@ class ExtraFields
|
||||
elseif ($type == 'double')
|
||||
{
|
||||
if (!empty($value)) {
|
||||
$value=price($value);
|
||||
//$value=price($value);
|
||||
$sizeparts = explode(",", $size);
|
||||
$number_decimals = $sizeparts[1];
|
||||
$value=price($value, 0, $langs, 0, 0, $number_decimals, '');
|
||||
}
|
||||
}
|
||||
elseif ($type == 'boolean')
|
||||
|
||||
@ -45,6 +45,8 @@ class FileUpload
|
||||
{
|
||||
global $db, $conf;
|
||||
global $object;
|
||||
global $hookmanager;
|
||||
$hookmanager->initHooks(array('fileupload'));
|
||||
|
||||
$this->fk_element=$fk_element;
|
||||
$this->element=$element;
|
||||
@ -183,6 +185,18 @@ class FileUpload
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$hookmanager->executeHooks(
|
||||
'overrideUploadOptions',
|
||||
array(
|
||||
'options' => &$options,
|
||||
'element' => $element
|
||||
),
|
||||
$object,
|
||||
$action,
|
||||
$hookmanager
|
||||
);
|
||||
|
||||
if ($options) {
|
||||
$this->options = array_replace_recursive($this->options, $options);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ class Form
|
||||
* @param string $value Value to show/edit
|
||||
* @param object $object Object
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
|
||||
* @param object $extObject External object
|
||||
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
|
||||
@ -174,7 +174,7 @@ class Form
|
||||
if (empty($typeofdata)) return 'ErrorBadParameter';
|
||||
|
||||
// When option to edit inline is activated
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker and support select
|
||||
{
|
||||
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
|
||||
}
|
||||
@ -231,7 +231,8 @@ class Form
|
||||
foreach($arraydata as $val)
|
||||
{
|
||||
$tmp=explode(':', $val);
|
||||
$arraylist[$tmp[0]]=$tmp[1];
|
||||
$tmpkey=str_replace('|', ':', $tmp[0]);
|
||||
$arraylist[$tmpkey]=$tmp[1];
|
||||
}
|
||||
$ret.=$this->selectarray($htmlname, $arraylist, $value);
|
||||
}
|
||||
@ -300,7 +301,7 @@ class Form
|
||||
* @param string $value Value to show/edit
|
||||
* @param string $htmlname DIV ID (field name)
|
||||
* @param int $condition Condition to edit
|
||||
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
|
||||
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly')
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||
* @param object $extObject External object
|
||||
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
|
||||
@ -2593,7 +2594,7 @@ class Form
|
||||
}
|
||||
|
||||
$opt.= "</option>\n";
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -422,7 +422,7 @@ class FormOther
|
||||
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.= " 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('usergroup')."))";
|
||||
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
|
||||
}
|
||||
}
|
||||
@ -445,7 +445,7 @@ class FormOther
|
||||
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')."))";
|
||||
$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('usergroup')."))";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -419,7 +419,7 @@ class FormTicket
|
||||
|
||||
if ($withdolfichehead) dol_fiche_end();
|
||||
|
||||
print '<center>';
|
||||
print '<br><center>';
|
||||
print '<input class="button" type="submit" name="add" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';
|
||||
|
||||
if ($this->withcancel) {
|
||||
|
||||
@ -101,11 +101,11 @@ interface Database
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return int Nombre de lignes
|
||||
* @see num_rows
|
||||
* @return int Number of lines
|
||||
* @see num_rows()
|
||||
*/
|
||||
public function affected_rows($resultset);
|
||||
// phpcs:enable
|
||||
|
||||
@ -523,10 +523,10 @@ class DoliDBMssql extends DoliDB
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return int Nombre de lignes
|
||||
* @return int Number of lines
|
||||
* @see num_rows()
|
||||
*/
|
||||
public function affected_rows($resultset)
|
||||
|
||||
@ -363,10 +363,10 @@ class DoliDBMysqli extends DoliDB
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
||||
*
|
||||
* @param mysqli_result $resultset Curseur de la requete voulue
|
||||
* @return int Nombre de lignes
|
||||
* @return int Number of lines
|
||||
* @see num_rows()
|
||||
*/
|
||||
public function affected_rows($resultset)
|
||||
|
||||
@ -617,11 +617,11 @@ class DoliDBPgsql extends DoliDB
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
||||
*
|
||||
* @param resource $resultset Result set of request
|
||||
* @return int Nb of lines
|
||||
* @see num_rows
|
||||
* @see num_rows()
|
||||
*/
|
||||
public function affected_rows($resultset)
|
||||
{
|
||||
|
||||
@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra
|
||||
case 'boolean':
|
||||
$typeFilter="Boolean";
|
||||
break;
|
||||
case 'select':
|
||||
if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT))
|
||||
{
|
||||
$tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...)
|
||||
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
|
||||
$typeFilter="Select:".$obj->param;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'sellist':
|
||||
$tmp='';
|
||||
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
||||
|
||||
@ -175,7 +175,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
|
||||
{
|
||||
global $langs;
|
||||
|
||||
print "\n\n<!-- debut cartouche journal -->\n";
|
||||
print "\n\n<!-- start banner journal -->\n";
|
||||
|
||||
if(! is_empty($varlink)) $varlink = '?'.$varlink;
|
||||
|
||||
@ -186,6 +186,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
|
||||
$head[$h][2] = 'journal';
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].$varlink.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head($head, 'journal');
|
||||
|
||||
@ -240,5 +241,5 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
|
||||
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- fin cartouche journal -->\n\n";
|
||||
print "\n<!-- end banner journal -->\n\n";
|
||||
}
|
||||
|
||||
@ -1435,16 +1435,16 @@ function dol_meta_create($object)
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
$client = $object->thirdparty->name . " " . $object->thirdparty->address . " " . $object->thirdparty->zip . " " . $object->thirdparty->town;
|
||||
$meta = "REFERENCE=\"" . $object->ref . "\"
|
||||
DATE=\"" . dol_print_date($object->date, '') . "\"
|
||||
NB_ITEMS=\"" . $nblignes . "\"
|
||||
NB_ITEMS=\"" . $nblines . "\"
|
||||
CLIENT=\"" . $client . "\"
|
||||
AMOUNT_EXCL_TAX=\"" . $object->total_ht . "\"
|
||||
AMOUNT=\"" . $object->total_ttc . "\"\n";
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
//Pour les articles
|
||||
$meta .= "ITEM_" . $i . "_QUANTITY=\"" . $object->lines[$i]->qty . "\"
|
||||
@ -2568,7 +2568,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$db->escape($refname)."' AND entity=".$conf->entity;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
|
||||
}
|
||||
// Wrapping pour les rapport de paiements
|
||||
elseif ($modulepart == 'supplier_payment')
|
||||
|
||||
@ -7037,7 +7037,7 @@ function getLanguageCodeFromCountryCode($countrycode)
|
||||
$buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode);
|
||||
if (in_array($buildprimarykeytotest, $locales)) return strtolower($countrycode).'_'.strtoupper($countrycode);
|
||||
|
||||
if (function_exists('locale_get_primary_language')) // Need extension php-intl
|
||||
if (function_exists('locale_get_primary_language') && function_exists('locale_get_region')) // Need extension php-intl
|
||||
{
|
||||
foreach ($locales as $locale)
|
||||
{
|
||||
|
||||
@ -2045,10 +2045,10 @@ function pdf_getTotalQty($object, $type, $outputlangs)
|
||||
global $hookmanager;
|
||||
|
||||
$total=0;
|
||||
$nblignes=count($object->lines);
|
||||
$nblines=count($object->lines);
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
|
||||
@ -159,7 +159,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
||||
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
|
||||
print '<body id="mainbody" class="publicnewticketform" style="margin-top: 10px;">';
|
||||
print '<body id="mainbody" class="publicnewticketform">';
|
||||
|
||||
if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) {
|
||||
print '<center>';
|
||||
|
||||
@ -1590,7 +1590,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
{
|
||||
$langs->load("mrp");
|
||||
|
||||
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
|
||||
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom');
|
||||
$newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write);
|
||||
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
|
||||
if ($conf->bank->dir_output)
|
||||
{
|
||||
//$nblignes = count($object->lines); // This is set later with array of tasks
|
||||
//$nblines = count($object->lines); // This is set later with array of tasks
|
||||
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
@ -275,6 +275,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
@ -287,13 +288,15 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show top header of page.
|
||||
*
|
||||
@ -303,9 +306,10 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
// phpcs:enable
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -380,6 +384,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
@ -389,9 +394,11 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return integer
|
||||
*/
|
||||
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||
//return pdf_pagefoot($pdf,$outputlangs,'BANK_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
|
||||
if (! empty($conf->bank->dir_output))
|
||||
{
|
||||
//$nblignes = count($object->lines); // This is set later with array of tasks
|
||||
//$nblines = count($object->lines); // This is set later with array of tasks
|
||||
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
@ -418,6 +418,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
@ -430,15 +431,17 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
@ -448,7 +451,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
private function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
@ -475,7 +478,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Show area for the customer to sign
|
||||
*
|
||||
@ -485,7 +489,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
private function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
||||
protected function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -517,6 +521,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show top header of page.
|
||||
*
|
||||
@ -526,8 +531,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -609,6 +615,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
@ -618,9 +625,11 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return integer
|
||||
*/
|
||||
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||
return pdf_pagefoot($pdf, $outputlangs, 'PAYMENTORDER_FREE_TEXT', null, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes;
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
@ -228,7 +228,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
if ($conf->commande->dir_output)
|
||||
{
|
||||
@ -308,7 +308,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if ($object->lines[$i]->remise_percent)
|
||||
{
|
||||
@ -400,7 +400,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||
@ -429,7 +429,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$posyafter=$pdf->GetY();
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('', '', true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
@ -540,7 +540,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->tva[$vatrate] += $tvaligne;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
||||
@ -549,7 +549,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
$nexY+=2; // Add space between lines
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -27,7 +27,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
|
||||
* \ingroup commande
|
||||
* \brief File of the class allowing to generate the orders to the Eratosthene model
|
||||
* \brief File of Class to generate PDF orders with template Eratosthène
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
|
||||
@ -149,13 +149,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Affiche mode reglement
|
||||
$this->option_condreg = 1; // Affiche conditions reglement
|
||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||
$this->option_logo = 1; // Display logo
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
@ -194,7 +194,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes;
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
@ -203,7 +203,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
// Translations
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
$hidetop=0;
|
||||
if(!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)){
|
||||
@ -217,7 +217,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
{
|
||||
$objphoto = new Product($this->db);
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
@ -541,7 +541,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
// Loop on each lines
|
||||
$pageposbeforeprintlines=$pdf->getPage();
|
||||
$pagenb = $pageposbeforeprintlines;
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||
@ -599,7 +599,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$posyafter=$pdf->GetY();
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('', '', true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
@ -738,7 +738,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->tva[$vatrate] += $tvaligne;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
||||
@ -747,7 +747,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
$nexY+=2; // Add space between lines
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/commande/doc/pdf_proforma.modules.php
|
||||
* \ingroup commande
|
||||
* \brief Fichier de la classe permettant de generer les commandes au modele Proforma
|
||||
* \brief File of Class to generate PDF orders with template Proforma
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php';
|
||||
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe permettant de generer les commandes au modele Proforma
|
||||
* Class to generate PDF orders with template Proforma
|
||||
*/
|
||||
class pdf_proforma extends pdf_einstein
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Fabrice CHERRIER
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -144,13 +144,13 @@ class pdf_strato extends ModelePDFContract
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Affiche mode reglement
|
||||
$this->option_condreg = 0; // Affiche conditions reglement
|
||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||
$this->option_logo = 1; // Display logo
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 0; // Available in several languages
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
|
||||
@ -168,7 +168,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
// Loop on each lines to detect if there is at least one image to show
|
||||
$realpatharray=array();
|
||||
@ -176,7 +176,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
{
|
||||
$objphoto = new Product($this->db);
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
@ -253,8 +253,8 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
global $action;
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Set nblignes with the new facture lines content after hook
|
||||
$nblignes = count($object->lines);
|
||||
// Set nblines with the new facture lines content after hook
|
||||
$nblines = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -404,7 +404,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
$nexY = $tab_top + $this->tabTitleHeight + 2;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $nblignes; $i++)
|
||||
for ($i = 0; $i < $nblines; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||
@ -464,7 +464,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforsignature+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('', '', true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
@ -548,7 +548,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
if ($weighttxt && $voltxt) $nexY+=2;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80,80,80)));
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/expedition/doc/pdf_merou.modules.php
|
||||
* \ingroup expedition
|
||||
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Merou
|
||||
* \brief Class file used to generate the dispatch slips for the Merou model
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
|
||||
@ -134,7 +134,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1;
|
||||
$this->option_logo = 1; // Display logo
|
||||
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
@ -222,7 +222,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
global $action;
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format, 'mm', 'l');
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -347,7 +347,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0);
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
||||
@ -356,7 +356,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
$nexY+=2; // Add space between lines
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
|
||||
* \ingroup expedition
|
||||
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Rouget
|
||||
* \brief Class file used to generate the dispatch slips for the Rouget model
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
|
||||
@ -133,7 +133,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1;
|
||||
$this->option_logo = 1; // Display logo
|
||||
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
@ -197,7 +197,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
// Loop on each lines to detect if there is at least one image to show
|
||||
$realpatharray=array();
|
||||
@ -205,7 +205,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
{
|
||||
$objphoto = new Product($this->db);
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
@ -282,8 +282,8 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
global $action;
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Set nblignes with the new facture lines content after hook
|
||||
$nblignes = count($object->lines);
|
||||
// Set nblines with the new facture lines content after hook
|
||||
$nblines = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -423,7 +423,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $nblignes; $i++)
|
||||
for ($i = 0; $i < $nblines; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||
@ -481,7 +481,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('', '', true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
@ -563,7 +563,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
if ($weighttxt && $voltxt) $nexY+=2;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user