Merge https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
c39116f132
89
ChangeLog
89
ChangeLog
@ -13,7 +13,8 @@ For Developers:
|
||||
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
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
||||
@ -71,7 +72,7 @@ NEW: Can generate invoices from the timespent entered on a project
|
||||
NEW: Can update product supplier price ref
|
||||
NEW: Can upload files from the edit page of expense report
|
||||
NEW: Color for hover and for checked line is on by default
|
||||
NEW: Column of parent company is available in list of third parties
|
||||
NEW: Column of p...arent company is available in list of third parties
|
||||
NEW: conditionnal add member button by statut
|
||||
NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN
|
||||
NEW: Contact related items tab
|
||||
@ -195,6 +196,55 @@ Following changes may create regressions for some external modules, but were nec
|
||||
called $dolibarr_main_instance_unique_id is now generated at each installation. It will be used by some future features.
|
||||
|
||||
|
||||
***** ChangeLog for 9.0.4 compared to 9.0.3 *****
|
||||
FIX: #5249
|
||||
FIX: #11025
|
||||
FIX: #11032
|
||||
FIX: #11097
|
||||
FIX: #11169
|
||||
FIX: #11202
|
||||
FIX: #11244
|
||||
FIX: #11296
|
||||
FIX: #11316
|
||||
FIX: #11335
|
||||
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: Import of chart of account
|
||||
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: javascript error when ckeditor module not enabled
|
||||
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
|
||||
FIX: mass send mail
|
||||
FIX: missing compatibility with multicompany transverse mode
|
||||
FIX: missing llx_const encrypt
|
||||
FIX: modulebuilder: hardcoded llx_
|
||||
FIX: Not showing Contract and Project columns on ficheinter list
|
||||
FIX: only profid1 to 4 were editable for pdf option to show. Not 5 and 6.
|
||||
FIX: productaccount buylist with pages
|
||||
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: the id was not loaded in fetch of accounting system
|
||||
FIX: try to use WHERE EXISTS instead of 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: Use of cron with multicompany
|
||||
FIX: var name
|
||||
FIX: we need to fetch fourn invoice with ref in current entity
|
||||
FIX: Wrong stock movement on supplier credit notes
|
||||
FIX: Import of record in ledger
|
||||
|
||||
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
|
||||
FIX: #11013
|
||||
@ -449,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/"
|
||||
|
||||
@ -106,6 +106,7 @@ if (empty($includecustom)) {
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp) {
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
@ -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
|
||||
|
||||
@ -2124,28 +2124,28 @@ class Adherent extends CommonObject
|
||||
$link.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
|
||||
$result.=$link;
|
||||
if ($withpictoimg) $result.='<div class="inline-block nopadding valignmiddle">';
|
||||
if ($withpictoimg)
|
||||
{
|
||||
$paddafterimage='';
|
||||
if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"';
|
||||
// Only picto
|
||||
if ($withpictoimg > 0) $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</div>';
|
||||
if ($withpictoimg > 0) $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</span>';
|
||||
// Picto must be a photo
|
||||
else $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</div>';
|
||||
else $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</span>';
|
||||
$result.=$picto;
|
||||
}
|
||||
if ($withpictoimg > -2 && $withpictoimg != 2)
|
||||
{
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<span class="nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
|
||||
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
|
||||
elseif ($mode == 'ref') $result.=$this->id;
|
||||
else $result.=$this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen);
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</span>';
|
||||
}
|
||||
if ($withpictoimg) $result.='</div>';
|
||||
$result.=$linkend;
|
||||
//if ($withpictoimg == -1) $result.='</div>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ class Members extends DolibarrApi
|
||||
// Remove the subscriptions because they are handled as a subresource.
|
||||
unset($object->subscriptions);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->libelle_incoterms);
|
||||
unset($object->label_incoterms);
|
||||
unset($object->location_incoterms);
|
||||
unset($object->fk_delivery_address);
|
||||
unset($object->shipping_method_id);
|
||||
|
||||
@ -307,7 +307,7 @@ class MembersTypes extends DolibarrApi
|
||||
unset($object->note_public);
|
||||
unset($object->note_private);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->libelle_incoterms);
|
||||
unset($object->label_incoterms);
|
||||
unset($object->location_incoterms);
|
||||
unset($object->name);
|
||||
unset($object->lastname);
|
||||
|
||||
@ -667,7 +667,7 @@ if ($rowid > 0)
|
||||
*/
|
||||
if ($action != 'addsubscription' && $action != 'create_thirdparty')
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
|
||||
$sql.= " c.rowid as crowid, c.subscription,";
|
||||
$sql.= " c.datec, c.fk_type as cfk_type,";
|
||||
$sql.= " c.dateadh as dateh,";
|
||||
@ -705,26 +705,30 @@ if ($rowid > 0)
|
||||
print "</tr>\n";
|
||||
|
||||
$accountstatic=new Account($db);
|
||||
$adh = new Adherent($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$adh->id = $objp->rowid;
|
||||
$adh->typeid = $objp->type;
|
||||
|
||||
$subscriptionstatic->ref=$objp->crowid;
|
||||
$subscriptionstatic->id=$objp->crowid;
|
||||
|
||||
if ($objp->cfk_type > 0)
|
||||
$typeid = ($objp->cfk_type > 0 ? $objp->cfk_type : $adh->typeid);
|
||||
if ($typeid > 0)
|
||||
{
|
||||
$adht->fetch($objp->cfk_type);
|
||||
$adht->fetch($typeid);
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n";
|
||||
print '<td class="center">';
|
||||
if ($objp->cfk_type > 0)
|
||||
{
|
||||
if ($typeid > 0) {
|
||||
print $adht->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -313,8 +313,9 @@ if ($rowid && $action != 'edit')
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
if (! empty($object->fk_type) ) {
|
||||
$adht->fetch($object->fk_type);
|
||||
if ($object->fk_type > 0 || $adh->typeid > 0) {
|
||||
$typeid = ($object->fk_type > 0 ? $object->fk_type : $adh->typeid);
|
||||
$adht->fetch($typeid);
|
||||
print $adht->getNomUrl(1);
|
||||
} else {
|
||||
print $langs->trans("NoType");
|
||||
@ -345,7 +346,7 @@ if ($rowid && $action != 'edit')
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';
|
||||
|
||||
// Amount
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||
|
||||
// Bank line
|
||||
|
||||
@ -142,7 +142,7 @@ $accountstatic=new Account($db);
|
||||
$now=dol_now();
|
||||
|
||||
// List of subscriptions
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,";
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,";
|
||||
$sql.= " c.rowid as crowid, c.fk_type, c.subscription,";
|
||||
$sql.= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
|
||||
$sql.= " c.fk_bank as bank, c.note,";
|
||||
@ -225,7 +225,7 @@ $param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($statut != '') $param.="&statut=".urlencode($statut);
|
||||
if ($search_type) $param.="&search_type=".urlencode($search_type);
|
||||
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);
|
||||
@ -298,33 +298,33 @@ if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'" size="4"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
|
||||
}
|
||||
|
||||
// Type
|
||||
if (! empty($arrayfields['d.fk_type']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'" size="7">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
|
||||
print'</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="7"></td>';
|
||||
print '<input class="flat maxwidth75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'" size="12"></td>';
|
||||
print '<input class="flat maxwidth75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
|
||||
print '<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
@ -409,23 +409,23 @@ if (! empty($arrayfields['d.login']['checked']))
|
||||
}
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
{
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder);
|
||||
}
|
||||
if (! empty($arrayfields['d.bank']['checked']))
|
||||
{
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $pram, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder);
|
||||
}
|
||||
if (! empty($arrayfields['c.dateadh']['checked']))
|
||||
{
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall ');
|
||||
}
|
||||
if (! empty($arrayfields['c.datef']['checked']))
|
||||
{
|
||||
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall ');
|
||||
}
|
||||
if (! empty($arrayfields['d.amount']['checked']))
|
||||
{
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
@ -457,9 +457,11 @@ while ($i < min($num, $limit))
|
||||
$adherent->statut=$obj->statut;
|
||||
$adherent->login=$obj->login;
|
||||
$adherent->photo=$obj->photo;
|
||||
$adherent->typeid=$obj->type;
|
||||
|
||||
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($obj->fk_type);
|
||||
$adht->fetch($typeid);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -473,7 +475,10 @@ while ($i < min($num, $limit))
|
||||
if (! empty($arrayfields['d.fk_type']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if ( ! empty($obj->fk_type) ) print $adht->getNomUrl(1);
|
||||
if ($typeid > 0)
|
||||
{
|
||||
print $adht->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1903,6 +1903,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 +1968,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 +1991,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 +2001,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>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -186,7 +186,7 @@ class DolibarrApi
|
||||
unset($object->lines[$i]->note_public);
|
||||
unset($object->lines[$i]->note_private);
|
||||
unset($object->lines[$i]->fk_incoterms);
|
||||
unset($object->lines[$i]->libelle_incoterms);
|
||||
unset($object->lines[$i]->label_incoterms);
|
||||
unset($object->lines[$i]->location_incoterms);
|
||||
unset($object->lines[$i]->name);
|
||||
unset($object->lines[$i]->lastname);
|
||||
|
||||
@ -398,7 +398,7 @@ class BlockedLog
|
||||
'name','lastname','firstname','region','region_id','region_code','state','state_id','state_code','country','country_id','country_code',
|
||||
'total_ht','total_tva','total_ttc','total_localtax1','total_localtax2',
|
||||
'barcode_type','barcode_type_code','barcode_type_label','barcode_type_coder','mode_reglement_id','cond_reglement_id','mode_reglement','cond_reglement','shipping_method_id',
|
||||
'fk_incoterms','libelle_incoterms','location_incoterms','lines')
|
||||
'fk_incoterms','label_incoterms','location_incoterms','lines')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -290,7 +290,7 @@ class Categories extends DolibarrApi
|
||||
unset($object->total_tva);
|
||||
unset($object->lines);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->libelle_incoterms);
|
||||
unset($object->label_incoterms);
|
||||
unset($object->location_incoterms);
|
||||
unset($object->civility_id);
|
||||
unset($object->name);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -356,7 +356,7 @@ class AgendaEvents extends DolibarrApi
|
||||
unset($object->total_localtax2);
|
||||
unset($object->total_ttc);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->libelle_incoterms);
|
||||
unset($object->label_incoterms);
|
||||
unset($object->location_incoterms);
|
||||
unset($object->name);
|
||||
unset($object->lastname);
|
||||
|
||||
@ -1688,7 +1688,7 @@ if ($action == 'create')
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->libelle_incoterms, 1).'</label></td>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms)?$soc->location_incoterms:''));
|
||||
print '</td></tr>';
|
||||
@ -2305,7 +2305,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print '<td>';
|
||||
if ($action != 'editincoterm')
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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!)
|
||||
@ -1383,7 +1383,7 @@ class Propal extends CommonObject
|
||||
$sql.= ", p.fk_incoterms, p.location_incoterms";
|
||||
$sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
|
||||
$sql.= ", p.tms as date_modification";
|
||||
$sql.= ", i.libelle as libelle_incoterms";
|
||||
$sql.= ", i.libelle as label_incoterms";
|
||||
$sql.= ", c.label as statut_label";
|
||||
$sql.= ", ca.code as availability_code, ca.label as availability";
|
||||
$sql.= ", dr.code as demand_reason_code, dr.label as demand_reason";
|
||||
@ -1471,7 +1471,7 @@ class Propal extends CommonObject
|
||||
//Incoterms
|
||||
$this->fk_incoterms = $obj->fk_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
$this->libelle_incoterms = $obj->libelle_incoterms;
|
||||
$this->label_incoterms = $obj->label_incoterms;
|
||||
|
||||
// Multicurrency
|
||||
$this->fk_multicurrency = $obj->fk_multicurrency;
|
||||
@ -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,";
|
||||
|
||||
@ -1737,7 +1737,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
$incoterm_id = GETPOST('incoterm_id');
|
||||
$incoterm_location = GETPOST('location_incoterms');
|
||||
@ -2361,7 +2361,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<td>';
|
||||
if ($action != 'editincoterm')
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -1676,7 +1676,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ', c.fk_incoterms, c.location_incoterms';
|
||||
$sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
|
||||
$sql.= ", c.module_source, c.pos_source";
|
||||
$sql.= ", i.libelle as libelle_incoterms";
|
||||
$sql.= ", i.libelle as label_incoterms";
|
||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
|
||||
$sql.= ', ca.code as availability_code, ca.label as availability_label';
|
||||
@ -1758,7 +1758,7 @@ class Commande extends CommonOrder
|
||||
//Incoterms
|
||||
$this->fk_incoterms = $obj->fk_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
$this->libelle_incoterms = $obj->libelle_incoterms;
|
||||
$this->label_incoterms = $obj->label_incoterms;
|
||||
|
||||
// Multicurrency
|
||||
$this->fk_multicurrency = $obj->fk_multicurrency;
|
||||
@ -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> ';
|
||||
@ -3171,7 +3175,7 @@ if ($action == 'create')
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
|
||||
print '<td colspan="2" class="maxwidthonsmartphone">';
|
||||
$incoterm_id = GETPOST('incoterm_id');
|
||||
$incoterm_location = GETPOST('location_incoterms');
|
||||
@ -4007,7 +4011,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<td>';
|
||||
if ($action != 'editincoterm')
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -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;
|
||||
@ -1335,7 +1335,7 @@ class Facture extends CommonInvoice
|
||||
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
|
||||
$sql.= ', f.fk_incoterms, f.location_incoterms';
|
||||
$sql.= ', f.module_source, f.pos_source';
|
||||
$sql.= ", i.libelle as libelle_incoterms";
|
||||
$sql.= ", i.libelle as label_incoterms";
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id';
|
||||
@ -1410,7 +1410,7 @@ class Facture extends CommonInvoice
|
||||
//Incoterms
|
||||
$this->fk_incoterms = $obj->fk_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
$this->libelle_incoterms = $obj->libelle_incoterms;
|
||||
$this->label_incoterms = $obj->label_incoterms;
|
||||
|
||||
$this->module_source = $obj->module_source;
|
||||
$this->pos_source = $obj->pos_source;
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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.'">';
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -181,6 +181,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);
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -592,7 +592,7 @@ if (! empty($arrayfields['c.tms']['checked'])){
|
||||
print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
}
|
||||
if (! empty($arrayfields['lower_planned_end_date']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (! empty($arrayfields['status']['checked'])) {
|
||||
print_liste_field_titre($staticcontratligne->LibStatut(0, 3), '', '', '', '', 'width="16"');
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ if (! empty($massaction) && is_array($toselect) && count($toselect) < 1)
|
||||
}
|
||||
if (! $error && is_array($toselect) && count($toselect) > $maxformassaction)
|
||||
{
|
||||
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
|
||||
setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
|
||||
// Check mandatory parameters
|
||||
if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
|
||||
if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
|
||||
@ -124,7 +124,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$massaction='presend';
|
||||
}
|
||||
|
||||
if (! GETPOST('subject','none'))
|
||||
if (! GETPOST('subject', 'none'))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings');
|
||||
@ -166,12 +166,12 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact
|
||||
{
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
|
||||
$sendtoid[] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sendto=implode(',',$tmparray);
|
||||
$sendto=implode(',', $tmparray);
|
||||
|
||||
// Define $sendtocc
|
||||
$receivercc=$_POST['receivercc'];
|
||||
@ -196,12 +196,12 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
elseif ($val) // Id du contact
|
||||
{
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
|
||||
//$sendtoid[] = $val; TODO Add also id of contact in CC ?
|
||||
}
|
||||
}
|
||||
}
|
||||
$sendtocc=implode(',',$tmparray);
|
||||
$sendtocc=implode(',', $tmparray);
|
||||
|
||||
//var_dump($listofobjectref);exit;
|
||||
$listofqualifiedobj=array();
|
||||
@ -215,21 +215,21 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction', $objectobj->ref).'</div><br>';
|
||||
continue; // Payment done or started or canceled
|
||||
}
|
||||
if ($objectclass == 'Commande' && $objectobj->statut == Commande::STATUS_DRAFT)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction', $objectobj->ref).'</div><br>';
|
||||
continue;
|
||||
}
|
||||
if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction', $objectobj->ref).'</div><br>';
|
||||
continue; // Payment done or started or canceled
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$nbignored++;
|
||||
if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id]))
|
||||
{
|
||||
$resaction.='<div class="error">'.$langs->trans('NoRecipientEmail',$objectobj->thirdparty->name).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('NoRecipientEmail', $objectobj->thirdparty->name).'</div><br>';
|
||||
}
|
||||
dol_syslog('No recipient for thirdparty: '.$objectobj->thirdparty->name, LOG_WARNING);
|
||||
$thirdpartywithoutemail[$objectobj->thirdparty->id]=1;
|
||||
@ -282,7 +282,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
// For supplier invoices, we use the file provided by supplier, not the one we generate
|
||||
if ($objectobj->element == 'invoice_supplier')
|
||||
{
|
||||
$fileparams = dol_most_recent_file($uploaddir . '/' . get_exdir($objectobj->id,2,0,0,$objectobj,$objectobj->element).$objectobj->ref, preg_quote($objectobj->ref,'/').'([^\-])+');
|
||||
$fileparams = dol_most_recent_file($uploaddir . '/' . get_exdir($objectobj->id, 2, 0, 0, $objectobj, $objectobj->element).$objectobj->ref, preg_quote($objectobj->ref, '/').'([^\-])+');
|
||||
$file = $fileparams['fullname'];
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
{
|
||||
$nbignored++;
|
||||
$langs->load("errors");
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorCantReadFile', $file).'</div><br>';
|
||||
dol_syslog('Failed to read file: '.$file, LOG_WARNING);
|
||||
continue;
|
||||
}
|
||||
@ -349,8 +349,8 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
|
||||
$replyto = $from;
|
||||
$subject = GETPOST('subject','none');
|
||||
$message = GETPOST('message','none');
|
||||
$subject = GETPOST('subject', 'none');
|
||||
$message = GETPOST('message', 'none');
|
||||
|
||||
$sendtobcc = GETPOST('sendtoccc');
|
||||
if ($objectclass == 'Propal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO));
|
||||
@ -385,17 +385,17 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
{
|
||||
// Make substitution in email content
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedobj)) : $objecttmp->id);
|
||||
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ',$listofqualifiedref) : $objecttmp->ref);
|
||||
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ', array_keys($listofqualifiedobj)) : $objecttmp->id);
|
||||
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref);
|
||||
$substitutionarray['__EMAIL__'] = $thirdparty->email;
|
||||
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
|
||||
|
||||
$parameters=array('mode'=>'formemail');
|
||||
|
||||
if ( ! empty( $listofobjectthirdparties ) ) {
|
||||
if (! empty($listofobjectthirdparties)) {
|
||||
$parameters['listofobjectthirdparties'] = $listofobjectthirdparties;
|
||||
}
|
||||
if ( ! empty( $listofobjectref ) ) {
|
||||
if (! empty($listofobjectref)) {
|
||||
$parameters['listofobjectref'] = $listofobjectref;
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
|
||||
$resaction.=$langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)).'<br>'; // Must not contain "
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -535,7 +535,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$langs->load("other");
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resaction.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$resaction.=$langs->trans('ErrorFailedToSendMail', $from, $sendto);
|
||||
$resaction.='<br><div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
@ -574,7 +574,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
|
||||
if ($massaction == 'confirm_createbills') // Create bills from orders
|
||||
{
|
||||
$orders = GETPOST('toselect','array');
|
||||
$orders = GETPOST('toselect', 'array');
|
||||
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
|
||||
$validate_invoices = GETPOST('validate_invoices', 'int');
|
||||
|
||||
@ -925,9 +925,9 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
}
|
||||
|
||||
$arrayofinclusion=array();
|
||||
foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf),'/').'\.pdf$';
|
||||
foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf),'/').'_[a-zA-Z0-9-_]+\.pdf$'; // To include PDF generated from ODX files
|
||||
$listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true);
|
||||
foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$';
|
||||
foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9-_]+\.pdf$'; // To include PDF generated from ODX files
|
||||
$listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);
|
||||
|
||||
// build list of files with full path
|
||||
$files = array();
|
||||
@ -936,7 +936,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
$basename = dol_sanitizeFileName($basename);
|
||||
foreach($listoffiles as $filefound)
|
||||
{
|
||||
if (strstr($filefound["name"],$basename))
|
||||
if (strstr($filefound["name"], $basename))
|
||||
{
|
||||
$files[] = $uploaddir.'/'.$basename.'/'.$filefound["name"];
|
||||
break;
|
||||
@ -947,10 +947,10 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
// Define output language (Here it is not used because we do only merging existing PDF)
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
@ -961,7 +961,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
|
||||
// Defined name of merged file
|
||||
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
|
||||
$filename=preg_replace('/\s/','_',$filename);
|
||||
$filename=preg_replace('/\s/', '_', $filename);
|
||||
|
||||
// Save merged file
|
||||
if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
|
||||
@ -975,7 +975,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
if (count($files)>0)
|
||||
{
|
||||
$now=dol_now();
|
||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf';
|
||||
|
||||
$input_files = '';
|
||||
foreach($files as $f) {
|
||||
@ -989,7 +989,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$langs->load("exports");
|
||||
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
||||
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1001,7 +1001,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
$formatarray=pdf_getFormat();
|
||||
$page_largeur = $formatarray['width'];
|
||||
$page_hauteur = $formatarray['height'];
|
||||
$format = array($page_largeur,$page_hauteur);
|
||||
$format = array($page_largeur, $page_hauteur);
|
||||
|
||||
$pdf=pdf_getInstance($format);
|
||||
|
||||
@ -1033,7 +1033,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
|
||||
// Defined name of merged file
|
||||
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
|
||||
$filename=preg_replace('/\s/','_',$filename);
|
||||
$filename=preg_replace('/\s/', '_', $filename);
|
||||
|
||||
// Save merged file
|
||||
if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED)
|
||||
@ -1046,13 +1046,13 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
||||
if ($pagecount)
|
||||
{
|
||||
$now=dol_now();
|
||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||
$pdf->Output($file,'F');
|
||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf';
|
||||
$pdf->Output($file, 'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$langs->load("exports");
|
||||
setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
|
||||
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1193,7 +1193,7 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'</div><br>';
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1257,12 +1257,12 @@ if (! $error && $massaction == 'generate_doc' && $permtoread)
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) $newlang=$objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->default_lang)) $newlang=$objecttmp->default_lang; // for thirdparty
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
@ -1307,8 +1307,5 @@ $parameters['uploaddir']=$uploaddir;
|
||||
$parameters['massaction']=$massaction;
|
||||
$parameters['diroutputmassaction']=$diroutputmassaction;
|
||||
|
||||
$reshook=$hookmanager->executeHooks('doMassActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -391,7 +391,7 @@ abstract class CommonObject
|
||||
* @var string
|
||||
* @see SetIncoterms()
|
||||
*/
|
||||
public $libelle_incoterms;
|
||||
public $label_incoterms;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
@ -3762,7 +3762,7 @@ abstract class CommonObject
|
||||
{
|
||||
// phpcs:enable
|
||||
$out = '';
|
||||
$this->libelle_incoterms = '';
|
||||
$this->label_incoterms = '';
|
||||
if (!empty($this->fk_incoterms))
|
||||
{
|
||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
|
||||
@ -3835,7 +3835,7 @@ abstract class CommonObject
|
||||
if ($res)
|
||||
{
|
||||
$obj = $this->db->fetch_object($res);
|
||||
$this->libelle_incoterms = $obj->libelle;
|
||||
$this->label_incoterms = $obj->libelle;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -5008,6 +5008,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 +5026,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;
|
||||
|
||||
|
||||
@ -1645,7 +1645,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);
|
||||
}
|
||||
|
||||
@ -1154,6 +1154,12 @@ class FormMail extends Form
|
||||
return -1;
|
||||
}
|
||||
|
||||
$languagetosearch = (is_object($outputlangs) ? $outputlangs->defaultlang : '');
|
||||
// Define $languagetosearchmain to fall back on main language (for example to get 'es_ES' for 'es_MX')
|
||||
$tmparray = explode('_', $languagetosearch);
|
||||
$languagetosearchmain = $tmparray[0].'_'.strtoupper($tmparray[0]);
|
||||
if ($languagetosearchmain == $languagetosearch) $languagetosearchmain = '';
|
||||
|
||||
$sql = "SELECT rowid, label, topic, joinfiles, content, content_lines, lang";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
|
||||
@ -1161,10 +1167,10 @@ class FormMail extends Form
|
||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
|
||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||
if ($label) $sql.=" AND label ='".$db->escape($label)."'";
|
||||
if (! ($id > 0) && is_object($outputlangs)) $sql.= " AND (lang = '".$db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')";
|
||||
if (! ($id > 0) && $languagetosearch) $sql.= " AND (lang = '".$db->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$db->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
|
||||
if ($id > 0) $sql.= " AND rowid=".$id;
|
||||
if ($id == -1) $sql.= " AND position=0";
|
||||
if (is_object($outputlangs)) $sql.= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
|
||||
if ($languagetosearch) $sql.= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
|
||||
else $sql.= $db->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
|
||||
$sql.= $db->plimit(1);
|
||||
//print $sql;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -50,33 +50,36 @@ class Utils
|
||||
* Purge files into directory of data files.
|
||||
* CAN BE A CRON TASK
|
||||
*
|
||||
* @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile')
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
* @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than $nbsecondsold seconds, 'allfiles', 'logfile')
|
||||
* @param int $nbsecondsold Nb of seconds old to accept deletion of a directory if $choice is 'tempfilesold'
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function purgeFiles($choice = 'tempfilesold')
|
||||
public function purgeFiles($choice = 'tempfilesold', $nbsecondsold = 86400)
|
||||
{
|
||||
global $conf, $langs, $dolibarr_main_data_root;
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$filesarray=array();
|
||||
if (empty($choice)) $choice='tempfilesold';
|
||||
|
||||
dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG);
|
||||
|
||||
if ($choice=='tempfiles' || $choice=='tempfilesold')
|
||||
{
|
||||
// Delete temporary files
|
||||
if ($dolibarr_main_data_root)
|
||||
{
|
||||
$filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks
|
||||
if ($choice == 'tempfilesold')
|
||||
$filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks
|
||||
|
||||
if ($choice == 'tempfilesold')
|
||||
{
|
||||
$now = dol_now();
|
||||
foreach($filesarray as $key => $val)
|
||||
{
|
||||
if ($val['date'] > ($now - (24 * 3600))) unset($filesarray[$key]); // Discard files not older than 24h
|
||||
if ($val['date'] > ($now - ($nbsecondsold))) unset($filesarray[$key]); // Discard temp dir not older than $nbsecondsold
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -119,13 +122,14 @@ class Utils
|
||||
$counterror=0;
|
||||
if (count($filesarray))
|
||||
{
|
||||
foreach($filesarray as $key => $value)
|
||||
foreach($filesarray as $key => $value)
|
||||
{
|
||||
//print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."<br>\n";
|
||||
if ($filesarray[$key]['type'] == 'dir')
|
||||
if ($filesarray[$key]['type'] == 'dir')
|
||||
{
|
||||
$startcount=0;
|
||||
$tmpcountdeleted=0;
|
||||
|
||||
$result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted);
|
||||
$count+=$result;
|
||||
$countdeleted+=$tmpcountdeleted;
|
||||
@ -165,6 +169,13 @@ class Utils
|
||||
}
|
||||
else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':'');
|
||||
|
||||
// Recreate temp dir that are not automatically recreated by core code for performance purpose, we need them
|
||||
if (! empty($conf->api->enabled))
|
||||
{
|
||||
dol_mkdir($conf->api->dir_temp);
|
||||
}
|
||||
dol_mkdir($conf->user->dir_temp);
|
||||
|
||||
//return $count;
|
||||
return 0; // This function can be called by cron so must return 0 if OK
|
||||
}
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -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)));
|
||||
|
||||
@ -220,7 +220,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "trips", "projects", "dict", "bills", "banks"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$nblines = count($object->lines);
|
||||
|
||||
if ($conf->expensereport->dir_output) {
|
||||
// Definition of $dir and $file
|
||||
@ -351,7 +351,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++) {
|
||||
for ($i = 0 ; $i < $nblines ; $i++) {
|
||||
$pdf->SetFont('', '', $default_font_size - 2); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
@ -374,7 +374,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
//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)) {
|
||||
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);
|
||||
@ -400,8 +400,8 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
//$nblineFollowComment = 1;
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
// if ($i < ($nblignes - 1)) // If it's not last line
|
||||
// Search number of lines coming to know if there is enough room
|
||||
// if ($i < ($nblines - 1)) // If it's not last line
|
||||
// {
|
||||
// //Fetch current description to know on which line the next one should be placed
|
||||
// $follow_comment = $object->lines[$i]->comments;
|
||||
@ -414,8 +414,8 @@ class pdf_standard extends ModeleExpenseReport
|
||||
// $nblineFollowComment = max($nbLineCommentNeed, $nbLineTypeNeed);
|
||||
// }
|
||||
|
||||
//$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Passe espace entre les lignes
|
||||
$nexY += ($pdf->getFontSize()*1.3); // Passe espace entre les lignes
|
||||
//$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Add space between lines
|
||||
$nexY += ($pdf->getFontSize()*1.3); // Add space between lines
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
|
||||
@ -261,6 +261,9 @@ class ExportCsv extends ModeleExports
|
||||
}
|
||||
|
||||
$this->col=0;
|
||||
|
||||
$reg=array();
|
||||
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);
|
||||
|
||||
@ -345,6 +345,8 @@ class ExportExcel extends ModeleExports
|
||||
// Define first row
|
||||
$this->col=0;
|
||||
|
||||
$reg=array();
|
||||
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);
|
||||
|
||||
@ -304,6 +304,8 @@ class ExportExcel2007new extends ModeleExports
|
||||
// Define first row
|
||||
$this->col=0;
|
||||
|
||||
$reg=array();
|
||||
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);
|
||||
|
||||
@ -160,13 +160,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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 = 1; // 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 = 1; // Displays if there has been a discount
|
||||
$this->option_credit_note = 1; // 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
|
||||
@ -235,7 +235,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
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;
|
||||
|
||||
dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
|
||||
|
||||
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
|
||||
@ -244,13 +246,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
||||
|
||||
$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();
|
||||
if (! empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE))
|
||||
{
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
@ -316,8 +318,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
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);
|
||||
$nbpayments = count($object->getListOfPayments());
|
||||
|
||||
// Create pdf instance
|
||||
@ -358,7 +360,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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)
|
||||
{
|
||||
@ -465,7 +467,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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
|
||||
@ -521,7 +523,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
//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);
|
||||
@ -650,7 +652,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
||||
|
||||
// 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)));
|
||||
@ -659,7 +661,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user